|
@@ -0,0 +1,52 @@
|
|
|
+package com.example.controller.teacher;
|
|
|
+
|
|
|
+import com.example.dto.PatentDTO;
|
|
|
+import com.example.result.Result;
|
|
|
+import com.example.service.PatentService;
|
|
|
+import com.example.vo.PatentVO;
|
|
|
+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.*;
|
|
|
+
|
|
|
+@RestController
|
|
|
+@Slf4j
|
|
|
+@Api(tags = "老师专利相关接口")
|
|
|
+@RequestMapping("/teacher/patent")
|
|
|
+public class PatentController {
|
|
|
+ @Autowired
|
|
|
+ private PatentService patentService;
|
|
|
+
|
|
|
+ @PostMapping
|
|
|
+ @ApiOperation(value = "老师专利上传")
|
|
|
+ public Result uploadPatent(@RequestBody PatentDTO patentDTO) {
|
|
|
+ log.info("专利上传,{}", patentDTO);
|
|
|
+ patentService.uploadPatent(patentDTO);
|
|
|
+ return Result.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping("/{id}")
|
|
|
+ @ApiOperation(value = "修改指定专利")
|
|
|
+ public Result updatePatent(@RequestBody PatentDTO patentDTO, @PathVariable Long id) {
|
|
|
+ log.info("修改指定专利:{}", id);
|
|
|
+ patentService.updatePatent(patentDTO, id);
|
|
|
+ return Result.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/{id}")
|
|
|
+ @ApiOperation(value = "获取指定专利详细信息")
|
|
|
+ public Result<PatentVO> getById(@PathVariable Long id) {
|
|
|
+ log.info("获取指定专利详细信息:{}", id);
|
|
|
+ PatentVO patentVO = patentService.getById(id);
|
|
|
+ return Result.success(patentVO);
|
|
|
+ }
|
|
|
+ @DeleteMapping("/{id}")
|
|
|
+ @ApiOperation(value = "删除指定专利")
|
|
|
+ public Result deleteById(@PathVariable Long id){
|
|
|
+ log.info("删除指定专利:{}",id);
|
|
|
+ patentService.deleteById(id);
|
|
|
+ return Result.success();
|
|
|
+ }
|
|
|
+
|
|
|
+}
|