mirror of
https://gitee.com/gz-yami/mall4j.git
synced 2025-12-25 23:56:20 +08:00
补充完善代码规范
This commit is contained in:
parent
84ba080198
commit
e1fed34903
@ -12,6 +12,7 @@ package com.yami.shop.admin.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yami.shop.bean.model.ProdTag;
|
||||
@ -26,6 +27,8 @@ import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.sql.Struct;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@ -54,7 +57,7 @@ public class ProdTagController {
|
||||
IPage<ProdTag> tagPage = prodTagService.page(
|
||||
page, new LambdaQueryWrapper<ProdTag>()
|
||||
.eq(prodTag.getStatus() != null, ProdTag::getStatus, prodTag.getStatus())
|
||||
.like(prodTag.getTitle() != null, ProdTag::getTitle, prodTag.getTitle())
|
||||
.like(StrUtil.isNotBlank(prodTag.getTitle()), ProdTag::getTitle, prodTag.getTitle())
|
||||
.orderByDesc(ProdTag::getSeq, ProdTag::getCreateTime));
|
||||
return ServerResponseEntity.success(tagPage);
|
||||
|
||||
@ -87,10 +90,11 @@ public class ProdTagController {
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
throw new YamiShopBindException("标签名称已存在,不能添加相同的标签");
|
||||
}
|
||||
Date date = new Date();
|
||||
prodTag.setIsDefault(0);
|
||||
prodTag.setProdCount(0L);
|
||||
prodTag.setCreateTime(new Date());
|
||||
prodTag.setUpdateTime(new Date());
|
||||
prodTag.setCreateTime(date);
|
||||
prodTag.setUpdateTime(date);
|
||||
prodTag.setShopId(SecurityUtils.getSysUser().getShopId());
|
||||
prodTagService.removeProdTag();
|
||||
return ServerResponseEntity.success(prodTagService.save(prodTag));
|
||||
|
||||
@ -31,7 +31,7 @@ public class AddrParam {
|
||||
@Schema(description = "地址" ,requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String addr;
|
||||
|
||||
@Schema(description = "邮编" ,required=false)
|
||||
@Schema(description = "邮编" ,requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String postCode;
|
||||
|
||||
@NotNull(message = "手机不能为空")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user