init
This commit is contained in:
@@ -10,10 +10,8 @@ import com.ruoyi.cai.enums.GenderEnum;
|
||||
import com.ruoyi.cai.enums.ImTypeEnum;
|
||||
import com.ruoyi.cai.enums.SystemConfigEnum;
|
||||
import com.ruoyi.cai.enums.UserMemberTypeEnum;
|
||||
import com.ruoyi.cai.mapper.AccountMapper;
|
||||
import com.ruoyi.cai.service.*;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import org.apache.xmlbeans.impl.xb.xsdschema.UnionDocument;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -61,6 +59,7 @@ public class ImService {
|
||||
Account account = accountService.getByUserId(fromUserId);
|
||||
ImResp resp = new ImResp();
|
||||
resp.setCoin(account.getCoin()+ account.getIncomeCoin());
|
||||
resp.setContent(message.getContent());
|
||||
return resp;
|
||||
}
|
||||
Set<Long> systemCustomerService = systemConfigManager.getSystemConfigOfLongSet(SystemConfigEnum.SYSTEM_CUSTOMER_SERVICE);
|
||||
@@ -79,10 +78,6 @@ public class ImService {
|
||||
throw new ServiceException("对方关注你才能发送图片|语音|视频");
|
||||
}
|
||||
}
|
||||
}
|
||||
// 正则判断违规数据替换
|
||||
if(typeEnum == ImTypeEnum.MESSAGE && !systemCustomerService.contains(fromUserId) && !systemCustomerService.contains(toUserId)){
|
||||
|
||||
}
|
||||
if(fromUserId.equals(toUserId)){
|
||||
throw new ServiceException("不能给自己发送哦!");
|
||||
@@ -115,7 +110,11 @@ public class ImService {
|
||||
if (fromUser.getIsAnchor().equals(0) && toUser.getIsAnchor().equals(0)) {
|
||||
throw new ServiceException("目前只能和女神私信!");
|
||||
}
|
||||
if(){
|
||||
// 正则判断违规数据替换
|
||||
if(typeEnum == ImTypeEnum.MESSAGE && !systemCustomerService.contains(fromUserId) && !systemCustomerService.contains(toUserId)){
|
||||
|
||||
}
|
||||
if(fromUser.getIsAnchor().equals(1)){ // 女神发消息不要钱
|
||||
Account account = accountService.getByUserId(fromUserId);
|
||||
ImResp resp = new ImResp();
|
||||
resp.setCoin(account.getCoin()+ account.getIncomeCoin());
|
||||
@@ -129,8 +128,15 @@ public class ImService {
|
||||
traceId = accountService.imDesc(fromUser, toUser, imPrice);
|
||||
}
|
||||
// 存储聊天记录
|
||||
userChatRecordService.saveRecord(fromUser,toUser,traceId,message);
|
||||
return null;
|
||||
Account account = accountService.getByUserId(fromUserId);
|
||||
UserChatRecord record = userChatRecordService.saveRecord(fromUser, toUser, traceId, message);
|
||||
ImResp resp = new ImResp();
|
||||
resp.setCut(imPrice > 0);
|
||||
resp.setCutCoin(imPrice);
|
||||
resp.setCoin(account.getCoin()+ account.getIncomeCoin());
|
||||
resp.setRecordId(record.getId());
|
||||
resp.setContent(message.getContent());
|
||||
return resp;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
|
||||
Reference in New Issue
Block a user