Commit b2c05067 authored by gaia's avatar gaia

Merge remote-tracking branch 'origin/quanku_0930' into release_pre_20230926104638

parents d509817b 69441bb2
......@@ -65,6 +65,19 @@ public class ElasticsearchUtilTest {
}
@Test
public void findByRange() {
EsSearchRequestDto esSearchRequestDto = new EsSearchRequestDto();
esSearchRequestDto.setPage(1);
esSearchRequestDto.setSize(40);
esSearchRequestDto.setIdStart(100L);
esSearchRequestDto.setIdEnd(110L);
EsPageInfo esPageInfo = itemEsDao.findByRange(esSearchRequestDto);
logger.info("esPageInfo = {}", esPageInfo);
}
@Test
public void getCuewords() {
EsSearchRequestDto esSearchRequestDto = new EsSearchRequestDto();
......
......@@ -31,4 +31,7 @@ public interface CommConsts {
* 上传微信小程序码目录
*/
public static final String UPLOAD_PRE_WXACODE_DIRECTORY = "quanku/wxacode/";
}
package com.wwdz.ch.core.consts;
public class FollowFansEnum {
public enum RelationEnum {
NO_FOLLOWED(0, "未关注"),
FOLLOWED(1, "已关注"),
BOTH_FOLLOWED(2, "互相关注"),
BACK_FOLLOWED(3, "回关"),
SELF(4, "本人"),
;
private int code;
private String des;
RelationEnum(int code, String des) {
this.code = code;
this.des = des;
}
public static String getNameByCode(int code) {
for (FollowFansEnum.RelationEnum relationEnum : FollowFansEnum.RelationEnum.values()) {
if (code == relationEnum.getCode()) {
return relationEnum.getDes();
}
}
return null;
}
public int getCode() {
return code;
}
public String getDes() {
return des;
}
}
}
package com.wwdz.ch.core.consts;
public class MessageEnum {
public enum StateEnum {
UNREAD(0, "未读"),
READED(1, "已读"),
DELETED(2, "删除"),
;
private int code;
private String des;
StateEnum(int code, String des) {
this.code = code;
this.des = des;
}
public static String getNameByCode(int code) {
for (StateEnum stateEnum : StateEnum.values()) {
if (code == stateEnum.getCode()) {
return stateEnum.getDes();
}
}
return null;
}
public int getCode() {
return code;
}
public String getDes() {
return des;
}
}
public enum TypeEnum {
SYSTEM(0, "系统信息"),
SHARE(1, "分享信息"),
COLLECT(2, "收藏信息"),
FOLLOW(3, "关注信息"),
;
private int code;
private String des;
TypeEnum(int code, String des) {
this.code = code;
this.des = des;
}
public static String getNameByCode(int code) {
for (TypeEnum typeEnum : TypeEnum.values()) {
if (code == typeEnum.getCode()) {
return typeEnum.getDes();
}
}
return null;
}
public int getCode() {
return code;
}
public String getDes() {
return des;
}
}
public enum ContentIdTypeEnum {
ITEM(0, "商品"),
COLLECTION_BOOK(1, "收藏册"),
USERID(2, "用户id"),
;
private int code;
private String des;
ContentIdTypeEnum(int code, String des) {
this.code = code;
this.des = des;
}
public static String getNameByCode(int code) {
for (ContentIdTypeEnum contentIdTypeEnum : ContentIdTypeEnum.values()) {
if (code == contentIdTypeEnum.getCode()) {
return contentIdTypeEnum.getDes();
}
}
return null;
}
public int getCode() {
return code;
}
public String getDes() {
return des;
}
}
public enum ContentTextEnum {
ITEM_SHARE(1, "分享了您的藏品"),
ITEM_COLLECT(2, "收藏了您的藏品"),
FAVORITES_SHARE(3, "分享了您的收藏册"),
FAVORITES_COLLECT(3, "收藏了您的收藏册"),
;
private int code;
private String des;
ContentTextEnum(int code, String des) {
this.code = code;
this.des = des;
}
public static String getNameByCode(int code) {
for (ContentTextEnum contentTextEnum : ContentTextEnum.values()) {
if (code == contentTextEnum.getCode()) {
return contentTextEnum.getDes();
}
}
return null;
}
public int getCode() {
return code;
}
public String getDes() {
return des;
}
}
}
package com.wwdz.ch.core.consts;
public enum ViewPermissionEnum {
ALL(0, "所有人"),
ONLY_ONESELF(1, "仅自己"),
;
private int code;
private String des;
ViewPermissionEnum(int code, String des) {
this.code = code;
this.des = des;
}
public static String getNameByCode(int code) {
for (ViewPermissionEnum viewPermissionEnum : ViewPermissionEnum.values()) {
if (code == viewPermissionEnum.getCode()) {
return viewPermissionEnum.getDes();
}
}
return null;
}
public int getCode() {
return code;
}
public String getDes() {
return des;
}
}
......@@ -3,6 +3,7 @@ package com.wwdz.ch.core.util;
import com.github.benmanes.caffeine.cache.AsyncLoadingCache;
import com.github.benmanes.caffeine.cache.Caffeine;
import com.wwdz.ch.db.dao.CategoryDao;
import com.wwdz.ch.db.dao.UserDao;
import com.wwdz.ch.db.dao.dts.DtsAdminDao;
import com.wwdz.ch.db.dao.dts.DtsUserDao;
import com.wwdz.ch.db.domain.Admin;
......@@ -12,10 +13,12 @@ import com.wwdz.ch.db.dto.request.CategorySearchRequestDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java.util.stream.Collectors;
@Component
......@@ -30,6 +33,9 @@ public class CacheUtil {
@Autowired
CategoryDao categoryDao;
@Autowired
UserDao userDao;
public String getAppletUserNameById(long key) {
try {
......@@ -40,6 +46,17 @@ public class CacheUtil {
return null;
}
public User getAppletUserById(long key) {
try {
return appletUserInfoCache.get(key).get(3, TimeUnit.SECONDS);
} catch (Exception e) {
e.printStackTrace();
}
return new User();
}
public String getSystemUserNameById(int key) {
try {
return systemUserCache.get(key).get(5, TimeUnit.SECONDS);
......@@ -59,6 +76,15 @@ public class CacheUtil {
.buildAsync(k -> getAppletUserList(k));
/**
* 小程序会员缓存
*/
public AsyncLoadingCache<Long, User> appletUserInfoCache = Caffeine.newBuilder()
.maximumSize(5000)
.expireAfterWrite(30, TimeUnit.MINUTES)
.buildAsync(k -> getAppletUsers(k));
/**
* 后台用户缓存
*/
......@@ -80,6 +106,17 @@ public class CacheUtil {
}
/**
* 查询小程序会员
* @return
*/
public User getAppletUsers(long key) {
List<User> userList = dtsUserDao.findAll();
Map<Long, User> map = userList.stream().collect(Collectors.toMap(User::getId, Function.identity(), (k1, k2) -> k2));
return map.get(key);
}
/**
* 查询后台用户
*
......
......@@ -74,5 +74,20 @@ public class DateTimeUtil {
}
/**
* 判断是否是当前的日期
* @param date
* @param pattern
* @return
*/
public static boolean isThisTime(Date date, String pattern) {
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
String param = sdf.format(date);
String now = sdf.format(new Date());
if (param.equals(now)) {
return true;
}
return false;
}
}
......@@ -139,6 +139,55 @@ public class MediaUtil {
return map;
}
/**
* 通过文件头判断图片格式
*
* @param inputStream
* @return
* @throws IOException
*/
public static String imgType(InputStream inputStream) throws IOException {
// 读取文件前几位
byte[] fileHeader = new byte[4];
int read = inputStream.read(fileHeader, 0, fileHeader.length);
inputStream.close();
// 转为十六进制字符串
String header = bytes2Hex(fileHeader);
if (header.contains("FFD8FF")) {
return "jpg";
} else if (header.contains("89504E47")) {
return "png";
} else if (header.contains("47494638")) {
return "gif";
} else if (header.contains("424D")) {
return "bmp";
} else if (header.contains("52494646")) {
return "webp";
} else if (header.contains("49492A00")) {
return "tif";
} else {
return "unknown";
}
}
/**
* 转为十六进制字符串
*
* @param bytes
* @return
*/
public static String bytes2Hex(byte[] bytes) {
StringBuilder sb = new StringBuilder();
for (byte b : bytes) {
String hex = Integer.toHexString(b & 0xff);
sb.append(hex.length() == 2 ? hex : ("0" + hex));
}
return sb.toString();
}
public static void main(String[] args) {
String vedioUrl = "https://cdn.wanwudezhi.com/static/web-static/video/53596700878a572ca4fae35243aaa819.mp4";
String url = getImageByCutVedio(vedioUrl);
......
......@@ -127,4 +127,9 @@ public class ItemOfEs implements Entity {
* 原始额外信息
*/
private String originalExtra;
/**
* 查看权限(0所有人,1仅自己可见)
*/
private Integer viewPermission;
}
......@@ -5,7 +5,6 @@ import com.wwdz.ch.db.domain.FavoritesItemsRelation;
import com.wwdz.ch.db.dto.FavoritesItemsDto;
import java.util.List;
import java.util.Map;
public interface FavoritesItemsRelationDao {
/**
......@@ -77,7 +76,7 @@ public interface FavoritesItemsRelationDao {
* @param size
* @return
*/
PageInfo<FavoritesItemsRelation> pageByFavoritesId(Long favoritesId, int page, int size);
PageInfo<FavoritesItemsRelation> pageByFavoritesId(Long favoritesId, List<Long> onlyOneselfItemIds, int page, int size);
/**
* 通过用户id分页查询
......@@ -88,7 +87,7 @@ public interface FavoritesItemsRelationDao {
* @param type
* @return
*/
PageInfo<FavoritesItemsRelation> pageByUserId(Long userId, Integer type, int page, int size);
PageInfo<FavoritesItemsRelation> pageByUserId(Long userId, List<Long> itemIds, Integer type, int page, int size);
/**
* 通过藏品id统计记录数
......@@ -98,6 +97,14 @@ public interface FavoritesItemsRelationDao {
*/
long countByItemId(Long itemId);
/**
* 通过藏品id列表统计记录数
*
* @param itemIds
* @return
*/
long countByItemIds(List<Long> itemIds);
/**
* 判断是否已经存在用户id和藏品id对应的记录
*
......@@ -121,14 +128,7 @@ public interface FavoritesItemsRelationDao {
* @param userId
* @return
*/
long countByUserId(Long userId);
/**
* 通过藏品id分组统计记录数量最多的20条记录
*
* @return
*/
List<Map<String, Object>> findItemIdByCount();
long countByUserId(Long userId, List<Long> itemIds);
/**
* 连表查询获取藏品的图片
......@@ -136,7 +136,7 @@ public interface FavoritesItemsRelationDao {
* @param favoritesId
* @return
*/
List<FavoritesItemsDto> queryItemImages(Long favoritesId);
List<FavoritesItemsDto> queryItemImages(Long favoritesId, List<Long> onlyOneselfItemIds);
/**
* 更新收藏册id
......
package com.wwdz.ch.db.dao;
import com.wwdz.ch.db.domain.FollowFansRecord;
import com.wwdz.ch.db.dto.request.FollowFansRecordRequestDto;
import java.util.List;
public interface FollowFansRecordDao {
int add(FollowFansRecord record);
/**
* 取消关注
* 根据关注记录的id来删除
* @param record
* @return
*/
boolean delete(FollowFansRecord record);
/**
* 取消关注
* @param fansId
* @param followerId
* @return
*/
boolean delete(long fansId, long followerId);
List<FollowFansRecord> findList(FollowFansRecordRequestDto dto);
FollowFansRecord findOne(FollowFansRecordRequestDto dto);
/**
* 统计关注的人数
* @param id
* @return
*/
long countFollowers(long id);
/**
* 统计粉丝的人数
* @param id
* @return
*/
long countFans(long id);
}
......@@ -32,6 +32,15 @@ public interface FootPrintDao {
*/
long countByUserId(Long userId);
/**
* 通过藏品id列表统计记录数
*
* @param itemId
* @param itemIds
* @return
*/
long countByItemIds(Long userId, Long itemId, List<Long> itemIds);
/**
* 批量删除记录
*
......
......@@ -124,11 +124,5 @@ public interface ItemDao {
*/
List<Item> findListWithImages(CoinRequestDto coinRequestDto);
/**
* 商品名称联想,返回16条
*
* @param coinRequestDto
* @return
*/
List<String> findNames(CoinRequestDto coinRequestDto);
List<Long> findOnlyOneselfItems(Long userId);
}
package com.wwdz.ch.db.dao;
import com.wwdz.ch.db.domain.ItemsOfficialUsersRelation;
public interface ItemsOfficialUsersRelationDao {
ItemsOfficialUsersRelation findUser(Long itemId);
ItemsOfficialUsersRelation findItems(Long user);
}
package com.wwdz.ch.db.dao;
import com.wwdz.ch.db.domain.MessageContent;
import com.wwdz.ch.db.dto.MessageContentRequestDto;
import java.util.List;
public interface MessageContentDao {
int add(MessageContent messageContent);
/**
* 查询消息列表
* @param dto
* @return
*/
List<MessageContent> findList(MessageContentRequestDto dto);
List<MessageContent> findListByIds(List<Integer> idList);
}
package com.wwdz.ch.db.dao;
import com.wwdz.ch.db.domain.MessageRecord;
import com.wwdz.ch.db.dto.MessageRecordRequestDto;
import java.util.List;
public interface MessageRecordDao {
int add(MessageRecord messageRecord);
/**
* 统计消息数量
* @param dto
* @return
*/
long count(MessageRecordRequestDto dto);
/**
* 查询消息列表
* @param dto
* @return
*/
List<MessageRecord> findList(MessageRecordRequestDto dto);
boolean update(MessageRecord record);
}
package com.wwdz.ch.db.dao;
import com.wwdz.ch.db.domain.UserCollectBrowseNum;
public interface UserCollectBrowseNumDao {
UserCollectBrowseNum findByUserId(Long userId);
int insert(UserCollectBrowseNum record);
int update(UserCollectBrowseNum record);
}
package com.wwdz.ch.db.domain;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import com.xxdxxs.entity.Entity;
import lombok.Data;
/**
* @author shiyu
* @date 2023/09/15
*/
@Data
public class FollowFansRecord implements Entity {
private Integer id;
/**
* 粉丝id
*/
private Long fansId;
/**
* 被关注者id
*/
private Long followerId;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 状态
*/
private Integer state;
private static final long serialVersionUID = 1L;
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", fansId=").append(fansId);
sb.append(", followerId=").append(followerId);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", state=").append(state);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
FollowFansRecord other = (FollowFansRecord) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getFansId() == null ? other.getFansId() == null : this.getFansId().equals(other.getFansId()))
&& (this.getFollowerId() == null ? other.getFollowerId() == null : this.getFollowerId().equals(other.getFollowerId()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getFansId() == null) ? 0 : getFansId().hashCode());
result = prime * result + ((getFollowerId() == null) ? 0 : getFollowerId().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
return result;
}
/**
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public enum Column {
id("id", "id", "INTEGER", false),
fansId("fans_id", "fansId", "BIGINT", false),
followerId("follower_id", "followerId", "BIGINT", false),
createTime("create_time", "createTime", "TIMESTAMP", false),
updateTime("update_time", "updateTime", "TIMESTAMP", false),
state("state", "state", "INTEGER", true);
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String BEGINNING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String ENDING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String column;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final boolean isColumnNameDelimited;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String javaProperty;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String jdbcType;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String value() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getValue() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJavaProperty() {
return this.javaProperty;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJdbcType() {
return this.jdbcType;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
}
}
\ No newline at end of file
package com.wwdz.ch.db.domain;
import java.io.Serializable;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import com.xxdxxs.entity.Entity;
import lombok.Data;
/**
* @author shiyu
* @date 2023/08/28
* @date 2023/09/15
*/
@Data
public class Item implements Entity {
......@@ -106,6 +105,11 @@ public class Item implements Entity {
*/
private Integer kind;
/**
* 查看权限(0所有人,1仅自己可见)
*/
private Integer viewPermission;
/**
* 商品额外信息
*/
......@@ -158,6 +162,7 @@ public class Item implements Entity {
sb.append(", originalSourceUrl=").append(originalSourceUrl);
sb.append(", source=").append(source);
sb.append(", kind=").append(kind);
sb.append(", viewPermission=").append(viewPermission);
sb.append(", extra=").append(extra);
sb.append(", images=").append(images);
sb.append(", videos=").append(videos);
......@@ -199,6 +204,7 @@ public class Item implements Entity {
&& (this.getOriginalSourceUrl() == null ? other.getOriginalSourceUrl() == null : this.getOriginalSourceUrl().equals(other.getOriginalSourceUrl()))
&& (this.getSource() == null ? other.getSource() == null : this.getSource().equals(other.getSource()))
&& (this.getKind() == null ? other.getKind() == null : this.getKind().equals(other.getKind()))
&& (this.getViewPermission() == null ? other.getViewPermission() == null : this.getViewPermission().equals(other.getViewPermission()))
&& (this.getExtra() == null ? other.getExtra() == null : this.getExtra().equals(other.getExtra()))
&& (this.getImages() == null ? other.getImages() == null : this.getImages().equals(other.getImages()))
&& (this.getVideos() == null ? other.getVideos() == null : this.getVideos().equals(other.getVideos()))
......@@ -229,6 +235,7 @@ public class Item implements Entity {
result = prime * result + ((getOriginalSourceUrl() == null) ? 0 : getOriginalSourceUrl().hashCode());
result = prime * result + ((getSource() == null) ? 0 : getSource().hashCode());
result = prime * result + ((getKind() == null) ? 0 : getKind().hashCode());
result = prime * result + ((getViewPermission() == null) ? 0 : getViewPermission().hashCode());
result = prime * result + ((getExtra() == null) ? 0 : getExtra().hashCode());
result = prime * result + ((getImages() == null) ? 0 : getImages().hashCode());
result = prime * result + ((getVideos() == null) ? 0 : getVideos().hashCode());
......@@ -264,6 +271,7 @@ public class Item implements Entity {
originalSourceUrl("original_source_url", "originalSourceUrl", "VARCHAR", false),
source("source", "source", "INTEGER", true),
kind("kind", "kind", "INTEGER", false),
viewPermission("view_permission", "viewPermission", "INTEGER", false),
extra("extra", "extra", "LONGVARCHAR", false),
images("images", "images", "LONGVARCHAR", false),
videos("videos", "videos", "LONGVARCHAR", false),
......
......@@ -2715,6 +2715,138 @@ public class ItemExample {
addCriterion("kind not between", value1, value2, "kind");
return (Criteria) this;
}
public Criteria andViewPermissionIsNull() {
addCriterion("view_permission is null");
return (Criteria) this;
}
public Criteria andViewPermissionIsNotNull() {
addCriterion("view_permission is not null");
return (Criteria) this;
}
public Criteria andViewPermissionEqualTo(Integer value) {
addCriterion("view_permission =", value, "viewPermission");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andViewPermissionEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("view_permission = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andViewPermissionNotEqualTo(Integer value) {
addCriterion("view_permission <>", value, "viewPermission");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andViewPermissionNotEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("view_permission <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andViewPermissionGreaterThan(Integer value) {
addCriterion("view_permission >", value, "viewPermission");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andViewPermissionGreaterThanColumn(Item.Column column) {
addCriterion(new StringBuilder("view_permission > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andViewPermissionGreaterThanOrEqualTo(Integer value) {
addCriterion("view_permission >=", value, "viewPermission");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andViewPermissionGreaterThanOrEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("view_permission >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andViewPermissionLessThan(Integer value) {
addCriterion("view_permission <", value, "viewPermission");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andViewPermissionLessThanColumn(Item.Column column) {
addCriterion(new StringBuilder("view_permission < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andViewPermissionLessThanOrEqualTo(Integer value) {
addCriterion("view_permission <=", value, "viewPermission");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andViewPermissionLessThanOrEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("view_permission <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andViewPermissionIn(List<Integer> values) {
addCriterion("view_permission in", values, "viewPermission");
return (Criteria) this;
}
public Criteria andViewPermissionNotIn(List<Integer> values) {
addCriterion("view_permission not in", values, "viewPermission");
return (Criteria) this;
}
public Criteria andViewPermissionBetween(Integer value1, Integer value2) {
addCriterion("view_permission between", value1, value2, "viewPermission");
return (Criteria) this;
}
public Criteria andViewPermissionNotBetween(Integer value1, Integer value2) {
addCriterion("view_permission not between", value1, value2, "viewPermission");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
......
package com.wwdz.ch.db.domain;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import lombok.Data;
/**
* @author shiyu
* @date 2023/09/15
*/
@Data
public class ItemsOfficialUsersRelation implements Serializable {
private Long beginItemId;
private Long endItemId;
private Long userId;
private static final long serialVersionUID = 1L;
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", beginItemId=").append(beginItemId);
sb.append(", endItemId=").append(endItemId);
sb.append(", userId=").append(userId);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
ItemsOfficialUsersRelation other = (ItemsOfficialUsersRelation) that;
return (this.getBeginItemId() == null ? other.getBeginItemId() == null : this.getBeginItemId().equals(other.getBeginItemId()))
&& (this.getEndItemId() == null ? other.getEndItemId() == null : this.getEndItemId().equals(other.getEndItemId()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getBeginItemId() == null) ? 0 : getBeginItemId().hashCode());
result = prime * result + ((getEndItemId() == null) ? 0 : getEndItemId().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
return result;
}
/**
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table items_official_users_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public enum Column {
beginItemId("begin_item_id", "beginItemId", "BIGINT", false),
endItemId("end_item_id", "endItemId", "BIGINT", false),
userId("user_id", "userId", "BIGINT", false);
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table items_official_users_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String BEGINNING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table items_official_users_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String ENDING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table items_official_users_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String column;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table items_official_users_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final boolean isColumnNameDelimited;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table items_official_users_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String javaProperty;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table items_official_users_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String jdbcType;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table items_official_users_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String value() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table items_official_users_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getValue() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table items_official_users_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJavaProperty() {
return this.javaProperty;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table items_official_users_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJdbcType() {
return this.jdbcType;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table items_official_users_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table items_official_users_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table items_official_users_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table items_official_users_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table items_official_users_relation
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
}
}
\ No newline at end of file
package com.wwdz.ch.db.domain;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import com.xxdxxs.entity.Entity;
import lombok.Data;
/**
* @author shiyu
* @date 2023/09/15
*/
@Data
public class MessageContent implements Entity {
private Integer id;
/**
* 发送者id
*/
private Long senderId;
/**
* 消息类型
*/
private Integer type;
/**
* 创建时间
*/
private Date createTime;
/**
* 消息内容
*/
private String content;
private static final long serialVersionUID = 1L;
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", senderId=").append(senderId);
sb.append(", type=").append(type);
sb.append(", createTime=").append(createTime);
sb.append(", content=").append(content);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
MessageContent other = (MessageContent) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getSenderId() == null ? other.getSenderId() == null : this.getSenderId().equals(other.getSenderId()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getSenderId() == null) ? 0 : getSenderId().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
return result;
}
/**
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public enum Column {
id("id", "id", "INTEGER", false),
senderId("sender_id", "senderId", "BIGINT", false),
type("type", "type", "INTEGER", true),
createTime("create_time", "createTime", "TIMESTAMP", false),
content("content", "content", "LONGVARCHAR", false);
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String BEGINNING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String ENDING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String column;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final boolean isColumnNameDelimited;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String javaProperty;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String jdbcType;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String value() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getValue() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJavaProperty() {
return this.javaProperty;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJdbcType() {
return this.jdbcType;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_content
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
package com.wwdz.ch.db.domain;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import lombok.Data;
/**
* @author shiyu
* @date 2023/09/22
*/
@Data
public class UserCollectBrowseNum implements Serializable {
private Integer id;
/**
* 用户id
*/
private Long userId;
/**
* 被收藏数
*/
private Integer collectNum;
/**
* 被浏览量
*/
private Integer browseNum;
/**
* 创建时间
*/
private Date addTime;
/**
* 更新时间
*/
private Date updateTime;
private static final long serialVersionUID = 1L;
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", userId=").append(userId);
sb.append(", collectNum=").append(collectNum);
sb.append(", browseNum=").append(browseNum);
sb.append(", addTime=").append(addTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
UserCollectBrowseNum other = (UserCollectBrowseNum) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getCollectNum() == null ? other.getCollectNum() == null : this.getCollectNum().equals(other.getCollectNum()))
&& (this.getBrowseNum() == null ? other.getBrowseNum() == null : this.getBrowseNum().equals(other.getBrowseNum()))
&& (this.getAddTime() == null ? other.getAddTime() == null : this.getAddTime().equals(other.getAddTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getCollectNum() == null) ? 0 : getCollectNum().hashCode());
result = prime * result + ((getBrowseNum() == null) ? 0 : getBrowseNum().hashCode());
result = prime * result + ((getAddTime() == null) ? 0 : getAddTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
return result;
}
/**
* This enum was generated by MyBatis Generator.
* This enum corresponds to the database table user_collect_browse_num
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public enum Column {
id("id", "id", "INTEGER", false),
userId("user_id", "userId", "BIGINT", false),
collectNum("collect_num", "collectNum", "INTEGER", false),
browseNum("browse_num", "browseNum", "INTEGER", false),
addTime("add_time", "addTime", "TIMESTAMP", false),
updateTime("update_time", "updateTime", "TIMESTAMP", false);
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table user_collect_browse_num
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String BEGINNING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table user_collect_browse_num
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private static final String ENDING_DELIMITER = "`";
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table user_collect_browse_num
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String column;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table user_collect_browse_num
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final boolean isColumnNameDelimited;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table user_collect_browse_num
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String javaProperty;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table user_collect_browse_num
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
private final String jdbcType;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_collect_browse_num
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String value() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_collect_browse_num
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getValue() {
return this.column;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_collect_browse_num
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJavaProperty() {
return this.javaProperty;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_collect_browse_num
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getJdbcType() {
return this.jdbcType;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_collect_browse_num
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
this.column = column;
this.javaProperty = javaProperty;
this.jdbcType = jdbcType;
this.isColumnNameDelimited = isColumnNameDelimited;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_collect_browse_num
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String desc() {
return this.getEscapedColumnName() + " DESC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_collect_browse_num
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String asc() {
return this.getEscapedColumnName() + " ASC";
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_collect_browse_num
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public static Column[] excludes(Column ... excludes) {
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
if (excludes != null && excludes.length > 0) {
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
}
return columns.toArray(new Column[]{});
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_collect_browse_num
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public String getEscapedColumnName() {
if (this.isColumnNameDelimited) {
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
} else {
return this.column;
}
}
}
}
\ No newline at end of file
package com.wwdz.ch.db.dto;
import com.wwdz.ch.db.dto.request.BaseRequestDto;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.Date;
@Data
public class MessageContentRequestDto extends BaseRequestDto implements Entity {
private Integer id;
/**
* 发送者id
*/
private Long senderId;
/**
* 消息类型
*/
private Integer type;
/**
* 创建时间
*/
private Date createTime;
/**
* 消息内容
*/
private String content;
}
package com.wwdz.ch.db.dto;
import com.wwdz.ch.db.dto.request.BaseRequestDto;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.Date;
@Data
public class MessageRecordRequestDto extends BaseRequestDto implements Entity {
private Integer id;
/**
* 接收者id
*/
private Long receiverId;
/**
* 对应消息id
*/
private Integer messageId;
/**
* 消息状态
*/
private Integer state;
/**
* 消息类型
*/
private Integer type;
/**
* 被排除的消息状态
*/
private Integer excluedState;
/**
* 重试次数
*/
private Integer tryNum;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
}
......@@ -108,4 +108,8 @@ public class CoinRequestDto extends BaseRequestDto implements Entity {
*/
private Integer state;
// 是否是客态
private Boolean isGuest;
// 查看权限(0所有人,1仅自己可见)
private Integer viewPermission;
}
......@@ -12,6 +12,8 @@ public class EsSearchRequestDto implements Entity {
private Map<String, String> paramMap;
private String content;
private Long idStart;
private Long idEnd;
private List<String> includes;
private String sortField;
private Boolean isDesc = true;
......
......@@ -30,4 +30,6 @@ public class FavoritesRequestDto implements Entity {
// 收藏册id列表
private List<Long> ids;
// 藏品id列表
private List<Long> itemIds;
}
package com.wwdz.ch.db.dto.request;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.Date;
@Data
public class FollowFansRecordRequestDto extends BaseRequestDto implements Entity {
private Integer id;
/**
* 被查询对象的id
*/
private Long searchTargetId;
/**
* 粉丝id
*/
private Long fansId;
/**
* 被关注者id
*/
private Long followerId;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 状态
*/
private Integer state;
/**
* 当前查看的用户id
* 进入别人的主页时需要传
*/
private Long currentUserId;
}
......@@ -145,6 +145,7 @@ public class CategoryDaoImpl implements CategoryDao {
}
@Override
public List<Category> findByPage(CategorySearchRequestDto dto) {
CategoryExample example = new CategoryExample();
......
......@@ -6,6 +6,7 @@ import com.wwdz.ch.db.dao.FootPrintDao;
import com.wwdz.ch.db.domain.Footprint;
import com.wwdz.ch.db.domain.FootprintExample;
import com.wwdz.ch.db.mapper.FootprintMapper;
import com.xxdxxs.db.component.JdbcHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
......@@ -56,6 +57,18 @@ public class FootPrintDaoImpl implements FootPrintDao {
return footprintMapper.countByExample(example);
}
@Override
public long countByItemIds(Long userId, Long itemId, List<Long> itemIds) {
FootprintExample example = new FootprintExample();
FootprintExample.Criteria criteria = example.createCriteria();
JdbcHelper.ifPresent(itemId, criteria::andItemIdEqualTo);
JdbcHelper.ifPresent(itemIds, criteria::andItemIdIn);
JdbcHelper.ifPresent(userId, criteria::andUserIdNotEqualTo);
criteria.andDeletedEqualTo(false);
return footprintMapper.countByExample(example);
}
@Override
public int delete(List<Long> ids) {
FootprintExample example = new FootprintExample();
......
package com.wwdz.ch.db.impl;
import com.wwdz.ch.db.dao.ItemsOfficialUsersRelationDao;
import com.wwdz.ch.db.domain.ItemsOfficialUsersRelation;
import com.wwdz.ch.db.domain.ItemsOfficialUsersRelationExample;
import com.wwdz.ch.db.mapper.ItemsOfficialUsersRelationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class ItemsOfficialUsersRelationDaoImpl implements ItemsOfficialUsersRelationDao {
@Autowired
private ItemsOfficialUsersRelationMapper itemsOfficialUsersRelationMapper;
@Override
public ItemsOfficialUsersRelation findUser(Long itemId) {
ItemsOfficialUsersRelationExample example = new ItemsOfficialUsersRelationExample();
ItemsOfficialUsersRelationExample.Criteria criteria = example.createCriteria();
criteria.andBeginItemIdLessThanOrEqualTo(itemId);
criteria.andEndItemIdGreaterThanOrEqualTo(itemId);
return itemsOfficialUsersRelationMapper.selectOneByExample(example);
}
@Override
public ItemsOfficialUsersRelation findItems(Long userId) {
ItemsOfficialUsersRelationExample example = new ItemsOfficialUsersRelationExample();
ItemsOfficialUsersRelationExample.Criteria criteria = example.createCriteria();
criteria.andUserIdEqualTo(userId);
return itemsOfficialUsersRelationMapper.selectOneByExample(example);
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment