package com.diagbot.web;

import com.diagbot.annotation.SysLogger;
import com.diagbot.dto.RespDTO;
import com.diagbot.dto.SysDictionaryInfoDTO;
import com.diagbot.facade.SysDictionaryFacade;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 系统字典表 前端控制器
 * </p>
 *
 * @author gaodm
 * @time: 2024-04-12
 */
@RequestMapping("/sys/dictionaryInfo")
@RestController
@SuppressWarnings("unchecked")
@Api(value = "字典信息API", tags = { "字典信息API" })
@ApiIgnore
@Deprecated
public class SysDictionaryInfoController {

    @Autowired
    SysDictionaryFacade sysDictionaryFacade;

    @ApiOperation(value = "返回字典信息[by:gaodm]",
            notes = "")
    @PostMapping("/getDictionary")
    @SysLogger("getDictionary")
    public RespDTO<Map<Long, List<SysDictionaryInfoDTO>>> getDictionary() {
        Map<Long, List<SysDictionaryInfoDTO>> data = sysDictionaryFacade.getDictionary();
        return RespDTO.onSuc(data);
    }

}
