CollegeStudentStationController.java 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package com.cyksj.web.controller.user;
  2. import com.cyksj.dto.Result;
  3. import com.cyksj.enums.GatewayResponse;
  4. import com.cyksj.service.station.CollegeStudentStationFService;
  5. import com.cyksj.web.util.StpUserUtil;
  6. import lombok.RequiredArgsConstructor;
  7. import lombok.extern.slf4j.Slf4j;
  8. import org.springframework.web.bind.annotation.GetMapping;
  9. import org.springframework.web.bind.annotation.PostMapping;
  10. import org.springframework.web.bind.annotation.RequestMapping;
  11. import org.springframework.web.bind.annotation.RestController;
  12. /**
  13. * 项目名: yhlxj2
  14. * 文件名: CollegeStudentStationController
  15. * 创建者: JavaZou
  16. * 创建时间:2024/5/28 11:50
  17. */
  18. @Slf4j
  19. @RestController
  20. @RequestMapping("/applet/college/student")
  21. @RequiredArgsConstructor
  22. public class CollegeStudentStationController {
  23. private final CollegeStudentStationFService collegeStudentStationService;
  24. /**
  25. * 大学生 扫码记录
  26. */
  27. @PostMapping("/post")
  28. public Result<String> saveCollegeStudent(Integer type) {
  29. long userId = StpUserUtil.getLoginIdAsLong();
  30. collegeStudentStationService.saveCollegeStudent(userId, type);
  31. return GatewayResponse.SUCCESS.newBuilder().toResult();
  32. }
  33. /**
  34. * 体验车票id
  35. */
  36. @GetMapping("/get")
  37. public Result<Long> getExperienceTicket() {
  38. long userId = StpUserUtil.getLoginIdAsLong();
  39. Long relationId = collegeStudentStationService.getExperienceTicket(userId);
  40. return GatewayResponse.SUCCESS.newBuilder().toResult(relationId);
  41. }
  42. }