GlobalAward首次提交
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
package com.ai.da.controller;
|
||||
|
||||
import com.ai.da.common.response.Response;
|
||||
import com.ai.da.model.dto.ContestantDTO;
|
||||
import com.ai.da.service.GlobalAwardService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/global-award")
|
||||
public class GlobalAwardController {
|
||||
|
||||
@Resource
|
||||
private GlobalAwardService globalAwardService;
|
||||
|
||||
@PostMapping("/uploads/pdf")
|
||||
public Response<String> uploadPdf(@RequestParam("file") MultipartFile file,
|
||||
@RequestParam(value = "email", required = false) String email) throws Exception {
|
||||
return Response.success(globalAwardService.uploadPdf(file, email));
|
||||
}
|
||||
|
||||
@PostMapping("/uploads/video")
|
||||
public Response<String> uploadVideo(@RequestParam("file") MultipartFile file,
|
||||
@RequestParam(value = "email", required = false) String email) throws Exception {
|
||||
return Response.success(globalAwardService.uploadVideo(file, email));
|
||||
}
|
||||
|
||||
@PostMapping("/contestants/save")
|
||||
public Response<Map<String,Object>> submit(@RequestBody ContestantDTO request) {
|
||||
return Response.success(globalAwardService.saveContestant(request));
|
||||
}
|
||||
|
||||
@GetMapping("/contestants/by-email")
|
||||
public Response<ContestantDTO> getContestantByEmail(@RequestParam("email") String email) {
|
||||
ContestantDTO dto = globalAwardService.getContestantByEmail(email);
|
||||
return Response.success(dto);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user