From aaaa40f2c812d04f30c3355b44539a9cfd838468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=9D=9E=E5=87=A1?= Date: Tue, 9 Dec 2025 07:49:16 +0000 Subject: [PATCH] Merge #7 into master from cc_20251209_dict MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix:小程序新增字典接口 * cc_20251209_dict: (1 commits squashed) - fix:小程序新增字典接口 Signed-off-by: 王非凡 Reviewed-by: 苏竹红 Merged-by: 苏竹红 CR-link: https://codeup.aliyun.com/692ea314dec569489f6f167c/hangzhou/java/custom_zxjp/change/7 --- .../webc/MiniDictManagerController.java | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 coolstore-partner-web/src/main/java/com/cool/store/controller/webc/MiniDictManagerController.java diff --git a/coolstore-partner-web/src/main/java/com/cool/store/controller/webc/MiniDictManagerController.java b/coolstore-partner-web/src/main/java/com/cool/store/controller/webc/MiniDictManagerController.java new file mode 100644 index 000000000..607a06a37 --- /dev/null +++ b/coolstore-partner-web/src/main/java/com/cool/store/controller/webc/MiniDictManagerController.java @@ -0,0 +1,88 @@ +package com.cool.store.controller.webc; + +import com.cool.store.request.dict.DictColumnQueryRequest; +import com.cool.store.request.dict.DictGroupQueryRequest; +import com.cool.store.request.dict.DictTableQueryRequest; +import com.cool.store.response.ResponseResult; +import com.cool.store.service.dict.DictColumnService; +import com.cool.store.service.dict.DictGroupService; +import com.cool.store.service.dict.DictTableInfoService; +import com.cool.store.vo.dict.DictColumnSimpleVO; +import com.cool.store.vo.dict.DictColumnVO; +import com.cool.store.vo.dict.DictGroupVO; +import com.cool.store.vo.dict.DictTableVO; +import com.github.pagehelper.PageInfo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import javax.validation.constraints.NotBlank; +import java.util.List; +import java.util.Map; + +/** + *

+ * 字典管理 前端控制器 + *

+ * + * @author wangff + * @since 2025/2/20 + */ +@Api(tags = "Mini字典管理") +@RestController +@RequestMapping("/mini/sys/dict") +@RequiredArgsConstructor +public class MiniDictManagerController { + private final DictGroupService groupService; + private final DictTableInfoService tableService; + private final DictColumnService columnService; + + @ApiOperation("字典分组-查询") + @GetMapping("/group/{groupId}") + public ResponseResult groupGet(@PathVariable("groupId") Long groupId) { + return ResponseResult.success(groupService.getById(groupId)); + } + + @ApiOperation("字典分组-列表") + @GetMapping("/group/list") + public ResponseResult> groupList(DictGroupQueryRequest dto) { + return ResponseResult.success(groupService.getList(dto)); + } + + @ApiOperation("字典表-查询") + @GetMapping("/table/{tableId}") + public ResponseResult tableGet(@PathVariable("tableId") Long tableId) { + return ResponseResult.success(tableService.getById(tableId)); + } + + @ApiOperation("字典表-列表") + @GetMapping("/table/list") + public ResponseResult> tableList(DictTableQueryRequest dto) { + return ResponseResult.success(tableService.getList(dto)); + } + + @ApiOperation("字典项-分页查询") + @GetMapping("/column/page") + public ResponseResult> columnPage(DictColumnQueryRequest dto) { + return ResponseResult.success(columnService.getPage(dto)); + } + + @ApiOperation("字典项-查询") + @GetMapping("/column/{columnId}") + public ResponseResult columnGet(@PathVariable("columnId") Long columnId) { + return ResponseResult.success(columnService.getById(columnId)); + } + + @ApiOperation("字典项-根据字典项code查询已启用的字典项") + @GetMapping("/column/getByColumnCode") + public ResponseResult getColumnByColumnCode(@NotBlank(message = "字典项编码不能为空") String columnCode) { + return ResponseResult.success(columnService.getColumnByColumnCode(columnCode)); + } + + @ApiOperation("字典项-根据字典表code查询已启用的字典项列表") + @PostMapping("/column/getMapByTableCodes") + public ResponseResult>> getColumnByTableCode(@RequestBody List tableCodes) { + return ResponseResult.success(columnService.getMapListByTableCode(tableCodes)); + } +}