parent
f662493fd9
commit
a15ed1f2d1
|
|
@ -135,7 +135,8 @@ export default {
|
|||
attrGroups: [],
|
||||
dataRule: {
|
||||
attrName: [
|
||||
{required: true, message: "属性名不能为空", trigger: "blur"}
|
||||
{required: true, message: "属性名不能为空", trigger: "blur"},
|
||||
{ min: 1, max: 30, message: '长度在 1 到 30 个字符', trigger: 'blur' }
|
||||
],
|
||||
searchType: [
|
||||
{required: true, message: "是否需要检索不能为空", trigger: "blur"}
|
||||
|
|
@ -144,7 +145,8 @@ export default {
|
|||
{required: true, message: "值类型不能为空", trigger: "blur"}
|
||||
],
|
||||
icon: [
|
||||
{required: true, message: "属性图标不能为空", trigger: "blur"}
|
||||
{required: true, message: "属性图标不能为空", trigger: "blur"},
|
||||
{ min: 1, max: 30, message: '长度在 1 到 30 个字符', trigger: 'blur' }
|
||||
],
|
||||
attrType: [
|
||||
{required: true, message: "属性类型不能为空", trigger: "blur"}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
label-width="90px"
|
||||
>
|
||||
<el-form-item label="组名" prop="attrGroupName">
|
||||
<el-input v-model="dataForm.attrGroupName" placeholder="组名"></el-input>
|
||||
<el-input v-model="dataForm.attrGroupName" placeholder="组名" ></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input-number v-model.number="dataForm.sort" :min="1" :max="9999" label="排序"></el-input-number>
|
||||
|
|
@ -81,13 +81,18 @@ export default {
|
|||
},
|
||||
dataRule: {
|
||||
attrGroupName: [
|
||||
{required: true, message: "组名不能为空", trigger: "blur"}
|
||||
{required: true, message: "组名不能为空", trigger: "blur"},
|
||||
{ min: 1, max: 20, message: '长度在 1 到 20 个字符', trigger: 'blur' }
|
||||
],
|
||||
sort: [{required: true, message: "排序不能为空", trigger: "blur"}],
|
||||
descript: [
|
||||
{required: true, message: "描述不能为空", trigger: "blur"}
|
||||
{required: true, message: "描述不能为空", trigger: "blur"},
|
||||
{ min: 1, max: 255, message: '长度在 1 到 255 个字符', trigger: 'blur' }
|
||||
],
|
||||
icon: [
|
||||
{required: true, message: "组图标不能为空", trigger: "blur"},
|
||||
{ min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' }
|
||||
],
|
||||
icon: [{required: true, message: "组图标不能为空", trigger: "blur"}],
|
||||
catelogId: [
|
||||
{required: true, message: "所属分类id不能为空", trigger: "blur"}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
<el-input maxlength="20" v-model="dataForm.key" placeholder="请输入属性名等" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button-group>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<div class="app-container">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input size="mini" v-model="dataForm.key" placeholder="请输入品牌名、介绍、检索首字母等" clearable style="width: 300px"></el-input>
|
||||
<el-input size="mini" maxlength="20" v-model="dataForm.key" placeholder="请输入品牌名、介绍、检索首字母等" clearable style="width: 300px"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button-group>
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
prefix-icon="el-icon-search"
|
||||
@input="rest"
|
||||
placeholder="输入关键字进行过滤"
|
||||
maxlength="10"
|
||||
v-model="filterText">
|
||||
</el-input>
|
||||
|
||||
|
|
@ -134,11 +135,11 @@ export default {
|
|||
|
||||
dataRule: {
|
||||
name: [
|
||||
{ required: true, message: "分类名称不能为空", trigger: "blur" },
|
||||
{ min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' }
|
||||
{required: true, message: "分类名称不能为空", trigger: "blur"},
|
||||
{min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur'}
|
||||
],
|
||||
productUnit: [
|
||||
{ min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' }
|
||||
{min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur'}
|
||||
],
|
||||
},
|
||||
|
||||
|
|
@ -180,7 +181,7 @@ export default {
|
|||
for (let i = 0; i < checkedNodes.length; i++) {
|
||||
catIds.push(checkedNodes[i].catId);
|
||||
}
|
||||
if (catIds.length===0) {
|
||||
if (catIds.length === 0) {
|
||||
this.$modal.notifyWarning("请选择删除内容")
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import java.util.Objects;
|
|||
* @author xiejs
|
||||
* @since 2022-02-18
|
||||
*/
|
||||
public class CheckNumberConstraintValidator implements ConstraintValidator<CheckNumber,Integer> {
|
||||
public class CheckNumberConstraintValidator implements ConstraintValidator<CheckNumber,Object> {
|
||||
|
||||
private int[] num;
|
||||
|
||||
|
|
@ -27,14 +27,29 @@ public class CheckNumberConstraintValidator implements ConstraintValidator<Check
|
|||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean isValid(Integer value, ConstraintValidatorContext context) {
|
||||
public boolean isValid(Object value, ConstraintValidatorContext context) {
|
||||
|
||||
if (Objects.nonNull(value)) {
|
||||
for (int i : num) {
|
||||
if (value == i) {
|
||||
return true;
|
||||
|
||||
if (value instanceof Integer) {
|
||||
int val =(int) value;
|
||||
for (int i : num) {
|
||||
if (val == i) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (value instanceof Long) {
|
||||
long val =(long) value;
|
||||
for (int i : num) {
|
||||
if (val == i) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,84 +0,0 @@
|
|||
package com.xjs.mall.product.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.xjs.mall.product.entity.AttrAttrgroupRelationEntity;
|
||||
import com.xjs.mall.product.service.AttrAttrgroupRelationService;
|
||||
import com.xjs.utils.PageUtils;
|
||||
import com.xjs.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 属性&属性分组关联
|
||||
*
|
||||
* @author xiejs
|
||||
* @email 1294405880@qq.com
|
||||
* @date 2022-03-15 10:16:53
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("product/attrattrgrouprelation")
|
||||
public class AttrAttrgroupRelationController {
|
||||
@Autowired
|
||||
private AttrAttrgroupRelationService attrAttrgroupRelationService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = attrAttrgroupRelationService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
public R info(@PathVariable("id") Long id){
|
||||
AttrAttrgroupRelationEntity attrAttrgroupRelation = attrAttrgroupRelationService.getById(id);
|
||||
|
||||
return R.ok().put("attrAttrgroupRelation", attrAttrgroupRelation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
public R save(@RequestBody AttrAttrgroupRelationEntity attrAttrgroupRelation){
|
||||
attrAttrgroupRelationService.save(attrAttrgroupRelation);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
public R update(@RequestBody AttrAttrgroupRelationEntity attrAttrgroupRelation){
|
||||
attrAttrgroupRelationService.updateById(attrAttrgroupRelation);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
public R delete(@RequestBody Long[] ids){
|
||||
attrAttrgroupRelationService.removeByIds(Arrays.asList(ids));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -7,22 +7,24 @@ import com.xjs.mall.product.vo.AttrResponseVo;
|
|||
import com.xjs.mall.product.vo.AttrVo;
|
||||
import com.xjs.utils.PageUtils;
|
||||
import com.xjs.utils.R;
|
||||
import com.xjs.validation.group.AddGroup;
|
||||
import com.xjs.validation.group.UpdateGroup;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 商品属性
|
||||
*
|
||||
* @author xiejs
|
||||
* @email 1294405880@qq.com
|
||||
* @since 2022-03-15 10:16:53
|
||||
* @since 2022-03-15 10:16:53
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("product/attr")
|
||||
|
|
@ -45,8 +47,8 @@ public class AttrController {
|
|||
*/
|
||||
@GetMapping("/info/{attrId}")
|
||||
@ApiOperation("信息")
|
||||
public R info(@PathVariable("attrId") Long attrId){
|
||||
AttrResponseVo attr = attrService.getAttrInfo(attrId);
|
||||
public R info(@PathVariable("attrId") Long attrId) {
|
||||
AttrResponseVo attr = attrService.getAttrInfo(attrId);
|
||||
|
||||
return R.ok().put("attr", attr);
|
||||
}
|
||||
|
|
@ -57,8 +59,8 @@ public class AttrController {
|
|||
@PostMapping("/save")
|
||||
@ApiOperation("保存")
|
||||
@Log(title = "规格参数", businessType = BusinessType.INSERT)
|
||||
public R save(@RequestBody AttrVo attr){
|
||||
attrService.saveAttr(attr);
|
||||
public R save(@Validated(AddGroup.class) @RequestBody AttrVo attr) {
|
||||
attrService.saveAttr(attr);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
|
@ -69,8 +71,8 @@ public class AttrController {
|
|||
@PutMapping("/update")
|
||||
@ApiOperation("修改")
|
||||
@Log(title = "规格参数", businessType = BusinessType.UPDATE)
|
||||
public R update(@RequestBody AttrVo attr){
|
||||
attrService.updateAttr(attr);
|
||||
public R update(@Validated(UpdateGroup.class) @RequestBody AttrVo attr) {
|
||||
attrService.updateAttr(attr);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
|
@ -81,8 +83,8 @@ public class AttrController {
|
|||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除")
|
||||
@Log(title = "规格参数", businessType = BusinessType.DELETE)
|
||||
public R delete(@RequestBody Long[] attrIds){
|
||||
attrService.removeByIds(Arrays.asList(attrIds));
|
||||
public R delete(@RequestBody Long[] attrIds) {
|
||||
attrService.removeByIds(Arrays.asList(attrIds));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,9 +7,12 @@ import com.xjs.mall.product.service.AttrGroupService;
|
|||
import com.xjs.mall.product.service.CategoryService;
|
||||
import com.xjs.utils.PageUtils;
|
||||
import com.xjs.utils.R;
|
||||
import com.xjs.validation.group.AddGroup;
|
||||
import com.xjs.validation.group.UpdateGroup;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
|
@ -23,7 +26,7 @@ import java.util.stream.Collectors;
|
|||
*
|
||||
* @author xiejs
|
||||
* @email 1294405880@qq.com
|
||||
* @since 2022-03-15 10:16:53
|
||||
* @since 2022-03-15 10:16:53
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("product/attrgroup")
|
||||
|
|
@ -39,9 +42,9 @@ public class AttrGroupController {
|
|||
*/
|
||||
@GetMapping("/list/{catelogId}")
|
||||
@ApiOperation("列表")
|
||||
public R list(@RequestParam Map<String, Object> params,Long catelogId){
|
||||
public R list(@RequestParam Map<String, Object> params, Long catelogId) {
|
||||
|
||||
PageUtils page =attrGroupService.queryPage(params,catelogId);
|
||||
PageUtils page = attrGroupService.queryPage(params, catelogId);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
|
@ -52,10 +55,10 @@ public class AttrGroupController {
|
|||
*/
|
||||
@GetMapping("/info/{attrGroupId}")
|
||||
@ApiOperation("信息")
|
||||
public R info(@PathVariable("attrGroupId") Long attrGroupId){
|
||||
AttrGroupEntity attrGroup = attrGroupService.getById(attrGroupId);
|
||||
public R info(@PathVariable("attrGroupId") Long attrGroupId) {
|
||||
AttrGroupEntity attrGroup = attrGroupService.getById(attrGroupId);
|
||||
|
||||
Long[] path=categoryService.finCatelogPath(attrGroup.getCatelogId());
|
||||
Long[] path = categoryService.finCatelogPath(attrGroup.getCatelogId());
|
||||
List<String> collect = Arrays.stream(path).map(String::valueOf).collect(Collectors.toList());
|
||||
|
||||
attrGroup.setCatelogPath(collect);
|
||||
|
|
@ -69,8 +72,8 @@ public class AttrGroupController {
|
|||
@PostMapping("/save")
|
||||
@ApiOperation("保存")
|
||||
@Log(title = "属性分组", businessType = BusinessType.INSERT)
|
||||
public R save(@RequestBody AttrGroupEntity attrGroup){
|
||||
attrGroupService.save(attrGroup);
|
||||
public R save(@Validated(AddGroup.class) @RequestBody AttrGroupEntity attrGroup) {
|
||||
attrGroupService.save(attrGroup);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
|
@ -81,8 +84,8 @@ public class AttrGroupController {
|
|||
@PutMapping("/update")
|
||||
@ApiOperation("修改")
|
||||
@Log(title = "属性分组", businessType = BusinessType.UPDATE)
|
||||
public R update(@RequestBody AttrGroupEntity attrGroup){
|
||||
attrGroupService.updateById(attrGroup);
|
||||
public R update(@Validated(UpdateGroup.class) @RequestBody AttrGroupEntity attrGroup) {
|
||||
attrGroupService.updateById(attrGroup);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
|
@ -93,8 +96,8 @@ public class AttrGroupController {
|
|||
@DeleteMapping("/delete")
|
||||
@ApiOperation("删除")
|
||||
@Log(title = "属性分组", businessType = BusinessType.DELETE)
|
||||
public R delete(@RequestBody Long[] attrGroupIds){
|
||||
attrGroupService.removeByIds(Arrays.asList(attrGroupIds));
|
||||
public R delete(@RequestBody Long[] attrGroupIds) {
|
||||
attrGroupService.removeByIds(Arrays.asList(attrGroupIds));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,12 @@ package com.xjs.mall.product.entity;
|
|||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.xjs.validation.group.AddGroup;
|
||||
import com.xjs.validation.group.UpdateGroup;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -18,38 +22,44 @@ import java.util.List;
|
|||
@Data
|
||||
@TableName("pms_attr_group")
|
||||
public class AttrGroupEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 分组id
|
||||
*/
|
||||
@TableId
|
||||
private Long attrGroupId;
|
||||
/**
|
||||
* 组名
|
||||
*/
|
||||
private String attrGroupName;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String descript;
|
||||
/**
|
||||
* 组图标
|
||||
*/
|
||||
private String icon;
|
||||
/**
|
||||
* 所属分类id
|
||||
*/
|
||||
private Long catelogId;
|
||||
/**
|
||||
* 分组id
|
||||
*/
|
||||
@TableId
|
||||
private Long attrGroupId;
|
||||
/**
|
||||
* 组名
|
||||
*/
|
||||
@NotBlank(message = "组名不能为空", groups = {UpdateGroup.class, AddGroup.class})
|
||||
@Size(max = 20, groups = {UpdateGroup.class, AddGroup.class}, message = "图标大小长度大于 20 字符")
|
||||
private String attrGroupName;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@NotBlank(message = "描述不能为空", groups = {UpdateGroup.class, AddGroup.class})
|
||||
@Size(max = 255, groups = {UpdateGroup.class, AddGroup.class}, message = "图标大小长度大于 255 字符")
|
||||
private String descript;
|
||||
/**
|
||||
* 组图标
|
||||
*/
|
||||
@Size(max = 50, groups = {UpdateGroup.class, AddGroup.class}, message = "图标大小长度大于 50 字符")
|
||||
private String icon;
|
||||
/**
|
||||
* 所属分类id
|
||||
*/
|
||||
@NotBlank(message = "所属分类id不能为空", groups = {UpdateGroup.class, AddGroup.class})
|
||||
private Long catelogId;
|
||||
|
||||
/**
|
||||
* 分类id完整路径
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private List<String> catelogPath;
|
||||
/**
|
||||
* 分类id完整路径
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private List<String> catelogPath;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,8 @@
|
|||
package com.xjs.mall.product.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xjs.utils.PageUtils;
|
||||
import com.xjs.mall.product.entity.AttrAttrgroupRelationEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 属性&属性分组关联
|
||||
*
|
||||
|
|
@ -15,6 +12,5 @@ import java.util.Map;
|
|||
*/
|
||||
public interface AttrAttrgroupRelationService extends IService<AttrAttrgroupRelationEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,29 +1,15 @@
|
|||
package com.xjs.mall.product.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xjs.utils.PageUtils;
|
||||
import com.xjs.utils.Query;
|
||||
|
||||
import com.xjs.mall.product.dao.AttrAttrgroupRelationDao;
|
||||
import com.xjs.mall.product.entity.AttrAttrgroupRelationEntity;
|
||||
import com.xjs.mall.product.service.AttrAttrgroupRelationService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
@Service("attrAttrgroupRelationService")
|
||||
public class AttrAttrgroupRelationServiceImpl extends ServiceImpl<AttrAttrgroupRelationDao, AttrAttrgroupRelationEntity> implements AttrAttrgroupRelationService {
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
IPage<AttrAttrgroupRelationEntity> page = this.page(
|
||||
new Query<AttrAttrgroupRelationEntity>().getPage(params),
|
||||
new QueryWrapper<AttrAttrgroupRelationEntity>()
|
||||
);
|
||||
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,17 @@
|
|||
package com.xjs.mall.product.vo;
|
||||
|
||||
import com.xjs.validation.annotation.CheckNumber;
|
||||
import com.xjs.validation.group.AddGroup;
|
||||
import com.xjs.validation.group.UpdateGroup;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 商品属性Vo
|
||||
*
|
||||
* @author xiejs
|
||||
* @since 2022-03-17
|
||||
*/
|
||||
|
|
@ -13,39 +21,54 @@ public class AttrVo {
|
|||
/**
|
||||
* 属性名
|
||||
*/
|
||||
@NotBlank(message = "属性名不能为空", groups = {AddGroup.class, UpdateGroup.class})
|
||||
@Size(max = 30, groups = {AddGroup.class, UpdateGroup.class}, message = "属性名长度在 1 到 30 字符")
|
||||
private String attrName;
|
||||
/**
|
||||
* 是否需要检索[0-不需要,1-需要]
|
||||
*/
|
||||
@NotNull(message = "是否需要检索不能为空", groups = {AddGroup.class, UpdateGroup.class})
|
||||
@CheckNumber(num = {0, 1}, groups = {AddGroup.class, UpdateGroup.class})
|
||||
private Integer searchType;
|
||||
/**
|
||||
* 属性图标
|
||||
*/
|
||||
@NotBlank(message = "属性图标不能为空", groups = {AddGroup.class, UpdateGroup.class})
|
||||
@Size(max = 30, groups = {AddGroup.class, UpdateGroup.class}, message = "属性图标长度在 1 到 30 字符")
|
||||
private String icon;
|
||||
/**
|
||||
* 可选值列表[用逗号分隔]
|
||||
*/
|
||||
@Size(max = 255, groups = {AddGroup.class, UpdateGroup.class}, message = "可选值列表长度在 1 到 255 字符")
|
||||
private String valueSelect;
|
||||
/**
|
||||
* 属性类型[0-销售属性,1-基本属性,2-既是销售属性又是基本属性]
|
||||
*/
|
||||
@CheckNumber(num = {0, 1}, groups = {AddGroup.class, UpdateGroup.class})
|
||||
@NotNull(message = "属性类型不能为空", groups = {AddGroup.class, UpdateGroup.class})
|
||||
private Integer attrType;
|
||||
|
||||
/**
|
||||
* 值类型(多选单选)
|
||||
*/
|
||||
@NotNull(message = "值类型不能为空", groups = {AddGroup.class, UpdateGroup.class})
|
||||
private Integer valueType;
|
||||
/**
|
||||
* 启用状态[0 - 禁用,1 - 启用]
|
||||
*/
|
||||
@CheckNumber(num = {0, 1}, groups = {AddGroup.class, UpdateGroup.class})
|
||||
@NotNull(message = "启用状态不能为空", groups = {AddGroup.class, UpdateGroup.class})
|
||||
private Long enable;
|
||||
/**
|
||||
* 所属分类
|
||||
*/
|
||||
@NotNull(message = "所属分类id不能为空", groups = {AddGroup.class, UpdateGroup.class})
|
||||
private Long catelogId;
|
||||
/**
|
||||
* 快速展示【是否展示在介绍上;0-否 1-是】,在sku中仍然可以调整
|
||||
*/
|
||||
@CheckNumber(num = {0, 1}, groups = {AddGroup.class, UpdateGroup.class})
|
||||
@NotNull(message = "快速展示不能为空", groups = {AddGroup.class, UpdateGroup.class})
|
||||
private Integer showDesc;
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue