2023-11-03 14:59:19 +08:00
|
|
|
package com.ai.da.controller;
|
|
|
|
|
|
|
|
|
|
import com.ai.da.common.response.Response;
|
|
|
|
|
import com.ai.da.model.dto.ClassificationDTO;
|
|
|
|
|
import com.ai.da.model.vo.ClassificationVO;
|
|
|
|
|
import com.ai.da.service.ClassificationService;
|
|
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
2025-12-11 10:35:08 +08:00
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
2023-11-03 14:59:19 +08:00
|
|
|
import lombok.AllArgsConstructor;
|
|
|
|
|
import lombok.NoArgsConstructor;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
2025-11-25 16:46:05 +08:00
|
|
|
import jakarta.annotation.Resource;
|
|
|
|
|
import jakarta.validation.Valid;
|
2023-11-03 14:59:19 +08:00
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 控制器
|
|
|
|
|
*
|
|
|
|
|
* @author SHAHAIBO
|
|
|
|
|
* @since 2023-11-03
|
|
|
|
|
*/
|
|
|
|
|
@RestController
|
|
|
|
|
@AllArgsConstructor
|
|
|
|
|
@NoArgsConstructor
|
|
|
|
|
@RequestMapping("/api/classification")
|
2025-12-11 10:35:08 +08:00
|
|
|
@Tag(name = "分类")
|
2023-11-03 14:59:19 +08:00
|
|
|
public class ClassificationController {
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private ClassificationService classificationService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 新增修改
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/saveOrUpdate")
|
|
|
|
|
@ApiOperationSupport(order = 1)
|
2025-12-11 10:35:08 +08:00
|
|
|
@Operation(summary = "新增修改", description = "传入ClassificationDTO")
|
2023-11-03 14:59:19 +08:00
|
|
|
public Response<Boolean> saveOrUpdate(@Valid @RequestBody ClassificationDTO classificationDTO) {
|
|
|
|
|
return Response.success(classificationService.saveOrUpdate(classificationDTO));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 删除
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/delete")
|
|
|
|
|
@ApiOperationSupport(order = 2)
|
2025-12-11 10:35:08 +08:00
|
|
|
@Operation(summary = "删除", description = "传入ClassificationDTO")
|
2023-11-03 14:59:19 +08:00
|
|
|
public Response<Boolean> delete(@Valid @RequestBody ClassificationDTO classificationDTO) {
|
|
|
|
|
return Response.success(classificationService.delete(classificationDTO));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping("/queryClassification")
|
|
|
|
|
@ApiOperationSupport(order = 3)
|
2025-12-11 10:35:08 +08:00
|
|
|
@Operation(summary = "查询", description = "传入ClassificationDTO")
|
2023-11-03 14:59:19 +08:00
|
|
|
public Response<List<ClassificationVO>> queryClassification(@Valid @RequestBody ClassificationDTO classificationDTO) {
|
|
|
|
|
return Response.success(classificationService.queryClassification(classificationDTO));
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-07 15:12:55 +08:00
|
|
|
@PostMapping("/relationLibrary")
|
|
|
|
|
@ApiOperationSupport(order = 4)
|
2025-12-11 10:35:08 +08:00
|
|
|
@Operation(summary = "关联", description = "传入ClassificationDTO")
|
2023-11-07 15:12:55 +08:00
|
|
|
public Response<Boolean> relationLibrary(@Valid @RequestBody ClassificationDTO classificationDTO) {
|
|
|
|
|
return Response.success(classificationService.relationLibrary(classificationDTO));
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-14 15:59:11 +08:00
|
|
|
@PostMapping("/getRelClassificationIdList")
|
|
|
|
|
@ApiOperationSupport(order = 5)
|
2025-12-11 10:35:08 +08:00
|
|
|
@Operation(summary = "获取关联分类IDList", description = "传入ClassificationDTO")
|
2023-11-14 15:59:11 +08:00
|
|
|
public Response<List<Long>> getRelClassificationIdList(@Valid @RequestBody ClassificationDTO classificationDTO) {
|
|
|
|
|
return Response.success(classificationService.getRelClassificationIdList(classificationDTO));
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-04 13:57:17 +08:00
|
|
|
/**
|
|
|
|
|
* 多选 获取共有标签
|
|
|
|
|
* @param classificationDTO
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/getRelPublicClassificationIdList")
|
|
|
|
|
@ApiOperationSupport(order = 5)
|
2025-12-11 10:35:08 +08:00
|
|
|
@Operation(summary = "获取关联公共分类IDList", description = "传入ClassificationDTO")
|
2024-01-04 13:57:17 +08:00
|
|
|
public Response<List<Long>> getRelPublicClassificationIdList(@Valid @RequestBody ClassificationDTO classificationDTO) {
|
|
|
|
|
return Response.success(classificationService.getRelPublicClassificationIdList(classificationDTO));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 多选 编辑共有标签
|
|
|
|
|
* @param classificationDTO
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/editRelPublicClassificationIdList")
|
|
|
|
|
@ApiOperationSupport(order = 5)
|
2025-12-11 10:35:08 +08:00
|
|
|
@Operation(summary = "编辑关联公共分类IDList", description = "传入ClassificationDTO")
|
2024-01-04 13:57:17 +08:00
|
|
|
public Response<Boolean> editRelPublicClassificationIdList(@Valid @RequestBody ClassificationDTO classificationDTO) {
|
|
|
|
|
return Response.success(classificationService.editRelPublicClassificationIdList(classificationDTO));
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-03 14:59:19 +08:00
|
|
|
}
|