UserController.java 951 B

12345678910111213141516171819202122232425262728
  1. package com.webchat.client.chat.controller;
  2. import com.webchat.client.chat.service.UserService;
  3. import com.webchat.common.bean.APIResponseBean;
  4. import com.webchat.common.bean.APIResponseBeanUtil;
  5. import com.webchat.common.helper.SessionHelper;
  6. import com.webchat.domain.vo.response.UserBaseResponseInfoVO;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.web.bind.annotation.GetMapping;
  9. import org.springframework.web.bind.annotation.RequestMapping;
  10. import org.springframework.web.bind.annotation.RestController;
  11. @RestController
  12. @RequestMapping("/client-service/chat/user")
  13. public class UserController {
  14. @Autowired
  15. private UserService userService;
  16. @GetMapping("/current/info")
  17. public APIResponseBean<UserBaseResponseInfoVO> getCurrentUserInfo() {
  18. String userId = SessionHelper.getCurrentUserId();
  19. return APIResponseBeanUtil.success(userService.userInfo(userId));
  20. }
  21. }