zhangyuewww 2 년 전
부모
커밋
6748d5b581

+ 65 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/tourism/ILikeCollectionInfoService.java

@@ -0,0 +1,65 @@
+package com.iotechn.unimall.admin.api.tourism;
+
+
+import com.iotechn.unimall.data.domain.LikeCollectionInfo;
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.model.Page;
+import java.util.Date;
+
+/**
+ * 记录点赞收藏信息Service接口
+ * 
+ * @author jlb
+ * @date 2023-06-08
+ */
+@HttpOpenApi(group = "admin.tourism.likeCollectionInfo", description = "记录点赞收藏信息")
+public interface ILikeCollectionInfoService{
+	@HttpMethod(description = "新增",   permissionName = "记录点赞收藏信息管理")
+	public Boolean add(@NotNull @HttpParam(name = "likeCollectionInfo", type = HttpParamType.COMMON, description = "记录点赞收藏信息") LikeCollectionInfo likeCollectionInfo)throws ServiceException;
+
+	@HttpMethod(description = "列表", permissionName = "记录点赞收藏信息管理")
+	public Page<LikeCollectionInfo> list(
+								@HttpParam(name = "infoId", type = HttpParamType.COMMON, description = "主表id") Long infoId,
+							@HttpParam(name = "commonId", type = HttpParamType.COMMON, description = "互动人id") Long commonId,
+							@HttpParam(name = "nickname", type = HttpParamType.COMMON, description = "昵称") String nickname,
+							@HttpParam(name = "commentContent", type = HttpParamType.COMMON, description = "评论内容") String commentContent,
+							@HttpParam(name = "commentId", type = HttpParamType.COMMON, description = "回复的评论id") Long commentId,
+							@HttpParam(name = "commentName", type = HttpParamType.COMMON, description = "回复的评论人昵称") String commentName,
+							@HttpParam(name = "interactionFlag", type = HttpParamType.COMMON, description = "标识(1收藏2点赞3评论)") String interactionFlag,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,
+					@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+		@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+		throws ServiceException;
+
+	@HttpMethod(description = "删除",permissionName = "记录点赞收藏信息管理")
+	public Boolean delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")String id)throws ServiceException;
+
+	@HttpMethod(description = "修改",  permissionName = "记录点赞收藏信息管理")
+	public Boolean update(@NotNull @HttpParam(name = "likeCollectionInfo", type = HttpParamType.COMMON, description = "记录点赞收藏信息") LikeCollectionInfo likeCollectionInfo)throws ServiceException;
+
+	@HttpMethod(description = "查询", permissionName = "记录点赞收藏信息管理")
+	public LikeCollectionInfo get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")Long id)throws ServiceException;
+	
+	@HttpMethod(description = "导出excl表",  permissionName = "记录点赞收藏信息管理")
+	public String export(
+								@HttpParam(name = "infoId", type = HttpParamType.COMMON, description = "主表id") Long infoId,
+							@HttpParam(name = "commonId", type = HttpParamType.COMMON, description = "互动人id") Long commonId,
+							@HttpParam(name = "nickname", type = HttpParamType.COMMON, description = "昵称") String nickname,
+							@HttpParam(name = "commentContent", type = HttpParamType.COMMON, description = "评论内容") String commentContent,
+							@HttpParam(name = "commentId", type = HttpParamType.COMMON, description = "回复的评论id") Long commentId,
+							@HttpParam(name = "commentName", type = HttpParamType.COMMON, description = "回复的评论人昵称") String commentName,
+							@HttpParam(name = "interactionFlag", type = HttpParamType.COMMON, description = "标识(1收藏2点赞3评论)") String interactionFlag,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,
+				@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+	@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)throws ServiceException;
+	
+}

+ 142 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/tourism/impl/LikeCollectionInfoServiceImpl.java

@@ -0,0 +1,142 @@
+package com.iotechn.unimall.admin.api.tourism.impl;
+
+import java.util.List;
+
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.util.ExcelUtil;
+import com.iotechn.unimall.data.mapper.LikeCollectionInfoMapper;
+import com.iotechn.unimall.data.domain.LikeCollectionInfo;
+import com.iotechn.unimall.admin.api.tourism.ILikeCollectionInfoService;
+import com.iotechn.unimall.data.model.Page;
+import java.util.Date;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 记录点赞收藏信息Service业务层处理
+ * 
+ * @author jlb
+ * @date 2023-06-08
+ */
+@Service
+public class LikeCollectionInfoServiceImpl implements ILikeCollectionInfoService{
+	@Autowired
+	private LikeCollectionInfoMapper likeCollectionInfoMapper;
+	
+	@Override
+	public Boolean add(LikeCollectionInfo likeCollectionInfo) throws ServiceException {
+		Date now = new Date();
+		likeCollectionInfo.setGmtCreate(now);
+		likeCollectionInfo.setGmtUpdate(now);
+		return likeCollectionInfoMapper.insert(likeCollectionInfo)>0;
+	}
+
+	@Override
+	public Page<LikeCollectionInfo> list(Long infoId,Long commonId,String nickname,String commentContent,Long commentId,String commentName,String interactionFlag,Date gmtCreate,Date gmtUpdate,Long deleteFlag, Integer page, Integer limit)throws ServiceException {
+		Wrapper<LikeCollectionInfo> wrapper = new EntityWrapper<LikeCollectionInfo>();
+														if (!StringUtils.isEmpty(infoId)) {
+					wrapper.eq("info_id", infoId);
+				}
+												if (!StringUtils.isEmpty(commonId)) {
+					wrapper.eq("common_id", commonId);
+				}
+												if (!StringUtils.isEmpty(nickname)) {
+					wrapper.eq("nickname", nickname);
+				}
+												if (!StringUtils.isEmpty(commentContent)) {
+					wrapper.eq("comment_content", commentContent);
+				}
+												if (!StringUtils.isEmpty(commentId)) {
+					wrapper.eq("comment_id", commentId);
+				}
+												if (!StringUtils.isEmpty(commentName)) {
+					wrapper.eq("comment_name", commentName);
+				}
+												if (!StringUtils.isEmpty(interactionFlag)) {
+					wrapper.eq("interaction_flag", interactionFlag);
+				}
+												if (!StringUtils.isEmpty(gmtCreate)) {
+					wrapper.eq("gmt_create", gmtCreate);
+				}
+												if (!StringUtils.isEmpty(gmtUpdate)) {
+					wrapper.eq("gmt_update", gmtUpdate);
+				}
+												if (!StringUtils.isEmpty(deleteFlag)) {
+					wrapper.eq("delete_flag", deleteFlag);
+				}
+							wrapper.eq("delete_flag", 0);
+		List<LikeCollectionInfo> list = likeCollectionInfoMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+		Integer count = likeCollectionInfoMapper.selectCount(wrapper);
+		return new Page<LikeCollectionInfo>(list, page, limit, count);
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public Boolean delete(String id) {
+		String[] ids = String.valueOf(id).split(",");
+		for (String tt:ids) {
+			LikeCollectionInfo tmp =  likeCollectionInfoMapper.selectById(Long.parseLong(tt));
+			if(tmp != null){
+				tmp.setDeleteFlag(1l);
+				likeCollectionInfoMapper.updateById(tmp);
+			}
+		}
+		return true;
+	}
+
+	@Override
+	public Boolean update(LikeCollectionInfo likeCollectionInfo) throws ServiceException {
+		Date now = new Date();
+		likeCollectionInfo.setGmtUpdate(now);
+		return likeCollectionInfoMapper.updateById(likeCollectionInfo)>0;
+	}
+
+	@Override
+	public LikeCollectionInfo get(Long id) throws ServiceException {
+		return likeCollectionInfoMapper.selectById(id);
+	}
+	
+	@Override
+	public String export(Long infoId,Long commonId,String nickname,String commentContent,Long commentId,String commentName,String interactionFlag,Date gmtCreate,Date gmtUpdate,Long deleteFlag, Integer page, Integer limit)throws ServiceException {
+		Wrapper<LikeCollectionInfo> wrapper = new EntityWrapper<LikeCollectionInfo>();
+														if (!StringUtils.isEmpty(infoId)) {
+					wrapper.eq("info_id", infoId);
+				}
+												if (!StringUtils.isEmpty(commonId)) {
+					wrapper.eq("common_id", commonId);
+				}
+												if (!StringUtils.isEmpty(nickname)) {
+					wrapper.eq("nickname", nickname);
+				}
+												if (!StringUtils.isEmpty(commentContent)) {
+					wrapper.eq("comment_content", commentContent);
+				}
+												if (!StringUtils.isEmpty(commentId)) {
+					wrapper.eq("comment_id", commentId);
+				}
+												if (!StringUtils.isEmpty(commentName)) {
+					wrapper.eq("comment_name", commentName);
+				}
+												if (!StringUtils.isEmpty(interactionFlag)) {
+					wrapper.eq("interaction_flag", interactionFlag);
+				}
+												if (!StringUtils.isEmpty(gmtCreate)) {
+					wrapper.eq("gmt_create", gmtCreate);
+				}
+												if (!StringUtils.isEmpty(gmtUpdate)) {
+					wrapper.eq("gmt_update", gmtUpdate);
+				}
+												if (!StringUtils.isEmpty(deleteFlag)) {
+					wrapper.eq("delete_flag", deleteFlag);
+				}
+							List<LikeCollectionInfo> list = likeCollectionInfoMapper.selectList(wrapper);
+		ExcelUtil<LikeCollectionInfo> util = new ExcelUtil<LikeCollectionInfo>(LikeCollectionInfo.class);
+		return util.exportExcel(list, "操作日志");
+	}
+}

+ 97 - 0
unimall-data/src/main/java/com/iotechn/unimall/data/domain/LikeCollectionInfo.java

@@ -0,0 +1,97 @@
+package com.iotechn.unimall.data.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.iotechn.unimall.core.framework.aspectj.lang.annotaion.Excel;
+import com.iotechn.unimall.core.framework.aspectj.lang.annotaion.Excel.ColumnType;
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+import lombok.Data;
+import com.baomidou.mybatisplus.annotations.TableField;
+import com.baomidou.mybatisplus.enums.FieldFill;
+import com.iotechn.unimall.core.util.StringUtils;
+import java.util.Date;
+
+/**
+ * 记录点赞收藏信息对象 like_collection_info
+ * 
+ * @author jlb
+ * @date 2023-06-08
+ */
+@Data
+@TableName("like_collection_info")
+public class LikeCollectionInfo extends SuperDO{
+    private static final long serialVersionUID = 1L;
+
+    /**  */
+    @TableId("id")
+    private Long id;
+
+    /** 主表id */
+    @Excel(name = "主表id")
+    @TableField("info_id")
+    private Long infoId;
+
+    /** 互动人id */
+    @Excel(name = "互动人id")
+    @TableField("common_id")
+    private Long commonId;
+
+    /** 昵称 */
+    @Excel(name = "昵称")
+    @TableField("nickname")
+    private String nickname;
+
+    /** 评论内容 */
+    @Excel(name = "评论内容")
+    @TableField("comment_content")
+    private String commentContent;
+
+    /** 回复的评论id */
+    @Excel(name = "回复的评论id")
+    @TableField("comment_id")
+    private Long commentId;
+
+    /** 回复的评论人昵称 */
+    @Excel(name = "回复的评论人昵称")
+    @TableField("comment_name")
+    private String commentName;
+
+    /** 标识(1收藏2点赞3评论) */
+    @Excel(name = "标识(1收藏2点赞3评论)")
+    @TableField("interaction_flag")
+    private String interactionFlag;
+
+    /**  */
+    @Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd")
+    @TableField("gmt_create")
+    private Date gmtCreate;
+
+    /**  */
+    @Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd")
+    @TableField("gmt_update")
+    private Date gmtUpdate;
+
+    /** 删除标识 */
+    @Excel(name = "删除标识")
+    @TableField("delete_flag")
+    private Long deleteFlag;
+
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("infoId", getInfoId())
+            .append("commonId", getCommonId())
+            .append("nickname", getNickname())
+            .append("commentContent", getCommentContent())
+            .append("commentId", getCommentId())
+            .append("commentName", getCommentName())
+            .append("interactionFlag", getInteractionFlag())
+            .append("gmtCreate", getGmtCreate())
+            .append("gmtUpdate", getGmtUpdate())
+            .append("deleteFlag", getDeleteFlag())
+            .toString();
+    }
+}

+ 13 - 0
unimall-data/src/main/java/com/iotechn/unimall/data/mapper/LikeCollectionInfoMapper.java

@@ -0,0 +1,13 @@
+package com.iotechn.unimall.data.mapper;
+
+import com.iotechn.unimall.data.domain.LikeCollectionInfo;
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+/**
+ * 记录点赞收藏信息Mapper接口
+ * 
+ * @author jlb
+ * @date 2023-06-08
+ */
+public interface LikeCollectionInfoMapper extends BaseMapper<LikeCollectionInfo>{
+
+}

+ 9 - 0
unimall-data/src/main/resources/com/iotechn/unimall/data/mapper/LikeCollectionInfoMapper.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.iotechn.unimall.data.mapper.LikeCollectionInfoMapper">
+    
+
+
+</mapper>