feat():添加禁用和启用接口

master
zhang chengzhi 2024-08-08 16:03:38 +08:00
parent 58088c358d
commit cd341b1a01
4 changed files with 68 additions and 3 deletions

View File

@ -1,6 +1,5 @@
package com.muyu.cloud.pay; package com.muyu.cloud.pay;
import com.dtflys.forest.springboot.annotation.ForestScan;
import com.muyu.common.security.annotation.EnableCustomConfig; import com.muyu.common.security.annotation.EnableCustomConfig;
import com.muyu.common.security.annotation.EnableMyFeignClients; import com.muyu.common.security.annotation.EnableMyFeignClients;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;

View File

@ -107,7 +107,7 @@ public Result<String> update(@Schema(title = "客户ID",type = "Long",defaultVal
*/ */
@DeleteMapping("/{orderCustomerId}") @DeleteMapping("/{orderCustomerId}")
@Operation(summary = "客户信息删除",description = "通过ID删除客户信息") @Operation(summary = "客户信息删除",description = "通过ID删除客户信息,七天内有支付支付记录的客户,不可进行删除")
public Result<String> delete(@PathVariable("orderCustomerId") Long orderCustomerId){ public Result<String> delete(@PathVariable("orderCustomerId") Long orderCustomerId){
orderPayCustomerService.removeById(orderCustomerId); orderPayCustomerService.removeById(orderCustomerId);
return Result.success(null,"操作成功"); return Result.success(null,"操作成功");
@ -122,12 +122,38 @@ public Result<String> update(@Schema(title = "客户ID",type = "Long",defaultVal
@GetMapping("/{orderCustomerId}") @GetMapping("/{orderCustomerId}")
@Operation(summary = "通过ID获取客户信息",description = "通过ID获取客户信息") @Operation(summary = "通过ID获取客户信息",description = "通过ID获取客户信息")
public Result<OrderPayCustomer> findById(@PathVariable("orderCustomerId") Long orderCustomerId){ public Result<OrderPayCustomer> findById(@PathVariable("orderCustomerId") Long orderCustomerId){
log.info("");
return Result.success(orderPayCustomerService.getById(orderCustomerId),"操作成功"); return Result.success(orderPayCustomerService.getById(orderCustomerId),"操作成功");
} }
/**
* ID
* @param orderCustomerId ID
* @return
*/
@GetMapping("/disable/{orderCustomerId}")
@Operation(summary = "通过ID禁用客户",description = "通过ID禁用客户,禁用之后禁止调用支付相关接口")
public Result<OrderPayCustomer> disable(@PathVariable("orderCustomerId") Long orderCustomerId){
this.orderPayCustomerService.disable(orderCustomerId);
return Result.success(null,"操作成功");
}
/**
* ID
* @param orderCustomerId ID
* @return
*/
@GetMapping("/enable/{orderCustomerId}")
@Operation(summary = "通过ID启动客户",description = "通过ID启用被禁止的客户,启用后可以调用支付相关的接口")
public Result<OrderPayCustomer> enable(@PathVariable("orderCustomerId") Long orderCustomerId){
this.orderPayCustomerService.enable(orderCustomerId);
return Result.success(null,"操作成功");
}

View File

@ -34,5 +34,26 @@ public interface OrderPayCustomerService extends IService<OrderPayCustomer> {
List<String> getCustomerAllList(); List<String> getCustomerAllList();
/**
*
* @param orderCustomerId
*/
void disable(Long orderCustomerId);
/**
*
* @param orderCustomerId
*/
void enable(Long orderCustomerId);
/**
* ID
* @param orderCustomerId ID
* @param status SysIsYesNo
*/
void settingStatus(Long orderCustomerId,String status);
} }

View File

@ -12,6 +12,7 @@ import com.muyu.cloud.pay.mapper.OrderPayCustomerMapper;
import com.muyu.cloud.pay.service.OrderPayCustomerService; import com.muyu.cloud.pay.service.OrderPayCustomerService;
import com.muyu.cloud.pay.service.OrderPayInfoService; import com.muyu.cloud.pay.service.OrderPayInfoService;
import com.muyu.common.core.enums.SysPayType; import com.muyu.common.core.enums.SysPayType;
import com.muyu.common.core.enums.SystemYesNo;
import com.muyu.common.core.exception.ServiceException; import com.muyu.common.core.exception.ServiceException;
import com.muyu.common.core.utils.StringUtils; import com.muyu.common.core.utils.StringUtils;
import com.muyu.common.nacos.remote.service.NacosServerService; import com.muyu.common.nacos.remote.service.NacosServerService;
@ -92,6 +93,24 @@ public class OrderPayCustomerServiceImpl extends ServiceImpl<OrderPayCustomerMap
.toList(); .toList();
} }
@Override
public void disable(Long orderCustomerId) {
this.settingStatus(orderCustomerId, SystemYesNo.NO.getCode());
}
@Override
public void enable(Long orderCustomerId) {
this.settingStatus(orderCustomerId, SystemYesNo.NO.getCode());
}
public void settingStatus(Long orderCustomerId,String status){
}
@Override @Override
public boolean save(OrderPayCustomer orderPayCustomer) { public boolean save(OrderPayCustomer orderPayCustomer) {