|
@@ -13,6 +13,7 @@ import com.xiaoan.service.backend.SceneService;
|
|
import com.xiaoan.service.backend.UserService;
|
|
import com.xiaoan.service.backend.UserService;
|
|
import com.xiaoan.web.aop.WebControllerLog;
|
|
import com.xiaoan.web.aop.WebControllerLog;
|
|
import com.xiaoan.web.shiro.JWTUtil;
|
|
import com.xiaoan.web.shiro.JWTUtil;
|
|
|
|
+import com.xiaoan.web.shiro.JwtUtil2;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -36,22 +37,16 @@ public class PersonalCenterController extends BaseController {
|
|
private SceneService sceneService;
|
|
private SceneService sceneService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- private UserService userService;
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
private CameraService cameraService;
|
|
private CameraService cameraService;
|
|
|
|
|
|
@WebControllerLog(description = "个人中心-我的场景/搜索")
|
|
@WebControllerLog(description = "个人中心-我的场景/搜索")
|
|
@ApiOperation("获取场景列表/搜索")
|
|
@ApiOperation("获取场景列表/搜索")
|
|
@PostMapping("scene/list")
|
|
@PostMapping("scene/list")
|
|
public ResultJson findSceneList(@RequestBody SceneProRequest param){
|
|
public ResultJson findSceneList(@RequestBody SceneProRequest param){
|
|
-// List<Long> ids = null;
|
|
|
|
-// if(StringUtils.isNotEmpty(param.getSearchKey())){
|
|
|
|
-// ids = userService.findUserIdByRealName(param.getSearchKey());
|
|
|
|
-// }
|
|
|
|
|
|
|
|
List<SceneResponse> list = null;
|
|
List<SceneResponse> list = null;
|
|
- List userRole = JWTUtil.getUserRole(getToken());
|
|
|
|
|
|
+// List userRole = JWTUtil.getUserRole(getToken());
|
|
|
|
+ List userRole = JwtUtil2.getUserRole(getToken());
|
|
if (userRole.contains("admin")) {
|
|
if (userRole.contains("admin")) {
|
|
list = sceneService.findAllBySearchKey(param, null);
|
|
list = sceneService.findAllBySearchKey(param, null);
|
|
} else {
|
|
} else {
|
|
@@ -66,7 +61,7 @@ public class PersonalCenterController extends BaseController {
|
|
|
|
|
|
@WebControllerLog(description = "个人中心-我的场景/删除")
|
|
@WebControllerLog(description = "个人中心-我的场景/删除")
|
|
@ApiOperation("删除场景")
|
|
@ApiOperation("删除场景")
|
|
- @PostMapping("scene/delete/{id}")
|
|
|
|
|
|
+ @GetMapping("scene/delete/{id}")
|
|
public ResultJson delete(@PathVariable Long id){
|
|
public ResultJson delete(@PathVariable Long id){
|
|
sceneService.deleteById(id);
|
|
sceneService.deleteById(id);
|
|
return new ResultJson(MsgCode.SUCCESS_CODE, MsgCode.SUCCESS_MSG);
|
|
return new ResultJson(MsgCode.SUCCESS_CODE, MsgCode.SUCCESS_MSG);
|
|
@@ -79,7 +74,7 @@ public class PersonalCenterController extends BaseController {
|
|
*/
|
|
*/
|
|
@WebControllerLog(description = "个人中心-我的场景/编辑")
|
|
@WebControllerLog(description = "个人中心-我的场景/编辑")
|
|
@ApiOperation("编辑场景")
|
|
@ApiOperation("编辑场景")
|
|
- @PostMapping("scene/edit/{id}")
|
|
|
|
|
|
+ @GetMapping("scene/edit/{id}")
|
|
public ResultJson edit(@PathVariable Long id){
|
|
public ResultJson edit(@PathVariable Long id){
|
|
SceneProEntity proEntity = sceneService.findById(id);
|
|
SceneProEntity proEntity = sceneService.findById(id);
|
|
String webSite = proEntity.getWebSite();
|
|
String webSite = proEntity.getWebSite();
|
|
@@ -93,7 +88,7 @@ public class PersonalCenterController extends BaseController {
|
|
public ResultJson cameraList(@RequestBody PageDto param){
|
|
public ResultJson cameraList(@RequestBody PageDto param){
|
|
|
|
|
|
List<CameraEntity> list = null;
|
|
List<CameraEntity> list = null;
|
|
- List userRole = JWTUtil.getUserRole(getToken());
|
|
|
|
|
|
+ List userRole = JwtUtil2.getUserRole(getToken());
|
|
if (userRole.contains("admin")) {
|
|
if (userRole.contains("admin")) {
|
|
list = cameraService.findAllBySearchKey(param, null);
|
|
list = cameraService.findAllBySearchKey(param, null);
|
|
} else {
|
|
} else {
|
|
@@ -115,7 +110,7 @@ public class PersonalCenterController extends BaseController {
|
|
*/
|
|
*/
|
|
@ApiOperation("新增相机")
|
|
@ApiOperation("新增相机")
|
|
@WebControllerLog(description = "设备管理-新增相机")
|
|
@WebControllerLog(description = "设备管理-新增相机")
|
|
- @PostMapping("save/{code}")
|
|
|
|
|
|
+ @GetMapping("camera/save/{code}")
|
|
public ResultJson save(@PathVariable String code){
|
|
public ResultJson save(@PathVariable String code){
|
|
if(StringUtils.isEmpty(code)){
|
|
if(StringUtils.isEmpty(code)){
|
|
return new ResultJson(MsgCode.FAILURE_CODE_3001, MsgCode.FAILURE_MSG_3001);
|
|
return new ResultJson(MsgCode.FAILURE_CODE_3001, MsgCode.FAILURE_MSG_3001);
|