feat():增加禁用启用接口

master
Yueng 2024-08-10 23:59:22 +08:00
parent c779917cab
commit 1ff6797a54
3 changed files with 70 additions and 1 deletions

View File

@ -117,9 +117,33 @@ public class OrderPayCustomerController {
* @return * @return
*/ */
@DeleteMapping("/{orderCustomerId}") @DeleteMapping("/{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){
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<String> 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<String> enable(@PathVariable ("orderCustomerId") Long orderCustomerId){
this.orderPayCustomerService.enable(orderCustomerId);
return Result.success(null,"操作成功");
}
} }

View File

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

View File

@ -11,6 +11,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.OrderPayService; 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.exception.ServiceException;
import com.muyu.common.nacos.service.NacosServiceService; import com.muyu.common.nacos.service.NacosServiceService;
@ -95,6 +96,29 @@ public class OrderPayCustomerServiceImpl
.toList(); .toList();
} }
/**
*
* @param orderCustomerId ID
*/
@Override
public void disable(Long orderCustomerId) {
this.settingStatus(orderCustomerId, SystemYesNo.NO.getCode());
}
/**
*
* @param orderCustomerId ID
*/
@Override
public void enable(Long orderCustomerId) {
this.settingStatus(orderCustomerId, SystemYesNo.YES.getCode());
}
@Override
public void settingStatus(Long orderCustomerId,String status){
}
@Override @Override
public boolean save(OrderPayCustomer orderPayCustomer) { public boolean save(OrderPayCustomer orderPayCustomer) {
String appCode = orderPayCustomer.getAppCode(); String appCode = orderPayCustomer.getAppCode();