|
|
@@ -32,6 +32,9 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
import java.rmi.ServerException;
|
|
|
import java.util.*;
|
|
|
|
|
|
+/**
|
|
|
+ * 主机白令海-请求中心接口(本类下所有接口,原始路径均携带 /api/deploy 前缀)
|
|
|
+ */
|
|
|
@RestController
|
|
|
public class BeringController {
|
|
|
|
|
|
@@ -58,7 +61,7 @@ public class BeringController {
|
|
|
/**
|
|
|
* 白令海Rest接口-推送主机的注册码及机器设备序列号信息,并返回应用秘钥
|
|
|
*/
|
|
|
- @PostMapping("/api/deploy/register")
|
|
|
+ @PostMapping("/register")
|
|
|
public Object register(@RequestBody RegisterVo registerVo){
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
try {
|
|
|
@@ -75,7 +78,7 @@ public class BeringController {
|
|
|
/**
|
|
|
* 白令海Rest接口-获取token
|
|
|
*/
|
|
|
- @PostMapping("/api/deploy/accesstoken")
|
|
|
+ @PostMapping("/accesstoken")
|
|
|
public Object register(@RequestBody TokenVo tokenVo, HttpServletResponse response){
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
try {
|
|
|
@@ -98,7 +101,7 @@ public class BeringController {
|
|
|
/**
|
|
|
* 白令海Rest接口-上送心跳
|
|
|
*/
|
|
|
- @PostMapping("/api/deploy/heartbeat")
|
|
|
+ @PostMapping("/heartbeat")
|
|
|
public Object heartBeat(HttpServletRequest request, @RequestBody HeartBeat heartBeat){
|
|
|
//获取令牌
|
|
|
String authorization = request.getHeader("Authorization");
|
|
|
@@ -117,7 +120,7 @@ public class BeringController {
|
|
|
/**
|
|
|
* 白令海Rest接口-推送应用清单
|
|
|
*/
|
|
|
- @PostMapping("/api/deploy/list")
|
|
|
+ @PostMapping("/list")
|
|
|
public Object putList(@RequestBody PutAppInfoVo putAppInfoVo, HttpServletResponse response, HttpServletRequest request){
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
logger.info("白令海Rest接口-推送应用清单: 传入参数={}",JSONArray.toJSON(putAppInfoVo).toString());
|
|
|
@@ -157,7 +160,7 @@ public class BeringController {
|
|
|
/**
|
|
|
* 白令海Rest接口-获取应用清单
|
|
|
*/
|
|
|
- @GetMapping("/api/deploy/list")
|
|
|
+ @GetMapping("/list")
|
|
|
public Object getAppList(HttpServletResponse response, HttpServletRequest request){
|
|
|
|
|
|
try {
|
|
|
@@ -272,7 +275,7 @@ public class BeringController {
|
|
|
/**
|
|
|
* 白令海Rest接口-报告应用部署状态(此接口给白令海调用,避免其打印错误日志)
|
|
|
*/
|
|
|
- @PostMapping("/api/deploy/report")
|
|
|
+ @PostMapping("/report")
|
|
|
public Object report(){
|
|
|
return null;
|
|
|
}
|
|
|
@@ -280,7 +283,7 @@ public class BeringController {
|
|
|
/**
|
|
|
* 白令海Rest接口-下载服务升级包
|
|
|
*/
|
|
|
- @GetMapping("/api/deploy/package/download/{id}")
|
|
|
+ @GetMapping("/package/download/{id}")
|
|
|
public void getAgentPackage(HttpServletResponse response, HttpServletRequest request, @PathVariable @Value("id") String id){
|
|
|
UploadAppInfo uploadAppInfo = uploadAppInfoService.getById(id);
|
|
|
if (null == uploadAppInfo){
|
|
|
@@ -296,7 +299,7 @@ public class BeringController {
|
|
|
/**
|
|
|
* 白令海Rest接口-获取任务
|
|
|
*/
|
|
|
- @GetMapping("/api/deploy/task")
|
|
|
+ @GetMapping("/task")
|
|
|
public Object getTask(HttpServletRequest request, HttpServletResponse response){
|
|
|
String authorization = request.getHeader("Authorization");
|
|
|
authorization = StringUtils.replace(authorization,"Bearer ","");
|
|
|
@@ -313,7 +316,7 @@ public class BeringController {
|
|
|
/**
|
|
|
* 白令海Rest接口-上送任务执行状态
|
|
|
*/
|
|
|
- @PostMapping("/api/deploy/taskReport")
|
|
|
+ @PostMapping("/taskReport")
|
|
|
public Object taskReport(HttpServletRequest request, HttpServletResponse response, @RequestBody List<TaskVo> tasks){
|
|
|
//获取令牌
|
|
|
String authorization = request.getHeader("Authorization");
|
|
|
@@ -331,7 +334,7 @@ public class BeringController {
|
|
|
* 主机iot服务Rest接口-3100主机获取部署中心系统时间并同步到本地
|
|
|
* @return
|
|
|
*/
|
|
|
- @PostMapping(value = "/api/deploy/frontend/synchronDate")
|
|
|
+ @PostMapping(value = "/frontend/synchronDate")
|
|
|
public JSONObject synchronDate(){
|
|
|
JSONObject result = new JSONObject();
|
|
|
String now = UTCTimeUtils.convertDateToStringByFormat(new Date(),"yyyy-MM-dd HH:mm:ss");
|