| | |
| | | |
| | | @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(){ |
| | | |
| | | return service.parent(); |
| | | String companyId = getCurrentUserCompanyId(); |
| | | return service.parent(companyId); |
| | | } |
| | | } |