|
@@ -3,30 +3,20 @@ package com.xiaoan.web.backend;
|
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.xiaoan.common.constant.MsgCode;
|
|
|
-import com.xiaoan.common.exception.BaseRuntimeException;
|
|
|
import com.xiaoan.common.model.PageDto;
|
|
|
import com.xiaoan.common.util.Result;
|
|
|
import com.xiaoan.common.util.ResultJson;
|
|
|
-import com.xiaoan.dao.backend.CameraVersionMapper;
|
|
|
import com.xiaoan.domain.backend.CameraVersionEntity;
|
|
|
import com.xiaoan.domain.dto.request.CameraVersionRequest;
|
|
|
-import com.xiaoan.domain.dto.response.UserResponse;
|
|
|
import com.xiaoan.service.backend.CameraVersionService;
|
|
|
import com.xiaoan.web.aop.WebControllerLog;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.log4j.Log4j2;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.apache.shiro.authz.annotation.Logical;
|
|
|
-import org.apache.shiro.authz.annotation.RequiresRoles;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
-import org.springframework.web.multipart.MultipartFile;
|
|
|
-
|
|
|
-import javax.validation.Valid;
|
|
|
-import java.io.IOException;
|
|
|
-import java.util.List;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -34,7 +24,7 @@ import java.util.List;
|
|
|
*
|
|
|
* 相机版本管理
|
|
|
*/
|
|
|
-@Api(tags = "后台相机版本管理")
|
|
|
+@Api(tags = "相机版本管理")
|
|
|
@Log4j2
|
|
|
@RestController
|
|
|
@RequestMapping("api")
|
|
@@ -48,7 +38,7 @@ public class CameraVersionController extends BaseController {
|
|
|
|
|
|
|
|
|
@WebControllerLog(description = "版本管理-固件列表")
|
|
|
- @ApiOperation("相机列表")
|
|
|
+ @ApiOperation("固件列表")
|
|
|
@PostMapping("manage/version/list")
|
|
|
public ResultJson list(@RequestBody PageDto param){
|
|
|
PageInfo<CameraVersionEntity> page = new PageInfo<CameraVersionEntity>(cameraVersionService.findAllBySearchKey(param));
|
|
@@ -59,6 +49,7 @@ public class CameraVersionController extends BaseController {
|
|
|
/**
|
|
|
* 仅有有一台相机是活动状态
|
|
|
*/
|
|
|
+ @WebControllerLog(description = "版本管理-更新状态")
|
|
|
@ApiOperation("更新状态")
|
|
|
@GetMapping("manage/version/update/{id}/{status}")
|
|
|
public ResultJson updateStatus(@PathVariable("id") Long id, @PathVariable("status") String status) {
|
|
@@ -66,31 +57,6 @@ public class CameraVersionController extends BaseController {
|
|
|
|
|
|
}
|
|
|
|
|
|
-// @ApiOperation("上传文件")
|
|
|
-// @WebControllerLog(description = "版本管理-上传文件")
|
|
|
-// @PutMapping(value = "manage/version/save", consumes = { "multipart/form-data" })
|
|
|
-// public ResultJson save(@RequestParam("file") MultipartFile file, CameraVersionRequest param) throws Exception {
|
|
|
-//
|
|
|
-//// log.info("111: {}", StringUtils.isEmpty(param.getVersion()));
|
|
|
-//// log.info("2222: {}", param.getVersion());
|
|
|
-// if(StringUtils.isBlank(param.getVersion())){
|
|
|
-// log.error("版本不能为空");
|
|
|
-// return new ResultJson(MsgCode.e_COMMON_3001, "版本不能为空");
|
|
|
-// }
|
|
|
-//
|
|
|
-// if(StringUtils.isBlank(param.getDescription())){
|
|
|
-// log.error("描述不能为空");
|
|
|
-// return new ResultJson(MsgCode.e_COMMON_3001, "描述不能为空");
|
|
|
-// }
|
|
|
-//
|
|
|
-// if (!file.isEmpty() && file.getSize() <= 0) {
|
|
|
-// log.error("文件不能为空");
|
|
|
-// throw new BaseRuntimeException(MsgCode.e_COMMON_3001, "文件不能为空");
|
|
|
-// }
|
|
|
-//
|
|
|
-// cameraVersionService.upload(file, param, savePath);
|
|
|
-// return new ResultJson(MsgCode.SUCCESS_CODE, MsgCode.msg_SUCCESS);
|
|
|
-// }
|
|
|
|
|
|
@ApiOperation("上传文件")
|
|
|
@WebControllerLog(description = "版本管理-上传文件")
|