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.R;
|
import com.panzhihua.service_community.service.BcDictionaryService;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
import java.util.List;
|
|
/** 字典
|
* @author xyh
|
* @date 2021/6/11 16:11
|
*/
|
@Slf4j
|
@RestController
|
@RequestMapping("/dictionary")
|
public class DictionaryApi {
|
|
@Resource
|
private BcDictionaryService bcDictionaryService;
|
|
/**
|
* 根据字典key查询自典项
|
* @param key
|
* @return
|
*/
|
@GetMapping("/listDictionaryByKey")
|
R<List<BcDictionaryVO>> listDictionaryByKey(@RequestParam("key")String key){
|
|
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);
|
}
|
}
|