package com.cweb.controller;

import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.BsAudit;
import com.hfkj.entity.SecVersion;
import com.hfkj.model.ResponseData;
import com.hfkj.model.UserInfoModel;
import com.hfkj.service.BsAuditService;
import com.hfkj.service.SecVersionService;
import com.hfkj.sysenum.AuditStatusEnum;
import com.hfkj.sysenum.SecUserTypeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@Controller
@Api(value = "系统版本")
@RequestMapping(value = "/sysVersion")
public class SecVersionController {

    private static Logger log = LoggerFactory.getLogger(SecVersionController.class);

    @Resource
    private SecVersionService secVersionService;

    @RequestMapping(value="/queryVersion",method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "查询版本")
    public ResponseData queryVersion(@RequestParam(name = "termType", required = true) String termType) {
        try {

            SecVersion version = secVersionService.getCurrentVersion(termType);
            return ResponseMsgUtil.success(version);

        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return ResponseMsgUtil.exception(e);
        }
    }



}
