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