修改数量接口

master
bynt 1 year ago
parent cacf59d2ea
commit a7d92902c0

@ -20,6 +20,7 @@ import cn.hutool.core.io.IoUtil;
import cn.hutool.core.text.StrPool; import cn.hutool.core.text.StrPool;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.poi.excel.BigExcelWriter; import cn.hutool.poi.excel.BigExcelWriter;
import cn.hutool.poi.excel.ExcelUtil; import cn.hutool.poi.excel.ExcelUtil;
import com.baiye.exception.BadRequestException; import com.baiye.exception.BadRequestException;

@ -1,7 +1,5 @@
package com.baiye.modules.agent.controller; package com.baiye.modules.agent.controller;
import com.baiye.annotation.Inner;
import com.baiye.annotation.Log;
import com.baiye.http.CommonResponse; import com.baiye.http.CommonResponse;
import com.baiye.modules.agent.entity.query.ChannelQuery; import com.baiye.modules.agent.entity.query.ChannelQuery;
import com.baiye.modules.agent.entity.query.ResourceAssignInfoQuery; import com.baiye.modules.agent.entity.query.ResourceAssignInfoQuery;
@ -46,13 +44,5 @@ public class ChannelResourceAssignController {
return channelResourceAssignService.assignNum(channelId, assignNum); return channelResourceAssignService.assignNum(channelId, assignNum);
} }
@Log
@Inner
@ApiOperation("修改数量")
@GetMapping("/update/quantity")
public ResponseEntity<Void> updateQuantity(Long userId, Integer number) {
channelResourceAssignService.updateQuantity(userId, number);
return new ResponseEntity<>(HttpStatus.OK);
}
} }

@ -1,5 +1,7 @@
package com.baiye.modules.agent.controller; package com.baiye.modules.agent.controller;
import com.baiye.annotation.Inner;
import com.baiye.annotation.Log;
import com.baiye.http.CommonResponse; import com.baiye.http.CommonResponse;
import com.baiye.modules.agent.entity.ChannelCustom; import com.baiye.modules.agent.entity.ChannelCustom;
import com.baiye.modules.agent.entity.query.ChannelQuery; import com.baiye.modules.agent.entity.query.ChannelQuery;
@ -64,4 +66,16 @@ public class CustomManageController {
public CommonResponse<List<Map<String, Object>>> findCustomList(@RequestParam("customId") Long customId) { public CommonResponse<List<Map<String, Object>>> findCustomList(@RequestParam("customId") Long customId) {
return CommonResponse.createBySuccess(customManageService.findUrlByCustomId(customId)); return CommonResponse.createBySuccess(customManageService.findUrlByCustomId(customId));
} }
@Log
@Inner
@ApiOperation("修改数量")
@GetMapping("/update/quantity")
public ResponseEntity<Void> updateQuantity(Long userId, Integer number) {
customManageService.updateQuantity(userId, number);
return new ResponseEntity<>(HttpStatus.OK);
}
} }

@ -38,10 +38,5 @@ public interface ChannelResourceAssignService {
*/ */
CommonResponse<Object> assignNum(Long customId, Integer assignNum); CommonResponse<Object> assignNum(Long customId, Integer assignNum);
/**
*
* @param userId
* @param number
*/
void updateQuantity(Long userId, Integer number);
} }

@ -76,4 +76,11 @@ public interface CustomManageService {
* @return * @return
*/ */
ChannelCustom findCustomByUserIdAndStatus(Long userId, Integer status); ChannelCustom findCustomByUserIdAndStatus(Long userId, Integer status);
/**
*
* @param userId
* @param number
*/
void updateQuantity(Long userId, Integer number);
} }

@ -57,9 +57,5 @@ public class ChannelResourceAssignServiceImpl implements ChannelResourceAssignSe
return CommonResponse.createBySuccess(); return CommonResponse.createBySuccess();
} }
@Override
@Transactional(rollbackFor = Exception.class)
public void updateQuantity(Long userId, Integer number) {
channelCustomRepository.updateQuantity(userId, number);
}
} }

@ -250,4 +250,10 @@ public class CustomManageServiceImpl implements CustomManageService {
} }
return byUserId; return byUserId;
} }
@Override
@Transactional(rollbackFor = Exception.class)
public void updateQuantity(Long userId, Integer number) {
channelCustomRepository.updateQuantity(userId, number);
}
} }

@ -17,7 +17,7 @@ public interface DeliveryRecordClient {
String PAY_PREFIX = "/api/down/record"; String PAY_PREFIX = "/api/down/record";
String AGENT_PREFIX = "/api/resource"; String AGENT_PREFIX = "/api/custom";
/** /**
* *

Loading…
Cancel
Save