30 changed files with 1031 additions and 76 deletions
@ -0,0 +1,135 @@ |
|||||
|
package com.qs.serve.modules.tag.controller; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.qs.serve.common.model.annotation.SysLog; |
||||
|
import com.qs.serve.common.model.dto.PageVo; |
||||
|
import com.qs.serve.common.model.dto.R; |
||||
|
import com.qs.serve.common.model.enums.BizType; |
||||
|
import com.qs.serve.common.model.enums.SystemModule; |
||||
|
import com.qs.serve.common.util.PageUtil; |
||||
|
import com.qs.serve.common.util.CopierUtil; |
||||
|
import com.qs.serve.common.util.StringUtils; |
||||
|
import com.qs.serve.common.util.TreeUtil; |
||||
|
import com.qs.serve.modules.tag.entity.TagData; |
||||
|
import com.qs.serve.modules.tag.entity.TagInfo; |
||||
|
import com.qs.serve.modules.tag.entity.vo.TagCategoryTreeVo; |
||||
|
import com.qs.serve.modules.tag.service.TagInfoService; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.security.access.prepost.PreAuthorize; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import com.qs.serve.modules.tag.entity.TagCategory; |
||||
|
import com.qs.serve.modules.tag.service.TagCategoryService; |
||||
|
|
||||
|
import javax.validation.Valid; |
||||
|
import java.util.List; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* 标签 标签分类 |
||||
|
* @author YenHex |
||||
|
* @since 2023-04-23 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@AllArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("tag/category") |
||||
|
public class TagCategoryController { |
||||
|
|
||||
|
private TagCategoryService tagCategoryService; |
||||
|
private TagInfoService tagInfoService; |
||||
|
|
||||
|
/** |
||||
|
* 树列表 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/tree") |
||||
|
public R<List<TagCategoryTreeVo>> getList(TagCategory param){ |
||||
|
LambdaQueryWrapper<TagCategory> lqw = new LambdaQueryWrapper<>(param); |
||||
|
List<TagCategory> list = tagCategoryService.list(lqw); |
||||
|
List<TagCategoryTreeVo> treeVoList = list.stream().map(cate->{ |
||||
|
TagCategoryTreeVo treeVo = new TagCategoryTreeVo(); |
||||
|
treeVo.setCategoryName(cate.getCategoryName()); |
||||
|
treeVo.setId(cate.getId()); |
||||
|
treeVo.setParentId(cate.getPid()); |
||||
|
treeVo.setSort(0); |
||||
|
treeVo.setCategoryName(cate.getCategoryName()); |
||||
|
return treeVo; |
||||
|
}).collect(Collectors.toList()); |
||||
|
treeVoList = TreeUtil.buildByRecursive(treeVoList,TreeUtil.DEFAULT_PID_STRING); |
||||
|
return R.ok(treeVoList); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 翻页 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/page") |
||||
|
public R<PageVo<TagCategory>> getPage(TagCategory param){ |
||||
|
LambdaQueryWrapper<TagCategory> lqw = new LambdaQueryWrapper<>(param); |
||||
|
PageUtil.startPage(); |
||||
|
List<TagCategory> list = tagCategoryService.list(lqw); |
||||
|
return R.byPageHelperList(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* ID查询 |
||||
|
* @param id |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("/getById/{id}") |
||||
|
public R<TagCategory> getById(@PathVariable("id") String id){ |
||||
|
TagCategory tagCategory = tagCategoryService.getById(id); |
||||
|
return R.ok(tagCategory); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 更新 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/updateById") |
||||
|
@SysLog(module = SystemModule.Tag, title = "标签分类", biz = BizType.UPDATE) |
||||
|
@PreAuthorize("hasRole('tag:category:update')") |
||||
|
public R<?> updateById(@RequestBody @Valid TagCategory param){ |
||||
|
tagCategoryService.modify(param); |
||||
|
return R.ok(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
@PostMapping("/save") |
||||
|
@SysLog(module = SystemModule.Tag, title = "标签分类", biz = BizType.INSERT) |
||||
|
@PreAuthorize("hasRole('tag:category:insert')") |
||||
|
public R<?> save(@RequestBody @Valid TagCategory param){ |
||||
|
tagCategoryService.modify(param); |
||||
|
return R.ok(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除 |
||||
|
* @param ids |
||||
|
* @return |
||||
|
*/ |
||||
|
@DeleteMapping("/deleteById/{ids}") |
||||
|
@SysLog(module = SystemModule.Tag, title = "标签分类", biz = BizType.DELETE) |
||||
|
@PreAuthorize("hasRole('tag:category:delete')") |
||||
|
public R<?> deleteById(@PathVariable("ids") String ids){ |
||||
|
List<Long> idsLong = StringUtils.splitIdLong(ids); |
||||
|
LambdaQueryWrapper<TagInfo> lqw = new LambdaQueryWrapper<>(); |
||||
|
lqw.in(TagInfo::getTagCategroyId,idsLong); |
||||
|
if(tagInfoService.count(lqw)>0){ |
||||
|
return R.error("含有标签的类目无法删除"); |
||||
|
} |
||||
|
boolean result = tagCategoryService.removeByIds(idsLong); |
||||
|
return R.isTrue(result); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,55 @@ |
|||||
|
package com.qs.serve.modules.tag.controller; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.qs.serve.common.model.annotation.SysLog; |
||||
|
import com.qs.serve.common.model.dto.PageVo; |
||||
|
import com.qs.serve.common.model.dto.R; |
||||
|
import com.qs.serve.common.model.enums.BizType; |
||||
|
import com.qs.serve.common.model.enums.SystemModule; |
||||
|
import com.qs.serve.common.util.CopierUtil; |
||||
|
import com.qs.serve.common.util.PageUtil; |
||||
|
import com.qs.serve.common.util.StringUtils; |
||||
|
import com.qs.serve.modules.tag.entity.TagInfo; |
||||
|
import com.qs.serve.modules.tag.entity.bo.TagInfoBo; |
||||
|
import com.qs.serve.modules.tag.entity.so.TagInfoSo; |
||||
|
import com.qs.serve.modules.tag.service.TagInfoService; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.security.access.prepost.PreAuthorize; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.validation.Valid; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 标签 标签信息 |
||||
|
* @author YenHex |
||||
|
* @since 2023-04-23 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@AllArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("tag/data") |
||||
|
public class TagDataController { |
||||
|
|
||||
|
private TagInfoService tagInfoService; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 新增 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
//@PostMapping("/save")
|
||||
|
@SysLog(module = SystemModule.Tag, title = "标签信息", biz = BizType.INSERT) |
||||
|
@PreAuthorize("hasRole('tag:info:insert')") |
||||
|
public R<?> save(@RequestBody @Valid TagInfoBo param){ |
||||
|
TagInfo entity = CopierUtil.copy(param,new TagInfo()); |
||||
|
boolean result = tagInfoService.save(entity); |
||||
|
return R.isTrue(result); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,126 @@ |
|||||
|
package com.qs.serve.modules.tag.controller; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.qs.serve.common.model.annotation.SysLog; |
||||
|
import com.qs.serve.common.model.dto.PageVo; |
||||
|
import com.qs.serve.common.model.dto.R; |
||||
|
import com.qs.serve.common.model.enums.BizType; |
||||
|
import com.qs.serve.common.model.enums.SystemModule; |
||||
|
import com.qs.serve.common.util.PageUtil; |
||||
|
import com.qs.serve.common.util.CopierUtil; |
||||
|
import com.qs.serve.common.util.StringUtils; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.security.access.prepost.PreAuthorize; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import com.qs.serve.modules.tag.entity.so.TagInfoSo; |
||||
|
import com.qs.serve.modules.tag.entity.bo.TagInfoBo; |
||||
|
import com.qs.serve.modules.tag.entity.TagInfo; |
||||
|
import com.qs.serve.modules.tag.service.TagInfoService; |
||||
|
|
||||
|
import javax.validation.Valid; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 标签 标签信息 |
||||
|
* @author YenHex |
||||
|
* @since 2023-04-23 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@AllArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("tag/info") |
||||
|
public class TagInfoController { |
||||
|
|
||||
|
private TagInfoService tagInfoService; |
||||
|
|
||||
|
/** |
||||
|
* 列表 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
//@GetMapping("/list")
|
||||
|
@PreAuthorize("hasRole('tag:info:query')") |
||||
|
public R<List<TagInfo>> getList(TagInfoSo param){ |
||||
|
TagInfo entity = CopierUtil.copy(param,new TagInfo()); |
||||
|
LambdaQueryWrapper<TagInfo> lqw = new LambdaQueryWrapper<>(entity); |
||||
|
PageUtil.startPage(); |
||||
|
List<TagInfo> list = tagInfoService.list(lqw); |
||||
|
return R.ok(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 翻页 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
//@GetMapping("/page")
|
||||
|
@PreAuthorize("hasRole('tag:info:query')") |
||||
|
public R<PageVo<TagInfo>> getPage(TagInfoSo param){ |
||||
|
TagInfo entity = CopierUtil.copy(param,new TagInfo()); |
||||
|
LambdaQueryWrapper<TagInfo> lqw = new LambdaQueryWrapper<>(entity); |
||||
|
PageUtil.startPage(); |
||||
|
List<TagInfo> list = tagInfoService.list(lqw); |
||||
|
return R.byPageHelperList(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* ID查询 |
||||
|
* @param id |
||||
|
* @return |
||||
|
*/ |
||||
|
//@GetMapping("/getById/{id}")
|
||||
|
@SysLog(module = SystemModule.Tag, title = "标签信息", biz = BizType.QUERY) |
||||
|
@PreAuthorize("hasRole('tag:info:query')") |
||||
|
public R<TagInfo> getById(@PathVariable("id") String id){ |
||||
|
TagInfo tagInfo = tagInfoService.getById(id); |
||||
|
return R.ok(tagInfo); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 更新 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
//@PostMapping("/updateById")
|
||||
|
@SysLog(module = SystemModule.Tag, title = "标签信息", biz = BizType.UPDATE) |
||||
|
@PreAuthorize("hasRole('tag:info:update')") |
||||
|
public R<?> updateById(@RequestBody @Valid TagInfoBo param){ |
||||
|
TagInfo entity = CopierUtil.copy(param,new TagInfo()); |
||||
|
boolean result = tagInfoService.updateById(entity); |
||||
|
return R.isTrue(result); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
//@PostMapping("/save")
|
||||
|
@SysLog(module = SystemModule.Tag, title = "标签信息", biz = BizType.INSERT) |
||||
|
@PreAuthorize("hasRole('tag:info:insert')") |
||||
|
public R<?> save(@RequestBody @Valid TagInfoBo param){ |
||||
|
TagInfo entity = CopierUtil.copy(param,new TagInfo()); |
||||
|
boolean result = tagInfoService.save(entity); |
||||
|
return R.isTrue(result); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除 |
||||
|
* @param ids |
||||
|
* @return |
||||
|
*/ |
||||
|
@DeleteMapping("/deleteById/{ids}") |
||||
|
@SysLog(module = SystemModule.Tag, title = "标签信息", biz = BizType.DELETE) |
||||
|
@PreAuthorize("hasRole('tag:info:delete')") |
||||
|
public R<?> deleteById(@PathVariable("ids") String ids){ |
||||
|
List<Long> idsLong = StringUtils.splitIdLong(ids); |
||||
|
boolean result = tagInfoService.removeByIds(idsLong); |
||||
|
return R.isTrue(result); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,97 @@ |
|||||
|
package com.qs.serve.modules.tag.entity; |
||||
|
|
||||
|
import java.time.LocalDate; |
||||
|
import java.io.Serializable; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.*; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import lombok.Data; |
||||
|
import org.hibernate.validator.constraints.Length; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
|
||||
|
/** |
||||
|
* 标签分类 实体类 |
||||
|
* @author YenHex |
||||
|
* @since 2023-04-23 |
||||
|
*/ |
||||
|
@Data |
||||
|
@TableName("tag_category") |
||||
|
public class TagCategory implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** id */ |
||||
|
@TableId(type = IdType.ASSIGN_UUID) |
||||
|
private String id; |
||||
|
|
||||
|
/** 标签名 */ |
||||
|
@Length(max = 255,message = "标签名长度不能超过255字") |
||||
|
private String categoryName; |
||||
|
|
||||
|
/** 上级标签类目id */ |
||||
|
private String pid; |
||||
|
|
||||
|
/** */ |
||||
|
@Length(max = 255,message = "长度不能超过255字") |
||||
|
private String pathIds; |
||||
|
|
||||
|
/** 备注 */ |
||||
|
@Length(max = 255,message = "备注长度不能超过255字") |
||||
|
private String remark; |
||||
|
|
||||
|
/** 创建时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private LocalDateTime createTime; |
||||
|
|
||||
|
/** 更新时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
@TableField(fill = FieldFill.UPDATE) |
||||
|
private LocalDateTime updateTime; |
||||
|
|
||||
|
/** 创建人 */ |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private String createBy; |
||||
|
|
||||
|
/** 更新人 */ |
||||
|
@TableField(fill = FieldFill.UPDATE) |
||||
|
private String updateBy; |
||||
|
|
||||
|
/** 租户id */ |
||||
|
@JsonIgnore |
||||
|
@JsonProperty |
||||
|
private String tenantId; |
||||
|
|
||||
|
/** 删除标识 */ |
||||
|
@JsonIgnore |
||||
|
@JsonProperty |
||||
|
private Boolean delFlag; |
||||
|
|
||||
|
|
||||
|
public static TagCategory toNewObject(TagCategory source){ |
||||
|
TagCategory category = new TagCategory(); |
||||
|
category.setId(source.getId()); |
||||
|
category.setCategoryName(source.getCategoryName()); |
||||
|
category.setPid(source.getPid()); |
||||
|
category.setPathIds(source.getPathIds()); |
||||
|
category.setRemark(source.getRemark()); |
||||
|
category.setCreateTime(source.getCreateTime()); |
||||
|
category.setUpdateTime(source.getUpdateTime()); |
||||
|
category.setCreateBy(source.getCreateBy()); |
||||
|
category.setUpdateBy(source.getUpdateBy()); |
||||
|
category.setTenantId(source.getTenantId()); |
||||
|
category.setDelFlag(source.getDelFlag()); |
||||
|
return category; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,101 @@ |
|||||
|
package com.qs.serve.modules.tag.entity; |
||||
|
|
||||
|
import java.time.LocalDate; |
||||
|
import java.io.Serializable; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.*; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import lombok.Data; |
||||
|
import org.hibernate.validator.constraints.Length; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
|
||||
|
/** |
||||
|
* 标签数据 实体类 |
||||
|
* @author YenHex |
||||
|
* @since 2023-04-23 |
||||
|
*/ |
||||
|
@Data |
||||
|
@TableName("tag_data") |
||||
|
public class TagData implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** id */ |
||||
|
@TableId(type = IdType.AUTO) |
||||
|
private Long id; |
||||
|
|
||||
|
/** 标签名 */ |
||||
|
@Length(max = 255,message = "标签名长度不能超过255字") |
||||
|
private String tagName; |
||||
|
|
||||
|
/** 标签id */ |
||||
|
private Long tagId; |
||||
|
|
||||
|
/** 业务类型 */ |
||||
|
@Length(max = 30,message = "业务类型长度不能超过30字") |
||||
|
private String businessType; |
||||
|
|
||||
|
/** 目标id */ |
||||
|
private Long businessTargetId; |
||||
|
|
||||
|
/** 备注 */ |
||||
|
@Length(max = 255,message = "备注长度不能超过255字") |
||||
|
private String remark; |
||||
|
|
||||
|
/** 创建时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private LocalDateTime createTime; |
||||
|
|
||||
|
/** 更新时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
@TableField(fill = FieldFill.UPDATE) |
||||
|
private LocalDateTime updateTime; |
||||
|
|
||||
|
/** 创建人 */ |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private String createBy; |
||||
|
|
||||
|
/** 更新人 */ |
||||
|
@TableField(fill = FieldFill.UPDATE) |
||||
|
private String updateBy; |
||||
|
|
||||
|
/** 租户id */ |
||||
|
@JsonIgnore |
||||
|
@JsonProperty |
||||
|
private String tenantId; |
||||
|
|
||||
|
/** 删除标识 */ |
||||
|
@JsonIgnore |
||||
|
@JsonProperty |
||||
|
private Boolean delFlag; |
||||
|
|
||||
|
|
||||
|
public static TagData toNewObject(TagData source){ |
||||
|
TagData data = new TagData(); |
||||
|
data.setId(source.getId()); |
||||
|
data.setTagName(source.getTagName()); |
||||
|
data.setTagId(source.getTagId()); |
||||
|
data.setBusinessType(source.getBusinessType()); |
||||
|
data.setBusinessTargetId(source.getBusinessTargetId()); |
||||
|
data.setRemark(source.getRemark()); |
||||
|
data.setCreateTime(source.getCreateTime()); |
||||
|
data.setUpdateTime(source.getUpdateTime()); |
||||
|
data.setCreateBy(source.getCreateBy()); |
||||
|
data.setUpdateBy(source.getUpdateBy()); |
||||
|
data.setTenantId(source.getTenantId()); |
||||
|
data.setDelFlag(source.getDelFlag()); |
||||
|
return data; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,97 @@ |
|||||
|
package com.qs.serve.modules.tag.entity; |
||||
|
|
||||
|
import java.time.LocalDate; |
||||
|
import java.io.Serializable; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.*; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import lombok.Data; |
||||
|
import org.hibernate.validator.constraints.Length; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
|
||||
|
/** |
||||
|
* 标签信息 实体类 |
||||
|
* @author YenHex |
||||
|
* @since 2023-04-23 |
||||
|
*/ |
||||
|
@Data |
||||
|
@TableName("tag_info") |
||||
|
public class TagInfo implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** id */ |
||||
|
@TableId(type = IdType.AUTO) |
||||
|
private Long id; |
||||
|
|
||||
|
/** 标签名 */ |
||||
|
@Length(max = 255,message = "标签名长度不能超过255字") |
||||
|
private String tagName; |
||||
|
|
||||
|
/** 标签类目id */ |
||||
|
private Long tagCategroyId; |
||||
|
|
||||
|
/** 标签类目名称 */ |
||||
|
@Length(max = 255,message = "标签类目名称长度不能超过255字") |
||||
|
private String tagCategoryName; |
||||
|
|
||||
|
/** 备注 */ |
||||
|
@Length(max = 255,message = "备注长度不能超过255字") |
||||
|
private String remark; |
||||
|
|
||||
|
/** 创建时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private LocalDateTime createTime; |
||||
|
|
||||
|
/** 更新时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
||||
|
@TableField(fill = FieldFill.UPDATE) |
||||
|
private LocalDateTime updateTime; |
||||
|
|
||||
|
/** 创建人 */ |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private String createBy; |
||||
|
|
||||
|
/** 更新人 */ |
||||
|
@TableField(fill = FieldFill.UPDATE) |
||||
|
private String updateBy; |
||||
|
|
||||
|
/** 租户id */ |
||||
|
@JsonIgnore |
||||
|
@JsonProperty |
||||
|
private String tenantId; |
||||
|
|
||||
|
/** 删除标识 */ |
||||
|
@JsonIgnore |
||||
|
@JsonProperty |
||||
|
private Boolean delFlag; |
||||
|
|
||||
|
|
||||
|
public static TagInfo toNewObject(TagInfo source){ |
||||
|
TagInfo info = new TagInfo(); |
||||
|
info.setId(source.getId()); |
||||
|
info.setTagName(source.getTagName()); |
||||
|
info.setTagCategroyId(source.getTagCategroyId()); |
||||
|
info.setTagCategoryName(source.getTagCategoryName()); |
||||
|
info.setRemark(source.getRemark()); |
||||
|
info.setCreateTime(source.getCreateTime()); |
||||
|
info.setUpdateTime(source.getUpdateTime()); |
||||
|
info.setCreateBy(source.getCreateBy()); |
||||
|
info.setUpdateBy(source.getUpdateBy()); |
||||
|
info.setTenantId(source.getTenantId()); |
||||
|
info.setDelFlag(source.getDelFlag()); |
||||
|
return info; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,71 @@ |
|||||
|
package com.qs.serve.modules.tag.entity.bo; |
||||
|
|
||||
|
import java.time.LocalDate; |
||||
|
import java.io.Serializable; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import lombok.Data; |
||||
|
import org.hibernate.validator.constraints.Length; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
|
||||
|
/** |
||||
|
* 标签信息 Bo |
||||
|
* @author YenHex |
||||
|
* @since 2023-04-23 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class TagInfoBo implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** id */ |
||||
|
private Long id; |
||||
|
|
||||
|
/** 标签名 */ |
||||
|
@Length(max = 255,message = "标签名长度不能超过255字") |
||||
|
private String tagName; |
||||
|
|
||||
|
/** 标签类目id */ |
||||
|
private Long tagCategroyId; |
||||
|
|
||||
|
/** 标签类目名称 */ |
||||
|
@Length(max = 255,message = "标签类目名称长度不能超过255字") |
||||
|
private String tagCategoryName; |
||||
|
|
||||
|
/** 备注 */ |
||||
|
@Length(max = 255,message = "备注长度不能超过255字") |
||||
|
private String remark; |
||||
|
|
||||
|
/** 创建时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
private LocalDateTime createTime; |
||||
|
|
||||
|
/** 更新时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
private LocalDateTime updateTime; |
||||
|
|
||||
|
/** 创建人 */ |
||||
|
private String createBy; |
||||
|
|
||||
|
/** 更新人 */ |
||||
|
private String updateBy; |
||||
|
|
||||
|
/** 租户id */ |
||||
|
@JsonIgnore |
||||
|
@JsonProperty |
||||
|
private String tenantId; |
||||
|
|
||||
|
/** 删除标识 */ |
||||
|
@JsonIgnore |
||||
|
@JsonProperty |
||||
|
private Boolean delFlag; |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,68 @@ |
|||||
|
package com.qs.serve.modules.tag.entity.so; |
||||
|
|
||||
|
import java.time.LocalDate; |
||||
|
import java.io.Serializable; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import lombok.Data; |
||||
|
import org.hibernate.validator.constraints.Length; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
|
||||
|
/** |
||||
|
* 标签信息 查询参数 |
||||
|
* @author YenHex |
||||
|
* @since 2023-04-23 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class TagInfoSo implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** id */ |
||||
|
private Long id; |
||||
|
|
||||
|
/** 标签名 */ |
||||
|
private String tagName; |
||||
|
|
||||
|
/** 标签类目id */ |
||||
|
private Long tagCategroyId; |
||||
|
|
||||
|
/** 标签类目名称 */ |
||||
|
private String tagCategoryName; |
||||
|
|
||||
|
/** 备注 */ |
||||
|
private String remark; |
||||
|
|
||||
|
/** 创建时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
private LocalDateTime createTime; |
||||
|
|
||||
|
/** 更新时间 */ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
private LocalDateTime updateTime; |
||||
|
|
||||
|
/** 创建人 */ |
||||
|
private String createBy; |
||||
|
|
||||
|
/** 更新人 */ |
||||
|
private String updateBy; |
||||
|
|
||||
|
/** 租户id */ |
||||
|
@JsonIgnore |
||||
|
@JsonProperty |
||||
|
private String tenantId; |
||||
|
|
||||
|
/** 删除标识 */ |
||||
|
@JsonIgnore |
||||
|
@JsonProperty |
||||
|
private Boolean delFlag; |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,15 @@ |
|||||
|
package com.qs.serve.modules.tag.entity.vo; |
||||
|
|
||||
|
import com.qs.serve.common.model.dto.TreeNode; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/4/23 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class TagCategoryTreeVo extends TreeNode { |
||||
|
|
||||
|
private String categoryName; |
||||
|
|
||||
|
} |
@ -0,0 +1,14 @@ |
|||||
|
package com.qs.serve.modules.tag.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.qs.serve.modules.tag.entity.TagCategory; |
||||
|
|
||||
|
/** |
||||
|
* 标签分类 Mapper |
||||
|
* @author YenHex |
||||
|
* @date 2023-04-23 |
||||
|
*/ |
||||
|
public interface TagCategoryMapper extends BaseMapper<TagCategory> { |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,14 @@ |
|||||
|
package com.qs.serve.modules.tag.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.qs.serve.modules.tag.entity.TagData; |
||||
|
|
||||
|
/** |
||||
|
* 标签数据 Mapper |
||||
|
* @author YenHex |
||||
|
* @date 2023-04-23 |
||||
|
*/ |
||||
|
public interface TagDataMapper extends BaseMapper<TagData> { |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,14 @@ |
|||||
|
package com.qs.serve.modules.tag.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.qs.serve.modules.tag.entity.TagInfo; |
||||
|
|
||||
|
/** |
||||
|
* 标签信息 Mapper |
||||
|
* @author YenHex |
||||
|
* @date 2023-04-23 |
||||
|
*/ |
||||
|
public interface TagInfoMapper extends BaseMapper<TagInfo> { |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1 @@ |
|||||
|
package com.qs.serve.modules.tag; |
@ -0,0 +1,20 @@ |
|||||
|
package com.qs.serve.modules.tag.service; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
import com.qs.serve.modules.tag.entity.TagCategory; |
||||
|
|
||||
|
/** |
||||
|
* 标签分类 服务接口 |
||||
|
* @author YenHex |
||||
|
* @date 2023-04-23 |
||||
|
*/ |
||||
|
public interface TagCategoryService extends IService<TagCategory> { |
||||
|
|
||||
|
/** |
||||
|
* 编辑 |
||||
|
* @param category |
||||
|
*/ |
||||
|
void modify(TagCategory category); |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,14 @@ |
|||||
|
package com.qs.serve.modules.tag.service; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
import com.qs.serve.modules.tag.entity.TagData; |
||||
|
|
||||
|
/** |
||||
|
* 标签数据 服务接口 |
||||
|
* @author YenHex |
||||
|
* @date 2023-04-23 |
||||
|
*/ |
||||
|
public interface TagDataService extends IService<TagData> { |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,14 @@ |
|||||
|
package com.qs.serve.modules.tag.service; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
import com.qs.serve.modules.tag.entity.TagInfo; |
||||
|
|
||||
|
/** |
||||
|
* 标签信息 服务接口 |
||||
|
* @author YenHex |
||||
|
* @date 2023-04-23 |
||||
|
*/ |
||||
|
public interface TagInfoService extends IService<TagInfo> { |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,29 @@ |
|||||
|
package com.qs.serve.modules.tag.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import com.qs.serve.modules.tag.entity.TagCategory; |
||||
|
import com.qs.serve.modules.tag.service.TagCategoryService; |
||||
|
import com.qs.serve.modules.tag.mapper.TagCategoryMapper; |
||||
|
|
||||
|
/** |
||||
|
* 标签分类 服务实现类 |
||||
|
* @author YenHex |
||||
|
* @since 2023-04-23 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
@AllArgsConstructor |
||||
|
public class TagCategoryServiceImpl extends ServiceImpl<TagCategoryMapper,TagCategory> implements TagCategoryService { |
||||
|
|
||||
|
@Override |
||||
|
public void modify(TagCategory category) { |
||||
|
String id = category.getId(); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,22 @@ |
|||||
|
package com.qs.serve.modules.tag.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import com.qs.serve.modules.tag.entity.TagData; |
||||
|
import com.qs.serve.modules.tag.service.TagDataService; |
||||
|
import com.qs.serve.modules.tag.mapper.TagDataMapper; |
||||
|
|
||||
|
/** |
||||
|
* 标签数据 服务实现类 |
||||
|
* @author YenHex |
||||
|
* @since 2023-04-23 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
@AllArgsConstructor |
||||
|
public class TagDataServiceImpl extends ServiceImpl<TagDataMapper,TagData> implements TagDataService { |
||||
|
|
||||
|
} |
||||
|
|
@ -0,0 +1,22 @@ |
|||||
|
package com.qs.serve.modules.tag.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import com.qs.serve.modules.tag.entity.TagInfo; |
||||
|
import com.qs.serve.modules.tag.service.TagInfoService; |
||||
|
import com.qs.serve.modules.tag.mapper.TagInfoMapper; |
||||
|
|
||||
|
/** |
||||
|
* 标签信息 服务实现类 |
||||
|
* @author YenHex |
||||
|
* @since 2023-04-23 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
@AllArgsConstructor |
||||
|
public class TagInfoServiceImpl extends ServiceImpl<TagInfoMapper,TagInfo> implements TagInfoService { |
||||
|
|
||||
|
} |
||||
|
|
Loading…
Reference in new issue