TestController.java 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. package com.webchat.gateway.controller;
  2. import com.webchat.common.bean.APIResponseBean;
  3. import com.webchat.common.bean.APIResponseBeanUtil;
  4. import com.webchat.domain.vo.response.UserBaseResponseInfoVO;
  5. import com.webchat.rmi.user.UserServiceClient;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.cloud.context.config.annotation.RefreshScope;
  8. import org.springframework.web.bind.annotation.GetMapping;
  9. import org.springframework.web.bind.annotation.PathVariable;
  10. import org.springframework.web.bind.annotation.RequestMapping;
  11. import org.springframework.web.bind.annotation.RestController;
  12. /**
  13. * @Author 程序员七七
  14. * @webSite https://www.coderutil.com
  15. * @Date 2025/1/14 00:55
  16. * @description
  17. */
  18. @RefreshScope
  19. @RestController
  20. @RequestMapping("/pgc-service")
  21. public class TestController {
  22. @Autowired
  23. private UserServiceClient userServiceClient;
  24. @GetMapping("/user/{userId}")
  25. public APIResponseBean<UserBaseResponseInfoVO> user(@PathVariable String userId) {
  26. return APIResponseBeanUtil.success(userServiceClient.userInfo(userId));
  27. }
  28. }