From 56b8b82fc207d6ce3fffa0bae6a9f05b727bba6b Mon Sep 17 00:00:00 2001 From: yanyang Date: Tue, 28 Feb 2023 09:26:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E5=8A=A8=E8=A3=85=E7=AE=B1=E6=89=93?= =?UTF-8?q?=E5=8D=B0=E6=96=B0=E5=A2=9E=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/WoPackagingBoxController.java | 7 ++-- .../main/java/com/cnbm/packing/dto/IdVo.java | 32 +++++++++++++++++++ .../service/WoPackagingBoxServiceBiz.java | 4 +-- .../impl/WoPackagingBoxServiceBizImpl.java | 6 ++-- 4 files changed, 40 insertions(+), 9 deletions(-) create mode 100644 ym-packing/src/main/java/com/cnbm/packing/dto/IdVo.java diff --git a/ym-packing/src/main/java/com/cnbm/packing/controller/WoPackagingBoxController.java b/ym-packing/src/main/java/com/cnbm/packing/controller/WoPackagingBoxController.java index 2381184..a9f330e 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/controller/WoPackagingBoxController.java +++ b/ym-packing/src/main/java/com/cnbm/packing/controller/WoPackagingBoxController.java @@ -10,6 +10,7 @@ import com.cnbm.common.validator.ValidatorUtils; import com.cnbm.common.validator.group.AddGroup; import com.cnbm.common.validator.group.DefaultGroup; import com.cnbm.common.validator.group.UpdateGroup; +import com.cnbm.packing.dto.IdVo; import com.cnbm.packing.dto.WoPackagingBoxDTO; import com.cnbm.packing.excel.WoPackagingBoxExcel; import com.cnbm.packing.service.WoPackagingBoxServiceBiz; @@ -75,13 +76,11 @@ public class WoPackagingBoxController { @ApiOperation("保存") @LogOperation("保存") @PreAuthorize("@ex.hasAuthority('packing:woPackagingBox:save')") - public Result save(@RequestBody WoPackagingBoxDTO dto){ + public IdVo save(@RequestBody WoPackagingBoxDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - woPackagingBoxService.save(dto); - - return new Result().ok(dto.getId()); + return woPackagingBoxService.add(dto); } @PutMapping diff --git a/ym-packing/src/main/java/com/cnbm/packing/dto/IdVo.java b/ym-packing/src/main/java/com/cnbm/packing/dto/IdVo.java new file mode 100644 index 0000000..7977579 --- /dev/null +++ b/ym-packing/src/main/java/com/cnbm/packing/dto/IdVo.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018. + * http://www.ulabcare.com + */ + +package com.cnbm.packing.dto; + + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + + +/** + * 主键对象 + * + * @author jiff + * @date 2018/11/7 + * @since 1.0 + */ +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@Data +@Builder +@ApiModel("主键视图对象") +public class IdVo { + @ApiModelProperty(value = "主键", required = true, example = "1", notes = "根据实际接口返回不同对象的主键") + private Long id; +} diff --git a/ym-packing/src/main/java/com/cnbm/packing/service/WoPackagingBoxServiceBiz.java b/ym-packing/src/main/java/com/cnbm/packing/service/WoPackagingBoxServiceBiz.java index 0e153b6..8db6c17 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/service/WoPackagingBoxServiceBiz.java +++ b/ym-packing/src/main/java/com/cnbm/packing/service/WoPackagingBoxServiceBiz.java @@ -2,7 +2,7 @@ package com.cnbm.packing.service; import com.cnbm.common.page.PageData; import com.cnbm.common.service.CrudService; -import com.cnbm.packing.dto.WoPackagingBoxDTO; +import com.cnbm.packing.dto.IdVo; import com.cnbm.packing.dto.WoPackagingBoxDTO; import com.cnbm.packing.entity.WoPackagingBox; @@ -21,7 +21,7 @@ public interface WoPackagingBoxServiceBiz extends CrudService