|
@@ -35,6 +35,7 @@ public class ProductController {
|
|
|
private final AssoPersonProductService assoPersonProductService;
|
|
|
private final ImportProductService importProductService;
|
|
|
private final ImportTaskService importTaskService;
|
|
|
+
|
|
|
@Operation(summary = "查询爆款产品")
|
|
|
@PostMapping("/queryHotProduct")
|
|
|
public Response queryHotProduct(@RequestBody ProductDTO productDTO) {
|
|
@@ -60,19 +61,18 @@ public class ProductController {
|
|
|
@PostMapping("/follow")
|
|
|
public Response follow(@RequestBody AssoPersonProductDTO assoPersonProductDTO) {
|
|
|
Records records = new Records();
|
|
|
- Integer id =null;
|
|
|
+ Integer id = null;
|
|
|
try {
|
|
|
- id = assoPersonProductService.add(assoPersonProductDTO);
|
|
|
+ id = assoPersonProductService.add(assoPersonProductDTO);
|
|
|
if (id == null) {
|
|
|
return Response.noPermissions("已超过可关注数量");
|
|
|
}
|
|
|
if (id.equals(-2)) {
|
|
|
return Response.noPermissions("无关注产品的权益");
|
|
|
}
|
|
|
+ } catch (BusinessException e) {
|
|
|
+ return Response.error(e.getErrorCode(), e.getMessage());
|
|
|
}
|
|
|
- catch (BusinessException e){
|
|
|
- return Response.error(e.getErrorCode(),e.getMessage());
|
|
|
- }
|
|
|
records.setData(id);
|
|
|
return Response.success(records);
|
|
|
}
|
|
@@ -105,11 +105,11 @@ public class ProductController {
|
|
|
@Operation(summary = "添加或更新爆款产品")
|
|
|
@PostMapping("/addOrUpdateHotProduct")
|
|
|
public Response addOrUpdateHotProduct(@RequestBody HotProductAddDTO hotProductAddDTO) {
|
|
|
- Integer id =null;
|
|
|
+ Integer id = null;
|
|
|
try {
|
|
|
- id = productService.addOrUpdateHotProduct(hotProductAddDTO,null);
|
|
|
+ id = productService.addOrUpdateHotProduct(hotProductAddDTO, null);
|
|
|
} catch (BusinessException e) {
|
|
|
- return Response.error(e.getErrorCode(),e.getMessage());
|
|
|
+ return Response.error(e.getErrorCode(), e.getMessage());
|
|
|
}
|
|
|
return Response.success(id);
|
|
|
}
|
|
@@ -144,9 +144,9 @@ public class ProductController {
|
|
|
@Operation(summary = "导入产品")
|
|
|
@PostMapping("/ImportProductBatch")
|
|
|
public Response importProduct(@RequestBody MultipartFile file) throws Exception {
|
|
|
- File newFile= FileUtils.multipartFileToFile(file);
|
|
|
- ImportTask importTask =importTaskService.addImportTask(newFile,2);
|
|
|
- importProductService.importProject(newFile,importTask);
|
|
|
+ File newFile = FileUtils.multipartFileToFile(file);
|
|
|
+ ImportTask importTask = importTaskService.addImportTask(newFile, 2);
|
|
|
+ importProductService.importProject(newFile, importTask);
|
|
|
return Response.success("records");
|
|
|
}
|
|
|
}
|