EnrollInfoController.java 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. package com.smcic.api.operate.controller;
  2. import com.smcic.api.operate.entity.EnrollInfo;
  3. import com.smcic.api.operate.service.impl.EnrollInfoServiceImpl;
  4. import com.smcic.core.auth.LoginRequired;
  5. import org.springframework.web.bind.annotation.RequestMapping;
  6. import org.springframework.web.bind.annotation.RequestParam;
  7. import org.springframework.web.bind.annotation.RestController;
  8. import org.springframework.web.multipart.MultipartFile;
  9. import javax.annotation.Resource;
  10. import java.util.List;
  11. /**
  12. * <p>
  13. * 前端控制器
  14. * </p>
  15. *
  16. * @author syj
  17. * @since 2022-12-10
  18. */
  19. @RestController
  20. @RequestMapping("/operate/enroll")
  21. public class EnrollInfoController {
  22. @Resource
  23. private EnrollInfoServiceImpl enrollInfoService;
  24. @RequestMapping("/store")
  25. @LoginRequired
  26. public void upload(
  27. @RequestParam("name") String name,
  28. @RequestParam("phone") String phone,
  29. @RequestParam(value = "university", required = false, defaultValue = "") String university,
  30. @RequestParam(value = "isOnLine", required = false, defaultValue = "") String isOnLine,
  31. @RequestParam(value = "type", required = false, defaultValue = "") String type,
  32. @RequestParam(value = "introduction", required = false, defaultValue = "") String introduction,
  33. @RequestParam(value = "operateId", required = false, defaultValue = "2") Integer operateId,
  34. @RequestParam(value = "workTitle", required = false, defaultValue = "") String workTitle,
  35. @RequestParam(value = "file", required = false) MultipartFile file) {
  36. enrollInfoService.store(phone, name, university, isOnLine, type, operateId, introduction, workTitle, file);
  37. }
  38. @RequestMapping("list")
  39. @LoginRequired
  40. public List<EnrollInfo> list(@RequestParam(value = "type", required = false, defaultValue = "") String type,
  41. @RequestParam(value = "operateId", required = false, defaultValue = "2") Integer operateId,
  42. @RequestParam(value = "phone", required = false, defaultValue = "") String phone){
  43. return enrollInfoService.list(type, operateId, phone);
  44. }
  45. @RequestMapping("rank")
  46. @LoginRequired
  47. public List<EnrollInfo> rank(@RequestParam(value = "type", required = false, defaultValue = "") String type,
  48. @RequestParam(value = "operateId", required = false, defaultValue = "2") Integer operateId,
  49. @RequestParam(value = "phone", required = false, defaultValue = "") String phone){
  50. return enrollInfoService.rank(type, operateId, phone);
  51. }
  52. }