package com.community.huiju.controller;

import com.community.commom.mode.ResponseBean;
import com.community.huiju.service.TaVersionServicel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

/**
 * version V1.0
 * class_name: $METHOD_NAME$
 * param: $METHOD_PARAM$
 * describe: TODO
 * creat_user:fuxingfan
 * creat_time: 2019/5/9
 **/
@RestController
@RefreshScope
@RequestMapping("/")
@Api(value = "版本相关的API", description = "版本相关的API")
public class TaVersionController extends BaseController {


    @Autowired
    private TaVersionServicel taVersionService;


    @ApiOperation(value = "获取APP版本号并对比", notes = "获取APP版本号并对比")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "path",dataType = "String",name = "type",value = "ios/android"),
    })
    @RequestMapping(value = "/version/{type}",method = RequestMethod.GET)
    public ResponseBean getVersion(@PathVariable String type, HttpSession session){
        ResponseBean responseBean = taVersionService.getVersion(type);
        return responseBean;
    }
}
