|
|
@@ -131,15 +131,19 @@ public class ServiceInfoController extends MallUserInfoBaseController{ |
|
|
|
@ApiVersion(group = SwaggerConstant.V_1_0_0) |
|
|
|
@ApiOperation("慧影-设置时长") |
|
|
|
@PostMapping("/setRemainingTimes") |
|
|
|
public R<Void> setRemainingTimes(Long id,Long times) { |
|
|
|
ServiceInfo si = serviceInfoService.getServiceInfo(id); |
|
|
|
if (null == si) { |
|
|
|
public R<Void> setRemainingTimes(@RequestBody ServiceInfo dto) { |
|
|
|
if (null == dto.getId()) { |
|
|
|
throw new BizException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"id无效"); |
|
|
|
} |
|
|
|
if (null == times) { |
|
|
|
if (null == dto.getTimes()) { |
|
|
|
throw new BizException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"times无效"); |
|
|
|
} |
|
|
|
si.setRemainingTimes(times); |
|
|
|
ServiceInfo si = serviceInfoService.getServiceInfo(dto.getId()); |
|
|
|
if (null == si) { |
|
|
|
throw new BizException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"id无效"); |
|
|
|
} |
|
|
|
|
|
|
|
si.setRemainingTimes(dto.getTimes()); |
|
|
|
serviceInfoService.updateServiceInfo(si); |
|
|
|
return R.ok(); |
|
|
|
} |
|
|
|