package com.smcic.api.operate.controller; import com.smcic.api.operate.entity.EnrollInfo; import com.smcic.api.operate.service.impl.EnrollInfoServiceImpl; import com.smcic.core.auth.LoginRequired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import java.util.List; /** *

* 前端控制器 *

* * @author syj * @since 2022-12-10 */ @RestController @RequestMapping("/operate/enroll") public class EnrollInfoController { @Resource private EnrollInfoServiceImpl enrollInfoService; @RequestMapping("/store") @LoginRequired public void upload( @RequestParam("name") String name, @RequestParam("phone") String phone, @RequestParam(value = "university", required = false, defaultValue = "") String university, @RequestParam(value = "isOnLine", required = false, defaultValue = "") String isOnLine, @RequestParam(value = "type", required = false, defaultValue = "") String type, @RequestParam(value = "introduction", required = false, defaultValue = "") String introduction, @RequestParam(value = "operateId", required = false, defaultValue = "2") Integer operateId, @RequestParam(value = "workTitle", required = false, defaultValue = "") String workTitle, @RequestParam(value = "file", required = false) MultipartFile file) { enrollInfoService.store(phone, name, university, isOnLine, type, operateId, introduction, workTitle, file); } @RequestMapping("list") @LoginRequired public List list(@RequestParam(value = "type", required = false, defaultValue = "") String type, @RequestParam(value = "operateId", required = false, defaultValue = "2") Integer operateId, @RequestParam(value = "phone", required = false, defaultValue = "") String phone){ return enrollInfoService.list(type, operateId, phone); } @RequestMapping("rank") @LoginRequired public List rank(@RequestParam(value = "type", required = false, defaultValue = "") String type, @RequestParam(value = "operateId", required = false, defaultValue = "2") Integer operateId, @RequestParam(value = "phone", required = false, defaultValue = "") String phone){ return enrollInfoService.rank(type, operateId, phone); } }