2026-01-16 16:37:03 +08:00
|
|
|
package com.ai.da.controller;
|
|
|
|
|
|
|
|
|
|
import com.ai.da.common.response.Response;
|
|
|
|
|
import com.ai.da.model.dto.ContestantDTO;
|
2026-01-20 13:14:50 +08:00
|
|
|
import com.ai.da.model.vo.CheckOTPVO;
|
2026-01-16 16:37:03 +08:00
|
|
|
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);
|
|
|
|
|
}
|
2026-01-20 13:14:50 +08:00
|
|
|
|
|
|
|
|
@GetMapping("/checkEmail")
|
|
|
|
|
public Response<String> checkEmail(@RequestParam("email") String email) {
|
|
|
|
|
globalAwardService.checkEmail(email);
|
|
|
|
|
return Response.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/checkCode")
|
|
|
|
|
public Response<CheckOTPVO> checkOTP(@RequestParam("email") String email, @RequestParam("code") String code) {
|
|
|
|
|
return Response.success(globalAwardService.checkOTP(email, code));
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-16 16:37:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|