package org.cs.mgr.setting.ctl;

import org.apache.log4j.Logger;
import org.cs.core.ctl.BaseCtl;
import org.cs.mgr.setting.service.IAppVersionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSONObject;

@Controller
public class VersionAPI extends BaseCtl {
	private static Logger log = Logger.getLogger(VersionAPI.class);
	@Autowired
	private IAppVersionService appVersionService;
	@RequestMapping("/rest/app/getVersion")
	@ResponseBody
	public JSONObject getVersion(String plat, String v ){
		JSONObject json = new JSONObject();
		try{
			json = appVersionService.check(plat, v);
		}catch(Exception e){
			log.info(e.getMessage());
			json = getJson(0, null, "版本信息获取失败");
		}
		return json;
	}
}
