From cc1098fc00a50cb1591d182f04bc37066ff0a9e2 Mon Sep 17 00:00:00 2001 From: 罗元桥 <2376770955@qq.com> Date: 星期四, 05 八月 2021 15:12:39 +0800 Subject: [PATCH] Merge branch 'test' into 'master' --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/DictionaryApi.java | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 45 insertions(+), 0 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/DictionaryApi.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/DictionaryApi.java index c7381be..0147b52 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/DictionaryApi.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/DictionaryApi.java @@ -1,10 +1,14 @@ package com.panzhihua.service_community.api; +import com.panzhihua.common.model.vos.BcDictionaryItemVO; import com.panzhihua.common.model.vos.BcDictionaryVO; +import com.panzhihua.common.model.vos.DictionaryVO; import com.panzhihua.common.model.vos.R; import com.panzhihua.service_community.service.BcDictionaryService; import lombok.extern.slf4j.Slf4j; +import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; import javax.annotation.Resource; import java.util.List; @@ -22,6 +26,34 @@ private BcDictionaryService bcDictionaryService; /** + * 插入字典 + * @param dictionaryVO 字典数据 + * @return Boolean 是否保存成功 + * @author manailin + * @date 2021/6/10 17:00 + */ + @PostMapping("/insertDiction") + R insertDiction(@RequestBody DictionaryVO dictionaryVO, @ApiIgnore BindingResult results){ + if (results.hasErrors()) { + return R.fail(results.getFieldError().getDefaultMessage()); + } + return bcDictionaryService.insertDiction(dictionaryVO); + } + /** + * 插入字典项 + * @param dictionaryVO 字典数据 + * @return Boolean 是否保存成功 + * @author manailin + * @date 2021/6/10 17:00 + */ + @PostMapping("/insertDictionItem") + R insertDictionItem(@RequestBody BcDictionaryVO dictionaryVO, @ApiIgnore BindingResult results){ + if (results.hasErrors()) { + return R.fail(results.getFieldError().getDefaultMessage()); + } + return bcDictionaryService.insertDictionItem(dictionaryVO); + } + /** * 根据字典key查询自典项 * @param key * @return @@ -31,4 +63,17 @@ return bcDictionaryService.getDictionaryByKey(key); } + + /** + * description 根据字典code查询自典项 + * + * @param code 入参参数 + * @return BcDictionaryVO 字典 + * @author manailin + * @date 2021/6/10 17:00 + */ + @GetMapping("/getByCode") + BcDictionaryItemVO getByCode(@RequestParam("dictId") String dictId, @RequestParam("code")String code){ + return bcDictionaryService.getByCode(dictId,code); + } } -- Gitblit v1.7.1