package cn.estsh.i3plus.core.apiservice.controller.busi;

import cn.estsh.i3plus.platform.common.util.PlatformConstWords;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.ImppEnumUtil;
import cn.estsh.impp.framework.base.controller.CoreBaseController;
import cn.estsh.impp.framework.boot.util.ResultBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @Description : 系统对外枚举服务
 * @Reference :
 * @Author : wei.peng
 * @Date : 2018-10-22 15:58
 * @Modify :
 **/
@RestController
@Api(description = "系统枚举服务")
@RequestMapping(PlatformConstWords.BASE_URL + "/sys-enum")
public class SysEnumController extends CoreBaseController{

    @GetMapping("/method-level")
    @ApiOperation(value = "功能类型", notes = "查询全部功能类型功能")
    public ResultBean getEnumMethodLevel(){
         return new ResultBean(true, "操作成功",
                 Arrays.asList(CommonEnumUtil.METHOD_LEVEL.values()));
    }

    @GetMapping("/user-data-status")
    @ApiOperation(value = "数据功能状态", notes = "查询全部数据状态功能")
    public ResultBean getEnumUserDataStatus(){
        return new ResultBean(true, "操作成功",
                Arrays.asList(CommonEnumUtil.DATA_STATUS.values()));
    }

    @GetMapping("/data-status")
    @ApiOperation(value = "数据功能状态", notes = "查询全部数据状态功能")
    public ResultBean getEnumDataStatus(){
        List<CommonEnumUtil.DATA_STATUS> enumList = new ArrayList();
        enumList.add(CommonEnumUtil.DATA_STATUS.ENABLE);
        enumList.add(CommonEnumUtil.DATA_STATUS.DISABLE);
        return new ResultBean(true, "操作成功",enumList);
    }

    @GetMapping("/organize-type")
    @ApiOperation(value = "组织类型", notes = "查询全部组织类型功能")
    public ResultBean getEnumOrganizeType(){
        return new ResultBean(true, "操作成功",
                Arrays.asList(ImppEnumUtil.ORGANIZE_YTPE.values()));
    }

    @GetMapping("/task-method-type")
    @ApiOperation(value = "任务类型", notes = "查询全部任务类型功能")
    public ResultBean getTaskMethodType(){
        return new ResultBean(true, "操作成功",
                Arrays.asList(ImppEnumUtil.TASK_METHOD_TYPE.values()));
    }

    @GetMapping("/user-type")
    @ApiOperation(value = "用户类型", notes = "查询全部用户类型功能")
    public ResultBean getUserType(){
        return new ResultBean(true, "操作成功",
                Arrays.asList(CommonEnumUtil.USER_TYPE.values()));
    }

    @GetMapping("/user-status")
    @ApiOperation(value = "用户账号状态", notes = "查询全部用户账号功能")
    public ResultBean getUserStatus(){
        return new ResultBean(true, "操作成功",
                Arrays.asList(CommonEnumUtil.USER_STATUS.values()));
    }

    @GetMapping("/log-level")
    @ApiOperation(value = "日志等级", notes = "日志等级")
    public ResultBean getLogLevel(){
        return new ResultBean(true, "操作成功",
                Arrays.asList(ImppEnumUtil.LOG_LEVEL.values()));
    }

    @GetMapping("/soft-type")
    @ApiOperation(value = "软件类型", notes = "软件类型")
    public ResultBean getSoftType(){
        return new ResultBean(true, "操作成功",
                Arrays.asList(CommonEnumUtil.SOFT_TYPE.values()));
    }

    @GetMapping("/operate-type")
    @ApiOperation(value = "操作日志类型", notes = "操作日志类型")
    public ResultBean getOperateType(){
        return new ResultBean(true, "操作成功",
                Arrays.asList(ImppEnumUtil.OPERATE_TYPE.values()));
    }

    @GetMapping("/user-message-status")
    @ApiOperation(value = "用户消息状态", notes = "用户消息状态")
    public ResultBean getUserMessageStatus(){
        return new ResultBean(true, "操作成功",
                Arrays.asList(ImppEnumUtil.MESSAGE_STATUS.values()));
    }

