mirror of
https://github.com/zongzibinbin/MallChat.git
synced 2026-03-13 21:53:41 +08:00
新增表情包功能
This commit is contained in:
@@ -5,6 +5,7 @@ import com.abin.mallchat.common.common.annotation.RedissonLock;
|
|||||||
import com.abin.mallchat.common.common.domain.vo.request.CursorPageBaseReq;
|
import com.abin.mallchat.common.common.domain.vo.request.CursorPageBaseReq;
|
||||||
import com.abin.mallchat.common.common.domain.vo.response.ApiResult;
|
import com.abin.mallchat.common.common.domain.vo.response.ApiResult;
|
||||||
import com.abin.mallchat.common.common.domain.vo.response.CursorPageBaseResp;
|
import com.abin.mallchat.common.common.domain.vo.response.CursorPageBaseResp;
|
||||||
|
import com.abin.mallchat.common.common.utils.AssertUtil;
|
||||||
import com.abin.mallchat.common.common.utils.CursorUtils;
|
import com.abin.mallchat.common.common.utils.CursorUtils;
|
||||||
import com.abin.mallchat.common.common.utils.RequestHolder;
|
import com.abin.mallchat.common.common.utils.RequestHolder;
|
||||||
import com.abin.mallchat.common.user.mapper.UserEmojisMapper;
|
import com.abin.mallchat.common.user.mapper.UserEmojisMapper;
|
||||||
@@ -66,15 +67,11 @@ public class UserEmojisServiceImpl extends ServiceImpl<UserEmojisMapper, UserEmo
|
|||||||
LambdaQueryWrapper<UserEmojis> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<UserEmojis> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(UserEmojis::getUid,uid);
|
queryWrapper.eq(UserEmojis::getUid,uid);
|
||||||
int count = this.count(queryWrapper);
|
int count = this.count(queryWrapper);
|
||||||
if (count>30){
|
AssertUtil.isFalse(count>30, "最多只能添加30个表情哦~~");
|
||||||
return ApiResult.fail(-1,"最多只能添加30个表情");
|
|
||||||
}
|
|
||||||
//校验表情是否存在
|
//校验表情是否存在
|
||||||
queryWrapper.eq(UserEmojis::getExpressionUrl,emojis.getExpressionUrl());
|
queryWrapper.eq(UserEmojis::getExpressionUrl,emojis.getExpressionUrl());
|
||||||
count = this.count(queryWrapper);
|
count = this.count(queryWrapper);
|
||||||
if (count >0){
|
AssertUtil.isFalse(count >0, "当前表情已存在哦~~");
|
||||||
return ApiResult.fail(-1,"当前表情已存在");
|
|
||||||
}
|
|
||||||
emojis.setUid(RequestHolder.get().getUid());
|
emojis.setUid(RequestHolder.get().getUid());
|
||||||
this.saveOrUpdate(emojis, queryWrapper);
|
this.saveOrUpdate(emojis, queryWrapper);
|
||||||
return ApiResult.success(emojis);
|
return ApiResult.success(emojis);
|
||||||
|
|||||||
Reference in New Issue
Block a user