Commit 10d6085e by “zcwang”

add: 拦截器测试

parent 9b3c76df
Pipeline #43474 passed with stages
in 1 minute 29 seconds
...@@ -23,7 +23,7 @@ public class WebMvcConfig implements WebMvcConfigurer { ...@@ -23,7 +23,7 @@ public class WebMvcConfig implements WebMvcConfigurer {
@Override @Override
public void addInterceptors(InterceptorRegistry registry) { public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(userLoginInterceptor).addPathPatterns("/**").excludePathPatterns("/i/health") registry.addInterceptor(userLoginInterceptor).addPathPatterns("/**").excludePathPatterns("/i/health")
.excludePathPatterns("/change/flow/getOperator", "/test/**"); .excludePathPatterns("/change/flow/getOperator", "/test/createToDo","/test/progressTodo","/test/submit");
} }
} }
...@@ -6,15 +6,11 @@ ...@@ -6,15 +6,11 @@
*/ */
package com.netease.mail.yanxuan.change.web.controller; package com.netease.mail.yanxuan.change.web.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
...@@ -22,20 +18,11 @@ import com.netease.mail.yanxuan.change.biz.meta.exception.ExceptionFactory; ...@@ -22,20 +18,11 @@ import com.netease.mail.yanxuan.change.biz.meta.exception.ExceptionFactory;
import com.netease.mail.yanxuan.change.biz.service.ChangeFlowService; import com.netease.mail.yanxuan.change.biz.service.ChangeFlowService;
import com.netease.mail.yanxuan.change.biz.service.rpc.TodoService; import com.netease.mail.yanxuan.change.biz.service.rpc.TodoService;
import com.netease.mail.yanxuan.change.biz.task.AutoSubmit; import com.netease.mail.yanxuan.change.biz.task.AutoSubmit;
import com.netease.mail.yanxuan.change.common.bean.AdminUserHolder;
import com.netease.mail.yanxuan.change.common.bean.AjaxResult; import com.netease.mail.yanxuan.change.common.bean.AjaxResult;
import com.netease.mail.yanxuan.change.common.bean.ResponseCode; import com.netease.mail.yanxuan.change.common.bean.ResponseCode;
import com.netease.mail.yanxuan.change.common.enums.ChangeFlowEnum; import com.netease.mail.yanxuan.change.common.enums.ChangeFlowEnum;
import com.netease.mail.yanxuan.change.dal.entity.ChangeRecord; import com.netease.mail.yanxuan.change.dal.entity.ChangeRecord;
import com.netease.mail.yanxuan.change.integration.flow.supplier.FlowRpcSupplierSendService;
import com.netease.mail.yanxuan.change.integration.flow.supplier.FlowRpcSupplierService;
import com.netease.mail.yanxuan.change.integration.flow.supplier.req.SupplierGoodsInfoReq;
import com.netease.mail.yanxuan.change.integration.flow.supplier.req.SupplierRelatedUserReq;
import com.netease.mail.yanxuan.change.integration.flow.supplier.req.SupplierSearchRemoteReq;
import com.netease.mail.yanxuan.change.integration.flow.supplier.rsp.SupplierGoodsInfoRsp;
import com.netease.mail.yanxuan.change.integration.flow.supplier.rsp.SupplierInfoRsp;
import com.netease.mail.yanxuan.change.integration.flow.supplier.rsp.SupplierSimpleRsp;
import com.netease.mail.yanxuan.change.integration.flow.supplier.rsp.SupplierUserRsp;
import com.netease.yanxuan.flowx.sdk.meta.controller.communal.AjaxResponse;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -82,4 +69,10 @@ public class TestController { ...@@ -82,4 +69,10 @@ public class TestController {
autoSubmit.progressRecord(record); autoSubmit.progressRecord(record);
return AjaxResult.success(); return AjaxResult.success();
} }
@GetMapping("/getUid")
public AjaxResult<String> getUid() {
return AjaxResult.success(AdminUserHolder.getUserName());
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment