ActivityRaceSignController.java 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. package com.crm.custom.controller;
  2. import com.crm.custom.service.CustomInfoService;
  3. import com.crm.custom.service.activity.ActivityRaceSignFeignService;
  4. import com.crm.login.rely.backend.controller.BaseLoginController;
  5. import com.crm.rely.backend.core.dto.base.BaseResultDto;
  6. import com.crm.rely.backend.core.dto.base.BaseResultWithPagerDto;
  7. import com.crm.rely.backend.core.entity.base.SingleLongEntity;
  8. import com.crm.rely.backend.core.entity.login.InfoEntity;
  9. import com.crm.rely.backend.model.dto.activity.ActivityRaceSignInfoDto;
  10. import com.crm.rely.backend.model.entity.activity.ActivityRaceSignAddEntity;
  11. import com.crm.rely.backend.model.entity.activity.ActivityRaceSignInfoEntity;
  12. import com.crm.rely.backend.model.entity.activity.ActivityRaceSignListEntity;
  13. import com.crm.rely.backend.model.entity.activity.ActivityRaceSignLoginEntity;
  14. import com.crm.rely.backend.model.pojo.table.CustomInfoTable;
  15. import org.springframework.beans.factory.annotation.Autowired;
  16. import org.springframework.web.bind.annotation.PostMapping;
  17. import org.springframework.web.bind.annotation.RequestBody;
  18. import org.springframework.web.bind.annotation.RequestMapping;
  19. import org.springframework.web.bind.annotation.RestController;
  20. import java.util.Date;
  21. import java.util.List;
  22. /**
  23. * 比赛报名api
  24. *
  25. * @author y
  26. * @create 2022/7/19
  27. */
  28. @RestController
  29. @RequestMapping("/activity/race/sign")
  30. public class ActivityRaceSignController extends BaseLoginController {
  31. @Autowired
  32. private ActivityRaceSignFeignService activityRaceSignFeignService;
  33. @Autowired
  34. private CustomInfoService customInfoService;
  35. /**
  36. * 添加报名
  37. *
  38. * @param entity
  39. * @return
  40. * @throws Exception
  41. */
  42. @PostMapping("/add")
  43. public BaseResultDto<Boolean> add(@RequestBody ActivityRaceSignAddEntity entity, InfoEntity infoEntity) throws Exception {
  44. entity.setCustomId(infoEntity.getId());
  45. CustomInfoTable custom = customInfoService.getById(infoEntity.getId());
  46. entity.setCId(custom.getCId());
  47. entity.setSignDate(new Date());
  48. return activityRaceSignFeignService.add(entity);
  49. }
  50. /**
  51. * 最近一次报名信息
  52. *
  53. * @param entity
  54. * @return
  55. * @throws Exception
  56. */
  57. @PostMapping("/recent")
  58. public BaseResultDto<ActivityRaceSignInfoDto> info(@RequestBody ActivityRaceSignInfoEntity entity, InfoEntity infoEntity) throws Exception {
  59. entity.setCustomId(infoEntity.getId());
  60. return activityRaceSignFeignService.info(entity);
  61. }
  62. /**
  63. * 根据ID获取报名信息
  64. *
  65. * @param entity
  66. * @return
  67. * @throws Exception
  68. */
  69. @PostMapping("/search/single")
  70. public BaseResultDto<ActivityRaceSignInfoDto> searchSingle(@RequestBody SingleLongEntity entity) throws Exception {
  71. return activityRaceSignFeignService.searchSingle(entity);
  72. }
  73. /**
  74. * 报名列表
  75. *
  76. * @param entity
  77. * @return
  78. * @throws Exception
  79. */
  80. @PostMapping("/search/list")
  81. public BaseResultWithPagerDto<List<ActivityRaceSignInfoDto>>
  82. searchList(@RequestBody ActivityRaceSignListEntity entity, InfoEntity infoEntity) throws Exception {
  83. entity.setCustomId(infoEntity.getId());
  84. return activityRaceSignFeignService.searchList(entity);
  85. }
  86. /**
  87. * 获取可用的交易账户
  88. *
  89. * @param entity
  90. * @return
  91. * @throws Exception
  92. */
  93. @PostMapping("/logins")
  94. public BaseResultDto<List<Long>> logins(@RequestBody ActivityRaceSignLoginEntity entity, InfoEntity infoEntity) throws Exception {
  95. entity.setCustomId(infoEntity.getId());
  96. return activityRaceSignFeignService.logins(entity);
  97. }
  98. }