parent
64335ed9d6
commit
a2afb0fef6
|
|
@ -10,6 +10,7 @@ import com.multictrl.modules.log.service.SysLogErrorService;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.shiro.authz.UnauthorizedException;
|
||||||
import org.springframework.dao.DuplicateKeyException;
|
import org.springframework.dao.DuplicateKeyException;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||||
|
|
@ -48,6 +49,14 @@ public class RenExceptionHandler {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ExceptionHandler(UnauthorizedException.class)
|
||||||
|
public Result<Object> handleDuplicateKeyException(UnauthorizedException ex) {
|
||||||
|
Result<Object> result = new Result<Object>();
|
||||||
|
result.error(ErrorCode.SHIRO_NOT_AUTHORIZED);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
@ExceptionHandler(Exception.class)
|
@ExceptionHandler(Exception.class)
|
||||||
public Result<Object> handleException(Exception ex) {
|
public Result<Object> handleException(Exception ex) {
|
||||||
log.error(ex.getMessage(), ex);
|
log.error(ex.getMessage(), ex);
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ import com.multictrl.modules.business.service.MultiService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.v3.oas.annotations.Parameters;
|
import io.swagger.v3.oas.annotations.Parameters;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
|
@ -139,7 +140,17 @@ public class MultiController {
|
||||||
|
|
||||||
@PostMapping("/multiGroupDockTest")
|
@PostMapping("/multiGroupDockTest")
|
||||||
@Operation(summary = "蛙跳组机库测试")
|
@Operation(summary = "蛙跳组机库测试")
|
||||||
public Result<String> multiGroupDockTest(MultiTestDTO dto) {
|
@Parameters({
|
||||||
|
@Parameter(name = "dockSn", description = "妙算SN"),
|
||||||
|
@Parameter(name = "routeId", description = "航线标识"),
|
||||||
|
@Parameter(name = "lon1", description = "经度1"),
|
||||||
|
@Parameter(name = "lat1", description = "纬度1"),
|
||||||
|
@Parameter(name = "height1", description = "高度1"),
|
||||||
|
@Parameter(name = "lon2", description = "经度2"),
|
||||||
|
@Parameter(name = "lat2", description = "纬度2"),
|
||||||
|
@Parameter(name = "height2", description = "高度2"),
|
||||||
|
})
|
||||||
|
public Result<String> multiGroupDockTest(@Parameter(hidden = true) MultiTestDTO dto) {
|
||||||
String message = multiService.multiGroupDockTest(dto);
|
String message = multiService.multiGroupDockTest(dto);
|
||||||
|
|
||||||
return new Result<String>().ok(message);
|
return new Result<String>().ok(message);
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,7 @@ public class ShiroConfig {
|
||||||
filterMap.put("/q20-ctrl.html", "anon");
|
filterMap.put("/q20-ctrl.html", "anon");
|
||||||
filterMap.put("/srs/**", "anon");
|
filterMap.put("/srs/**", "anon");
|
||||||
filterMap.put("/mqtt/auth", "anon");
|
filterMap.put("/mqtt/auth", "anon");
|
||||||
|
filterMap.put("/business/multi/multiGroupDockTest", "anon");
|
||||||
filterMap.put("/**", "oauth2");
|
filterMap.put("/**", "oauth2");
|
||||||
return filterMap;
|
return filterMap;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ public interface ErrorCode {
|
||||||
int JOB_ERROR = 10028;
|
int JOB_ERROR = 10028;
|
||||||
int INVALID_SYMBOL = 10029;
|
int INVALID_SYMBOL = 10029;
|
||||||
int OSS_REMOVE_FILE_ERROR = 10030;
|
int OSS_REMOVE_FILE_ERROR = 10030;
|
||||||
|
int SHIRO_NOT_AUTHORIZED = 10031;
|
||||||
|
|
||||||
int ROUTE_EXIST = 20001;
|
int ROUTE_EXIST = 20001;
|
||||||
int PARAMS_ERROR = 20002;
|
int PARAMS_ERROR = 20002;
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
10028=\u5B9A\u65F6\u4EFB\u52A1\u5931\u8D25
|
10028=\u5B9A\u65F6\u4EFB\u52A1\u5931\u8D25
|
||||||
10029=\u4E0D\u80FD\u5305\u542B\u975E\u6CD5\u5B57\u7B26
|
10029=\u4E0D\u80FD\u5305\u542B\u975E\u6CD5\u5B57\u7B26
|
||||||
10030=\u5220\u9664\u6587\u4EF6\u5931\u8D25{0}
|
10030=\u5220\u9664\u6587\u4EF6\u5931\u8D25{0}
|
||||||
|
10031=\u65E0\u6743\u8BBF\u95EE\u8BE5\u8D44\u6E90\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u5206\u914D\u6743\u9650
|
||||||
#business
|
#business
|
||||||
20001=\u822a\u7ebf\u5df2\u5b58\u5728
|
20001=\u822a\u7ebf\u5df2\u5b58\u5728
|
||||||
20002={0}\u53C2\u6570\u9519\u8BEF
|
20002={0}\u53C2\u6570\u9519\u8BEF
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue