|
@@ -3,14 +3,15 @@ package com.example.controller.teacher;
|
|
|
import com.example.dto.AwardsDTO;
|
|
|
import com.example.result.Result;
|
|
|
import com.example.service.AwardsService;
|
|
|
+import com.example.service.TeacherService;
|
|
|
+import com.example.vo.AwardsVO;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import static org.apache.coyote.http11.Constants.a;
|
|
|
|
|
|
@RestController
|
|
|
@Slf4j
|
|
@@ -22,9 +23,33 @@ public class AwardsController {
|
|
|
|
|
|
@PostMapping
|
|
|
@ApiOperation(value = "老师获奖上传")
|
|
|
- public Result uploadAwards(@RequestBody AwardsDTO awardsDTO,Integer awardsNum){
|
|
|
- log.info("获奖上传,{}",awardsDTO);
|
|
|
- awardsService.uploadAwards(awardsDTO,awardsNum);
|
|
|
+ public Result uploadAwards(@RequestBody AwardsDTO awardsDTO) {
|
|
|
+ log.info("获奖上传,{}", awardsDTO);
|
|
|
+ awardsService.uploadAwards(awardsDTO);
|
|
|
return Result.success();
|
|
|
}
|
|
|
+
|
|
|
+ @PutMapping("/{id}")
|
|
|
+ @ApiOperation(value = "修改指定奖项")
|
|
|
+ public Result updateAwards(@RequestBody AwardsDTO awardsDTO, @PathVariable Long id) {
|
|
|
+ log.info("修改指定奖项:{}", id);
|
|
|
+ awardsService.updateAwards(awardsDTO, id);
|
|
|
+ return Result.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/{id}")
|
|
|
+ @ApiOperation(value = "获取指定奖项详细信息")
|
|
|
+ public Result<AwardsVO> getById(@PathVariable Long id) {
|
|
|
+ log.info("获取指定奖项详细信息:{}", id);
|
|
|
+ AwardsVO awardsVO = awardsService.getById(id);
|
|
|
+ return Result.success(awardsVO);
|
|
|
+ }
|
|
|
+ @DeleteMapping("/{id}")
|
|
|
+ @ApiOperation(value = "删除指定奖项")
|
|
|
+ public Result deleteById(@PathVariable Long id){
|
|
|
+ log.info("删除指定奖项:{}",id);
|
|
|
+ awardsService.deleteById(id);
|
|
|
+ return Result.success();
|
|
|
+ }
|
|
|
+
|
|
|
}
|