소스 검색

fix: 鉴权异常抛出

370774330@qq.com 5 년 전
부모
커밋
f38d566619

+ 2 - 2
web/src/main/java/cn/seecoder/web/controller/sql/SqlController.java

@@ -1,6 +1,6 @@
 package cn.seecoder.web.controller.sql;
 
-import cn.seecoder.common.exceptions.AccessDeniedException;
+import cn.seecoder.common.exceptions.ServiceException;
 import cn.seecoder.web.model.vo.Response;
 import cn.seecoder.web.model.vo.sql.SqlExecVO;
 import cn.seecoder.web.service.sql.SqlService;
@@ -36,7 +36,7 @@ public class SqlController {
     @ApiOperation(value = "执行sql", httpMethod = "POST")
     @PostMapping("/exec")
     @ApiImplicitParam(name = "projectCreateVO",dataType = "object", paramType = "body")
-    public Response<String> exec(@RequestBody SqlExecVO sqlExecVO) throws AccessDeniedException {
+    public Response<String> exec(@RequestBody SqlExecVO sqlExecVO) throws ServiceException {
         return Response.buildSuccess(sqlService.execute(sqlExecVO.getDeploymentId(), sqlExecVO.getDb(),sqlExecVO.getUsername(),sqlExecVO.getPassword(),sqlExecVO.getSql()));
     }
 }

+ 2 - 2
web/src/main/java/cn/seecoder/web/service/impl/sql/SqlServiceImpl.java

@@ -1,6 +1,6 @@
 package cn.seecoder.web.service.impl.sql;
 
-import cn.seecoder.common.exceptions.AccessDeniedException;
+import cn.seecoder.common.exceptions.ServiceException;
 import cn.seecoder.web.dao.pipeline.DeploymentMapper;
 import cn.seecoder.web.dao.pipeline.PipelineMapper;
 import cn.seecoder.web.model.po.pipeline.DeploymentPO;
@@ -35,7 +35,7 @@ public class SqlServiceImpl implements SqlService {
     }
 
     @Override
-    public String execute(Integer deploymentId, String db,String username, String password, String sql) throws AccessDeniedException {
+    public String execute(Integer deploymentId, String db,String username, String password, String sql) throws ServiceException {
 
         sql = sql.trim();
         if (sql.endsWith(";")){

+ 2 - 1
web/src/main/java/cn/seecoder/web/service/sql/SqlService.java

@@ -2,9 +2,10 @@ package cn.seecoder.web.service.sql;
 
 
 import cn.seecoder.common.exceptions.AccessDeniedException;
+import cn.seecoder.common.exceptions.ServiceException;
 
 public interface SqlService {
 
-    String execute(Integer deploymentId, String db, String username, String password,String sql) throws AccessDeniedException;
+    String execute(Integer deploymentId, String db, String username, String password,String sql) throws ServiceException;
 
 }