1.取消消息标记的对立状态

2.优化ai消息排序
This commit is contained in:
乾乾
2025-05-10 08:55:02 +08:00
parent 1bf38bba91
commit 7ad2c12b2c
5 changed files with 26 additions and 25 deletions

View File

@@ -14,11 +14,12 @@ public class AngryStrategy extends AbstractMsgMarkStrategy {
return MessageMarkTypeEnum.ANGRY;
}
@Override
public void doMark(Long uid, Long msgId) {
super.doMark(uid, msgId);
// 标记愤怒时清除正向表情
MsgMarkFactory.getStrategyNoNull(MessageMarkTypeEnum.LIKE.getType()).unMark(uid, msgId);
MsgMarkFactory.getStrategyNoNull(MessageMarkTypeEnum.HEART.getType()).unMark(uid, msgId);
}
// @Override
// public void doMark(Long uid, Long msgId) {
// super.doMark(uid, msgId);
// // 标记愤怒时清除正向表情
// MsgMarkFactory.getStrategyNoNull(MessageMarkTypeEnum.LIKE.getType()).unMark(uid, msgId);
// MsgMarkFactory.getStrategyNoNull(MessageMarkTypeEnum.HEART.getType()).unMark(uid, msgId);
// MsgMarkFactory.getStrategyNoNull(MessageMarkTypeEnum.MONEY.getType()).unMark(uid, msgId);
// }
}

View File

@@ -4,7 +4,7 @@ import com.hula.core.chat.domain.enums.MessageMarkTypeEnum;
import org.springframework.stereotype.Component;
/**
* 点踩标记策略类
* 不满标记策略类
* @author nyh
*/
@Component

View File

@@ -18,7 +18,8 @@ public class LikeStrategy extends AbstractMsgMarkStrategy {
@Override
public void doMark(Long uid, Long msgId) {
super.doMark(uid, msgId);
//同时取消点踩的动作
//同时取消不满的动作
MsgMarkFactory.getStrategyNoNull(MessageMarkTypeEnum.DISLIKE.getType()).unMark(uid, msgId);
// MsgMarkFactory.getStrategyNoNull(MessageMarkTypeEnum.BOMB.getType()).unMark(uid, msgId);
}
}

View File

@@ -14,12 +14,12 @@ public class MoneyStrategy extends AbstractMsgMarkStrategy {
return MessageMarkTypeEnum.MONEY;
}
@Override
public void doMark(Long uid, Long msgId) {
super.doMark(uid, msgId);
// 打赏时清除所有负面标记
MsgMarkFactory.getStrategyNoNull(MessageMarkTypeEnum.BOMB.getType()).unMark(uid, msgId);
MsgMarkFactory.getStrategyNoNull(MessageMarkTypeEnum.DISLIKE.getType()).unMark(uid, msgId);
MsgMarkFactory.getStrategyNoNull(MessageMarkTypeEnum.ANGRY.getType()).unMark(uid, msgId);
}
// @Override
// public void doMark(Long uid, Long msgId) {
// super.doMark(uid, msgId);
// // 打赏时清除所有负面标记
// MsgMarkFactory.getStrategyNoNull(MessageMarkTypeEnum.BOMB.getType()).unMark(uid, msgId);
// MsgMarkFactory.getStrategyNoNull(MessageMarkTypeEnum.DISLIKE.getType()).unMark(uid, msgId);
// MsgMarkFactory.getStrategyNoNull(MessageMarkTypeEnum.ANGRY.getType()).unMark(uid, msgId);
// }
}

View File

@@ -35,23 +35,22 @@
left join ai_gpt_chat t1 on t.chat_id = t1.id
<where>
t.is_del = 0
<!-- <if test="q.id != null and q.id != ''"> and t.id = #{q.id} </if>-->
<if test="q.chatId != null"> and t1.id = #{q.chatId}</if>
<if test="q.chatNumber != null"> and t1.chat_number = #{q.chatNumber}</if>
<!-- <if test="q.userId != null and q.userId != ''"> and t1.user_id = #{q.userId}</if>-->
<if test="q.messageId != null"> and t.message_id = #{q.messageId}</if>
<if test="q.model != null and q.model != ''"> and t.model = #{q.model}</if>
<if test="q.role != null and q.role != ''"> and t.role = #{q.role}</if>
<if test="q.appKey != null and q.appKey != ''"> and t.app_key = #{q.appKey}</if>
<if test="q.finishReason != null and q.finishReason != ''"> and t.finish_reason = #{q.finishReason}</if>
<if test="q.status != null"> and t.status = #{q.status}</if>
<if test="q.size != null and q.size > 0">
LIMIT #{q.size}
<if test="q.current != null and q.current > 0">
OFFSET #{q.offset}
</if>
</if>
</where>
order by t.created_time desc
<if test="q.size != null and q.size > 0">
LIMIT #{q.size}
<if test="q.current != null and q.current > 0">
OFFSET #{q.offset}
</if>
</if>
</sql>
<select id="pageChatMessage" resultType="com.hula.ai.gpt.pojo.vo.ChatMessageVO">