|
@@ -3,6 +3,7 @@ package com.roma.romaapi.controller;
|
|
|
|
|
|
|
|
import com.roma.romaapi.service.ApiService;
|
|
import com.roma.romaapi.service.ApiService;
|
|
|
import com.roma.romaapi.service.CaptchaService;
|
|
import com.roma.romaapi.service.CaptchaService;
|
|
|
|
|
+import com.roma.romaapi.utils.CommonUtil;
|
|
|
import com.roma.romaapi.utils.CustomResponse;
|
|
import com.roma.romaapi.utils.CustomResponse;
|
|
|
import com.roma.romaapi.utils.UUIDUtil;
|
|
import com.roma.romaapi.utils.UUIDUtil;
|
|
|
import jakarta.servlet.http.HttpServletRequest;
|
|
import jakarta.servlet.http.HttpServletRequest;
|
|
@@ -10,13 +11,11 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.data.redis.core.ValueOperations;
|
|
import org.springframework.data.redis.core.ValueOperations;
|
|
|
-import org.springframework.web.bind.annotation.CrossOrigin;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RequestHeader;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
@@ -32,6 +31,8 @@ public class ApiController {
|
|
|
private UUIDUtil uuidUtil;
|
|
private UUIDUtil uuidUtil;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private RedisTemplate<String, String> redisTemplate;
|
|
private RedisTemplate<String, String> redisTemplate;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ CommonUtil commonUtil;
|
|
|
// 获取验证码
|
|
// 获取验证码
|
|
|
@RequestMapping("/login/verifyCode")
|
|
@RequestMapping("/login/verifyCode")
|
|
|
public Map<String, Object> loginVerifyCode() throws IOException {
|
|
public Map<String, Object> loginVerifyCode() throws IOException {
|
|
@@ -62,4 +63,47 @@ public class ApiController {
|
|
|
|
|
|
|
|
return CustomResponse.formatResponse(loginResult);
|
|
return CustomResponse.formatResponse(loginResult);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ //=============================================权限相关======================================
|
|
|
|
|
+ // 权限管理-获取所有权限
|
|
|
|
|
+ @RequestMapping("/api/permissionList")
|
|
|
|
|
+ public Map permissionList(HttpServletRequest request) {
|
|
|
|
|
+ Map<String, Object> ret = new HashMap<>();
|
|
|
|
|
+ List allPermiss = apiService.permissionList();
|
|
|
|
|
+ ret.put("options", allPermiss);
|
|
|
|
|
+
|
|
|
|
|
+ return CustomResponse.formatResponse(ret);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @RequestMapping("/api/addPermissions")
|
|
|
|
|
+ public Map addPermissions(HttpServletRequest request, @RequestBody String data) {
|
|
|
|
|
+ Map maps = commonUtil.analysisRequestParams(request, data); // 参数
|
|
|
|
|
+ Map<String, Object> ret = new HashMap<>();
|
|
|
|
|
+
|
|
|
|
|
+ apiService.addPermissions(maps);
|
|
|
|
|
+
|
|
|
|
|
+ return CustomResponse.formatResponse(ret);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // 获取所有页面
|
|
|
|
|
+// @RequestMapping("/api/pageList")
|
|
|
|
|
+// public Map pageList(HttpServletRequest request) {
|
|
|
|
|
+// Map<String, Object> ret = new HashMap<>();
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+// List allPermiss = apiService.pageList();
|
|
|
|
|
+// ret.put("options", allPermiss);
|
|
|
|
|
+// System.out.println("------------------------------"+allPermiss);
|
|
|
|
|
+// return CustomResponse.formatResponse(ret);
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+ // 角色管理-获取全部角色
|
|
|
|
|
+
|
|
|
|
|
+ // 角色分配权限
|
|
|
|
|
+
|
|
|
|
|
+ // 用户管理-获取全部用户
|
|
|
|
|
+
|
|
|
|
|
+ // 用户分配角色
|
|
|
}
|
|
}
|