店铺扩展数据 初始化四条数据

This commit is contained in:
2024-08-27 17:57:13 +08:00
parent 2ca427f808
commit 489b3597d6
3 changed files with 79 additions and 3 deletions

View File

@@ -1,7 +1,9 @@
package cn.ysk.cashier.controller.shop;
import cn.ysk.cashier.exception.BadRequestException;
import cn.ysk.cashier.mybatis.entity.TbShopExtend;
import cn.ysk.cashier.mybatis.service.TbShopExtendService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.HttpStatus;
@@ -51,8 +53,11 @@ public class TbShopExtendController {
@PutMapping
@ApiOperation("通过id修改")
public ResponseEntity<Object> update(@RequestBody TbShopExtend tbShopExtend) {
tbShopExtend.setUpdateTime(new Date());
tbShopExtendService.updateById(tbShopExtend);
if (tbShopExtend.getId() != null) {
tbShopExtendService.updateById(tbShopExtend);
} else {
tbShopExtendService.saveInfo(tbShopExtend);
}
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}