From 0a03cd062b626292f604c03c14dcfbf4be4bd515 Mon Sep 17 00:00:00 2001 From: hupeng Date: Sat, 21 Mar 2020 17:22:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E4=B8=AA=E9=97=A8=E5=BA=97=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/shop/domain/YxSystemStore.java | 3 ++- .../shop/rest/SystemStoreController.java | 21 ++++++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemStore.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemStore.java index 85f57ac4..a4a9296c 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemStore.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/domain/YxSystemStore.java @@ -88,7 +88,8 @@ public class YxSystemStore implements Serializable { private Integer addTime; /** 是否显示 */ - @Column(name = "is_show",insertable = false) + @Column(name = "is_show") + @NotNull private Integer isShow; /** 是否删除 */ diff --git a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemStoreController.java b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemStoreController.java index 435c7096..4402d5c3 100644 --- a/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemStoreController.java +++ b/yshop-shop/src/main/java/co/yixiang/modules/shop/rest/SystemStoreController.java @@ -69,18 +69,23 @@ public class SystemStoreController { return new ResponseEntity<>(json,HttpStatus.CREATED); } + @PostMapping + @Log("新增门店") + @ApiOperation("新增门店") + @PreAuthorize("@el.check('yxSystemStore:add')") + public ResponseEntity create(@Validated @RequestBody YxSystemStore resources){ + //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); + resources.setAddTime(OrderUtil.getSecondTimestampTwo()); + return new ResponseEntity<>(yxSystemStoreService.create(resources),HttpStatus.CREATED); + } + @PutMapping - @Log("设置门店信息") - @ApiOperation("设置门店信息") + @Log("修改门店") + @ApiOperation("修改门店") @PreAuthorize("@el.check('yxSystemStore:edit')") public ResponseEntity update(@Validated @RequestBody YxSystemStore resources){ //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); - if(resources.getId() == null){ - resources.setAddTime(OrderUtil.getSecondTimestampTwo()); - yxSystemStoreService.create(resources); - }else{ - yxSystemStoreService.update(resources); - } + yxSystemStoreService.update(resources); return new ResponseEntity<>(HttpStatus.NO_CONTENT); }