UpSoftVerController.java
1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.xkl.controller.uploadsoft;
import com.wordnik.swagger.annotations.ApiOperation;
import com.xkl.domain.UpSoftVersion;
import com.xkl.model.ResultModel;
import com.xkl.repository.UpSoftVersionRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
/**
* AMP报告上传软件客户端获取最新软件版本。
*/
@RestController
@RequestMapping("/upsoft/version")
public class UpSoftVerController {
@Autowired
private UpSoftVersionRepository upSoftVersionRepository;
@RequestMapping(method = RequestMethod.GET)
@ApiOperation(value = "获取最新软件版本信息,返回值中,version_num为版本号")
public ResponseEntity<ResultModel> getVersionInfo() {
List<UpSoftVersion> versionList = upSoftVersionRepository.findAllVersion();
UpSoftVersion version = versionList.get(versionList.size() - 1);
return new ResponseEntity<>(ResultModel.ok(version), HttpStatus.OK);
}
}