OrchestraController.java 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package com.ym.mec.collectfee.controller;
  2. import com.ym.mec.collectfee.common.web.BaseController;
  3. import com.ym.mec.collectfee.entity.ApplyInfo;
  4. import com.ym.mec.collectfee.service.ApplyInfoService;
  5. import org.apache.ibatis.annotations.Param;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.validation.annotation.Validated;
  8. import org.springframework.web.bind.annotation.*;
  9. /**
  10. * 乐团
  11. */
  12. @RestController
  13. @RequestMapping("orchestra")
  14. public class OrchestraController extends BaseController {
  15. @Autowired
  16. private ApplyInfoService applyInfoService;
  17. /**
  18. * 乐团报名
  19. */
  20. @PostMapping("/apply")
  21. public Object apply(@ModelAttribute @Validated ApplyInfo applyInfo) throws Exception {
  22. System.out.println(applyInfo);
  23. return applyInfoService.insert(applyInfo);
  24. }
  25. /**
  26. * 根据手机获取报名信息
  27. * @param mobile
  28. * @return
  29. */
  30. @RequestMapping("/applyinfo")
  31. public ApplyInfo applyInfo(@Param("patriarchPhone") String mobile) {
  32. System.out.println(mobile);
  33. ApplyInfo applyInfoByMobile = applyInfoService.getApplyInfoByMobile(mobile);
  34. System.out.println(applyInfoByMobile);
  35. return applyInfoByMobile;
  36. }
  37. }