package com.reyun.saas.web.controller.common;

import com.reyun.saas.common.framework.ApiRestController;
import com.reyun.saas.common.restResult.RestResult;
import com.reyun.saas.common.restResult.ResultGenerator;
import com.reyun.saas.report.data.service.DropDownService;
import com.reyun.saas.security.utils.SecurityUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import javax.annotation.Resource;

/**
 * @desc 需要查实时离线的下拉框
 */
@Slf4j
@Api(value = "/dropDown", tags = "需要查实时离线的下拉框")
@ApiRestController("dropDown/{os}")
public class DropDownBoxReportController {

    @Resource
    private DropDownService dropDownServiceImpl;

    @ApiOperation(value = "获取各种下拉框值", notes = "" , produces = "application/json")
    @GetMapping("/{type}")
    public RestResult getAppVersion(@PathVariable String os,@ApiParam(value = "appVersion:App版本,sdkVersion:SDK版本,sysVersion:操作系统版本,model:设备型号,brand:设备品牌") @PathVariable String type){
        return ResultGenerator.genSuccessResult(dropDownServiceImpl.getVersion(SecurityUtils.getLoginUserId(),os,type));
    }
}
