孙永军 пре 1 година
родитељ
комит
cdb0da457c

+ 3 - 3
src/main/java/com/smcic/api/conference/controller/SSEController.java

@@ -15,13 +15,13 @@ import java.io.IOException;
 
 @Controller
 @RequestMapping("/conference")
-@NoAPIResponse
+//@NoAPIResponse
 public class SSEController {
 
     @Resource
     private SSEService sseService;
 
-    @GetMapping(path = "/photo-sse/{id}", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
+    /*@GetMapping(path = "/photo-sse/{id}", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
     @NoAPIResponse
     public SseEmitter handleSse(@PathVariable("id") Long id) throws IOException {
         String uuid = UUID.fastUUID( ).toString( );
@@ -30,5 +30,5 @@ public class SSEController {
         sseEmitter.send(SseEmitter.event().name("hello").data("hello"));
         sseEmitter.onCompletion(() -> sseService.complate(id, uuid));
         return sseEmitter;
-    }
+    }*/
 }

+ 5 - 0
src/main/java/com/smcic/api/conference/controller/UserThirdController.java

@@ -36,4 +36,9 @@ public class UserThirdController {
         userThirdService.save(userThird);
     }
 
+    @GetMapping("info/{id}")
+    public ConferenceUserThird info(@PathVariable("id") Long id, @RequestParam( value = "code") String code) {
+        return userThirdService.info(id, code);
+    }
+
 }

+ 8 - 0
src/main/java/com/smcic/api/conference/service/impl/UserThirdServiceImpl.java

@@ -85,4 +85,12 @@ public class UserThirdServiceImpl extends ServiceImpl<ConferenceUserThirdMapper,
         }
     }
 
+    public ConferenceUserThird info(Long cid , String code){
+        String phone = redisTemplate.opsForValue().get("WX_CODE_" + code);
+        if(TextUtils.isEmpty(phone)){
+            throw new APIException("请先登录");
+        }
+        return lambdaQuery().eq(ConferenceUserThird::getConferenceId, cid).eq(ConferenceUserThird::getPhone, phone).one();
+    }
+
 }

+ 3 - 0
src/test/java/conference.http

@@ -260,6 +260,9 @@ Content-Type: application/json
   "position": "职位"
 }
 
+### 获取用户信息
+GET {{ip}}
+
 ### 订阅, status: 1 订阅, 2 取消订阅
 POST {{ip}}/conference/subscription/create?code=xxx
 Content-Type: application/json