|
@@ -1,95 +1,95 @@
|
|
|
-package com.xiaoan.web.backend;
|
|
|
-
|
|
|
-import com.github.pagehelper.PageInfo;
|
|
|
-import com.xiaoan.common.constant.MsgCode;
|
|
|
-import com.xiaoan.common.util.ResultJson;
|
|
|
-import com.xiaoan.domain.dto.request.SceneProRequest;
|
|
|
-import com.xiaoan.domain.dto.response.SceneResponse;
|
|
|
-import com.xiaoan.service.backend.SceneService;
|
|
|
-import com.xiaoan.web.aop.WebControllerLog;
|
|
|
-import com.xiaoan.web.shiro.JwtUtil2;
|
|
|
-import io.swagger.annotations.Api;
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
-import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
-
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
-/**
|
|
|
- * Created by Hb_zzZ on 2020/3/2.
|
|
|
- *
|
|
|
- * 这个好像不使用了
|
|
|
- */
|
|
|
-
|
|
|
-@Api(tags = "后台场景管理", value = "SceneController")
|
|
|
-
|
|
|
-@RestController
|
|
|
-@RequestMapping("api/manage/scene")
|
|
|
-@Transactional
|
|
|
-public class SceneController extends BaseController {
|
|
|
-
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private SceneService sceneService;
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 根据场景名称,拍摄人查询
|
|
|
- * 需要分角色
|
|
|
- */
|
|
|
- @RequiresPermissions("admin:scene:list")
|
|
|
- @WebControllerLog(description = "场景管理-场景搜索/列表")
|
|
|
- @ApiOperation("获取场景列表")
|
|
|
- @PostMapping("list")
|
|
|
- public ResultJson list(@RequestBody SceneProRequest param){
|
|
|
-
|
|
|
- List<SceneResponse> list = null;
|
|
|
- List userRole = JwtUtil2.getUserRole(getToken());
|
|
|
- if (userRole.contains("admin")) {
|
|
|
- list = sceneService.findAllBySearchKey(param, null);
|
|
|
- } else {
|
|
|
- Long userId = JwtUtil2.getUserId(getToken());
|
|
|
- list = sceneService.findAllBySearchKey(param, userId);
|
|
|
- }
|
|
|
-
|
|
|
- PageInfo<SceneResponse> pageInfo = new PageInfo<SceneResponse>(list);
|
|
|
- return new ResultJson(MsgCode.SUCCESS_CODE, pageInfo);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 本地后台修改场景名称
|
|
|
- */
|
|
|
-// @ApiOperation("下载场景")
|
|
|
-// @WebControllerLog(description = "场景管理-下载场景")
|
|
|
-// @GetMapping(value = "/downloadTexData/{sceneNum}")
|
|
|
-// public ResultJson downloadTexData(@PathVariable String sceneNum) {
|
|
|
+//package com.xiaoan.web.backend;
|
|
|
//
|
|
|
-// if(StringUtils.isEmpty(sceneNum)){
|
|
|
-// return new ResultJson(MsgCode.FAILURE_CODE_3001, MsgCode.FAILURE_MSG_3001);
|
|
|
-// }
|
|
|
-// SceneProEntity sceneProEntity = sceneService.findBySceneNum(sceneNum);
|
|
|
-// if(sceneProEntity == null){
|
|
|
-// return new ResultJson(MsgCode.FAILURE_CODE_3001, MsgCode.FAILURE_MSG_3001);
|
|
|
-// }
|
|
|
+//import com.github.pagehelper.PageInfo;
|
|
|
+//import com.xiaoan.common.constant.MsgCode;
|
|
|
+//import com.xiaoan.common.util.ResultJson;
|
|
|
+//import com.xiaoan.domain.dto.request.SceneProRequest;
|
|
|
+//import com.xiaoan.domain.dto.response.SceneResponse;
|
|
|
+//import com.xiaoan.service.backend.SceneService;
|
|
|
+//import com.xiaoan.web.aop.WebControllerLog;
|
|
|
+//import com.xiaoan.web.shiro.JwtUtil2;
|
|
|
+//import io.swagger.annotations.Api;
|
|
|
+//import io.swagger.annotations.ApiOperation;
|
|
|
+//import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
+//import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+//import org.springframework.transaction.annotation.Transactional;
|
|
|
+//import org.springframework.web.bind.annotation.*;
|
|
|
//
|
|
|
-// String dataPath = sceneProEntity.getDataSource() + "/caches/tex";
|
|
|
-// String saveZipPath = scenePath + "images/images" + sceneNum;
|
|
|
-//// FileUtils.createDir(saveZipPath);
|
|
|
-// FileUtil.mkdir(saveZipPath);
|
|
|
+//import java.util.List;
|
|
|
//
|
|
|
-// String sourcePath = "F:\\test\\test123";
|
|
|
-// ZipUtil.zip(sourcePath, saveZipPath+ "/tex.zip");
|
|
|
+///**
|
|
|
+// * Created by Hb_zzZ on 2020/3/2.
|
|
|
+// *
|
|
|
+// * 这个好像不使用了
|
|
|
+// */
|
|
|
//
|
|
|
-//// return new ResultJson(MsgCode.SUCCESS_CODE,mainUrl + "scene/images/images" + sceneNum + "/tex.zip?t=" +System.currentTimeMillis());
|
|
|
-// return new ResultJson(MsgCode.SUCCESS_CODE,"");
|
|
|
-// }
|
|
|
+//@Api(tags = "后台场景管理", value = "SceneController")
|
|
|
+//
|
|
|
+//@RestController
|
|
|
+//@RequestMapping("api/manage/scene")
|
|
|
+//@Transactional
|
|
|
+//public class SceneController extends BaseController {
|
|
|
+//
|
|
|
+//
|
|
|
+// @Autowired
|
|
|
+// private SceneService sceneService;
|
|
|
//
|
|
|
-// public static void main(String[] args) {
|
|
|
-// String sourcePath = "F:\\test\\test123";
|
|
|
-// String saveZipPath = "F:\\test\\xiaoan\\";
|
|
|
-// ZipUtil.zip(sourcePath, saveZipPath+ "tex.zip");
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 根据场景名称,拍摄人查询
|
|
|
+// * 需要分角色
|
|
|
+// */
|
|
|
+// @RequiresPermissions("admin:scene:list")
|
|
|
+// @WebControllerLog(description = "场景管理-场景搜索/列表")
|
|
|
+// @ApiOperation("获取场景列表")
|
|
|
+// @PostMapping("list")
|
|
|
+// public ResultJson list(@RequestBody SceneProRequest param){
|
|
|
+//
|
|
|
+// List<SceneResponse> list = null;
|
|
|
+// List userRole = JwtUtil2.getUserRole(getToken());
|
|
|
+// if (userRole.contains("admin")) {
|
|
|
+// list = sceneService.findAllBySearchKey(param, null);
|
|
|
+// } else {
|
|
|
+// Long userId = JwtUtil2.getUserId(getToken());
|
|
|
+// list = sceneService.findAllBySearchKey(param, userId);
|
|
|
+// }
|
|
|
+//
|
|
|
+// PageInfo<SceneResponse> pageInfo = new PageInfo<SceneResponse>(list);
|
|
|
+// return new ResultJson(MsgCode.SUCCESS_CODE, pageInfo);
|
|
|
// }
|
|
|
-}
|
|
|
+//
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 本地后台修改场景名称
|
|
|
+// */
|
|
|
+//// @ApiOperation("下载场景")
|
|
|
+//// @WebControllerLog(description = "场景管理-下载场景")
|
|
|
+//// @GetMapping(value = "/downloadTexData/{sceneNum}")
|
|
|
+//// public ResultJson downloadTexData(@PathVariable String sceneNum) {
|
|
|
+////
|
|
|
+//// if(StringUtils.isEmpty(sceneNum)){
|
|
|
+//// return new ResultJson(MsgCode.FAILURE_CODE_3001, MsgCode.FAILURE_MSG_3001);
|
|
|
+//// }
|
|
|
+//// SceneProEntity sceneProEntity = sceneService.findBySceneNum(sceneNum);
|
|
|
+//// if(sceneProEntity == null){
|
|
|
+//// return new ResultJson(MsgCode.FAILURE_CODE_3001, MsgCode.FAILURE_MSG_3001);
|
|
|
+//// }
|
|
|
+////
|
|
|
+//// String dataPath = sceneProEntity.getDataSource() + "/caches/tex";
|
|
|
+//// String saveZipPath = scenePath + "images/images" + sceneNum;
|
|
|
+////// FileUtils.createDir(saveZipPath);
|
|
|
+//// FileUtil.mkdir(saveZipPath);
|
|
|
+////
|
|
|
+//// String sourcePath = "F:\\test\\test123";
|
|
|
+//// ZipUtil.zip(sourcePath, saveZipPath+ "/tex.zip");
|
|
|
+////
|
|
|
+////// return new ResultJson(MsgCode.SUCCESS_CODE,mainUrl + "scene/images/images" + sceneNum + "/tex.zip?t=" +System.currentTimeMillis());
|
|
|
+//// return new ResultJson(MsgCode.SUCCESS_CODE,"");
|
|
|
+//// }
|
|
|
+////
|
|
|
+//// public static void main(String[] args) {
|
|
|
+//// String sourcePath = "F:\\test\\test123";
|
|
|
+//// String saveZipPath = "F:\\test\\xiaoan\\";
|
|
|
+//// ZipUtil.zip(sourcePath, saveZipPath+ "tex.zip");
|
|
|
+//// }
|
|
|
+//}
|