diff --git a/src/main/java/club/joylink/xiannccda/controller/DraftingController.java b/src/main/java/club/joylink/xiannccda/controller/DraftingController.java index 88d2c07..7748454 100644 --- a/src/main/java/club/joylink/xiannccda/controller/DraftingController.java +++ b/src/main/java/club/joylink/xiannccda/controller/DraftingController.java @@ -23,9 +23,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** - *
* 绘图草稿 前端控制器 - *
* * @author walker-sheng * @since 2023-06-06 @@ -53,8 +51,8 @@ public class DraftingController { @SecurityRequirement(name = "jwt") @Operation(summary = "创建绘图草稿") @ApiResponse(description = "绘图草稿信息") - public Drafting create(Principal user, - @RequestBody @Validated(Creation.class) Drafting drafting) { + public Drafting create( + Principal user, @RequestBody @Validated(Creation.class) Drafting drafting) { return this.draftingRepository.create(drafting, Integer.valueOf(user.getName())); } @@ -62,7 +60,9 @@ public class DraftingController { @SecurityRequirement(name = "jwt") @Operation(summary = "另存为绘图草稿") @ApiResponse(description = "绘图草稿信息") - public Drafting saveAs(Principal user, @PathVariable Integer id, + public Drafting saveAs( + Principal user, + @PathVariable Integer id, @RequestBody @Validated(SaveAs.class) Drafting drafting) { return this.draftingRepository.saveAs(id, drafting, Integer.valueOf(user.getName())); } @@ -79,9 +79,12 @@ public class DraftingController { @SecurityRequirement(name = "jwt") @Operation(summary = "保存绘图草稿数据") @ApiResponse(description = "保存成功失败标识") - public boolean updateDrawData(@PathVariable Integer id, + public boolean updateDrawData( + Principal user, + @PathVariable Integer id, @RequestBody @Validated(SaveData.class) Drafting drafting) { - return this.draftingRepository.updateDrawData(id, drafting.getProto()); + return this.draftingRepository.updateDrawData( + id, drafting.getProto(), Integer.valueOf(user.getName())); } @DeleteMapping("/{id}") diff --git a/src/main/java/club/joylink/xiannccda/exception/BusinessExceptionAssertEnum.java b/src/main/java/club/joylink/xiannccda/exception/BusinessExceptionAssertEnum.java index a024dcf..3f2b10f 100644 --- a/src/main/java/club/joylink/xiannccda/exception/BusinessExceptionAssertEnum.java +++ b/src/main/java/club/joylink/xiannccda/exception/BusinessExceptionAssertEnum.java @@ -7,7 +7,8 @@ public enum BusinessExceptionAssertEnum implements BusinessExceptionAssert { ARGUMENT_ILLEGAL(1001, "argument illegal"), DATA_NOT_EXIST(1002, "data not exist"), UNIQUE_FIELD_REPEAT(1003, "unique field repeat"), - DATA_ALREADY_EXISTS(1004, "data already exists"); + DATA_ALREADY_EXISTS(1004, "data already exists"), + NOT_HAVE_AUTHORIZATION(1005, "Unauthorized"); int code; diff --git a/src/main/java/club/joylink/xiannccda/repository/IDraftingRepository.java b/src/main/java/club/joylink/xiannccda/repository/IDraftingRepository.java index 8ce34da..6d453df 100644 --- a/src/main/java/club/joylink/xiannccda/repository/IDraftingRepository.java +++ b/src/main/java/club/joylink/xiannccda/repository/IDraftingRepository.java @@ -6,9 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; /** - ** 绘图草稿 服务类 - *
* * @author walker-sheng * @since 2023-06-06 @@ -25,7 +23,7 @@ public interface IDraftingRepository extends IService* 绘图草稿 服务实现类 - *
* * @author walker-sheng * @since 2023-06-06 */ @Service @Slf4j -public class DraftingRepository extends ServiceImpl