123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- package com.demo.wjj.controller;
- import com.demo.wjj.po.Dictionary;
- import com.demo.wjj.po.ImgList;
- import com.demo.wjj.po.TbImgItem;
- import com.demo.wjj.service.DictionaryService;
- import com.demo.wjj.utils.ApiResult;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import java.util.List;
- /**
- * 数据字典
- * @author wangqing
- * @date 2018.11.11
- */
- @RequestMapping("/dic")
- @RestController
- public class DictionaryController {
- private final Logger LOG = LoggerFactory.getLogger(getClass());
- @Autowired
- private DictionaryService dictionaryService;
- /**
- * 获取设备类型
- * @return apiResult
- */
- @GetMapping("/getDeviceType")
- public ApiResult queryDeviceType() {
- LOG.info("调用获取设备类型(/dic/getDeviceType)接口");
- try {
- List<Dictionary> dictionaries = dictionaryService.queryDictionaryList(DictionaryService.DEVICE_TYPE);
- LOG.info("调用获取设备类型(/dic/getDeviceType)接口成功");
- return ApiResult.createSuccess(dictionaries);
- } catch (Exception e) {
- LOG.error("调用获取设备类型(/dic/getDeviceType)接口异常", e);
- return ApiResult.createFailure();
- }
- }
- /**
- * 获取配置说明
- * @return apiResult
- */
- @GetMapping("/getConfigInstructions")
- public ApiResult queryConfigInstructions() {
- LOG.info("调用获取配置说明(/dic/getDeviceType)接口");
- try {
- List<Dictionary> dictionaries = dictionaryService.queryDictionaryList(DictionaryService.CONFIG_INSTRUCTIONS);
- LOG.info("调用获取配置说明(/dic/getDeviceType)接口成功");
- return ApiResult.createSuccess(dictionaries);
- } catch (Exception e) {
- LOG.error("调用获取配置说明(/dic/getDeviceType)接口异常", e);
- return ApiResult.createFailure();
- }
- }
- /**
- * 获取作业履历
- * @return apiResult
- */
- @GetMapping("/getJobResume")
- public ApiResult queryJobResume() {
- LOG.info("调用获取作业履历(/dic/getJobResume)接口");
- try {
- List<Dictionary> dictionaries = dictionaryService.queryDictionaryList(DictionaryService.JOB_RESUME);
- LOG.info("调用获取作业履历(/dic/getJobResume)接口成功");
- return ApiResult.createSuccess(dictionaries);
- } catch (Exception e) {
- LOG.error("调用获取作业履历(/dic/getJobResume)接口异常", e);
- return ApiResult.createFailure();
- }
- }
- /**
- * 获取细节分类
- * @return apiResult
- */
- @PostMapping("/queryImgItemListByType")
- public ApiResult queryImgItemListByType(Integer type, Integer bqId) {
- LOG.info("获取细节分类(/dic/getQueryImgItemList)接口");
- try {
- List<TbImgItem> ImgItemList = dictionaryService.queryImgItemListByType(type, bqId);
- LOG.info("获取细节分类(/dic/getQueryImgItemList)接口成功 ImgItemList{}",ImgItemList);
- return ApiResult.createSuccess(ImgItemList);
- } catch (Exception e) {
- LOG.error("获取细节分类(/dic/getQueryImgItemList)接口异常", e);
- return ApiResult.createFailure();
- }
- }
- }
|