优化统一鉴权,优化目录结构
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package com.onekeycall.videotablet.controller.sn;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.onekeycall.videotablet.bean.ApkUploadRequest;
|
||||
import com.onekeycall.videotablet.entity.ApkInfo;
|
||||
import com.onekeycall.videotablet.result.Result;
|
||||
import com.onekeycall.videotablet.service.DeviceApkInfoService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/sn")
|
||||
public class DeviceApkInfoController {
|
||||
static Logger logger = LoggerFactory.getLogger(DeviceApkInfoController.class);
|
||||
|
||||
private final ObjectMapper objectMapper; // Spring默认已注入
|
||||
|
||||
public DeviceApkInfoController(ObjectMapper objectMapper) {
|
||||
this.objectMapper = objectMapper;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private DeviceApkInfoService deviceApkInfoService;
|
||||
|
||||
@PostMapping("/upload_install_apks")
|
||||
public Result uploadInstallApks(@RequestBody ApkUploadRequest request) {
|
||||
String sn = request.getSn();
|
||||
List<ApkInfo> apkList = request.getApk_list();
|
||||
if (apkList == null || apkList.size() == 0) {
|
||||
return Result.error().message("应用列表为空");
|
||||
}
|
||||
deviceApkInfoService.saveOrUpdateDeviceApkInfo(sn, apkList);
|
||||
return Result.ok();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user