| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | 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; |
| | | |
| | | /** 字典 |
| | | /** |
| | | * 字典 |
| | | * |
| | | * @author xyh |
| | | * @date 2021/6/11 16:11 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 插入字典 |
| | | * @param dictionaryVO 字典数据 |
| | | * |
| | | * @param dictionaryVO |
| | | * 字典数据 |
| | | * @return Boolean 是否保存成功 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @PostMapping("/insertDiction") |
| | | R insertDiction(@RequestBody DictionaryVO dictionaryVO, @ApiIgnore BindingResult results){ |
| | | R insertDiction(@RequestBody DictionaryVO dictionaryVO, @ApiIgnore BindingResult results) { |
| | | if (results.hasErrors()) { |
| | | return R.fail(results.getFieldError().getDefaultMessage()); |
| | | } |
| | | return bcDictionaryService.insertDiction(dictionaryVO); |
| | | } |
| | | |
| | | /** |
| | | * 插入字典项 |
| | | * @param dictionaryVO 字典数据 |
| | | * |
| | | * @param dictionaryVO |
| | | * 字典数据 |
| | | * @return Boolean 是否保存成功 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @PostMapping("/insertDictionItem") |
| | | R insertDictionItem(@RequestBody BcDictionaryVO dictionaryVO, @ApiIgnore BindingResult results){ |
| | | 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 |
| | | */ |
| | | @GetMapping("/listDictionaryByKey") |
| | | R<List<BcDictionaryVO>> listDictionaryByKey(@RequestParam("key")String key){ |
| | | R<List<BcDictionaryVO>> listDictionaryByKey(@RequestParam("key") String key) { |
| | | |
| | | return bcDictionaryService.getDictionaryByKey(key); |
| | | } |
| | |
| | | /** |
| | | * description 根据字典code查询自典项 |
| | | * |
| | | * @param 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); |
| | | BcDictionaryItemVO getByCode(@RequestParam("dictId") String dictId, @RequestParam("code") String code) { |
| | | return bcDictionaryService.getByCode(dictId, code); |
| | | } |
| | | } |