| | |
| | | import cc.mrbird.febs.common.controller.BaseController; |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.mall.vo.AdminMallGoodsCategoryTreeVo; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | |
| | | @GetMapping("list") |
| | | public FebsResponse list(AiProductCategory dto, QueryRequest request) { |
| | | String companyId = getCurrentUserCompanyId(); |
| | | dto.setCompanyId(companyId); |
| | | |
| | | Map<String, Object> data = getDataTable(service.listInPage(dto, request)); |
| | | return new FebsResponse().success().data(data); |
| | |
| | | @PostMapping("add") |
| | | @ControllerEndpoint(operation = "新增", exceptionMessage = "操作失败") |
| | | public FebsResponse add(@RequestBody @Valid AiProductCategory dto) { |
| | | |
| | | String companyId = getCurrentUserCompanyId(); |
| | | dto.setCompanyId(companyId); |
| | | return service.add(dto); |
| | | } |
| | | |
| | |
| | | @GetMapping(value = "/categoryTree") |
| | | public FebsResponse categoryTree() { |
| | | |
| | | return new FebsResponse().success().data(service.categoryTree()); |
| | | String companyId = getCurrentUserCompanyId(); |
| | | return new FebsResponse().success().data(service.categoryTree(companyId)); |
| | | } |
| | | |
| | | @GetMapping("categoryTree/parent") |
| | | @ControllerEndpoint(exceptionMessage = "获取分类失败") |
| | | public List<AiProductCategory> parent(){ |
| | | |
| | | String companyId = getCurrentUserCompanyId(); |
| | | return service.parent(companyId); |
| | | } |
| | | } |