package com.diagbot.web;

import com.diagbot.annotation.SysLogger;
import com.diagbot.dto.RespDTO;
import com.diagbot.facade.EnumsDataFacade;
import com.diagbot.util.EnumEntriesBuilder;
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.RestController;

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

/**
 * @Description: 产品中心枚举数据获取类
 * @author: gaodm
 * @time: 2018/9/19 14:32
 */
@RestController
@Api(value="产品中心枚举数据获取API", tags={"产品中心枚举数据获取API"})
@SuppressWarnings("unchecked")
public class EnumsController {
    @Autowired
    private EnumsDataFacade enumsDataFacade;

    @ApiOperation(value = "产品中心枚举数据获取[by:gaodm]",
            notes = "产品中心枚举数据获取")
    @PostMapping("/getDiagbotManEnumsData")
    @SysLogger("getDiagbotManEnumsData")
    public RespDTO<Map<String, List<EnumEntriesBuilder.Entry>>> getEnumsData(){
        return RespDTO.onSuc(enumsDataFacade.getEnumsData());
    }
}
