增加 查询版本接口
parent
33c2abb4de
commit
69ecc818c0
@ -0,0 +1,38 @@
|
||||
package com.ruoyi.api.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.api.domain.APKVersion;
|
||||
import com.ruoyi.api.service.IPdaApkVersionService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api")
|
||||
public class PdaVersionController {
|
||||
@Autowired
|
||||
private IPdaApkVersionService service;
|
||||
|
||||
@GetMapping("/getVersion")
|
||||
public String getVersion(){
|
||||
APKVersion apkVersion=service.getVersion();
|
||||
apkVersion.setCode(0);
|
||||
apkVersion.setMsg("");
|
||||
if (apkVersion==null){
|
||||
apkVersion=new APKVersion();
|
||||
apkVersion.setUpdateStatus(0);
|
||||
|
||||
|
||||
}else {
|
||||
apkVersion.setUpdateStatus(1);
|
||||
}
|
||||
|
||||
|
||||
String s = JSONObject.toJSONString(apkVersion);
|
||||
System.out.println("请求版本信息"+s);
|
||||
return s;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue