Jelajahi Sumber

不用注册即可购票

fllmoyu 4 tahun lalu
induk
melakukan
0dc89b4d20

+ 3 - 0
web/src/main/java/com/jpsoft/bus/config/WebMvcConfig.java

@@ -77,6 +77,9 @@ public class WebMvcConfig implements WebMvcConfigurer {
 				.excludePathPatterns("/aliPay/**")
 				.excludePathPatterns("/wxPay/**")
 				.excludePathPatterns("/bus/deviceCmdApi/queryPadLatestVersion")
+				.excludePathPatterns("/mobile/passengerApi/passengerMessageNoReadNum")
+				.excludePathPatterns("/mobile/passengerApi/passengerMessage")
+
 				;
 	}
 }

+ 6 - 17
web/src/main/java/com/jpsoft/bus/modules/mobile/controller/PassengerApiController.java

@@ -912,21 +912,16 @@ public class PassengerApiController {
     @PostMapping("passengerMessage")
     @ApiOperation(value = "乘客过站消息")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "token", value = "令牌", paramType = "form"),
-            @ApiImplicitParam(name = "subject", value = "目标(不传)", paramType = "form")
+            @ApiImplicitParam(name = "openId", value = "openId", paramType = "form")
     })
-    public MessageResult<Map> passengerMessage(String token, @RequestAttribute String subject,@RequestParam(value = "pageIndex", defaultValue = "1") int pageIndex, @RequestParam(value = "pageSize", defaultValue = "5") int pageSize) {
+    public MessageResult<Map> passengerMessage(String openId,@RequestParam(value = "pageIndex", defaultValue = "1") int pageIndex, @RequestParam(value = "pageSize", defaultValue = "5") int pageSize) {
         MessageResult<Map> messageResult = new MessageResult<>();
 
         try {
 
-            UserInfo userInfo = userInfoService.get(Long.parseLong(subject));
-            if (userInfo == null){
-                throw new Exception("请先注册信息");
-            }
 
             Map<String,Object> searchParams = new HashMap<>();
-            searchParams.put("openId",userInfo.getOpenId());
+            searchParams.put("openId",openId);
             searchParams.put("payStatus","2");
 
             List<Sort> sortList = new ArrayList<>();
@@ -990,21 +985,15 @@ public class PassengerApiController {
     @PostMapping("passengerMessageNoReadNum")
     @ApiOperation(value = "乘客未读过站消息数量")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "token", value = "令牌", paramType = "form"),
-            @ApiImplicitParam(name = "subject", value = "目标(不传)", paramType = "form")
+            @ApiImplicitParam(name = "openId", value = "openId", paramType = "form")
     })
-    public MessageResult<Map> passengerMessageNoReadNum(String token, @RequestAttribute String subject) {
+    public MessageResult<Map> passengerMessageNoReadNum(String openId) {
         MessageResult<Map> messageResult = new MessageResult<>();
 
         try {
 
-            UserInfo userInfo = userInfoService.get(Long.parseLong(subject));
-            if (userInfo == null){
-                throw new Exception("请先注册信息");
-            }
-
             Map<String,Object> searchParams = new HashMap<>();
-            searchParams.put("openId",userInfo.getOpenId());
+            searchParams.put("openId",openId);
             searchParams.put("readStatus",false);
 
             List<Sort> sortList = new ArrayList<>();