feat():补齐订单客户相关API接口

master
86191 2024-08-08 09:41:27 +08:00
parent 55f941b50a
commit 4f9e9adb87
3 changed files with 74 additions and 1 deletions

View File

@ -97,7 +97,7 @@ public class OrderPayCustomerController {
* @return
*/
@DeleteMapping("/{orderCustomerId}")
@Operation(summary = "客户信息删除",description = "通过ID删除客户信息")
@Operation(summary = "客户信息删除",description = "通过ID删除客户信息,七天内存在支付相关记录的客户,不可进行删除")
public Result<String> delete(@PathVariable("orderCustomerId") Long orderCustomerId){
orderPayCustomerService.removeById(orderCustomerId);
return Result.success(null,"操作成功");
@ -115,4 +115,29 @@ public class OrderPayCustomerController {
}
/**
* ID
* @param orderCustomerId
* @return
*/
@GetMapping("/disable/{orderCustomerId}")
@Operation(summary = "通过ID客户禁用",description = "通过ID禁用客户信息,禁用之后禁止调用支付相关接口")
public Result<String> disable(@PathVariable("orderCustomerId") Long orderCustomerId){
this.orderPayCustomerService.disable(orderCustomerId);
return Result.success(null,"操作成功");
}
/**
* ID
* @param orderCustomerId
* @return
*/
@GetMapping("/enable/{orderCustomerId}")
@Operation(summary = "通过ID客户启用",description = "通过ID启用客户信息,启用之后可以调用支付相关接口")
public Result<String> enable(@PathVariable("orderCustomerId") Long orderCustomerId){
this.orderPayCustomerService.disable(orderCustomerId);
return Result.success(null,"操作成功");
}
}

View File

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

View File

@ -9,6 +9,7 @@ import com.muyu.cloud.pay.domain.resp.CustomerResp;
import com.muyu.cloud.pay.mapper.OrderPayCustomerMapper;
import com.muyu.cloud.pay.service.OrderPayCustomerService;
import com.muyu.cloud.pay.service.OrderPayService;
import com.muyu.common.core.enums.SystemYesNo;
import com.muyu.common.core.exception.ServiceException;
import com.muyu.common.core.utils.StringUtils;
import com.muyu.common.nacos.service.NacosService;
@ -78,6 +79,7 @@ public class OrderPayCustomerServiceImpl extends ServiceImpl<OrderPayCustomerMap
.toList();
}
@Override
public boolean save(OrderPayCustomer orderPayCustomer) {
String appCode = orderPayCustomer.getAppCode();
@ -95,4 +97,32 @@ public class OrderPayCustomerServiceImpl extends ServiceImpl<OrderPayCustomerMap
}
return super.save(orderPayCustomer);
}
/**
*
* @param orderCustomerId
*/
@Override
public void disable(Long orderCustomerId) {
this.settingStatus(orderCustomerId, SystemYesNo.NO.getCode());
}
/**
*
* @param orderCustomerId
*/
@Override
public void enable(Long orderCustomerId) {
this.settingStatus(orderCustomerId, SystemYesNo.YES.getCode());
}
@Override
public void settingStatus(Long orderCustomerId, String status) {
}
}