    @GetMapping("/user-message-type")
    @ApiOperation(value = "用户消息类型", notes = "用户消息类型")
    public ResultBean getUserMessageType(){
        return new ResultBean(true, "操作成功",
                Arrays.asList(ImppEnumUtil.MESSAGE_TYPE.values()));
    }

    @GetMapping("/tool-conn-type")
    @ApiOperation(value = "硬件连接类型", notes = "硬件连接类型")
    public ResultBean getToolConnType(){
        return new ResultBean(true, "操作成功",
                Arrays.asList(ImppEnumUtil.TOOL_CONN_TYPE.values()));
    }

    @GetMapping("/tool-data-type")
    @ApiOperation(value = "硬件数据类型", notes = "硬件数据类型")
    public ResultBean getToolDataType(){
            return new ResultBean(true, "操作成功",
                    Arrays.asList(ImppEnumUtil.TOOL_DATA_TYPE.values()));
    }

    @GetMapping("/sys-config-type")
    @ApiOperation(value = "系统参数类型", notes = "系统参数")
    public ResultBean getSysParamType(){
        return new ResultBean(true, "操作成功",
                Arrays.asList(ImppEnumUtil.SYS_CONFIG_TYPE.values()));
    }

    @GetMapping("/sys-locale-resource-type")
    @ApiOperation(value = "系统资源类型")
    public ResultBean getSysLocaleResourceType(){
        return new ResultBean(true, "操作成功",
                Arrays.asList(CommonEnumUtil.SYS_LOCALE_RESOURCE_TYPE.values()));
    }

    @GetMapping("/user-sex")
    @ApiOperation(value = "用户性别", notes = "用户性别")
    public ResultBean getUserSex(){
        return new ResultBean(true, "操作成功",
                Arrays.asList(CommonEnumUtil.USER_ESX.values()));
    }

    @GetMapping("/user-info-status")
    @ApiOperation(value = "用户状态", notes = "用户状态")
    public ResultBean getUserInfoStatus(){
        return new ResultBean(true, "操作成功",
                Arrays.asList(CommonEnumUtil.USER_INFO_STATUS.values()));
    }

    @GetMapping("/sys-value-type")
    @ApiOperation(value = "系统参数值类型", notes = "用户状态")
    public ResultBean getSysConfigValueType(){
        return new ResultBean(true, "操作成功",
                Arrays.asList(ImppEnumUtil.SYS_VALUE_TYPE.values()));
    }

    @GetMapping("/sys-math-symbol")
    @ApiOperation(value = "数学表达式", notes = "数学表达式")
    public ResultBean getSysMathSymbol(){
        return new ResultBean(true, "操作成功",
                Arrays.asList(CommonEnumUtil.MATH_SYMBOL.values()));
    }

    @GetMapping("/sys-config-group")
    @ApiOperation(value = "系统配置组", notes = "系统配置组")
    public ResultBean getSysConfigGroup(){
        return new ResultBean(true, "操作成功",
                Arrays.asList(ImppEnumUtil.SYS_CONFIG_GROUP.values()));
    }

    @GetMapping("/internal-notice-method")
    @ApiOperation(value = "内部通知方式", notes = "内部通知方式")
    public ResultBean getInternalNoticeMethod(){
        List<ImppEnumUtil.MESSAGE_TYPE> list = new ArrayList<>();
        list.add(ImppEnumUtil.MESSAGE_TYPE.MAIL);
        list.add(ImppEnumUtil.MESSAGE_TYPE.LETTER);
        return new ResultBean(true, "操作成功",list);
    }

    @GetMapping("/external-notice-method")
    @ApiOperation(value = "外部通知方式", notes = "外部通知方式")
    public ResultBean getExternalNoticeMethod(){
        List<ImppEnumUtil.MESSAGE_TYPE> list = new ArrayList<>();
        list.add(ImppEnumUtil.MESSAGE_TYPE.MAIL);
        return new ResultBean(true, "操作成功",list);
    }
}
