You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.1 KiB

2 months ago
2 months ago
  1. package com.example.demo.controller;
  2. import com.example.demo.domain.vo.Gold;
  3. import com.example.demo.domain.vo.GoldUser;
  4. import com.example.demo.domain.vo.Result;
  5. import com.example.demo.service.ConsumeService;
  6. import com.example.demo.service.UserService;
  7. import lombok.RequiredArgsConstructor;
  8. import lombok.extern.slf4j.Slf4j;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import org.springframework.web.bind.annotation.*;
  11. /**
  12. * @program: gold-java
  13. * @ClassName UserController
  14. * @description:
  15. * @author: Double
  16. * @create: 202506-25 10:25
  17. * @Version 1.0
  18. **/
  19. @RestController
  20. @RequestMapping("/user")
  21. @RequiredArgsConstructor
  22. @Slf4j
  23. @CrossOrigin
  24. public class UserController {
  25. @Autowired
  26. private UserService userService;
  27. @PostMapping("/selectUser")
  28. public Result selectUser(@RequestBody GoldUser user) {
  29. try {
  30. user = userService.selectUser(user.getJwcode().toString());
  31. return Result.success(user);
  32. } catch (Exception e) {
  33. return Result.error("请检查输入精网号");
  34. }
  35. }
  36. }