mirror of
https://github.com/zongzibinbin/MallChat.git
synced 2026-03-14 06:03:42 +08:00
fix:1.优化表情包功能
2.优化oss存储路径 3.删除兼容历史代码
This commit is contained in:
@@ -22,7 +22,7 @@ public enum MessageTypeEnum {
|
||||
FILE(4, "文件"),
|
||||
SOUND(5, "语音"),
|
||||
VIDEO(6, "视频"),
|
||||
EMOJIS(7, "表情"),
|
||||
EMOJI(7, "表情"),
|
||||
;
|
||||
|
||||
private final Integer type;
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.abin.mallchat.common.common.domain.vo.request;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author zhongzb create on 2021/05/31
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class IdReqVO {
|
||||
@ApiModelProperty("id")
|
||||
@NotNull
|
||||
private long id;
|
||||
}
|
||||
@@ -136,8 +136,8 @@ public class MinIOTemplate {
|
||||
String uid = Optional.ofNullable(req.getUid()).map(String::valueOf).orElse("000000");
|
||||
cn.hutool.core.lang.UUID uuid = cn.hutool.core.lang.UUID.fastUUID();
|
||||
String suffix = FileNameUtil.getSuffix(req.getFileName());
|
||||
String year = DateUtil.format(new Date(), DatePattern.NORM_YEAR_PATTERN);
|
||||
return req.getFilePath() + StrUtil.SLASH + year + StrUtil.SLASH + uid + StrUtil.SLASH + uuid + StrUtil.DOT + suffix;
|
||||
String yearAndMonth = DateUtil.format(new Date(), DatePattern.NORM_MONTH_PATTERN);
|
||||
return req.getFilePath() + StrUtil.SLASH + yearAndMonth + StrUtil.SLASH + uid + StrUtil.SLASH + uuid + StrUtil.DOT + suffix;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.abin.mallchat.common.user.dao;
|
||||
|
||||
import com.abin.mallchat.common.user.domain.entity.UserEmoji;
|
||||
import com.abin.mallchat.common.user.mapper.UserEmojiMapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户表情包 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||
* @since 2023-07-09
|
||||
*/
|
||||
@Service
|
||||
public class UserEmojiDao extends ServiceImpl<UserEmojiMapper, UserEmoji> {
|
||||
|
||||
public List<UserEmoji> listByUid(Long uid) {
|
||||
return lambdaQuery().eq(UserEmoji::getUid, uid).list();
|
||||
}
|
||||
|
||||
public int countByUid(Long uid) {
|
||||
return lambdaQuery().eq(UserEmoji::getUid, uid).count();
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,28 @@
|
||||
package com.abin.mallchat.common.chat.domain.entity;
|
||||
package com.abin.mallchat.common.user.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.*;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户表情包
|
||||
* </p>
|
||||
*
|
||||
* @author: WuShiJie
|
||||
* @createTime: 2023/7/2 22:00
|
||||
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||
* @since 2023-07-09
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "user_emojis")
|
||||
public class UserEmojis implements Serializable {
|
||||
private static final long serialVersionUID = -7690290707154737263L;
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("user_emoji")
|
||||
public class UserEmoji implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
@@ -27,17 +33,22 @@ public class UserEmojis implements Serializable {
|
||||
/**
|
||||
* 用户表ID
|
||||
*/
|
||||
@TableField(value = "uid")
|
||||
@TableField("uid")
|
||||
private Long uid;
|
||||
|
||||
|
||||
/**
|
||||
* 表情地址
|
||||
*/
|
||||
@NotNull
|
||||
@TableField(value = "expression_url")
|
||||
@TableField("expression_url")
|
||||
private String expressionUrl;
|
||||
|
||||
/**
|
||||
* 逻辑删除(0-正常,1-删除)
|
||||
*/
|
||||
@TableField("delete_status")
|
||||
@TableLogic(value = "0", delval = "1")
|
||||
private Integer deleteStatus;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@@ -50,9 +61,5 @@ public class UserEmojis implements Serializable {
|
||||
@TableField("update_time")
|
||||
private Date updateTime;
|
||||
|
||||
@TableField(value = "delete_status")
|
||||
@TableLogic(value = "0",delval = "1")
|
||||
private Integer deleteStatus;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.abin.mallchat.common.user.mapper;
|
||||
|
||||
import com.abin.mallchat.common.user.domain.entity.UserEmoji;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户表情包 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||
* @since 2023-07-09
|
||||
*/
|
||||
public interface UserEmojiMapper extends BaseMapper<UserEmoji> {
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.abin.mallchat.common.user.mapper;
|
||||
|
||||
import com.abin.mallchat.common.chat.domain.entity.UserEmojis;
|
||||
import com.abin.mallchat.common.user.domain.entity.UserEmoji;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
@@ -9,5 +9,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
* @author: WuShiJie
|
||||
* @createTime: 2023/7/3 14:24
|
||||
*/
|
||||
public interface UserEmojisMapper extends BaseMapper<UserEmojis> {
|
||||
public interface UserEmojisMapper extends BaseMapper<UserEmoji> {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?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.abin.mallchat.common.user.mapper.UserEmojiMapper">
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user