谷歌包-moli-修复字段缺失异常
This commit is contained in:
@@ -1,158 +0,0 @@
|
||||
package com.accompany.admin.vo;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Created by PaperCut on 2018/4/3.
|
||||
*/
|
||||
public class MonsterAdminVo {
|
||||
private Long monsterId;
|
||||
|
||||
private Integer monsterKindId;
|
||||
|
||||
private String monsterKindName;
|
||||
|
||||
private Integer totalBlood;
|
||||
|
||||
private Integer remainBlood;
|
||||
|
||||
private Long appearRoomUid;
|
||||
|
||||
private Date appearTime;
|
||||
|
||||
private Integer appearDuration;
|
||||
|
||||
private Date disappearTime;
|
||||
|
||||
private Byte monsterStatus;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
private Long roomErbanNo;
|
||||
|
||||
private Byte notifyType;
|
||||
|
||||
private Byte drawStrategy;
|
||||
|
||||
public Long getMonsterId() {
|
||||
return monsterId;
|
||||
}
|
||||
|
||||
public void setMonsterId(Long monsterId) {
|
||||
this.monsterId = monsterId;
|
||||
}
|
||||
|
||||
public Integer getMonsterKindId() {
|
||||
return monsterKindId;
|
||||
}
|
||||
|
||||
public void setMonsterKindId(Integer monsterKindId) {
|
||||
this.monsterKindId = monsterKindId;
|
||||
}
|
||||
|
||||
public Integer getTotalBlood() {
|
||||
return totalBlood;
|
||||
}
|
||||
|
||||
public void setTotalBlood(Integer totalBlood) {
|
||||
this.totalBlood = totalBlood;
|
||||
}
|
||||
|
||||
public Integer getRemainBlood() {
|
||||
return remainBlood;
|
||||
}
|
||||
|
||||
public void setRemainBlood(Integer remainBlood) {
|
||||
this.remainBlood = remainBlood;
|
||||
}
|
||||
|
||||
public Long getAppearRoomUid() {
|
||||
return appearRoomUid;
|
||||
}
|
||||
|
||||
public void setAppearRoomUid(Long appearRoomUid) {
|
||||
this.appearRoomUid = appearRoomUid;
|
||||
}
|
||||
|
||||
public Date getAppearTime() {
|
||||
return appearTime;
|
||||
}
|
||||
|
||||
public void setAppearTime(Date appearTime) {
|
||||
this.appearTime = appearTime;
|
||||
}
|
||||
|
||||
public Integer getAppearDuration() {
|
||||
return appearDuration;
|
||||
}
|
||||
|
||||
public void setAppearDuration(Integer appearDuration) {
|
||||
this.appearDuration = appearDuration;
|
||||
}
|
||||
|
||||
public Date getDisappearTime() {
|
||||
return disappearTime;
|
||||
}
|
||||
|
||||
public void setDisappearTime(Date disappearTime) {
|
||||
this.disappearTime = disappearTime;
|
||||
}
|
||||
|
||||
public Byte getMonsterStatus() {
|
||||
return monsterStatus;
|
||||
}
|
||||
|
||||
public void setMonsterStatus(Byte monsterStatus) {
|
||||
this.monsterStatus = monsterStatus;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
public Long getRoomErbanNo() {
|
||||
return roomErbanNo;
|
||||
}
|
||||
|
||||
public void setRoomErbanNo(Long roomErbanNo) {
|
||||
this.roomErbanNo = roomErbanNo;
|
||||
}
|
||||
|
||||
public String getMonsterKindName() {
|
||||
return monsterKindName;
|
||||
}
|
||||
|
||||
public void setMonsterKindName(String monsterKindName) {
|
||||
this.monsterKindName = monsterKindName;
|
||||
}
|
||||
|
||||
public Byte getNotifyType() {
|
||||
return notifyType;
|
||||
}
|
||||
|
||||
public void setNotifyType(Byte notifyType) {
|
||||
this.notifyType = notifyType;
|
||||
}
|
||||
|
||||
public Byte getDrawStrategy() {
|
||||
return drawStrategy;
|
||||
}
|
||||
|
||||
public void setDrawStrategy(Byte drawStrategy) {
|
||||
this.drawStrategy = drawStrategy;
|
||||
}
|
||||
}
|
@@ -1,38 +0,0 @@
|
||||
package com.accompany.admin.vo.channel;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author
|
||||
* 渠道内容列表VO类
|
||||
*/
|
||||
@Data
|
||||
public class ChannelContentVo {
|
||||
/**
|
||||
* 序号
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 渠道
|
||||
*/
|
||||
private String channel;
|
||||
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
private Byte userType;
|
||||
/**
|
||||
* 生效时间
|
||||
*/
|
||||
private String validTime;
|
||||
/**
|
||||
* 状态:1-生效,2-失效,0-删除
|
||||
*/
|
||||
private Byte status;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
}
|
@@ -1,37 +0,0 @@
|
||||
package com.accompany.admin.service;
|
||||
|
||||
import com.accompany.admin.service.base.BaseService;
|
||||
import com.accompany.business.model.Feedback;
|
||||
import com.accompany.business.model.FeedbackExample;
|
||||
import com.accompany.business.mybatismapper.FeedbackMapper;
|
||||
import com.accompany.common.utils.DateTimeUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class FeedBackAdminService extends BaseService {
|
||||
@Autowired
|
||||
private FeedbackMapper feedbackMapper;
|
||||
|
||||
public PageInfo<Feedback> getFeedbackList(Integer pageSize, Integer pageNum, Long uid, String beginDate, String endDate){
|
||||
FeedbackExample feedbackExample = new FeedbackExample();
|
||||
feedbackExample.setOrderByClause("create_time DESC");
|
||||
FeedbackExample.Criteria criteria = feedbackExample.createCriteria();
|
||||
if(uid != null){
|
||||
criteria.andUidEqualTo(uid);
|
||||
}
|
||||
if(beginDate != "" && endDate != "") {
|
||||
Date date1 = DateTimeUtil.convertStrToDate(beginDate + " 00:00:00");
|
||||
Date date2 = DateTimeUtil.convertStrToDate(endDate + " 23:59:59");
|
||||
criteria.andCreateTimeBetween(date1,date2);
|
||||
}
|
||||
PageHelper.startPage(pageNum,pageSize);
|
||||
List<Feedback> feedbackList = feedbackMapper.selectByExample(feedbackExample);
|
||||
return new PageInfo<>(feedbackList);
|
||||
}
|
||||
}
|
@@ -1,371 +0,0 @@
|
||||
package com.accompany.admin.service.channel;
|
||||
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.accompany.admin.dto.channel.ChannelContentExcelDto;
|
||||
import com.accompany.admin.dto.channel.ChannelContentPartitionDto;
|
||||
import com.accompany.admin.dto.channel.ChannelQueryDto;
|
||||
import com.accompany.admin.vo.channel.ChannelContentVo;
|
||||
import com.accompany.common.constant.Constant;
|
||||
import com.accompany.common.redis.RedisKey;
|
||||
import com.accompany.common.utils.DateTimeUtil;
|
||||
import com.accompany.common.utils.StringUtils;
|
||||
import com.accompany.core.enumeration.ChannelUserTypeEnum;
|
||||
import com.accompany.core.exception.AdminServiceException;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.accompany.core.model.channel.ChannelContentPartition;
|
||||
import com.accompany.core.model.channel.ChannelContentPartitionExample;
|
||||
import com.accompany.core.mybatismapper.ChannelContentPartitionMapper;
|
||||
import com.accompany.core.service.base.BaseService;
|
||||
import com.accompany.core.service.channel.ChannelContentPartitionService;
|
||||
import com.accompany.core.service.common.JedisService;
|
||||
import com.accompany.core.service.user.UsersBaseService;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.NonNull;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class ChannelContentPartitionAdminService extends BaseService {
|
||||
|
||||
@Autowired
|
||||
private ChannelContentPartitionMapper channelContentPartitionMapper;
|
||||
@Autowired
|
||||
private UsersBaseService usersBaseService;
|
||||
@Autowired
|
||||
private JedisService jedisService;
|
||||
@Autowired
|
||||
private ChannelContentPartitionService channelContentPartitionService;
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
public PageInfo queryList(ChannelQueryDto channelQueryDto) {
|
||||
Integer pageNum = channelQueryDto.getPageNumber();
|
||||
Integer pageSize = channelQueryDto.getPageSize();
|
||||
|
||||
ChannelContentPartitionExample example = new ChannelContentPartitionExample();
|
||||
ChannelContentPartitionExample.Criteria criteria = example.createCriteria();
|
||||
//条件设置
|
||||
if (StringUtils.isNotBlank(channelQueryDto.getChannel())) criteria.andChannelEqualTo(channelQueryDto.getChannel());
|
||||
if (StringUtils.isNotBlank(channelQueryDto.getUserErbanNo())) criteria.andRoomErbanNoEqualTo(channelQueryDto.getUserErbanNo());
|
||||
if (StringUtils.isNotBlank(channelQueryDto.getRoomErbanNo())) criteria.andRoomErbanNoEqualTo(channelQueryDto.getRoomErbanNo());
|
||||
if (channelQueryDto.getUserType() != null) criteria.andUserTypeEqualTo(channelQueryDto.getUserType());
|
||||
|
||||
criteria.andStatusNotEqualTo((byte) 0);
|
||||
example.setOrderByClause("id desc");
|
||||
|
||||
PageHelper.startPage(pageNum,pageSize);
|
||||
PageInfo pageInfo = new PageInfo(channelContentPartitionMapper.selectByExample(example));
|
||||
List<ChannelContentPartition> list = pageInfo.getList();
|
||||
|
||||
List<ChannelContentVo> voList = new ArrayList<>();
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
for (ChannelContentPartition contentPartition : list) {
|
||||
ChannelContentVo vo = new ChannelContentVo();
|
||||
|
||||
vo.setId(contentPartition.getId());
|
||||
vo.setUserType(contentPartition.getUserType());
|
||||
vo.setChannel(contentPartition.getChannel());
|
||||
//设置生效时段 = 起始时间年-月-日 时:分:秒 ~ 结束时间年-月-日 时:分:秒
|
||||
vo.setValidTime(DateTimeUtil.convertDate(contentPartition.getStartTime()) + StrUtil.DASHED + DateTimeUtil.convertDate(contentPartition.getEndTime()));
|
||||
vo.setCreateTime(contentPartition.getCreateTime());
|
||||
vo.setStatus(contentPartition.getStatus());
|
||||
|
||||
voList.add(vo);
|
||||
}
|
||||
|
||||
}
|
||||
pageInfo.setList(voList);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增/编辑
|
||||
*/
|
||||
public void saveChannelContent(@NonNull ChannelContentPartitionDto channelContentPartitionDto) throws IOException {
|
||||
//执行新增:渠道用户类型校验检查
|
||||
ChannelContentPartitionExample example = new ChannelContentPartitionExample();
|
||||
ChannelContentPartitionExample.Criteria criteria = example.createCriteria();
|
||||
criteria.andChannelEqualTo(channelContentPartitionDto.getChannel());
|
||||
criteria.andUserTypeEqualTo(channelContentPartitionDto.getUserType());
|
||||
criteria.andStatusNotEqualTo((byte) 0);
|
||||
List<ChannelContentPartition> sampleList = channelContentPartitionMapper.selectByExample(example);
|
||||
|
||||
if (!CollectionUtils.isEmpty(sampleList)) {
|
||||
if (channelContentPartitionDto.getId() != null) {
|
||||
sampleList = sampleList.stream().filter(channel -> !channel.getId().equals(channelContentPartitionDto.getId())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
if (!CollectionUtils.isEmpty(sampleList)) throw new AdminServiceException("渠道+用户类型的组合不能重复存在!");
|
||||
}
|
||||
|
||||
//检查房主大鹅号
|
||||
String roomErbanNo = channelContentPartitionDto.getRoomErbanNo();
|
||||
if (StringUtils.isBlank(roomErbanNo)) throw new AdminServiceException("房主平台号不能为空");
|
||||
List<String> roomErbanList =Arrays.stream(roomErbanNo.split(StrUtil.COMMA)).collect(Collectors.toList());
|
||||
List<String> roomUidList = usersBaseService.getUidByErbanNo(roomErbanList);
|
||||
String errRoomErban = checkErban(roomErbanList, roomUidList);
|
||||
if (!StringUtils.isEmpty(errRoomErban)) {
|
||||
throw new AdminServiceException("以下房主平台号:" + errRoomErban + "不正确!");
|
||||
}
|
||||
|
||||
//检查用户平台号
|
||||
if (Constant.ChannelUserType.point_user.equals(channelContentPartitionDto.getUserType())) {
|
||||
String userErbanNo = channelContentPartitionDto.getUserErbanNo();
|
||||
if (StringUtils.isBlank(userErbanNo)) throw new AdminServiceException("用户平台号不能为空");
|
||||
//校验输入的用户平台号
|
||||
List<String> erbanList = Arrays.stream(userErbanNo.split(StrUtil.COMMA)).collect(Collectors.toList());
|
||||
List<String> uidStrList = usersBaseService.getUidByErbanNo(erbanList);
|
||||
String errUserErban = checkErban(erbanList, uidStrList);
|
||||
|
||||
if (!StringUtils.isEmpty(errUserErban)) {
|
||||
throw new AdminServiceException("以下用户平台号:" + errUserErban + "不正确!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ChannelContentPartition channelContentPartition = new ChannelContentPartition();
|
||||
BeanUtils.copyProperties(channelContentPartitionDto, channelContentPartition);
|
||||
if (channelContentPartitionDto.getId() != null) {
|
||||
channelContentPartition.setUpdateTime(new Date());
|
||||
//执行编辑
|
||||
channelContentPartitionMapper.updateByPrimaryKeySelective(channelContentPartition);
|
||||
}else {
|
||||
channelContentPartition.setCreateTime(new Date());
|
||||
//执行新增
|
||||
channelContentPartitionMapper.insertSelective(channelContentPartition);
|
||||
}
|
||||
|
||||
logger.info("渠道内容区分新增id:{}", channelContentPartition.getId());
|
||||
|
||||
writeChannelContentToCache(channelContentPartition.getId());
|
||||
|
||||
if (Constant.ChannelUserType.current_day_user.equals(channelContentPartition.getUserType())) {
|
||||
//如果调整的为当日新增用户类型
|
||||
dealCurrentDayType();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
public void writeChannelContentToCache(@NonNull Long id) {
|
||||
ChannelContentPartition record = channelContentPartitionMapper.selectByPrimaryKey(id);
|
||||
//写入redis
|
||||
jedisService.hset(RedisKey.channel_content_record.getKey(), String.valueOf(record.getId()), gson.toJson(record));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查时段冲突
|
||||
* @param channelDto
|
||||
* @param erbanList
|
||||
*/
|
||||
private void checkTimeZone(ChannelContentPartitionDto channelDto, List<String> erbanList) {
|
||||
ChannelContentPartitionExample example = new ChannelContentPartitionExample();
|
||||
ChannelContentPartitionExample.Criteria criteria = example.createCriteria();
|
||||
criteria.andUserTypeEqualTo(channelDto.getUserType());
|
||||
criteria.andStatusNotEqualTo((byte) 0);
|
||||
List<ChannelContentPartition> list = channelContentPartitionMapper.selectByExample(example);
|
||||
|
||||
|
||||
if (CollectionUtils.isEmpty(list)) return;
|
||||
|
||||
if (channelDto.getId() != null) {
|
||||
//编辑情况下先过滤原对象
|
||||
list = list.stream().filter(channel -> !channel.getId().equals(channelDto.getId())).collect(Collectors.toList());
|
||||
}
|
||||
if (Constant.ChannelUserType.point_user.equals(channelDto.getUserType())) {
|
||||
//对于指定用户,检查每一个平台号是否有时段冲突
|
||||
for (String erban : erbanList) {
|
||||
verfyPointUserTimeSection(channelDto, erban, list);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
//对于所有用户和新增用户
|
||||
for (ChannelContentPartition channelContent: list) {
|
||||
Boolean isCross = DateTimeUtil.IsInterSection(channelDto.getStartTime(), channelDto.getEndTime(), channelContent.getStartTime(), channelContent.getEndTime());
|
||||
//比较时间区间
|
||||
if (isCross) {
|
||||
String clashMsg = "当前组合类型存在时段冲突:冲突序号:%s,冲突时段:[%s-%s]";
|
||||
logger.info(String.format(clashMsg, channelContent.getId(), DateTimeUtil.convertDate(channelContent.getStartTime()), DateTimeUtil.convertDate(channelContent.getEndTime())));
|
||||
throw new AdminServiceException(String.format(clashMsg, channelContent.getId(), DateTimeUtil.convertDate(channelContent.getStartTime()), DateTimeUtil.convertDate(channelContent.getEndTime())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 对指定用户时段做校验
|
||||
* @param channelDto
|
||||
* @param erban
|
||||
* @param list
|
||||
*/
|
||||
private void verfyPointUserTimeSection(ChannelContentPartitionDto channelDto, String erban, List<ChannelContentPartition> list) {
|
||||
for (ChannelContentPartition channelContent: list) {
|
||||
if (channelContent.getChannel().indexOf(erban) != -1) {
|
||||
Boolean isCross = DateTimeUtil.IsInterSection(channelDto.getStartTime(), channelDto.getEndTime(), channelContent.getStartTime(), channelContent.getEndTime());
|
||||
if (isCross) {
|
||||
String clashMsg = "当前组合类型存在时段冲突:冲突序号:%s,冲突平台号:%s,时段:[%s-%s]";
|
||||
logger.info(String.format(clashMsg, channelContent.getId(), erban, DateTimeUtil.convertDate(channelContent.getStartTime())), DateTimeUtil.convertDate(channelContent.getStartTime()));
|
||||
throw new AdminServiceException(String.format(clashMsg, channelContent.getId(), erban, DateTimeUtil.convertDate(channelContent.getStartTime()), DateTimeUtil.convertDate(channelContent.getStartTime())));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验erban号
|
||||
* @param erbanList
|
||||
* @param uidStrList
|
||||
* @return
|
||||
*/
|
||||
private String checkErban(List<String> erbanList, List<String> uidStrList) {
|
||||
String errErban = "";
|
||||
if (CollectionUtils.isEmpty(uidStrList) || erbanList.size() != uidStrList.size()) {
|
||||
if (CollectionUtils.isEmpty(uidStrList)) {
|
||||
errErban = erbanList.toString();
|
||||
}else {
|
||||
List<Long> uidList = uidStrList.stream().map(str -> Long.valueOf(str)).collect(Collectors.toList());
|
||||
List<Users> usersList = usersBaseService.getUsersListByUids(uidList);
|
||||
List<String> userErbanList = usersList.stream().map(users -> String.valueOf(users.getErbanNo())).collect(Collectors.toList());
|
||||
List<String> resultList = (List<String>) CollectionUtils.subtract(erbanList, userErbanList);
|
||||
if (!CollectionUtils.isEmpty(resultList)) errErban = resultList.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return errErban;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 切换状态:生效/失效/删除
|
||||
*/
|
||||
public void toggleState(@NonNull ChannelContentPartition channelContentPartition) throws IOException {
|
||||
Assert.notNull(channelContentPartition.getId(), "id不能为空!");
|
||||
|
||||
ChannelContentPartition dbRecord = channelContentPartitionMapper.selectByPrimaryKey(channelContentPartition.getId());
|
||||
|
||||
//避免更新其他
|
||||
ChannelContentPartition record = new ChannelContentPartition();
|
||||
record.setId(channelContentPartition.getId());
|
||||
record.setStatus(channelContentPartition.getStatus());
|
||||
channelContentPartitionMapper.updateByPrimaryKeySelective(record);
|
||||
|
||||
if (Constant.ChannelContentStatus.exist.equals(channelContentPartition.getStatus())) {
|
||||
writeChannelContentToCache(record.getId());
|
||||
}else {
|
||||
jedisService.hdel(RedisKey.channel_content_record.getKey(), String.valueOf(record.getId()));
|
||||
}
|
||||
|
||||
if (Constant.ChannelUserType.current_day_user.equals(dbRecord.getUserType())) {
|
||||
dealCurrentDayType();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出查询
|
||||
*/
|
||||
public List<List> exportChannelQuery(@NonNull ChannelQueryDto channelQueryDto) {
|
||||
List<ChannelContentExcelDto> exportList = new ArrayList<>();
|
||||
ChannelContentPartitionExample example = new ChannelContentPartitionExample();
|
||||
ChannelContentPartitionExample.Criteria criteria = example.createCriteria();
|
||||
//条件设置
|
||||
if (StringUtils.isNotBlank(channelQueryDto.getChannel())) criteria.andChannelEqualTo(channelQueryDto.getChannel());
|
||||
if (StringUtils.isNotBlank(channelQueryDto.getUserErbanNo())) criteria.andRoomErbanNoEqualTo(channelQueryDto.getUserErbanNo());
|
||||
if (StringUtils.isNotBlank(channelQueryDto.getRoomErbanNo())) criteria.andRoomErbanNoEqualTo(channelQueryDto.getRoomErbanNo());
|
||||
if (channelQueryDto.getUserType() != null) criteria.andUserTypeEqualTo(channelQueryDto.getUserType());
|
||||
|
||||
criteria.andStatusNotEqualTo((byte) 0);
|
||||
example.setOrderByClause("id desc");
|
||||
|
||||
List<ChannelContentPartition> list = channelContentPartitionMapper.selectByExample(example);
|
||||
if (CollectionUtils.isEmpty(list)) return new ArrayList<>();
|
||||
|
||||
for (ChannelContentPartition channelContent : list) {
|
||||
ChannelContentExcelDto excelDto = new ChannelContentExcelDto();
|
||||
excelDto.setChannel(channelContent.getChannel());
|
||||
excelDto.setUserType(ChannelUserTypeEnum.get(channelContent.getUserType()).getDesc());
|
||||
excelDto.setUserErbanNo(channelContent.getUserErbanNo());
|
||||
excelDto.setRoomErbanNo(channelContent.getRoomErbanNo());
|
||||
if (Constant.ChannelContentStatus.exist.equals(channelContent.getStatus())) {
|
||||
excelDto.setStatus("生效");
|
||||
}
|
||||
if (Constant.ChannelContentStatus.invalid.equals(channelContent.getStatus())) {
|
||||
excelDto.setStatus("失效");
|
||||
}
|
||||
excelDto.setValidSection(DateTimeUtil.convertDate(channelContent.getStartTime()) + StrUtil.DASHED + DateTimeUtil.convertDate(channelContent.getEndTime()));
|
||||
excelDto.setCreateTime(DateTimeUtil.convertDate(channelContent.getCreateTime()));
|
||||
exportList.add(excelDto);
|
||||
}
|
||||
|
||||
return buildAnchorStatisticsExcelData(exportList);
|
||||
}
|
||||
|
||||
public List<List> buildAnchorStatisticsExcelData(List<ChannelContentExcelDto> exportList){
|
||||
List<List> excelRows = new ArrayList<>(exportList.size());
|
||||
for (ChannelContentExcelDto excelDto : exportList) {
|
||||
List<Object> excelData = new ArrayList<>();
|
||||
excelData.add(excelDto.getChannel());
|
||||
excelData.add(excelDto.getUserType());
|
||||
excelData.add(excelDto.getUserErbanNo());
|
||||
excelData.add(excelDto.getRoomErbanNo());
|
||||
excelData.add(excelDto.getValidSection());
|
||||
excelData.add(excelDto.getStatus());
|
||||
excelData.add(excelDto.getCreateTime());
|
||||
excelRows.add(excelData);
|
||||
}
|
||||
return excelRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取信息
|
||||
*/
|
||||
public ChannelContentPartition getChannelContent(@NonNull Long id) {
|
||||
return channelContentPartitionMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 对当日用户类型进行特殊处理
|
||||
* @throws IOException
|
||||
*/
|
||||
public void dealCurrentDayType() throws IOException {
|
||||
if (!jedisService.exits(RedisKey.channel_content_record.getKey())) {
|
||||
channelContentPartitionService.initChannelContentCache();
|
||||
}
|
||||
|
||||
Map<String, String> resultMap = jedisService.hgetAll(RedisKey.channel_content_record.getKey());
|
||||
if (MapUtil.isEmpty(resultMap)) return;
|
||||
|
||||
List<ChannelContentPartition> channelList = resultMap.entrySet().stream()
|
||||
.map(entry -> gson.fromJson(entry.getValue(), ChannelContentPartition.class)).filter(channelContentPartition -> Constant.ChannelUserType.current_day_user.equals(channelContentPartition.getUserType()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (CollectionUtils.isEmpty(channelList)) return;
|
||||
|
||||
List<Long> allErbanNoList = channelContentPartitionService.getAllErbanNoList(channelList);
|
||||
|
||||
if (CollectionUtils.isEmpty(allErbanNoList)) return;
|
||||
|
||||
|
||||
allErbanNoList = allErbanNoList.stream().distinct().collect(Collectors.toList());
|
||||
//先删除再写入
|
||||
channelContentPartitionService.dealSyncCache(allErbanNoList, true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@@ -10,8 +10,6 @@
|
||||
<result column="nick" property="nick" jdbcType="VARCHAR"/>
|
||||
<result column="email" property="email" jdbcType="VARCHAR"/>
|
||||
<result column="signture" property="signture" jdbcType="VARCHAR"/>
|
||||
<result column="user_voice" property="userVoice" jdbcType="VARCHAR"/>
|
||||
<result column="voice_dura" property="voiceDura" jdbcType="INTEGER"/>
|
||||
<result column="follow_num" property="followNum" jdbcType="INTEGER"/>
|
||||
<result column="fans_num" property="fansNum" jdbcType="INTEGER"/>
|
||||
<result column="def_user" property="defUser" jdbcType="TINYINT"/>
|
||||
@@ -24,16 +22,11 @@
|
||||
<result column="avatar" property="avatar" jdbcType="VARCHAR"/>
|
||||
<result column="region" property="region" jdbcType="VARCHAR"/>
|
||||
<result column="user_desc" property="userDesc" jdbcType="VARCHAR"/>
|
||||
<result column="alipay_account" property="alipayAccount" jdbcType="VARCHAR"/>
|
||||
<result column="alipay_account_name" property="alipayAccountName" jdbcType="VARCHAR"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="wx_pub_fans_openid" property="wxPubFansOpenid" jdbcType="VARCHAR"/>
|
||||
<result column="wx_pub_fans_gender" property="wxPubFansGender" jdbcType="TINYINT"/>
|
||||
<result column="room_uid" property="roomUid" jdbcType="BIGINT"/>
|
||||
<result column="share_uid" property="shareUid" jdbcType="BIGINT"/>
|
||||
<result column="share_channel" property="shareChannel" jdbcType="TINYINT"/>
|
||||
<result column="wx_openId" property="wxOpenid" jdbcType="VARCHAR"/>
|
||||
<result column="os" property="os" jdbcType="VARCHAR"/>
|
||||
<result column="osVersion" property="osversion" jdbcType="VARCHAR"/>
|
||||
<result column="app" property="app" jdbcType="VARCHAR"/>
|
||||
|
@@ -113,35 +113,4 @@ public class MyApiController {
|
||||
myApiService.sendConsumptionInformation(tId);
|
||||
return new BusiResult<>(BusiStatus.SUCCESS);
|
||||
}
|
||||
|
||||
/*@RequestMapping("/giftSendRecordBillRecord")
|
||||
@ResponseBody
|
||||
public BusiResult<List<String>> giftSendRecordBillRecord(Long roomId) {
|
||||
if (null == roomId || !roomId.equals(603L)){
|
||||
throw new AdminServiceException(BusiStatus.PARAMERROR);
|
||||
}
|
||||
myApiService.repairGiftSendRecordBillRecord();
|
||||
return new BusiResult<>(BusiStatus.SUCCESS);
|
||||
}*/
|
||||
|
||||
@RequestMapping("/b")
|
||||
@ResponseBody
|
||||
public BusiResult<Void> b(Long roomId){
|
||||
if (null == roomId || !roomId.equals(603L)){
|
||||
throw new AdminServiceException(BusiStatus.PARAMERROR);
|
||||
}
|
||||
|
||||
List<Account> accountList = SpringContextHolder.getBean(AccountService.class).list(null);
|
||||
for (Account a: accountList){
|
||||
try {
|
||||
TokenRet tokenRet = SpringContextHolder.getBean(NetEaseService.class).createNetEaseAccWithGender(
|
||||
a.getUid().toString(), a.getNeteaseToken(), "", Constant.DEFAULT_NICK, "", Constant.UserGender.MALE.toString());
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return new BusiResult<>(BusiStatus.SUCCESS);
|
||||
}
|
||||
}
|
||||
|
@@ -1,119 +0,0 @@
|
||||
package com.accompany.admin.controller.channel;
|
||||
|
||||
import com.accompany.admin.controller.BaseController;
|
||||
import com.accompany.admin.dto.channel.ChannelContentPartitionDto;
|
||||
import com.accompany.admin.dto.channel.ChannelQueryDto;
|
||||
import com.accompany.admin.service.channel.ChannelContentPartitionAdminService;
|
||||
import com.accompany.admin.util.ExcelUtils;
|
||||
import com.accompany.common.result.BusiResult;
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
import com.accompany.core.exception.ServiceException;
|
||||
import com.accompany.core.model.channel.ChannelContentPartition;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.OutputStream;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 渠道内容区分
|
||||
*/
|
||||
@RequestMapping("/admin/channel/content")
|
||||
@RestController
|
||||
public class ChannelContentPartitionAdminController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ChannelContentPartitionAdminService channelContentPartitionAdminService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
@GetMapping(value = "/queryList")
|
||||
public void queryList(ChannelQueryDto channelQueryDto) {
|
||||
PageInfo pageInfo = channelContentPartitionAdminService.queryList(channelQueryDto);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("total",pageInfo.getTotal());
|
||||
jsonObject.put("rows",pageInfo.getList());
|
||||
writeJson(jsonObject.toJSONString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增/编辑
|
||||
*/
|
||||
@PostMapping(value = "/saveChannelContent")
|
||||
public BusiResult addChannelContent(@Validated ChannelContentPartitionDto channelContentPartitionDto){
|
||||
try{
|
||||
channelContentPartitionAdminService.saveChannelContent(channelContentPartitionDto);
|
||||
return new BusiResult(BusiStatus.SUCCESS);
|
||||
}catch(Exception e){
|
||||
logger.error(e.getMessage());
|
||||
throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 状态切换
|
||||
*/
|
||||
@PostMapping(value = "/toggleState")
|
||||
public BusiResult toggleState(ChannelContentPartition channelContentPartition){
|
||||
try{
|
||||
channelContentPartitionAdminService.toggleState(channelContentPartition);
|
||||
return new BusiResult(BusiStatus.SUCCESS);
|
||||
}catch(Exception e){
|
||||
logger.error(e.getMessage());
|
||||
throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出
|
||||
*/
|
||||
@GetMapping(value = "/exportChannelContent")
|
||||
public void exportChannelContent(ChannelQueryDto channelQueryDto, HttpServletRequest request, HttpServletResponse response){
|
||||
List<List> resultList = channelContentPartitionAdminService.exportChannelQuery(channelQueryDto);
|
||||
try (OutputStream out = response.getOutputStream()) {
|
||||
List<String> headerList = new LinkedList<>();
|
||||
headerList.add("渠道");
|
||||
headerList.add("用户类型");
|
||||
headerList.add("用户平台号");
|
||||
headerList.add("房主平台号");
|
||||
headerList.add("生效时段");
|
||||
headerList.add("生效状态");
|
||||
headerList.add("创建时间");
|
||||
String fileName = new StringBuilder().append("渠道内容.xls").toString();
|
||||
Workbook workbook = ExcelUtils.createExcelSheet(headerList, resultList);
|
||||
ExcelUtils.setExcelResponseHeader(request, response, fileName);
|
||||
workbook.write(out);
|
||||
out.flush();
|
||||
} catch (Exception e) {
|
||||
logger.error("Failed to export invite_code_stats. Cause by {}", e.getMessage());
|
||||
writeJson(false, "导出失败");
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping(value = "/getChannelContent")
|
||||
public BusiResult getChannelContent(Long id){
|
||||
BusiResult busiResult = new BusiResult(BusiStatus.SUCCESS);
|
||||
try{
|
||||
busiResult.setData(channelContentPartitionAdminService.getChannelContent(id));
|
||||
}catch(Exception e){
|
||||
logger.error(e.getMessage());
|
||||
busiResult.setCode(BusiStatus.SERVERERROR.value());
|
||||
busiResult.setMessage(e.getMessage());
|
||||
}
|
||||
return busiResult;
|
||||
}
|
||||
|
||||
}
|
@@ -1,33 +0,0 @@
|
||||
package com.accompany.admin.controller.feedback;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.accompany.admin.controller.BaseController;
|
||||
import com.accompany.admin.service.FeedBackAdminService;
|
||||
import com.accompany.business.model.Feedback;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/admin/feedback")
|
||||
public class FeedBackAdminController extends BaseController{
|
||||
@Autowired
|
||||
private FeedBackAdminService feedBackAdminService;
|
||||
@RequestMapping(value = "/list",method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public void getFeedback(Integer pageSize,Integer pageNum,Long uid, String beginDate, String endDate){
|
||||
PageInfo<Feedback> pageInfo = feedBackAdminService.getFeedbackList(pageSize,pageNum,uid,beginDate,endDate);
|
||||
// List<Feedback> list = feedBackAdminService.getFeedbackList(pageSize,pageNum);
|
||||
// BusiResult<PageInfo> busiResult = new BusiResult<PageInfo>(BusiStatus.SUCCESS);
|
||||
// busiResult.setData(pageInfo);
|
||||
// return busiResult;
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("total",pageInfo.getTotal());
|
||||
jsonObject.put("rows",pageInfo.getList());
|
||||
writeJson(jsonObject.toJSONString());
|
||||
|
||||
}
|
||||
}
|
@@ -1822,76 +1822,6 @@ public class UsersExample {
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andWxOpenidIsNull() {
|
||||
addCriterion("wx_openId is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andWxOpenidIsNotNull() {
|
||||
addCriterion("wx_openId is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andWxOpenidEqualTo(String value) {
|
||||
addCriterion("wx_openId =", value, "wxOpenid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andWxOpenidNotEqualTo(String value) {
|
||||
addCriterion("wx_openId <>", value, "wxOpenid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andWxOpenidGreaterThan(String value) {
|
||||
addCriterion("wx_openId >", value, "wxOpenid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andWxOpenidGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("wx_openId >=", value, "wxOpenid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andWxOpenidLessThan(String value) {
|
||||
addCriterion("wx_openId <", value, "wxOpenid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andWxOpenidLessThanOrEqualTo(String value) {
|
||||
addCriterion("wx_openId <=", value, "wxOpenid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andWxOpenidLike(String value) {
|
||||
addCriterion("wx_openId like", value, "wxOpenid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andWxOpenidNotLike(String value) {
|
||||
addCriterion("wx_openId not like", value, "wxOpenid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andWxOpenidIn(List<String> values) {
|
||||
addCriterion("wx_openId in", values, "wxOpenid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andWxOpenidNotIn(List<String> values) {
|
||||
addCriterion("wx_openId not in", values, "wxOpenid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andWxOpenidBetween(String value1, String value2) {
|
||||
addCriterion("wx_openId between", value1, value2, "wxOpenid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andWxOpenidNotBetween(String value1, String value2) {
|
||||
addCriterion("wx_openId not between", value1, value2, "wxOpenid");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRoomUidIsNull() {
|
||||
addCriterion("room_uid is null");
|
||||
return (Criteria) this;
|
||||
|
@@ -1,56 +0,0 @@
|
||||
package com.accompany.core.model.channel;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author
|
||||
* 渠道内容区分
|
||||
*/
|
||||
@Data
|
||||
public class ChannelContentPartition implements Serializable {
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 渠道
|
||||
*/
|
||||
private String channel;
|
||||
|
||||
/**
|
||||
* 用户类型:1-当日新增,2-所有用户,3-指定用户
|
||||
*/
|
||||
private Byte userType;
|
||||
|
||||
/**
|
||||
* 用户66号对应的json数组
|
||||
*/
|
||||
private String userErbanNo;
|
||||
|
||||
/**
|
||||
* 房间66号对应的json数组
|
||||
*/
|
||||
private String roomErbanNo;
|
||||
|
||||
/**
|
||||
* 时段起始时间:页面选择到分
|
||||
*/
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 时段结束时间:页面选择到分
|
||||
*/
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 状态:1-生效,2-失效,0-删除
|
||||
*/
|
||||
private Byte status;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@@ -1,853 +0,0 @@
|
||||
package com.accompany.core.model.channel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class ChannelContentPartitionExample {
|
||||
protected String orderByClause;
|
||||
|
||||
protected boolean distinct;
|
||||
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
private Integer limit;
|
||||
|
||||
private Long offset;
|
||||
|
||||
public ChannelContentPartitionExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
this.orderByClause = orderByClause;
|
||||
}
|
||||
|
||||
public String getOrderByClause() {
|
||||
return orderByClause;
|
||||
}
|
||||
|
||||
public void setDistinct(boolean distinct) {
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
public List<Criteria> getOredCriteria() {
|
||||
return oredCriteria;
|
||||
}
|
||||
|
||||
public void or(Criteria criteria) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
|
||||
public Criteria or() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
oredCriteria.add(criteria);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public Criteria createCriteria() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
if (oredCriteria.size() == 0) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected Criteria createCriteriaInternal() {
|
||||
Criteria criteria = new Criteria();
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
oredCriteria.clear();
|
||||
orderByClause = null;
|
||||
distinct = false;
|
||||
}
|
||||
|
||||
public void setLimit(Integer limit) {
|
||||
this.limit = limit;
|
||||
}
|
||||
|
||||
public Integer getLimit() {
|
||||
return limit;
|
||||
}
|
||||
|
||||
public void setOffset(Long offset) {
|
||||
this.offset = offset;
|
||||
}
|
||||
|
||||
public Long getOffset() {
|
||||
return offset;
|
||||
}
|
||||
|
||||
protected abstract static class GeneratedCriteria {
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> getCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition) {
|
||||
if (condition == null) {
|
||||
throw new RuntimeException("Value for condition cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value, String property) {
|
||||
if (value == null) {
|
||||
throw new RuntimeException("Value for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) {
|
||||
if (value1 == null || value2 == null) {
|
||||
throw new RuntimeException("Between values for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value1, value2));
|
||||
}
|
||||
|
||||
public Criteria andIdIsNull() {
|
||||
addCriterion("id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIsNotNull() {
|
||||
addCriterion("id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdEqualTo(Long value) {
|
||||
addCriterion("id =", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotEqualTo(Long value) {
|
||||
addCriterion("id <>", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThan(Long value) {
|
||||
addCriterion("id >", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("id >=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThan(Long value) {
|
||||
addCriterion("id <", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Long value) {
|
||||
addCriterion("id <=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIn(List<Long> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<Long> values) {
|
||||
addCriterion("id not in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdBetween(Long value1, Long value2) {
|
||||
addCriterion("id between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotBetween(Long value1, Long value2) {
|
||||
addCriterion("id not between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChannelIsNull() {
|
||||
addCriterion("channel is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChannelIsNotNull() {
|
||||
addCriterion("channel is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChannelEqualTo(String value) {
|
||||
addCriterion("channel =", value, "channel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChannelNotEqualTo(String value) {
|
||||
addCriterion("channel <>", value, "channel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChannelGreaterThan(String value) {
|
||||
addCriterion("channel >", value, "channel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChannelGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("channel >=", value, "channel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChannelLessThan(String value) {
|
||||
addCriterion("channel <", value, "channel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChannelLessThanOrEqualTo(String value) {
|
||||
addCriterion("channel <=", value, "channel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChannelLike(String value) {
|
||||
addCriterion("channel like", value, "channel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChannelNotLike(String value) {
|
||||
addCriterion("channel not like", value, "channel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChannelIn(List<String> values) {
|
||||
addCriterion("channel in", values, "channel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChannelNotIn(List<String> values) {
|
||||
addCriterion("channel not in", values, "channel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChannelBetween(String value1, String value2) {
|
||||
addCriterion("channel between", value1, value2, "channel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andChannelNotBetween(String value1, String value2) {
|
||||
addCriterion("channel not between", value1, value2, "channel");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserTypeIsNull() {
|
||||
addCriterion("user_type is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserTypeIsNotNull() {
|
||||
addCriterion("user_type is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserTypeEqualTo(Byte value) {
|
||||
addCriterion("user_type =", value, "userType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserTypeNotEqualTo(Byte value) {
|
||||
addCriterion("user_type <>", value, "userType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserTypeGreaterThan(Byte value) {
|
||||
addCriterion("user_type >", value, "userType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserTypeGreaterThanOrEqualTo(Byte value) {
|
||||
addCriterion("user_type >=", value, "userType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserTypeLessThan(Byte value) {
|
||||
addCriterion("user_type <", value, "userType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserTypeLessThanOrEqualTo(Byte value) {
|
||||
addCriterion("user_type <=", value, "userType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserTypeIn(List<Byte> values) {
|
||||
addCriterion("user_type in", values, "userType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserTypeNotIn(List<Byte> values) {
|
||||
addCriterion("user_type not in", values, "userType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserTypeBetween(Byte value1, Byte value2) {
|
||||
addCriterion("user_type between", value1, value2, "userType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserTypeNotBetween(Byte value1, Byte value2) {
|
||||
addCriterion("user_type not between", value1, value2, "userType");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserErbanNoIsNull() {
|
||||
addCriterion("user_erban_no is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserErbanNoIsNotNull() {
|
||||
addCriterion("user_erban_no is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserErbanNoEqualTo(String value) {
|
||||
addCriterion("user_erban_no =", value, "userErbanNo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserErbanNoNotEqualTo(String value) {
|
||||
addCriterion("user_erban_no <>", value, "userErbanNo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserErbanNoGreaterThan(String value) {
|
||||
addCriterion("user_erban_no >", value, "userErbanNo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserErbanNoGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("user_erban_no >=", value, "userErbanNo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserErbanNoLessThan(String value) {
|
||||
addCriterion("user_erban_no <", value, "userErbanNo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserErbanNoLessThanOrEqualTo(String value) {
|
||||
addCriterion("user_erban_no <=", value, "userErbanNo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserErbanNoLike(String value) {
|
||||
addCriterion("user_erban_no like", value, "userErbanNo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserErbanNoNotLike(String value) {
|
||||
addCriterion("user_erban_no not like", value, "userErbanNo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserErbanNoIn(List<String> values) {
|
||||
addCriterion("user_erban_no in", values, "userErbanNo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserErbanNoNotIn(List<String> values) {
|
||||
addCriterion("user_erban_no not in", values, "userErbanNo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserErbanNoBetween(String value1, String value2) {
|
||||
addCriterion("user_erban_no between", value1, value2, "userErbanNo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUserErbanNoNotBetween(String value1, String value2) {
|
||||
addCriterion("user_erban_no not between", value1, value2, "userErbanNo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRoomErbanNoIsNull() {
|
||||
addCriterion("room_erban_no is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRoomErbanNoIsNotNull() {
|
||||
addCriterion("room_erban_no is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRoomErbanNoEqualTo(String value) {
|
||||
addCriterion("room_erban_no =", value, "roomErbanNo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRoomErbanNoNotEqualTo(String value) {
|
||||
addCriterion("room_erban_no <>", value, "roomErbanNo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRoomErbanNoGreaterThan(String value) {
|
||||
addCriterion("room_erban_no >", value, "roomErbanNo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRoomErbanNoGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("room_erban_no >=", value, "roomErbanNo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRoomErbanNoLessThan(String value) {
|
||||
addCriterion("room_erban_no <", value, "roomErbanNo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRoomErbanNoLessThanOrEqualTo(String value) {
|
||||
addCriterion("room_erban_no <=", value, "roomErbanNo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRoomErbanNoLike(String value) {
|
||||
addCriterion("room_erban_no like", value, "roomErbanNo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRoomErbanNoNotLike(String value) {
|
||||
addCriterion("room_erban_no not like", value, "roomErbanNo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRoomErbanNoIn(List<String> values) {
|
||||
addCriterion("room_erban_no in", values, "roomErbanNo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRoomErbanNoNotIn(List<String> values) {
|
||||
addCriterion("room_erban_no not in", values, "roomErbanNo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRoomErbanNoBetween(String value1, String value2) {
|
||||
addCriterion("room_erban_no between", value1, value2, "roomErbanNo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRoomErbanNoNotBetween(String value1, String value2) {
|
||||
addCriterion("room_erban_no not between", value1, value2, "roomErbanNo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStartTimeIsNull() {
|
||||
addCriterion("start_time is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStartTimeIsNotNull() {
|
||||
addCriterion("start_time is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStartTimeEqualTo(Date value) {
|
||||
addCriterion("start_time =", value, "startTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStartTimeNotEqualTo(Date value) {
|
||||
addCriterion("start_time <>", value, "startTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStartTimeGreaterThan(Date value) {
|
||||
addCriterion("start_time >", value, "startTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStartTimeGreaterThanOrEqualTo(Date value) {
|
||||
addCriterion("start_time >=", value, "startTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStartTimeLessThan(Date value) {
|
||||
addCriterion("start_time <", value, "startTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStartTimeLessThanOrEqualTo(Date value) {
|
||||
addCriterion("start_time <=", value, "startTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStartTimeIn(List<Date> values) {
|
||||
addCriterion("start_time in", values, "startTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStartTimeNotIn(List<Date> values) {
|
||||
addCriterion("start_time not in", values, "startTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStartTimeBetween(Date value1, Date value2) {
|
||||
addCriterion("start_time between", value1, value2, "startTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStartTimeNotBetween(Date value1, Date value2) {
|
||||
addCriterion("start_time not between", value1, value2, "startTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEndTimeIsNull() {
|
||||
addCriterion("end_time is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEndTimeIsNotNull() {
|
||||
addCriterion("end_time is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEndTimeEqualTo(Date value) {
|
||||
addCriterion("end_time =", value, "endTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEndTimeNotEqualTo(Date value) {
|
||||
addCriterion("end_time <>", value, "endTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEndTimeGreaterThan(Date value) {
|
||||
addCriterion("end_time >", value, "endTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEndTimeGreaterThanOrEqualTo(Date value) {
|
||||
addCriterion("end_time >=", value, "endTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEndTimeLessThan(Date value) {
|
||||
addCriterion("end_time <", value, "endTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEndTimeLessThanOrEqualTo(Date value) {
|
||||
addCriterion("end_time <=", value, "endTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEndTimeIn(List<Date> values) {
|
||||
addCriterion("end_time in", values, "endTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEndTimeNotIn(List<Date> values) {
|
||||
addCriterion("end_time not in", values, "endTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEndTimeBetween(Date value1, Date value2) {
|
||||
addCriterion("end_time between", value1, value2, "endTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andEndTimeNotBetween(Date value1, Date value2) {
|
||||
addCriterion("end_time not between", value1, value2, "endTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIsNull() {
|
||||
addCriterion("`status` is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIsNotNull() {
|
||||
addCriterion("`status` is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusEqualTo(Byte value) {
|
||||
addCriterion("`status` =", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotEqualTo(Byte value) {
|
||||
addCriterion("`status` <>", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusGreaterThan(Byte value) {
|
||||
addCriterion("`status` >", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusGreaterThanOrEqualTo(Byte value) {
|
||||
addCriterion("`status` >=", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLessThan(Byte value) {
|
||||
addCriterion("`status` <", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLessThanOrEqualTo(Byte value) {
|
||||
addCriterion("`status` <=", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIn(List<Byte> values) {
|
||||
addCriterion("`status` in", values, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotIn(List<Byte> values) {
|
||||
addCriterion("`status` not in", values, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusBetween(Byte value1, Byte value2) {
|
||||
addCriterion("`status` between", value1, value2, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotBetween(Byte value1, Byte value2) {
|
||||
addCriterion("`status` not between", value1, value2, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIsNull() {
|
||||
addCriterion("create_time is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIsNotNull() {
|
||||
addCriterion("create_time is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeEqualTo(Date value) {
|
||||
addCriterion("create_time =", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotEqualTo(Date value) {
|
||||
addCriterion("create_time <>", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeGreaterThan(Date value) {
|
||||
addCriterion("create_time >", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
|
||||
addCriterion("create_time >=", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeLessThan(Date value) {
|
||||
addCriterion("create_time <", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
|
||||
addCriterion("create_time <=", value, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeIn(List<Date> values) {
|
||||
addCriterion("create_time in", values, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotIn(List<Date> values) {
|
||||
addCriterion("create_time not in", values, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeBetween(Date value1, Date value2) {
|
||||
addCriterion("create_time between", value1, value2, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
|
||||
addCriterion("create_time not between", value1, value2, "createTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeIsNull() {
|
||||
addCriterion("update_time is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeIsNotNull() {
|
||||
addCriterion("update_time is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeEqualTo(Date value) {
|
||||
addCriterion("update_time =", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeNotEqualTo(Date value) {
|
||||
addCriterion("update_time <>", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeGreaterThan(Date value) {
|
||||
addCriterion("update_time >", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
|
||||
addCriterion("update_time >=", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeLessThan(Date value) {
|
||||
addCriterion("update_time <", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
|
||||
addCriterion("update_time <=", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeIn(List<Date> values) {
|
||||
addCriterion("update_time in", values, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeNotIn(List<Date> values) {
|
||||
addCriterion("update_time not in", values, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
|
||||
addCriterion("update_time between", value1, value2, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
|
||||
addCriterion("update_time not between", value1, value2, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
||||
protected Criteria() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
public static class Criterion {
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
private Object secondValue;
|
||||
|
||||
private boolean noValue;
|
||||
|
||||
private boolean singleValue;
|
||||
|
||||
private boolean betweenValue;
|
||||
|
||||
private boolean listValue;
|
||||
|
||||
private String typeHandler;
|
||||
|
||||
public String getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getSecondValue() {
|
||||
return secondValue;
|
||||
}
|
||||
|
||||
public boolean isNoValue() {
|
||||
return noValue;
|
||||
}
|
||||
|
||||
public boolean isSingleValue() {
|
||||
return singleValue;
|
||||
}
|
||||
|
||||
public boolean isBetweenValue() {
|
||||
return betweenValue;
|
||||
}
|
||||
|
||||
public boolean isListValue() {
|
||||
return listValue;
|
||||
}
|
||||
|
||||
public String getTypeHandler() {
|
||||
return typeHandler;
|
||||
}
|
||||
|
||||
protected Criterion(String condition) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.typeHandler = null;
|
||||
this.noValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.typeHandler = typeHandler;
|
||||
if (value instanceof List<?>) {
|
||||
this.listValue = true;
|
||||
} else {
|
||||
this.singleValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value) {
|
||||
this(condition, value, null);
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.secondValue = secondValue;
|
||||
this.typeHandler = typeHandler;
|
||||
this.betweenValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) {
|
||||
this(condition, value, secondValue, null);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,33 +0,0 @@
|
||||
package com.accompany.core.mybatismapper;
|
||||
|
||||
import com.accompany.core.model.channel.ChannelContentPartition;
|
||||
import com.accompany.core.model.channel.ChannelContentPartitionExample;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ChannelContentPartitionMapper {
|
||||
long countByExample(ChannelContentPartitionExample example);
|
||||
|
||||
int deleteByExample(ChannelContentPartitionExample example);
|
||||
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
int insert(ChannelContentPartition record);
|
||||
|
||||
int insertSelective(ChannelContentPartition record);
|
||||
|
||||
List<ChannelContentPartition> selectByExample(ChannelContentPartitionExample example);
|
||||
|
||||
ChannelContentPartition selectByPrimaryKey(Long id);
|
||||
|
||||
int updateByExampleSelective(@Param("record") ChannelContentPartition record, @Param("example") ChannelContentPartitionExample example);
|
||||
|
||||
int updateByExample(@Param("record") ChannelContentPartition record, @Param("example") ChannelContentPartitionExample example);
|
||||
|
||||
int updateByPrimaryKeySelective(ChannelContentPartition record);
|
||||
|
||||
int updateByPrimaryKey(ChannelContentPartition record);
|
||||
}
|
@@ -164,20 +164,11 @@ public class AccountService extends ServiceImpl<AccountMapper, Account> {
|
||||
return accountList;
|
||||
}
|
||||
|
||||
public boolean checkPhoneExists(String phone) {
|
||||
Account account = getAccountByPhone(phone);
|
||||
if (account == null) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public String refreshAndGetNetEaseToken(Account account) throws Exception {
|
||||
TokenRet tokenRet = netEaseService.refreshToken(account.getUid().toString());
|
||||
//未注册自动注册云信
|
||||
if (tokenRet != null && StrUtil.isNotEmpty(tokenRet.getDesc()) &&tokenRet.getDesc().contains("not register")) {
|
||||
tokenRet = netEaseService.createNetEaseAcc(String.valueOf(account.getUid()), account.getNeteaseToken(), StrUtil.EMPTY);
|
||||
tokenRet = netEaseService.createNetEaseAcc(String.valueOf(account.getUid()), account.getNeteaseToken(), StrUtil.EMPTY, null,null);
|
||||
}
|
||||
return (String) tokenRet.getInfo().get("token");
|
||||
}
|
||||
|
@@ -5,6 +5,7 @@ import com.accompany.common.netease.neteaseacc.NetEaseBaseClient;
|
||||
import com.accompany.common.netease.neteaseacc.result.SmsRet;
|
||||
import com.accompany.common.netease.neteaseacc.result.TokenRet;
|
||||
import com.accompany.common.netease.util.NetEaseConstant;
|
||||
import com.accompany.common.utils.StringUtils;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.gson.Gson;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -23,90 +24,27 @@ public class NetEaseService {
|
||||
* @param accid
|
||||
* @param token
|
||||
* @param name
|
||||
* @param props
|
||||
* @param icon
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public TokenRet createNetEaseAcc(String accid,String token,String props,String name,String icon) throws Exception{
|
||||
public TokenRet createNetEaseAcc(String accid, String token, String name, String icon, String gender) {
|
||||
String url= NetEaseConstant.basicUrl+ NetEaseConstant.AccUrl.create;
|
||||
NetEaseBaseClient netEaseBaseClient=new NetEaseBaseClient(NetEaseConfig.neteaseAppKey,NetEaseConfig.neteaseAppSecret,url);
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey,NetEaseConfig.neteaseAppSecret,url);
|
||||
Map<String,Object> param= Maps.newHashMap();
|
||||
param.put("accid",accid);
|
||||
param.put("token",token);
|
||||
param.put("name",name);
|
||||
param.put("props",props);
|
||||
param.put("icon",icon);
|
||||
String result=netEaseBaseClient.buildHttpPostParam(param).executePost();
|
||||
log.info("注册网易云账号,accid="+accid+"&token="+token+"&props="+props+"&name="+name+"&icon="+icon+"|&result="+result);
|
||||
param.put("accid", accid);
|
||||
param.put("token", token);
|
||||
param.put("name", name);
|
||||
if (StringUtils.isNotBlank(icon)){
|
||||
param.put("icon", icon);
|
||||
}
|
||||
if (StringUtils.isNotBlank(gender)){
|
||||
param.put("gender", gender);
|
||||
}
|
||||
String result = netEaseBaseClient.buildHttpPostParam(param).executePost();
|
||||
log.info("注册网易云账号,accid="+accid+"&token="+token+"&name="+name+"&icon="+icon+"|&result="+result);
|
||||
Gson gson=new Gson();
|
||||
TokenRet tokenRet= gson.fromJson(result,TokenRet.class);
|
||||
return tokenRet;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建有性别的网易云账号
|
||||
* @param accid
|
||||
* @param token
|
||||
* @param name
|
||||
* @param props
|
||||
* @param icon
|
||||
* @param gender
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public TokenRet createNetEaseAccWithGender(String accid,String token,String props,String name,String icon, String gender) throws Exception{
|
||||
String url= NetEaseConstant.basicUrl+ NetEaseConstant.AccUrl.create;
|
||||
NetEaseBaseClient netEaseBaseClient=new NetEaseBaseClient(NetEaseConfig.neteaseAppKey,NetEaseConfig.neteaseAppSecret,url);
|
||||
Map<String,Object> param= Maps.newHashMap();
|
||||
param.put("accid",accid);
|
||||
param.put("token",token);
|
||||
param.put("name",name);
|
||||
param.put("props",props);
|
||||
param.put("icon",icon);
|
||||
param.put("gender", gender);
|
||||
String result=netEaseBaseClient.buildHttpPostParam(param).executePost();
|
||||
log.info("注册网易云账号,accid="+accid+"&token="+token+"&props="+props+"&name="+name+"&icon="+icon+"|&result="+result);
|
||||
Gson gson=new Gson();
|
||||
TokenRet tokenRet= gson.fromJson(result,TokenRet.class);
|
||||
return tokenRet;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建完网易云账号之后,更新
|
||||
* 特别注意ex是业务方uid,不能再进行修改
|
||||
* @param accid
|
||||
* @param ex
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public TokenRet updateNetEaseAcc(String accid,String ex) throws Exception{
|
||||
String url= NetEaseConstant.basicUrl+ NetEaseConstant.UserUrl.updateUinfo;
|
||||
NetEaseBaseClient netEaseBaseClient=new NetEaseBaseClient(NetEaseConfig.neteaseAppKey,NetEaseConfig.neteaseAppSecret,url);
|
||||
Map<String,Object> param= Maps.newHashMap();
|
||||
param.put("accid",accid);
|
||||
param.put("ex",ex);
|
||||
log.info("updateNetEaseAcc:accid="+accid+"&ex="+ex);
|
||||
String result=netEaseBaseClient.buildHttpPostParam(param).executePost();
|
||||
Gson gson=new Gson();
|
||||
TokenRet tokenRet= gson.fromJson(result,TokenRet.class);
|
||||
return tokenRet;
|
||||
}
|
||||
|
||||
public TokenRet createNetEaseAcc(String accid,String token,String props) throws Exception{
|
||||
TokenRet tokenRet=createNetEaseAcc(accid,token,props,"","");
|
||||
return tokenRet;
|
||||
}
|
||||
|
||||
public TokenRet getNeteaseUsers(String accids) throws Exception{
|
||||
String url=NetEaseConstant.basicUrl+ NetEaseConstant.AccUrl.get;
|
||||
NetEaseBaseClient netEaseBaseClient=new NetEaseBaseClient(NetEaseConfig.neteaseAppKey,NetEaseConfig.neteaseAppSecret,url);
|
||||
Map<String,Object> param= Maps.newHashMap();
|
||||
param.put("accids",accids);
|
||||
String result=netEaseBaseClient.buildHttpPostParam(param).executePost();
|
||||
Gson gson=new Gson();
|
||||
TokenRet TokenRet=new TokenRet();
|
||||
return TokenRet;
|
||||
return gson.fromJson(result,TokenRet.class);
|
||||
}
|
||||
|
||||
public TokenRet refreshToken(String accid) throws Exception{
|
||||
@@ -121,18 +59,6 @@ public class NetEaseService {
|
||||
return tokenRet;
|
||||
}
|
||||
|
||||
public SmsRet queryStatus(Long sendid) throws Exception{
|
||||
String url = "https://api.netease.im/sms/querystatus.action";
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey,NetEaseConfig.neteaseAppSecret,url);
|
||||
Map<String,Object> param= Maps.newHashMap();
|
||||
param.put("sendid",sendid);
|
||||
log.info(param.toString());
|
||||
String result=netEaseBaseClient.buildHttpPostParam(param).executePost();
|
||||
Gson gson=new Gson();
|
||||
SmsRet smsRet=gson.fromJson(result,SmsRet.class);
|
||||
return smsRet;
|
||||
}
|
||||
|
||||
public void block(String accid,String needkick, String kickNotifyExt) throws Exception {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.AccUrl.block;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey,NetEaseConfig.neteaseAppSecret,url);
|
||||
@@ -143,6 +69,7 @@ public class NetEaseService {
|
||||
String result = netEaseBaseClient.buildHttpPostParam(param).executePost();
|
||||
log.info("block accid=" + accid + "&result=" + result);
|
||||
}
|
||||
|
||||
public void unblock(String accid) throws Exception {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.AccUrl.unblock;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey,NetEaseConfig.neteaseAppSecret,url);
|
||||
|
@@ -1,254 +0,0 @@
|
||||
package com.accompany.core.service.channel;
|
||||
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.accompany.common.constant.Constant;
|
||||
import com.accompany.common.device.DeviceInfo;
|
||||
import com.accompany.common.redis.RedisKey;
|
||||
import com.accompany.common.utils.DateTimeUtil;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.accompany.core.model.channel.ChannelContentPartition;
|
||||
import com.accompany.core.model.channel.ChannelContentPartitionExample;
|
||||
import com.accompany.core.mybatismapper.ChannelContentPartitionMapper;
|
||||
import com.accompany.core.mybatismapper.UsersMapper;
|
||||
import com.accompany.core.service.base.BaseService;
|
||||
import com.accompany.core.service.common.JedisService;
|
||||
import com.accompany.core.service.user.UsersBaseService;
|
||||
import lombok.NonNull;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class ChannelContentPartitionService extends BaseService {
|
||||
|
||||
@Autowired
|
||||
private ChannelContentPartitionMapper channelContentPartitionMapper;
|
||||
@Autowired
|
||||
private UsersBaseService usersBaseService;
|
||||
@Autowired
|
||||
private JedisService jedisService;
|
||||
@Autowired
|
||||
private UsersMapper usersMapper;
|
||||
|
||||
|
||||
public ChannelContentPartition queryByUidAndTimeRange(@NonNull Long uid, Date timePoint, DeviceInfo deviceInfo) throws IOException {
|
||||
Users users = usersBaseService.getUsersByUid(uid);
|
||||
if (users == null) return null;
|
||||
if (deviceInfo == null) {
|
||||
logger.info("用户请求未获取到渠道信息:uid:{}", uid);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (timePoint == null) timePoint = new Date();
|
||||
|
||||
if (!jedisService.exits(RedisKey.channel_content_record.getKey())) {
|
||||
initChannelContentCache();
|
||||
}
|
||||
|
||||
Map<String, String> resultMap = jedisService.hgetAll(RedisKey.channel_content_record.getKey());
|
||||
|
||||
if (MapUtil.isEmpty(resultMap)) return null;
|
||||
|
||||
List<ChannelContentPartition> channelList = resultMap.entrySet().stream()
|
||||
.map(entry -> gson.fromJson(entry.getValue(), ChannelContentPartition.class))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
Map<Byte, List<ChannelContentPartition>> userTypeMap = channelList.stream().collect(Collectors.groupingBy(ChannelContentPartition::getUserType));
|
||||
|
||||
List<ChannelContentPartition> pointList = userTypeMap.get(Constant.ChannelUserType.point_user);
|
||||
ChannelContentPartition result = cherryChannelContent(pointList, Constant.ChannelUserType.point_user, timePoint, users, deviceInfo);
|
||||
if (result != null) return result;
|
||||
|
||||
//当天新增用户渠道内容
|
||||
List<ChannelContentPartition> dayList = userTypeMap.get(Constant.ChannelUserType.current_day_user);
|
||||
result = cherryChannelContent(dayList, Constant.ChannelUserType.current_day_user, timePoint, users, deviceInfo);
|
||||
if (result != null) return result;
|
||||
|
||||
List<ChannelContentPartition> allList = userTypeMap.get(Constant.ChannelUserType.all_user);
|
||||
result = cherryChannelContent(allList, Constant.ChannelUserType.all_user, timePoint, users, deviceInfo);
|
||||
return result;
|
||||
}
|
||||
|
||||
public void initChannelContentCache() throws IOException {
|
||||
ChannelContentPartitionExample example = new ChannelContentPartitionExample();
|
||||
ChannelContentPartitionExample.Criteria criteria = example.createCriteria();
|
||||
criteria.andStatusEqualTo(Constant.ChannelContentStatus.exist);
|
||||
List<ChannelContentPartition> list = channelContentPartitionMapper.selectByExample(example);
|
||||
|
||||
jedisService.doInPipeline((pipeline) -> list.stream().forEach(channelContent -> pipeline.hset(RedisKey.channel_content_record.getKey(),
|
||||
String.valueOf(channelContent.getId()),gson.toJson(channelContent))));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param list
|
||||
* @param userType
|
||||
* @param timePoint
|
||||
* @param users
|
||||
* @param deviceInfo
|
||||
* @return
|
||||
*/
|
||||
public ChannelContentPartition cherryChannelContent(List<ChannelContentPartition> list, Byte userType, Date timePoint, Users users, DeviceInfo deviceInfo) {
|
||||
if (CollectionUtils.isEmpty(list)) return null;
|
||||
|
||||
ChannelContentPartition result = null;
|
||||
|
||||
String erbanNoStr = String.valueOf(users.getErbanNo());
|
||||
if (Constant.ChannelUserType.point_user.equals(userType)) {
|
||||
//指定用户
|
||||
for (ChannelContentPartition channelContent : list) {
|
||||
if (channelContent.getUserErbanNo().indexOf(erbanNoStr) != -1 && checkTimeSection(timePoint, channelContent) && channelContent.getChannel().equals(deviceInfo.getChannel())) return channelContent;
|
||||
}
|
||||
}
|
||||
|
||||
if (Constant.ChannelUserType.current_day_user.equals(userType)) {
|
||||
String key = RedisKey.current_day_new_user.getKey();
|
||||
//不是当日新增用户不处理
|
||||
if (!jedisService.sismember(key, String.valueOf(users.getErbanNo()))) return result;
|
||||
|
||||
for (ChannelContentPartition channelContent : list) {
|
||||
if (checkTimeSection(timePoint, channelContent) && channelContent.getChannel().equals(deviceInfo.getChannel())) return channelContent;
|
||||
}
|
||||
}
|
||||
|
||||
if (Constant.ChannelUserType.all_user.equals(userType)) {
|
||||
for (ChannelContentPartition channelContent : list) {
|
||||
if (checkTimeSection(timePoint, channelContent) && channelContent.getChannel().equals(deviceInfo.getChannel())) return channelContent;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public Boolean checkTimeSection(Date timePoint, ChannelContentPartition channelContentPartition) {
|
||||
return (timePoint.after(channelContentPartition.getStartTime()) && timePoint.before(channelContentPartition.getEndTime()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 依据当前登录账号uid,获取渠道内容对应的房主uid
|
||||
* 按渠道内容过滤
|
||||
*
|
||||
* @param uid
|
||||
* @return
|
||||
*/
|
||||
public List<Long> getChannelRommErbanList(Long uid, DeviceInfo deviceInfo) throws IOException {
|
||||
List<Long> resultList = new ArrayList<>();
|
||||
if (uid == null) return resultList;
|
||||
|
||||
ChannelContentPartition channelContentPartition = queryByUidAndTimeRange(uid, new Date(), deviceInfo);
|
||||
if (channelContentPartition == null) return resultList;
|
||||
|
||||
//渠道内容房主erbanNo
|
||||
String roomErbanNo = channelContentPartition.getRoomErbanNo();
|
||||
List<String> erbanList = Arrays.stream(roomErbanNo.split(StrUtil.COMMA)).collect(Collectors.toList());
|
||||
|
||||
List<String> uidStrList = usersBaseService.getUidByErbanNo(erbanList);
|
||||
resultList = uidStrList.stream().map(uidStr -> Long.valueOf(uidStr)).collect(Collectors.toList());
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查新用户的注册时间是否恰好落在类型为当日新增用户类型对应的某一渠道内
|
||||
* @param timePoint
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
public boolean checkNewUserTime(Date timePoint) throws IOException {
|
||||
if (timePoint == null) timePoint = new Date();
|
||||
|
||||
if (!jedisService.exits(RedisKey.channel_content_record.getKey())) {
|
||||
initChannelContentCache();
|
||||
}
|
||||
|
||||
Map<String, String> resultMap = jedisService.hgetAll(RedisKey.channel_content_record.getKey());
|
||||
|
||||
if (MapUtil.isEmpty(resultMap)) return false;
|
||||
|
||||
List<ChannelContentPartition> channelList = resultMap.entrySet().stream()
|
||||
.map(entry -> gson.fromJson(entry.getValue(), ChannelContentPartition.class)).filter(channelContentPartition -> Constant.ChannelUserType.current_day_user.equals(channelContentPartition.getUserType()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (CollectionUtils.isEmpty(channelList)) return false;
|
||||
|
||||
for (ChannelContentPartition content: channelList){
|
||||
Long timePointMs = timePoint.getTime();
|
||||
if (timePointMs >= content.getStartTime().getTime() && timePointMs <= content.getEndTime().getTime()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@NotNull
|
||||
public List<Long> getAllErbanNoList(List<ChannelContentPartition> channelList) {
|
||||
List<Long> allErbanNoList = new ArrayList<>();
|
||||
Long currentTimeMs = new Date().getTime();
|
||||
for (ChannelContentPartition channel : channelList) {
|
||||
//过期的不要
|
||||
if (channel.getEndTime().getTime() <= currentTimeMs) continue;
|
||||
String startDate = DateTimeUtil.convertDate(channel.getStartTime(), DateTimeUtil.DEFAULT_DATE_PATTERN);
|
||||
String endDate = DateTimeUtil.convertDate(channel.getEndTime(), DateTimeUtil.DEFAULT_DATE_PATTERN);
|
||||
List<Long> erbanNoList = usersMapper.getErbanNoListByCreateTime(startDate, endDate);
|
||||
if (CollectionUtils.isEmpty(erbanNoList)) continue;
|
||||
allErbanNoList.addAll(erbanNoList);
|
||||
}
|
||||
return allErbanNoList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param allErbanNoList
|
||||
* @param flag:true-调整渠道操作,false-用户注册新增
|
||||
*/
|
||||
public void dealSyncCache(List<Long> allErbanNoList, boolean flag) {
|
||||
String lockKey = RedisKey.current_day_new_user_lock.getKey();
|
||||
String lockVal = jedisLockService.lock(lockKey);
|
||||
|
||||
if (StringUtils.isEmpty(lockVal)) return;
|
||||
|
||||
try {
|
||||
if (flag) {
|
||||
jedisService.del(RedisKey.current_day_new_user.getKey());
|
||||
}
|
||||
jedisService.saddSet(RedisKey.current_day_new_user.getKey(), allErbanNoList);
|
||||
}finally {
|
||||
jedisLockService.unlock(lockKey, lockVal);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 校验用户是否符合渠道过滤
|
||||
* @return
|
||||
*/
|
||||
public Boolean checkUserChannelContent(Long uid, DeviceInfo deviceInfo) throws IOException{
|
||||
if (uid == null) return false;
|
||||
ChannelContentPartition channelContentPartition = queryByUidAndTimeRange(uid, new Date(), deviceInfo);
|
||||
if (channelContentPartition == null) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 按渠道内容过滤
|
||||
*/
|
||||
public <T> List<T> filterByChannelContent(Long uid, DeviceInfo deviceInfo, List<T> list, BiFunction<List<Long>, List<T>, List<T>> function) throws IOException {
|
||||
List<Long> uidList = this.getChannelRommErbanList(uid, deviceInfo);
|
||||
if (CollectionUtils.isEmpty(uidList)) return list;
|
||||
if (CollectionUtils.isEmpty(list)) return list;
|
||||
return function.apply(uidList, list);
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -313,15 +313,6 @@ public class UsersBaseService extends BaseService {
|
||||
saveUserCache(userDb);
|
||||
}
|
||||
|
||||
public void updateWxOpenIdAndGender(Users users) {
|
||||
if (users == null) {
|
||||
return;
|
||||
}
|
||||
Users user = new Users();
|
||||
user.setUid(users.getUid());
|
||||
updateUser(user);
|
||||
}
|
||||
|
||||
|
||||
public int updateByErbanNo(Long uid, Long erbanNo, boolean isPrettyNo) {
|
||||
Boolean result = accountService.updateAccountErbanNo(uid, erbanNo);
|
||||
|
@@ -1,302 +0,0 @@
|
||||
<?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.accompany.core.mybatismapper.ChannelContentPartitionMapper">
|
||||
<resultMap id="BaseResultMap" type="com.accompany.core.model.channel.ChannelContentPartition">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="channel" jdbcType="VARCHAR" property="channel" />
|
||||
<result column="user_type" jdbcType="TINYINT" property="userType" />
|
||||
<result column="user_erban_no" jdbcType="VARCHAR" property="userErbanNo" />
|
||||
<result column="room_erban_no" jdbcType="VARCHAR" property="roomErbanNo" />
|
||||
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
|
||||
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
|
||||
<result column="status" jdbcType="TINYINT" property="status" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Update_By_Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, channel, user_type, user_erban_no, room_erban_no, start_time, end_time, `status`,
|
||||
create_time, update_time
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.accompany.core.model.channel.ChannelContentPartitionExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from channel_content_partition
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="limit != null">
|
||||
<if test="offset != null">
|
||||
limit ${offset}, ${limit}
|
||||
</if>
|
||||
<if test="offset == null">
|
||||
limit ${limit}
|
||||
</if>
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from channel_content_partition
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from channel_content_partition
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.accompany.core.model.channel.ChannelContentPartitionExample">
|
||||
delete from channel_content_partition
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.accompany.core.model.channel.ChannelContentPartition">
|
||||
insert into channel_content_partition (id, channel, user_type,
|
||||
user_erban_no, room_erban_no, start_time,
|
||||
end_time, `status`, create_time,
|
||||
update_time)
|
||||
values (#{id,jdbcType=BIGINT}, #{channel,jdbcType=VARCHAR}, #{userType,jdbcType=TINYINT},
|
||||
#{userErbanNo,jdbcType=VARCHAR}, #{roomErbanNo,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP},
|
||||
#{endTime,jdbcType=TIMESTAMP}, #{status,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{updateTime,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.accompany.core.model.channel.ChannelContentPartition">
|
||||
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">SELECT LAST_INSERT_ID()</selectKey>
|
||||
insert into channel_content_partition
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="channel != null">
|
||||
channel,
|
||||
</if>
|
||||
<if test="userType != null">
|
||||
user_type,
|
||||
</if>
|
||||
<if test="userErbanNo != null">
|
||||
user_erban_no,
|
||||
</if>
|
||||
<if test="roomErbanNo != null">
|
||||
room_erban_no,
|
||||
</if>
|
||||
<if test="startTime != null">
|
||||
start_time,
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
end_time,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
`status`,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="channel != null">
|
||||
#{channel,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userType != null">
|
||||
#{userType,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="userErbanNo != null">
|
||||
#{userErbanNo,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="roomErbanNo != null">
|
||||
#{roomErbanNo,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="startTime != null">
|
||||
#{startTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
#{endTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.accompany.core.model.channel.ChannelContentPartitionExample" resultType="java.lang.Long">
|
||||
select count(*) from channel_content_partition
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update channel_content_partition
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.channel != null">
|
||||
channel = #{record.channel,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.userType != null">
|
||||
user_type = #{record.userType,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="record.userErbanNo != null">
|
||||
user_erban_no = #{record.userErbanNo,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.roomErbanNo != null">
|
||||
room_erban_no = #{record.roomErbanNo,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.startTime != null">
|
||||
start_time = #{record.startTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.endTime != null">
|
||||
end_time = #{record.endTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.status != null">
|
||||
`status` = #{record.status,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="record.createTime != null">
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update channel_content_partition
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
channel = #{record.channel,jdbcType=VARCHAR},
|
||||
user_type = #{record.userType,jdbcType=TINYINT},
|
||||
user_erban_no = #{record.userErbanNo,jdbcType=VARCHAR},
|
||||
room_erban_no = #{record.roomErbanNo,jdbcType=VARCHAR},
|
||||
start_time = #{record.startTime,jdbcType=TIMESTAMP},
|
||||
end_time = #{record.endTime,jdbcType=TIMESTAMP},
|
||||
`status` = #{record.status,jdbcType=TINYINT},
|
||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.accompany.core.model.channel.ChannelContentPartition">
|
||||
update channel_content_partition
|
||||
<set>
|
||||
<if test="channel != null">
|
||||
channel = #{channel,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userType != null">
|
||||
user_type = #{userType,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="userErbanNo != null">
|
||||
user_erban_no = #{userErbanNo,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="roomErbanNo != null">
|
||||
room_erban_no = #{roomErbanNo,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="startTime != null">
|
||||
start_time = #{startTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
end_time = #{endTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
`status` = #{status,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.accompany.core.model.channel.ChannelContentPartition">
|
||||
update channel_content_partition
|
||||
set channel = #{channel,jdbcType=VARCHAR},
|
||||
user_type = #{userType,jdbcType=TINYINT},
|
||||
user_erban_no = #{userErbanNo,jdbcType=VARCHAR},
|
||||
room_erban_no = #{roomErbanNo,jdbcType=VARCHAR},
|
||||
start_time = #{startTime,jdbcType=TIMESTAMP},
|
||||
end_time = #{endTime,jdbcType=TIMESTAMP},
|
||||
`status` = #{status,jdbcType=TINYINT},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
@@ -271,9 +271,6 @@
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="wxOpenid != null">
|
||||
wx_openId,
|
||||
</if>
|
||||
<if test="roomUid != null">
|
||||
room_uid,
|
||||
</if>
|
||||
@@ -902,12 +899,6 @@
|
||||
<if test="deviceBlockEndTime != null">
|
||||
device_block_end_time = #{deviceBlockEndTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="nobleId != null">
|
||||
noble_id = #{nobleId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="nobleName != null">
|
||||
noble_name = #{nobleName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="paymentPwd != null">
|
||||
payment_pwd = #{paymentPwd,jdbcType=VARCHAR},
|
||||
</if>
|
||||
@@ -986,8 +977,6 @@
|
||||
acc_block_end_time = #{accBlockEndTime,jdbcType=TIMESTAMP},
|
||||
device_block_start_time = #{deviceBlockStartTime,jdbcType=TIMESTAMP},
|
||||
device_block_end_time = #{deviceBlockEndTime,jdbcType=TIMESTAMP},
|
||||
noble_id = #{nobleId,jdbcType=INTEGER},
|
||||
noble_name = #{nobleName,jdbcType=VARCHAR},
|
||||
payment_pwd = #{paymentPwd,jdbcType=VARCHAR},
|
||||
real_name = #{realName,jdbcType=VARCHAR},
|
||||
id_card_num = #{idCardNum,jdbcType=VARCHAR},
|
||||
|
@@ -2947,7 +2947,6 @@ public class Constant {
|
||||
}
|
||||
|
||||
public static class BigGooseConstant {
|
||||
public static final String big_goose_appver = "1.0.0";//appversion
|
||||
//推荐位非置顶麦上人数要求
|
||||
public static final Integer home_not_top_default_mic_num = 3;//appversion
|
||||
//热门房间麦上人数要求
|
||||
@@ -3815,26 +3814,6 @@ public class Constant {
|
||||
|
||||
}
|
||||
|
||||
//渠道内容时段类型
|
||||
public static class ChannelUserType {
|
||||
//当日新增用户
|
||||
public static final Byte current_day_user = 1;
|
||||
//所有用户
|
||||
public static final Byte all_user = 2;
|
||||
//指定用户
|
||||
public static final Byte point_user = 3;
|
||||
}
|
||||
|
||||
// 渠道内容状态
|
||||
public static class ChannelContentStatus {
|
||||
//删除
|
||||
public static final Byte del = 0;
|
||||
//有效
|
||||
public static final Byte exist = 1;
|
||||
//无效
|
||||
public static final Byte invalid = 2;
|
||||
}
|
||||
|
||||
public static final class GooglePurchaseState {
|
||||
/**
|
||||
* 已支付
|
||||
|
@@ -1,9 +1,8 @@
|
||||
package com.accompany.common.netease.neteaseacc;
|
||||
|
||||
import com.accompany.common.netease.neteaseacc.result.TokenRet;
|
||||
import com.accompany.common.netease.util.CheckSumBuilder;
|
||||
import com.accompany.common.utils.StringUtils;
|
||||
import com.google.gson.Gson;
|
||||
import lombok.SneakyThrows;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.HttpHeaders;
|
||||
import org.apache.http.HttpResponse;
|
||||
@@ -41,23 +40,6 @@ public class NetEaseBaseClient {
|
||||
/** tcp响应超时时间 */
|
||||
private long readTimeoutMillis = 5000L;
|
||||
|
||||
// @Deprecated
|
||||
// public NetEaseBaseClient(String url) {
|
||||
// httpPost = new HttpPost(url);
|
||||
// String appKey = "";//NetEaseConstant.appKey;
|
||||
// String appSecret = "";//NetEaseConstant.appSecret;
|
||||
// String nonce = "12345";
|
||||
// String curTime = String.valueOf((new Date()).getTime() / 1000L);
|
||||
// String checkSum = CheckSumBuilder.getCheckSum(appSecret, nonce, curTime);//参考 计算CheckSum的java代码
|
||||
//
|
||||
// // 设置请求的header
|
||||
// httpPost.addHeader("AppKey", appKey);
|
||||
// httpPost.addHeader("Nonce", nonce);
|
||||
// httpPost.addHeader("CurTime", curTime);
|
||||
// httpPost.addHeader("CheckSum", checkSum);
|
||||
// httpPost.addHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
|
||||
// }
|
||||
|
||||
public NetEaseBaseClient(String appKey, String appSecret, String url) {
|
||||
httpPost = new HttpPost(url);
|
||||
String nonce = "12345";
|
||||
@@ -78,11 +60,12 @@ public class NetEaseBaseClient {
|
||||
httpPost.addHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
|
||||
}
|
||||
|
||||
public String executePost() throws Exception {
|
||||
public String executePost() {
|
||||
return executePost("");
|
||||
}
|
||||
|
||||
public String executePost(String charsetName) throws Exception {
|
||||
@SneakyThrows
|
||||
public String executePost(String charsetName) {
|
||||
HttpResponse response = httpClient.execute(httpPost);
|
||||
InputStream is = response.getEntity().getContent();
|
||||
BufferedReader reader = null;
|
||||
@@ -115,14 +98,8 @@ public class NetEaseBaseClient {
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String executePost2() throws IOException {
|
||||
HttpResponse response = httpClient.execute(httpPost);
|
||||
HttpEntity entity = response.getEntity();
|
||||
String respContent = EntityUtils.toString(entity, "GBK").trim();
|
||||
return respContent;
|
||||
}
|
||||
|
||||
public NetEaseBaseClient buildHttpPostParam(Map<String, Object> param) throws Exception {
|
||||
@SneakyThrows
|
||||
public NetEaseBaseClient buildHttpPostParam(Map<String, Object> param) {
|
||||
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
|
||||
for (Map.Entry<String, Object> entry : param.entrySet()) {
|
||||
Object value = entry.getValue();
|
||||
@@ -135,14 +112,4 @@ public class NetEaseBaseClient {
|
||||
return this;
|
||||
}
|
||||
|
||||
//{"code":200,"info":{"token":"c7f302b637099dc3039761ff3b45a21a","accid":"helloworld2","name":""}}
|
||||
//{"desc":"already register","code":414}
|
||||
public static void main(String args[]) {
|
||||
String str = "{\"code\":200,\"info\":{\"token\":\"c7f302b637099dc3039761ff3b45a21a\",\"accid\":\"helloworld2\",\"name\":\"\"}}";
|
||||
Gson gson = new Gson();
|
||||
TokenRet map = gson.fromJson(str, TokenRet.class);
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -1,25 +0,0 @@
|
||||
package com.accompany.common.netease.neteaseacc.result;
|
||||
|
||||
/**
|
||||
* Created by liuguofu on 2017/7/17.
|
||||
*/
|
||||
public class FileUploadRet {
|
||||
private int code;
|
||||
private String url;
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
}
|
@@ -1,4 +0,0 @@
|
||||
package com.accompany.common.netease.neteaseacc.result;
|
||||
|
||||
public class UserInfoRet {
|
||||
}
|
@@ -145,12 +145,6 @@ public enum RedisKey {
|
||||
sensitive_add_word,
|
||||
//敏感词过期时间
|
||||
sensitive_expire_time,
|
||||
//国庆活动锁
|
||||
act_national_lock,
|
||||
//送审核账号(过滤所有小秘书消息)
|
||||
audit_use_account,
|
||||
//系统消息是否过滤审核账号
|
||||
filter_audit_account_segment,
|
||||
|
||||
oper_act, // 运营活动内容
|
||||
//admin_session存储
|
||||
@@ -1136,12 +1130,6 @@ public enum RedisKey {
|
||||
|
||||
user_follow_limit_count, // 用户每日新增关注数
|
||||
|
||||
/*渠道内容*/
|
||||
channel_content_record,//渠道内容:Hash
|
||||
|
||||
current_day_new_user,//指定时段注册的用户平台号缓存Set
|
||||
current_day_new_user_lock,//渠道调整和用户注册缓存添加锁
|
||||
|
||||
user_give_diamond_daily_num, // 用户每日转赠钻石数量
|
||||
user_give_diamond_lock, // 用户转赠钻石锁
|
||||
|
||||
|
@@ -1,24 +1,18 @@
|
||||
package com.accompany.core.service.base;
|
||||
|
||||
import com.accompany.common.redis.RedisKey;
|
||||
import com.accompany.common.utils.AppVersionUtil;
|
||||
import com.accompany.common.utils.GsonUtil;
|
||||
import com.accompany.core.service.common.JedisLockService;
|
||||
import com.accompany.core.service.common.JedisService;
|
||||
import com.google.gson.Gson;
|
||||
import lombok.NonNull;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
@Service
|
||||
public class BaseService {
|
||||
@@ -33,15 +27,6 @@ public class BaseService {
|
||||
@Autowired
|
||||
protected JedisLockService jedisLockService;
|
||||
|
||||
|
||||
public String getTicketCacheByUid(Long uid){
|
||||
String ticketStr=jedisService.hget(RedisKey.uid_ticket.getKey(),uid.toString());
|
||||
if(StringUtils.isEmpty(ticketStr)){
|
||||
return null;
|
||||
}
|
||||
return ticketStr;
|
||||
}
|
||||
|
||||
//对list进行分页
|
||||
public <T> List<T> subListByPage(@NonNull Integer pageNum, @NonNull Integer pageSize, List<T> list) {
|
||||
if (CollectionUtils.isEmpty(list)) return Collections.emptyList();
|
||||
@@ -55,34 +40,11 @@ public class BaseService {
|
||||
return list.subList(startIndex, endIndex);
|
||||
}
|
||||
|
||||
//对集合对象按指定属性去重
|
||||
protected <T> Predicate<T> distinctByKey(Function<? super T, Object> keyExtractor) {
|
||||
Map<Object, Boolean> seen = new ConcurrentHashMap<>();
|
||||
return t -> seen.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null;
|
||||
}
|
||||
|
||||
protected <T> List<T> randomPickFromCollection(List<T> list, int n) {
|
||||
Map<Integer,String> map = new HashMap();
|
||||
List<T> resutList = new ArrayList();
|
||||
if (list.size() <= n) return list;
|
||||
|
||||
while (map.size() < n) {
|
||||
int random = (int)(Math.random() * list.size());
|
||||
if (!map.containsKey(random)) {
|
||||
map.put(random, "");
|
||||
resutList.add(list.get(random));
|
||||
}
|
||||
}
|
||||
return resutList;
|
||||
}
|
||||
|
||||
|
||||
public <T> void checkIsCrossPking(List<T> list, Consumer<List<T>> consumer) {
|
||||
if (CollectionUtils.isEmpty(list)) return;
|
||||
consumer.accept(list);
|
||||
}
|
||||
|
||||
|
||||
//对list进行分页
|
||||
public <T> List<T> subList(@NonNull Integer startIndex, @NonNull Integer endIndex, List<T> list) {
|
||||
if (CollectionUtils.isEmpty(list)) return Collections.emptyList();
|
||||
@@ -93,23 +55,4 @@ public class BaseService {
|
||||
return list.subList(startIndex, endIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param currentAppVersion:当前app版本
|
||||
* @param needVersion:需要的版本
|
||||
* @return
|
||||
*/
|
||||
public Boolean versionCheck(String currentAppVersion, String needVersion) {
|
||||
if (StringUtils.isEmpty(currentAppVersion)) {
|
||||
logger.info("app首页请求没有携带版本信息...");
|
||||
return false;
|
||||
}
|
||||
if (AppVersionUtil.compareVersion(currentAppVersion, needVersion) < 0) {
|
||||
return false;
|
||||
}else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -1,7 +0,0 @@
|
||||
package com.accompany.payment.exception;
|
||||
|
||||
public class CompletedException extends Exception {
|
||||
public CompletedException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
@@ -1,7 +0,0 @@
|
||||
package com.accompany.payment.exception;
|
||||
|
||||
public class ExpiredException extends Exception {
|
||||
public ExpiredException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
package com.accompany.payment.exception;
|
||||
|
||||
public class GlobalException extends RuntimeException {
|
||||
private String retCode;
|
||||
private String retMsg;
|
||||
|
||||
|
||||
public GlobalException(String retCode) {
|
||||
super(retCode);
|
||||
this.retCode = retCode;
|
||||
}
|
||||
|
||||
public GlobalException(Exception e) {
|
||||
super(e);
|
||||
}
|
||||
|
||||
public GlobalException(Exception e, String retMsg) {
|
||||
super(e);
|
||||
this.retMsg = retMsg;
|
||||
}
|
||||
|
||||
public GlobalException(String retCode, String retMsg) {
|
||||
super(retCode);
|
||||
this.retCode = retCode;
|
||||
this.retMsg = retMsg;
|
||||
}
|
||||
|
||||
public String getRetMsg() {
|
||||
return retMsg;
|
||||
}
|
||||
|
||||
public void setRetMsg(String retMsg) {
|
||||
this.retMsg = retMsg;
|
||||
}
|
||||
|
||||
public String getRetCode() {
|
||||
return retCode;
|
||||
}
|
||||
}
|
@@ -1,7 +0,0 @@
|
||||
package com.accompany.payment.exception;
|
||||
|
||||
public class PaymentNotReceivedException extends Exception {
|
||||
public PaymentNotReceivedException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
@@ -1,7 +0,0 @@
|
||||
package com.accompany.payment.exception;
|
||||
|
||||
public class PermissionDeniedException extends Exception {
|
||||
public PermissionDeniedException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
@@ -1,7 +0,0 @@
|
||||
package com.accompany.payment.exception;
|
||||
|
||||
public class UnknownException extends Exception {
|
||||
public UnknownException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
@@ -15,7 +15,6 @@
|
||||
SELECT
|
||||
t.*
|
||||
FROM
|
||||
(
|
||||
(SELECT
|
||||
c.world_id AS worldId,
|
||||
c.content,
|
||||
@@ -51,32 +50,6 @@
|
||||
</if>
|
||||
</if>
|
||||
</trim>
|
||||
)
|
||||
UNION ALL
|
||||
(SELECT
|
||||
NULL AS worldId,
|
||||
'我在声音匹配录制新声音了,来听听吧~' AS content,
|
||||
v.like_count AS likeCount,
|
||||
0 AS commentCount,
|
||||
NULL AS dynamicId,
|
||||
v.create_time AS publishTime,
|
||||
'声音匹配' AS tag,
|
||||
v.play_count AS playCount,
|
||||
v.id AS voiceId,
|
||||
1 AS type,
|
||||
v.status,
|
||||
v.uid,
|
||||
u.nick,
|
||||
u.avatar
|
||||
FROM
|
||||
user_voice v
|
||||
LEFT JOIN users u ON u.uid = v.uid
|
||||
WHERE
|
||||
<![CDATA[ v.`status` <> 3 ]]>
|
||||
<if test="uid != null">
|
||||
and v.uid = #{uid}
|
||||
</if>
|
||||
)
|
||||
) t
|
||||
<trim prefix="where" prefixOverrides="AND |OR">
|
||||
<if test="typeList != null" >
|
||||
|
@@ -1,65 +0,0 @@
|
||||
package com.accompany.business.model;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class Feedback {
|
||||
private String feedbackId;
|
||||
|
||||
private Long uid;
|
||||
|
||||
private String feedbackDesc;
|
||||
|
||||
private String imgUrl;
|
||||
|
||||
private String contact;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
public String getFeedbackId() {
|
||||
return feedbackId;
|
||||
}
|
||||
|
||||
public void setFeedbackId(String feedbackId) {
|
||||
this.feedbackId = feedbackId == null ? null : feedbackId.trim();
|
||||
}
|
||||
|
||||
public Long getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(Long uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public String getFeedbackDesc() {
|
||||
return feedbackDesc;
|
||||
}
|
||||
|
||||
public void setFeedbackDesc(String feedbackDesc) {
|
||||
this.feedbackDesc = feedbackDesc == null ? null : feedbackDesc.trim();
|
||||
}
|
||||
|
||||
public String getImgUrl() {
|
||||
return imgUrl;
|
||||
}
|
||||
|
||||
public void setImgUrl(String imgUrl) {
|
||||
this.imgUrl = imgUrl == null ? null : imgUrl.trim();
|
||||
}
|
||||
|
||||
public String getContact() {
|
||||
return contact;
|
||||
}
|
||||
|
||||
public void setContact(String contact) {
|
||||
this.contact = contact == null ? null : contact.trim();
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
}
|
@@ -1,100 +0,0 @@
|
||||
package com.accompany.business.vo;
|
||||
|
||||
/**
|
||||
* {这里添加描述}
|
||||
*
|
||||
* @author fangchengyan
|
||||
* @date 2019-08-08 11:28
|
||||
*/
|
||||
public class BankCardSignVo {
|
||||
|
||||
/** 签约记录id */
|
||||
private Long recordId;
|
||||
|
||||
/** 用户uid */
|
||||
private Long uid;
|
||||
|
||||
/** 用户银行卡号,脱敏处理 */
|
||||
private String bankCardNo;
|
||||
|
||||
/** 是否默认 */
|
||||
private Integer defaultFlag;
|
||||
|
||||
/** 银行名称 */
|
||||
private String bankName;
|
||||
|
||||
/** 银行logo */
|
||||
private String bankLogo;
|
||||
|
||||
/** 银行卡类型,CC-信用卡,DC-储蓄卡 */
|
||||
private String cardType;
|
||||
|
||||
public Long getRecordId() {
|
||||
return recordId;
|
||||
}
|
||||
|
||||
public void setRecordId(Long recordId) {
|
||||
this.recordId = recordId;
|
||||
}
|
||||
|
||||
public String getCardType() {
|
||||
return cardType;
|
||||
}
|
||||
|
||||
public void setCardType(String cardType) {
|
||||
this.cardType = cardType;
|
||||
}
|
||||
|
||||
public String getBankName() {
|
||||
return bankName;
|
||||
}
|
||||
|
||||
public void setBankName(String bankName) {
|
||||
this.bankName = bankName;
|
||||
}
|
||||
|
||||
public String getBankLogo() {
|
||||
return bankLogo;
|
||||
}
|
||||
|
||||
public void setBankLogo(String bankLogo) {
|
||||
this.bankLogo = bankLogo;
|
||||
}
|
||||
|
||||
public Long getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(Long uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public String getBankCardNo() {
|
||||
return bankCardNo;
|
||||
}
|
||||
|
||||
public void setBankCardNo(String bankCardNo) {
|
||||
this.bankCardNo = bankCardNo;
|
||||
}
|
||||
|
||||
public Integer getDefaultFlag() {
|
||||
return defaultFlag;
|
||||
}
|
||||
|
||||
public void setDefaultFlag(Integer defaultFlag) {
|
||||
this.defaultFlag = defaultFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BankCardSignVo{" +
|
||||
"recordId=" + recordId +
|
||||
", uid=" + uid +
|
||||
", bankCardNo='" + bankCardNo + '\'' +
|
||||
", defaultFlag=" + defaultFlag +
|
||||
", bankName='" + bankName + '\'' +
|
||||
", bankLogo='" + bankLogo + '\'' +
|
||||
", cardType='" + cardType + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@@ -1,27 +0,0 @@
|
||||
package com.accompany.business.vo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by PaperCut on 2018/4/19.
|
||||
*/
|
||||
public class BannerV3Vo {
|
||||
private List<BannerVo> topBanner;
|
||||
private List<BannerVo> botBanner;
|
||||
|
||||
public List<BannerVo> getTopBanner() {
|
||||
return topBanner;
|
||||
}
|
||||
|
||||
public void setTopBanner(List<BannerVo> topBanner) {
|
||||
this.topBanner = topBanner;
|
||||
}
|
||||
|
||||
public List<BannerVo> getBotBanner() {
|
||||
return botBanner;
|
||||
}
|
||||
|
||||
public void setBotBanner(List<BannerVo> botBanner) {
|
||||
this.botBanner = botBanner;
|
||||
}
|
||||
}
|
@@ -1,126 +0,0 @@
|
||||
package com.accompany.business.vo;
|
||||
|
||||
import com.accompany.common.annotation.ReplaceAppDomain;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by liuguofu on 2017/11/25.
|
||||
*/
|
||||
public class GiftSendVo {
|
||||
private Long uid;
|
||||
@ReplaceAppDomain
|
||||
private String avatar;
|
||||
private String nick;
|
||||
|
||||
private Long targetUid;
|
||||
|
||||
private List<Long> targetUids;//全麦送使用
|
||||
|
||||
@ReplaceAppDomain
|
||||
private String targetAvatar;
|
||||
private String targetNick;
|
||||
|
||||
private Integer giftId;
|
||||
private GiftVo gift;
|
||||
private int giftNum;
|
||||
private List<RoomGiftValueVo> giftValueVos;//房间麦上所有用户礼物值
|
||||
|
||||
private Long currentTime;//当前时间戳
|
||||
|
||||
public Long getCurrentTime() {
|
||||
return currentTime;
|
||||
}
|
||||
|
||||
public void setCurrentTime(Long currentTime) {
|
||||
this.currentTime = currentTime;
|
||||
}
|
||||
|
||||
public List<RoomGiftValueVo> getGiftValueVos() {
|
||||
return giftValueVos;
|
||||
}
|
||||
|
||||
public void setGiftValueVos(List<RoomGiftValueVo> giftValueVos) {
|
||||
this.giftValueVos = giftValueVos;
|
||||
}
|
||||
|
||||
public Long getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public List<Long> getTargetUids() {
|
||||
return targetUids;
|
||||
}
|
||||
|
||||
public void setTargetUids(List<Long> targetUids) {
|
||||
this.targetUids = targetUids;
|
||||
}
|
||||
|
||||
public void setUid(Long uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public String getNick() {
|
||||
return nick;
|
||||
}
|
||||
|
||||
public void setNick(String nick) {
|
||||
this.nick = nick;
|
||||
}
|
||||
|
||||
public Long getTargetUid() {
|
||||
return targetUid;
|
||||
}
|
||||
|
||||
public void setTargetUid(Long targetUid) {
|
||||
this.targetUid = targetUid;
|
||||
}
|
||||
|
||||
public String getTargetAvatar() {
|
||||
return targetAvatar;
|
||||
}
|
||||
|
||||
public void setTargetAvatar(String targetAvatar) {
|
||||
this.targetAvatar = targetAvatar;
|
||||
}
|
||||
|
||||
public String getTargetNick() {
|
||||
return targetNick;
|
||||
}
|
||||
|
||||
public void setTargetNick(String targetNick) {
|
||||
this.targetNick = targetNick;
|
||||
}
|
||||
|
||||
public Integer getGiftId() {
|
||||
return giftId;
|
||||
}
|
||||
|
||||
public void setGiftId(Integer giftId) {
|
||||
this.giftId = giftId;
|
||||
}
|
||||
|
||||
public int getGiftNum() {
|
||||
return giftNum;
|
||||
}
|
||||
|
||||
public void setGiftNum(int giftNum) {
|
||||
this.giftNum = giftNum;
|
||||
}
|
||||
|
||||
public GiftVo getGift() {
|
||||
return gift;
|
||||
}
|
||||
|
||||
public void setGift(GiftVo gift) {
|
||||
this.gift = gift;
|
||||
}
|
||||
}
|
@@ -1,26 +0,0 @@
|
||||
package com.accompany.business.vo;
|
||||
|
||||
/**
|
||||
* Created by 北岭山下 on 2017/8/5.
|
||||
*/
|
||||
public class GiftTypeCountVo {
|
||||
|
||||
private String objType;
|
||||
private Long sum;
|
||||
|
||||
public String getObjType ( ) {
|
||||
return objType;
|
||||
}
|
||||
|
||||
public void setObjType ( String objType ) {
|
||||
this.objType = objType;
|
||||
}
|
||||
|
||||
public Long getSum ( ) {
|
||||
return sum;
|
||||
}
|
||||
|
||||
public void setSum ( Long sum ) {
|
||||
this.sum = sum;
|
||||
}
|
||||
}
|
@@ -1,48 +0,0 @@
|
||||
package com.accompany.business.vo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: chucheng
|
||||
* @Date: 2019/7/1 16:26
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
public class GroupChatNotifyRoomNumVo {
|
||||
/**
|
||||
* 世界id
|
||||
*/
|
||||
private long worldId;
|
||||
/**
|
||||
* 当前派对中总人数
|
||||
*/
|
||||
private int count;
|
||||
/**
|
||||
* 房间Uid列表
|
||||
*/
|
||||
private List<Long> roomUids;
|
||||
|
||||
public int getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void setCount(int count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public List<Long> getRoomUids() {
|
||||
return roomUids;
|
||||
}
|
||||
|
||||
public void setRoomUids(List<Long> roomUids) {
|
||||
this.roomUids = roomUids;
|
||||
}
|
||||
|
||||
public long getWorldId() {
|
||||
return worldId;
|
||||
}
|
||||
|
||||
public void setWorldId(long worldId) {
|
||||
this.worldId = worldId;
|
||||
}
|
||||
}
|
@@ -1,35 +0,0 @@
|
||||
package com.accompany.business.vo;
|
||||
|
||||
|
||||
/**
|
||||
* @Author: chucheng
|
||||
* @Date: 2019/7/1 16:26
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
public class GroupChatNotifyTopicVo {
|
||||
/**
|
||||
* 世界id
|
||||
*/
|
||||
private long worldId;
|
||||
/**
|
||||
* 群聊话题
|
||||
*/
|
||||
private String topic;
|
||||
|
||||
public long getWorldId() {
|
||||
return worldId;
|
||||
}
|
||||
|
||||
public void setWorldId(long worldId) {
|
||||
this.worldId = worldId;
|
||||
}
|
||||
|
||||
public String getTopic() {
|
||||
return topic;
|
||||
}
|
||||
|
||||
public void setTopic(String topic) {
|
||||
this.topic = topic;
|
||||
}
|
||||
}
|
@@ -1,60 +0,0 @@
|
||||
package com.accompany.business.vo;
|
||||
|
||||
|
||||
/**
|
||||
* @Author: chucheng
|
||||
* @Date: 2019/7/1 16:26
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
public class JoinWorldRoomNotifyVo {
|
||||
/**
|
||||
* 世界id
|
||||
*/
|
||||
private long worldId;
|
||||
/**
|
||||
* 世界名称
|
||||
*/
|
||||
private String worldName;
|
||||
|
||||
/**
|
||||
* 用户uid
|
||||
*/
|
||||
private long uid;
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
private String nick;
|
||||
|
||||
public long getWorldId() {
|
||||
return worldId;
|
||||
}
|
||||
|
||||
public void setWorldId(long worldId) {
|
||||
this.worldId = worldId;
|
||||
}
|
||||
|
||||
public String getWorldName() {
|
||||
return worldName;
|
||||
}
|
||||
|
||||
public void setWorldName(String worldName) {
|
||||
this.worldName = worldName;
|
||||
}
|
||||
|
||||
public long getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(long uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public String getNick() {
|
||||
return nick;
|
||||
}
|
||||
|
||||
public void setNick(String nick) {
|
||||
this.nick = nick;
|
||||
}
|
||||
}
|
@@ -1,87 +0,0 @@
|
||||
package com.accompany.business.vo;
|
||||
|
||||
import com.accompany.common.annotation.ReplaceAppDomain;
|
||||
|
||||
/**
|
||||
* Created by PaperCut on 2018/4/23.
|
||||
*/
|
||||
public class ModelVo {
|
||||
@ReplaceAppDomain
|
||||
private String icon;
|
||||
private Object data;
|
||||
private String title;
|
||||
private Integer type;
|
||||
private Integer tagId;
|
||||
|
||||
public ModelVo() {}
|
||||
|
||||
public ModelVo(String icon, Object data, String title, Integer type, Integer tagId) {
|
||||
this.icon = icon;
|
||||
this.data = data;
|
||||
this.title = title;
|
||||
this.type = type;
|
||||
this.tagId = tagId;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public Object getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public Integer getTagId() {
|
||||
return tagId;
|
||||
}
|
||||
|
||||
public void setData(Object data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
@ReplaceAppDomain
|
||||
private String icon;
|
||||
private Object data;
|
||||
private String title;
|
||||
private Integer type;
|
||||
private Integer tagId;
|
||||
|
||||
public Builder setIcon(String icon) {
|
||||
this.icon = icon;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setData(Object data) {
|
||||
this.data = data;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setTitle(String title) {
|
||||
this.title = title;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setType(Integer type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setTagId(Integer tagId) {
|
||||
this.tagId = tagId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ModelVo build() {
|
||||
return new ModelVo(icon, data, title, type, tagId);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,72 +0,0 @@
|
||||
package com.accompany.business.vo;
|
||||
|
||||
/**
|
||||
* Created by 北岭山下 on 2017/7/24.
|
||||
*/
|
||||
/*
|
||||
{
|
||||
"access_token":"ACCESS_TOKEN",
|
||||
"expires_in":7200,
|
||||
"refresh_token":"REFRESH_TOKEN",
|
||||
"openid":"OPENID",
|
||||
"scope":"SCOPE",
|
||||
"unionid": "o6_bmasdasdsad6_2sgVt7hMZOPfL"
|
||||
}
|
||||
*/
|
||||
public class OpenIdInfoVo {
|
||||
|
||||
private String access_token; //接口调用凭证
|
||||
private String expires_in; //access_token接口调用凭证超时时间,单位(秒)
|
||||
private String refresh_token; //用户刷新access_token
|
||||
private String openid; //授权用户唯一标识
|
||||
private String scope; //用户授权的作用域,使用逗号(,)分隔
|
||||
private String unionid; //当且仅当该网站应用已获得该用户的userinfo授权时,才会出现该字段
|
||||
|
||||
public String getAccess_token ( ) {
|
||||
return access_token;
|
||||
}
|
||||
|
||||
public void setAccess_token ( String access_token ) {
|
||||
this.access_token = access_token;
|
||||
}
|
||||
|
||||
public String getExpires_in ( ) {
|
||||
return expires_in;
|
||||
}
|
||||
|
||||
public void setExpires_in ( String expires_in ) {
|
||||
this.expires_in = expires_in;
|
||||
}
|
||||
|
||||
public String getRefresh_token ( ) {
|
||||
return refresh_token;
|
||||
}
|
||||
|
||||
public void setRefresh_token ( String refresh_token ) {
|
||||
this.refresh_token = refresh_token;
|
||||
}
|
||||
|
||||
public String getOpenid ( ) {
|
||||
return openid;
|
||||
}
|
||||
|
||||
public void setOpenid ( String openid ) {
|
||||
this.openid = openid;
|
||||
}
|
||||
|
||||
public String getScope ( ) {
|
||||
return scope;
|
||||
}
|
||||
|
||||
public void setScope ( String scope ) {
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
public String getUnionid ( ) {
|
||||
return unionid;
|
||||
}
|
||||
|
||||
public void setUnionid ( String unionid ) {
|
||||
this.unionid = unionid;
|
||||
}
|
||||
}
|
@@ -1,147 +0,0 @@
|
||||
package com.accompany.business.vo;
|
||||
|
||||
/**
|
||||
* Created by 北岭山下 on 2017/7/24.
|
||||
*/
|
||||
/*
|
||||
微信订单查询结果
|
||||
*/
|
||||
public class OrderQueryResult {
|
||||
|
||||
private String appid; //应用ID
|
||||
private String mch_id; //商店ID
|
||||
private String nonce_str; //随机字符串
|
||||
private String device_info;
|
||||
private String sign; //签名
|
||||
//============================//
|
||||
private String result_code; //返回结果
|
||||
private String openid; //openid
|
||||
private String is_subscribe; //是否关注公众号
|
||||
private String trade_type; //交易类型
|
||||
private String bank_type; //银行类型
|
||||
private String total_fee; //交易金额,订单总金额,单位为分
|
||||
private String attach; //附加内容
|
||||
private String out_trade_no; //商品订单号
|
||||
private String time_end; //交易结束时间
|
||||
private String trade_state; //订单状态
|
||||
|
||||
public String getAppid ( ) {
|
||||
return appid;
|
||||
}
|
||||
|
||||
public void setAppid ( String appid ) {
|
||||
this.appid = appid;
|
||||
}
|
||||
|
||||
public String getMch_id ( ) {
|
||||
return mch_id;
|
||||
}
|
||||
|
||||
public void setMch_id ( String mch_id ) {
|
||||
this.mch_id = mch_id;
|
||||
}
|
||||
|
||||
public String getNonce_str ( ) {
|
||||
return nonce_str;
|
||||
}
|
||||
|
||||
public void setNonce_str ( String nonce_str ) {
|
||||
this.nonce_str = nonce_str;
|
||||
}
|
||||
|
||||
public String getDevice_info ( ) {
|
||||
return device_info;
|
||||
}
|
||||
|
||||
public void setDevice_info ( String device_info ) {
|
||||
this.device_info = device_info;
|
||||
}
|
||||
|
||||
public String getSign ( ) {
|
||||
return sign;
|
||||
}
|
||||
|
||||
public void setSign ( String sign ) {
|
||||
this.sign = sign;
|
||||
}
|
||||
|
||||
public String getResult_code ( ) {
|
||||
return result_code;
|
||||
}
|
||||
|
||||
public void setResult_code ( String result_code ) {
|
||||
this.result_code = result_code;
|
||||
}
|
||||
|
||||
public String getOpenid ( ) {
|
||||
return openid;
|
||||
}
|
||||
|
||||
public void setOpenid ( String openid ) {
|
||||
this.openid = openid;
|
||||
}
|
||||
|
||||
public String getIs_subscribe ( ) {
|
||||
return is_subscribe;
|
||||
}
|
||||
|
||||
public void setIs_subscribe ( String is_subscribe ) {
|
||||
this.is_subscribe = is_subscribe;
|
||||
}
|
||||
|
||||
public String getTrade_type ( ) {
|
||||
return trade_type;
|
||||
}
|
||||
|
||||
public void setTrade_type ( String trade_type ) {
|
||||
this.trade_type = trade_type;
|
||||
}
|
||||
|
||||
public String getBank_type ( ) {
|
||||
return bank_type;
|
||||
}
|
||||
|
||||
public void setBank_type ( String bank_type ) {
|
||||
this.bank_type = bank_type;
|
||||
}
|
||||
|
||||
public String getTotal_fee ( ) {
|
||||
return total_fee;
|
||||
}
|
||||
|
||||
public void setTotal_fee ( String total_fee ) {
|
||||
this.total_fee = total_fee;
|
||||
}
|
||||
|
||||
public String getAttach ( ) {
|
||||
return attach;
|
||||
}
|
||||
|
||||
public void setAttach ( String attach ) {
|
||||
this.attach = attach;
|
||||
}
|
||||
|
||||
public String getOut_trade_no ( ) {
|
||||
return out_trade_no;
|
||||
}
|
||||
|
||||
public void setOut_trade_no ( String out_trade_no ) {
|
||||
this.out_trade_no = out_trade_no;
|
||||
}
|
||||
|
||||
public String getTime_end ( ) {
|
||||
return time_end;
|
||||
}
|
||||
|
||||
public void setTime_end ( String time_end ) {
|
||||
this.time_end = time_end;
|
||||
}
|
||||
|
||||
public String getTrade_state ( ) {
|
||||
return trade_state;
|
||||
}
|
||||
|
||||
public void setTrade_state ( String trade_state ) {
|
||||
this.trade_state = trade_state;
|
||||
}
|
||||
}
|
@@ -1,148 +0,0 @@
|
||||
package com.accompany.business.vo;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Created by liuguofu on 2017/6/9.
|
||||
*/
|
||||
public class OrderServVo {
|
||||
private Long orderId;
|
||||
|
||||
private Long uid;
|
||||
|
||||
private Long prodUid;
|
||||
|
||||
private Byte orderType;
|
||||
|
||||
private String objId;
|
||||
|
||||
private Byte curStatus;
|
||||
|
||||
private Long totalMoney;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Date finishTime;
|
||||
|
||||
private String userName;
|
||||
|
||||
private String prodName;
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getProdName() {
|
||||
return prodName;
|
||||
}
|
||||
|
||||
public void setProdName(String prodName) {
|
||||
this.prodName = prodName;
|
||||
}
|
||||
|
||||
private String userImg;
|
||||
|
||||
public String getUserImg() {
|
||||
return userImg;
|
||||
}
|
||||
|
||||
public void setUserImg(String userImg) {
|
||||
this.userImg = userImg;
|
||||
}
|
||||
|
||||
public String getProdImg() {
|
||||
return prodImg;
|
||||
}
|
||||
|
||||
public void setProdImg(String prodImg) {
|
||||
this.prodImg = prodImg;
|
||||
}
|
||||
|
||||
public Long getRemainDay() {
|
||||
return remainDay;
|
||||
}
|
||||
|
||||
public void setRemainDay(Long remainDay) {
|
||||
this.remainDay = remainDay;
|
||||
}
|
||||
|
||||
private String prodImg;
|
||||
|
||||
private Long remainDay;
|
||||
|
||||
public Long getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(Long orderId) {
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public Long getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(Long uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public Long getProdUid() {
|
||||
return prodUid;
|
||||
}
|
||||
|
||||
public void setProdUid(Long prodUid) {
|
||||
this.prodUid = prodUid;
|
||||
}
|
||||
|
||||
public Byte getOrderType() {
|
||||
return orderType;
|
||||
}
|
||||
|
||||
public void setOrderType(Byte orderType) {
|
||||
this.orderType = orderType;
|
||||
}
|
||||
|
||||
public String getObjId() {
|
||||
return objId;
|
||||
}
|
||||
|
||||
public void setObjId(String objId) {
|
||||
this.objId = objId;
|
||||
}
|
||||
|
||||
public Byte getCurStatus() {
|
||||
return curStatus;
|
||||
}
|
||||
|
||||
public void setCurStatus(Byte curStatus) {
|
||||
this.curStatus = curStatus;
|
||||
}
|
||||
|
||||
public Long getTotalMoney() {
|
||||
return totalMoney;
|
||||
}
|
||||
|
||||
public void setTotalMoney(Long totalMoney) {
|
||||
this.totalMoney = totalMoney;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Date getFinishTime() {
|
||||
return finishTime;
|
||||
}
|
||||
|
||||
public void setFinishTime(Date finishTime) {
|
||||
this.finishTime = finishTime;
|
||||
}
|
||||
}
|
@@ -1,24 +0,0 @@
|
||||
package com.accompany.business.vo;
|
||||
|
||||
public class SimpleRoomVo {
|
||||
|
||||
private Long uid;
|
||||
|
||||
private Long roomId;
|
||||
|
||||
public Long getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(Long uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public Long getRoomId() {
|
||||
return roomId;
|
||||
}
|
||||
|
||||
public void setRoomId(Long roomId) {
|
||||
this.roomId = roomId;
|
||||
}
|
||||
}
|
@@ -1,199 +0,0 @@
|
||||
package com.accompany.business.vo;
|
||||
|
||||
/**
|
||||
* Created by yuanyi on 2019/3/14.
|
||||
*/
|
||||
public class WithDrawH5Vo {
|
||||
private Long uid;
|
||||
|
||||
private Double diamondNum;
|
||||
|
||||
private Boolean isBoundPhone;
|
||||
|
||||
private Boolean isBindPaymentPwd; // 是否绑定了支付密码
|
||||
|
||||
private Boolean isBindAlipay; //是否绑定了支付宝
|
||||
|
||||
private String alipayAccount;
|
||||
|
||||
private String alipayAccountName;
|
||||
|
||||
/** 是否绑定银行卡*/
|
||||
private Boolean isBindBankCard;
|
||||
|
||||
/** 银行卡号 */
|
||||
private String bankCardNum;
|
||||
|
||||
/** 持卡人姓名 */
|
||||
private String bankCardName;
|
||||
|
||||
private Long goldNum;
|
||||
|
||||
private Long chargeGoldNum;
|
||||
|
||||
private String phone; // h5提现兑换系统返回脱敏处理的phone
|
||||
|
||||
private Boolean sendGold; //是否有转赠金币功能
|
||||
|
||||
/**
|
||||
* 银行卡最低提现金额
|
||||
*/
|
||||
private Integer bankCardMinAmount;
|
||||
|
||||
/**
|
||||
* 默认的提现账号类型
|
||||
*/
|
||||
private Integer defaultWithdrawAccountType;
|
||||
|
||||
/**
|
||||
* 提现方式切换按钮是否展示
|
||||
*/
|
||||
private Boolean switchButtonShow;
|
||||
|
||||
/** 提现费率 */
|
||||
private Double withdrawRate;
|
||||
|
||||
public Double getWithdrawRate() {
|
||||
return withdrawRate;
|
||||
}
|
||||
|
||||
public void setWithdrawRate(Double withdrawRate) {
|
||||
this.withdrawRate = withdrawRate;
|
||||
}
|
||||
|
||||
public Integer getBankCardMinAmount() {
|
||||
return bankCardMinAmount;
|
||||
}
|
||||
|
||||
public void setBankCardMinAmount(Integer bankCardMinAmount) {
|
||||
this.bankCardMinAmount = bankCardMinAmount;
|
||||
}
|
||||
|
||||
public Integer getDefaultWithdrawAccountType() {
|
||||
return defaultWithdrawAccountType;
|
||||
}
|
||||
|
||||
public void setDefaultWithdrawAccountType(Integer defaultWithdrawAccountType) {
|
||||
this.defaultWithdrawAccountType = defaultWithdrawAccountType;
|
||||
}
|
||||
|
||||
public Boolean getSwitchButtonShow() {
|
||||
return switchButtonShow;
|
||||
}
|
||||
|
||||
public void setSwitchButtonShow(Boolean switchButtonShow) {
|
||||
this.switchButtonShow = switchButtonShow;
|
||||
}
|
||||
|
||||
public Boolean getIsBindBankCard() {
|
||||
return isBindBankCard;
|
||||
}
|
||||
|
||||
public void setIsBindBankCard(Boolean isBindBankCard) {
|
||||
this.isBindBankCard = isBindBankCard;
|
||||
}
|
||||
|
||||
public String getBankCardNum() {
|
||||
return bankCardNum;
|
||||
}
|
||||
|
||||
public void setBankCardNum(String bankCardNum) {
|
||||
this.bankCardNum = bankCardNum;
|
||||
}
|
||||
|
||||
public String getBankCardName() {
|
||||
return bankCardName;
|
||||
}
|
||||
|
||||
public void setBankCardName(String bankCardName) {
|
||||
this.bankCardName = bankCardName;
|
||||
}
|
||||
|
||||
public Long getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(Long uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public Double getDiamondNum() {
|
||||
return diamondNum;
|
||||
}
|
||||
|
||||
public void setDiamondNum(Double diamondNum) {
|
||||
this.diamondNum = diamondNum;
|
||||
}
|
||||
|
||||
public Boolean getBoundPhone() {
|
||||
return isBoundPhone;
|
||||
}
|
||||
|
||||
public void setBoundPhone(Boolean boundPhone) {
|
||||
isBoundPhone = boundPhone;
|
||||
}
|
||||
|
||||
public Boolean getBindPaymentPwd() {
|
||||
return isBindPaymentPwd;
|
||||
}
|
||||
|
||||
public void setBindPaymentPwd(Boolean bindPaymentPwd) {
|
||||
isBindPaymentPwd = bindPaymentPwd;
|
||||
}
|
||||
|
||||
public Boolean getBindAlipay() {
|
||||
return isBindAlipay;
|
||||
}
|
||||
|
||||
public void setBindAlipay(Boolean bindAlipay) {
|
||||
isBindAlipay = bindAlipay;
|
||||
}
|
||||
|
||||
public String getAlipayAccount() {
|
||||
return alipayAccount;
|
||||
}
|
||||
|
||||
public void setAlipayAccount(String alipayAccount) {
|
||||
this.alipayAccount = alipayAccount;
|
||||
}
|
||||
|
||||
public String getAlipayAccountName() {
|
||||
return alipayAccountName;
|
||||
}
|
||||
|
||||
public void setAlipayAccountName(String alipayAccountName) {
|
||||
this.alipayAccountName = alipayAccountName;
|
||||
}
|
||||
|
||||
public Long getGoldNum() {
|
||||
return goldNum;
|
||||
}
|
||||
|
||||
public void setGoldNum(Long goldNum) {
|
||||
this.goldNum = goldNum;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public Boolean getSendGold() {
|
||||
return sendGold;
|
||||
}
|
||||
|
||||
public void setSendGold(Boolean sendGold) {
|
||||
this.sendGold = sendGold;
|
||||
}
|
||||
|
||||
public Long getChargeGoldNum() {
|
||||
return chargeGoldNum;
|
||||
}
|
||||
|
||||
public void setChargeGoldNum(Long chargeGoldNum) {
|
||||
this.chargeGoldNum = chargeGoldNum;
|
||||
}
|
||||
}
|
@@ -1,148 +0,0 @@
|
||||
package com.accompany.business.vo;
|
||||
|
||||
import com.accompany.common.annotation.ReplaceAppDomain;
|
||||
import com.accompany.core.vo.UserLevelVo;
|
||||
|
||||
/**
|
||||
* @Author: chucheng
|
||||
* @Date: 2019/7/5 16:56
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
public class WorldMemberInfoVo {
|
||||
|
||||
private String nick;
|
||||
|
||||
private Byte gender;
|
||||
|
||||
@ReplaceAppDomain
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 用户uid
|
||||
*/
|
||||
private Long uid;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 消息提醒: 0.屏蔽消息 1.开启提醒
|
||||
*/
|
||||
private Integer promtFlag;
|
||||
|
||||
/**
|
||||
* 是否禁言: 0.不禁言 1.禁言
|
||||
*/
|
||||
private Integer muteFlag;
|
||||
|
||||
/**
|
||||
* 是否创始人
|
||||
*/
|
||||
private boolean ownerFlag;
|
||||
|
||||
/**
|
||||
* 是否在线
|
||||
*/
|
||||
private boolean onlineFlag;
|
||||
|
||||
/**
|
||||
* 当前所在派对
|
||||
*/
|
||||
private Long currentRoomUid;
|
||||
|
||||
/**
|
||||
* 用户等级信息
|
||||
*/
|
||||
private UserLevelVo userLevelVo;
|
||||
|
||||
public String getNick() {
|
||||
return nick;
|
||||
}
|
||||
|
||||
public void setNick(String nick) {
|
||||
this.nick = nick;
|
||||
}
|
||||
|
||||
public Byte getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public void setGender(Byte gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public Long getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(Long uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Integer getPromtFlag() {
|
||||
return promtFlag;
|
||||
}
|
||||
|
||||
public void setPromtFlag(Integer promtFlag) {
|
||||
this.promtFlag = promtFlag;
|
||||
}
|
||||
|
||||
public Integer getMuteFlag() {
|
||||
return muteFlag;
|
||||
}
|
||||
|
||||
public void setMuteFlag(Integer muteFlag) {
|
||||
this.muteFlag = muteFlag;
|
||||
}
|
||||
|
||||
public boolean isOwnerFlag() {
|
||||
return ownerFlag;
|
||||
}
|
||||
|
||||
public void setOwnerFlag(boolean ownerFlag) {
|
||||
this.ownerFlag = ownerFlag;
|
||||
}
|
||||
|
||||
public Long getCurrentRoomUid() {
|
||||
return currentRoomUid;
|
||||
}
|
||||
|
||||
public void setCurrentRoomUid(Long currentRoomUid) {
|
||||
this.currentRoomUid = currentRoomUid;
|
||||
}
|
||||
|
||||
public UserLevelVo getUserLevelVo() {
|
||||
return userLevelVo;
|
||||
}
|
||||
|
||||
public void setUserLevelVo(UserLevelVo userLevelVo) {
|
||||
this.userLevelVo = userLevelVo;
|
||||
}
|
||||
|
||||
public boolean isOnlineFlag() {
|
||||
return onlineFlag;
|
||||
}
|
||||
|
||||
public void setOnlineFlag(boolean onlineFlag) {
|
||||
this.onlineFlag = onlineFlag;
|
||||
}
|
||||
}
|
@@ -1,145 +0,0 @@
|
||||
package com.accompany.business.vo.monster;
|
||||
|
||||
import com.accompany.common.annotation.ReplaceAppDomain;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
/**
|
||||
* @author yangziwen
|
||||
* @description 攻击怪兽请求Response VO类
|
||||
* @date 2018/3/29 17:52
|
||||
*/
|
||||
public class AttackMonsterResponseVo {
|
||||
|
||||
private Long sequence;
|
||||
private Long uid;
|
||||
@ReplaceAppDomain
|
||||
private String avatar;
|
||||
private String nick;
|
||||
private Long monsterId;
|
||||
private String monsterName;
|
||||
private Integer monsterTotalBlood;
|
||||
private Integer monsterRemainBlood;
|
||||
private Byte monsterStatus;
|
||||
private Integer magicId;
|
||||
private Integer impactValue;
|
||||
private Long remainMillis;
|
||||
private Long beforeDisappearSeconds;
|
||||
private Boolean playEffect;
|
||||
|
||||
public Long getSequence() {
|
||||
return sequence;
|
||||
}
|
||||
|
||||
public void setSequence(Long sequence) {
|
||||
this.sequence = sequence;
|
||||
}
|
||||
|
||||
public Long getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(Long uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public String getNick() {
|
||||
return nick;
|
||||
}
|
||||
|
||||
public void setNick(String nick) {
|
||||
this.nick = nick;
|
||||
}
|
||||
|
||||
public Long getMonsterId() {
|
||||
return monsterId;
|
||||
}
|
||||
|
||||
public void setMonsterId(Long monsterId) {
|
||||
this.monsterId = monsterId;
|
||||
}
|
||||
|
||||
public String getMonsterName() {
|
||||
return monsterName;
|
||||
}
|
||||
|
||||
public void setMonsterName(String monsterName) {
|
||||
this.monsterName = monsterName;
|
||||
}
|
||||
|
||||
public Integer getMonsterTotalBlood() {
|
||||
return monsterTotalBlood;
|
||||
}
|
||||
|
||||
public void setMonsterTotalBlood(Integer monsterTotalBlood) {
|
||||
this.monsterTotalBlood = monsterTotalBlood;
|
||||
}
|
||||
|
||||
public Integer getMonsterRemainBlood() {
|
||||
return monsterRemainBlood;
|
||||
}
|
||||
|
||||
public void setMonsterRemainBlood(Integer monsterRemainBlood) {
|
||||
this.monsterRemainBlood = monsterRemainBlood;
|
||||
}
|
||||
|
||||
public Byte getMonsterStatus() {
|
||||
return monsterStatus;
|
||||
}
|
||||
|
||||
public void setMonsterStatus(Byte monsterStatus) {
|
||||
this.monsterStatus = monsterStatus;
|
||||
}
|
||||
|
||||
public Integer getMagicId() {
|
||||
return magicId;
|
||||
}
|
||||
|
||||
public void setMagicId(Integer magicId) {
|
||||
this.magicId = magicId;
|
||||
}
|
||||
|
||||
public Integer getImpactValue() {
|
||||
return impactValue;
|
||||
}
|
||||
|
||||
public void setImpactValue(Integer impactValue) {
|
||||
this.impactValue = impactValue;
|
||||
}
|
||||
|
||||
public Long getRemainMillis() {
|
||||
return remainMillis;
|
||||
}
|
||||
|
||||
public void setRemainMillis(Long remainMillis) {
|
||||
this.remainMillis = remainMillis;
|
||||
}
|
||||
|
||||
public Boolean getPlayEffect() {
|
||||
return playEffect;
|
||||
}
|
||||
|
||||
public void setPlayEffect(Boolean playEffect) {
|
||||
this.playEffect = playEffect;
|
||||
}
|
||||
|
||||
public Long getBeforeDisappearSeconds() {
|
||||
return beforeDisappearSeconds;
|
||||
}
|
||||
|
||||
public void setBeforeDisappearSeconds(Long beforeDisappearSeconds) {
|
||||
this.beforeDisappearSeconds = beforeDisappearSeconds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
@@ -1,74 +0,0 @@
|
||||
package com.accompany.business.vo.monster;
|
||||
|
||||
import com.accompany.common.annotation.ReplaceAppDomain;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author
|
||||
* @CreateDate 2018/4/3 1:53
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class MonsterDrawUserVo {
|
||||
|
||||
private Long uid;
|
||||
private Long erbanNo;
|
||||
private String nick;
|
||||
@ReplaceAppDomain
|
||||
private String avatar;
|
||||
private Long hurt;
|
||||
private Long ranking;
|
||||
|
||||
public Long getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(Long uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public Long getErbanNo() {
|
||||
return erbanNo;
|
||||
}
|
||||
|
||||
public void setErbanNo(Long erbanNo) {
|
||||
this.erbanNo = erbanNo;
|
||||
}
|
||||
|
||||
public String getNick() {
|
||||
return nick;
|
||||
}
|
||||
|
||||
public void setNick(String nick) {
|
||||
this.nick = nick;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public Long getHurt() {
|
||||
return hurt;
|
||||
}
|
||||
|
||||
public void setHurt(Long hurt) {
|
||||
this.hurt = hurt;
|
||||
}
|
||||
|
||||
public Long getRanking() {
|
||||
return ranking;
|
||||
}
|
||||
|
||||
public void setRanking(Long ranking) {
|
||||
this.ranking = ranking;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(){
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
@@ -1,82 +0,0 @@
|
||||
package com.accompany.business.vo.monster;
|
||||
|
||||
import com.accompany.common.annotation.ReplaceAppDomain;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
/**
|
||||
* @author yangziwen
|
||||
* @description
|
||||
* @date 2018/4/3 11:35
|
||||
*/
|
||||
public class MonsterDrawVo {
|
||||
|
||||
private Long prodId;
|
||||
private String prodName;
|
||||
private Byte prodType;
|
||||
private Long prodValue;
|
||||
@ReplaceAppDomain
|
||||
private String prodImage;
|
||||
private String monsterId;
|
||||
private Integer expireDays;
|
||||
|
||||
public Long getProdId() {
|
||||
return prodId;
|
||||
}
|
||||
|
||||
public void setProdId(Long prodId) {
|
||||
this.prodId = prodId;
|
||||
}
|
||||
|
||||
public String getProdName() {
|
||||
return prodName;
|
||||
}
|
||||
|
||||
public void setProdName(String prodName) {
|
||||
this.prodName = prodName;
|
||||
}
|
||||
|
||||
public Byte getProdType() {
|
||||
return prodType;
|
||||
}
|
||||
|
||||
public void setProdType(Byte prodType) {
|
||||
this.prodType = prodType;
|
||||
}
|
||||
|
||||
public Long getProdValue() {
|
||||
return prodValue;
|
||||
}
|
||||
|
||||
public void setProdValue(Long prodValue) {
|
||||
this.prodValue = prodValue;
|
||||
}
|
||||
|
||||
public String getProdImage() {
|
||||
return prodImage;
|
||||
}
|
||||
|
||||
public void setProdImage(String prodImage) {
|
||||
this.prodImage = prodImage;
|
||||
}
|
||||
|
||||
public String getMonsterId() {
|
||||
return monsterId;
|
||||
}
|
||||
|
||||
public void setMonsterId(String monsterId) {
|
||||
this.monsterId = monsterId;
|
||||
}
|
||||
|
||||
public Integer getExpireDays() {
|
||||
return expireDays;
|
||||
}
|
||||
|
||||
public void setExpireDays(Integer expireDays) {
|
||||
this.expireDays = expireDays;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
@@ -1,55 +0,0 @@
|
||||
package com.accompany.business.vo.monster;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author yangziwen
|
||||
* @description
|
||||
* @date 2018/4/2 16:00
|
||||
*/
|
||||
public class MonsterInitVo {
|
||||
|
||||
private Long monsterId;
|
||||
private String monsterName;
|
||||
private Long appearRoomUid;
|
||||
private Date appearTime;
|
||||
|
||||
public Long getMonsterId() {
|
||||
return monsterId;
|
||||
}
|
||||
|
||||
public void setMonsterId(Long monsterId) {
|
||||
this.monsterId = monsterId;
|
||||
}
|
||||
|
||||
public String getMonsterName() {
|
||||
return monsterName;
|
||||
}
|
||||
|
||||
public void setMonsterName(String monsterName) {
|
||||
this.monsterName = monsterName;
|
||||
}
|
||||
|
||||
public Long getAppearRoomUid() {
|
||||
return appearRoomUid;
|
||||
}
|
||||
|
||||
public void setAppearRoomUid(Long appearRoomUid) {
|
||||
this.appearRoomUid = appearRoomUid;
|
||||
}
|
||||
|
||||
public Date getAppearTime() {
|
||||
return appearTime;
|
||||
}
|
||||
|
||||
public void setAppearTime(Date appearTime) {
|
||||
this.appearTime = appearTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
}
|
@@ -1,278 +0,0 @@
|
||||
package com.accompany.business.vo.monster;
|
||||
|
||||
import com.accompany.common.annotation.ReplaceAppDomain;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
/**
|
||||
* @author yangziwen
|
||||
* @description
|
||||
* @date 2018/3/31 17:28
|
||||
*/
|
||||
public class MonsterVo {
|
||||
|
||||
private Long monsterId;
|
||||
|
||||
private String monsterName;
|
||||
|
||||
@ReplaceAppDomain
|
||||
private String appearSvg;
|
||||
|
||||
@ReplaceAppDomain
|
||||
private String normalSvg;
|
||||
|
||||
@ReplaceAppDomain
|
||||
private String attackSvg;
|
||||
|
||||
@ReplaceAppDomain
|
||||
private String defeatSvg;
|
||||
|
||||
@ReplaceAppDomain
|
||||
private String escapeSvg;
|
||||
|
||||
@ReplaceAppDomain
|
||||
private String hallNotifyBg;
|
||||
|
||||
@ReplaceAppDomain
|
||||
private String roomNotifyBg;
|
||||
|
||||
@ReplaceAppDomain
|
||||
private String monsterImg;
|
||||
|
||||
@ReplaceAppDomain
|
||||
private String hallNotifyClockImg;
|
||||
|
||||
@ReplaceAppDomain
|
||||
private String roomNotifyClockImg;
|
||||
|
||||
private Integer totalBlood;
|
||||
|
||||
private Integer remainBlood;
|
||||
|
||||
private Long appearRoomUid;
|
||||
|
||||
private Long appearTime;
|
||||
|
||||
private Integer appearDuration;
|
||||
|
||||
private Long disappearTime;
|
||||
|
||||
private Long serverTime;
|
||||
|
||||
private Byte monsterStatus;
|
||||
|
||||
private String notifyMessage;
|
||||
|
||||
private Long beforeAppearSeconds;
|
||||
|
||||
private Long beforeDisappearSeconds;
|
||||
|
||||
private Byte notifyType;
|
||||
|
||||
private Byte drawStrategy;
|
||||
|
||||
public Long getMonsterId() {
|
||||
return monsterId;
|
||||
}
|
||||
|
||||
public void setMonsterId(Long monsterId) {
|
||||
this.monsterId = monsterId;
|
||||
}
|
||||
|
||||
public String getMonsterName() {
|
||||
return monsterName;
|
||||
}
|
||||
|
||||
public void setMonsterName(String monsterName) {
|
||||
this.monsterName = monsterName;
|
||||
}
|
||||
|
||||
public String getAppearSvg() {
|
||||
return appearSvg;
|
||||
}
|
||||
|
||||
public void setAppearSvg(String appearSvg) {
|
||||
this.appearSvg = appearSvg;
|
||||
}
|
||||
|
||||
public String getNormalSvg() {
|
||||
return normalSvg;
|
||||
}
|
||||
|
||||
public void setNormalSvg(String normalSvg) {
|
||||
this.normalSvg = normalSvg;
|
||||
}
|
||||
|
||||
public String getAttackSvg() {
|
||||
return attackSvg;
|
||||
}
|
||||
|
||||
public void setAttackSvg(String attackSvg) {
|
||||
this.attackSvg = attackSvg;
|
||||
}
|
||||
|
||||
public String getDefeatSvg() {
|
||||
return defeatSvg;
|
||||
}
|
||||
|
||||
public void setDefeatSvg(String defeatSvg) {
|
||||
this.defeatSvg = defeatSvg;
|
||||
}
|
||||
|
||||
public String getEscapeSvg() {
|
||||
return escapeSvg;
|
||||
}
|
||||
|
||||
public void setEscapeSvg(String escapeSvg) {
|
||||
this.escapeSvg = escapeSvg;
|
||||
}
|
||||
|
||||
public String getHallNotifyBg() {
|
||||
return hallNotifyBg;
|
||||
}
|
||||
|
||||
public void setHallNotifyBg(String hallNotifyBg) {
|
||||
this.hallNotifyBg = hallNotifyBg;
|
||||
}
|
||||
|
||||
public String getRoomNotifyBg() {
|
||||
return roomNotifyBg;
|
||||
}
|
||||
|
||||
public void setRoomNotifyBg(String roomNotifyBg) {
|
||||
this.roomNotifyBg = roomNotifyBg;
|
||||
}
|
||||
|
||||
public Integer getTotalBlood() {
|
||||
return totalBlood;
|
||||
}
|
||||
|
||||
public void setTotalBlood(Integer totalBlood) {
|
||||
this.totalBlood = totalBlood;
|
||||
}
|
||||
|
||||
public Integer getRemainBlood() {
|
||||
return remainBlood;
|
||||
}
|
||||
|
||||
public void setRemainBlood(Integer remainBlood) {
|
||||
this.remainBlood = remainBlood;
|
||||
}
|
||||
|
||||
public Long getAppearRoomUid() {
|
||||
return appearRoomUid;
|
||||
}
|
||||
|
||||
public void setAppearRoomUid(Long appearRoomUid) {
|
||||
this.appearRoomUid = appearRoomUid;
|
||||
}
|
||||
|
||||
public Long getAppearTime() {
|
||||
return appearTime;
|
||||
}
|
||||
|
||||
public void setAppearTime(Long appearTime) {
|
||||
this.appearTime = appearTime;
|
||||
}
|
||||
|
||||
public Integer getAppearDuration() {
|
||||
return appearDuration;
|
||||
}
|
||||
|
||||
public void setAppearDuration(Integer appearDuration) {
|
||||
this.appearDuration = appearDuration;
|
||||
}
|
||||
|
||||
public Long getDisappearTime() {
|
||||
return disappearTime;
|
||||
}
|
||||
|
||||
public void setDisappearTime(Long disappearTime) {
|
||||
this.disappearTime = disappearTime;
|
||||
}
|
||||
|
||||
public Long getServerTime() {
|
||||
return serverTime;
|
||||
}
|
||||
|
||||
public void setServerTime(Long serverTime) {
|
||||
this.serverTime = serverTime;
|
||||
}
|
||||
|
||||
public Byte getMonsterStatus() {
|
||||
return monsterStatus;
|
||||
}
|
||||
|
||||
public void setMonsterStatus(Byte monsterStatus) {
|
||||
this.monsterStatus = monsterStatus;
|
||||
}
|
||||
|
||||
public String getNotifyMessage() {
|
||||
return notifyMessage;
|
||||
}
|
||||
|
||||
public void setNotifyMessage(String notifyMessage) {
|
||||
this.notifyMessage = notifyMessage;
|
||||
}
|
||||
|
||||
public Long getBeforeAppearSeconds() {
|
||||
return beforeAppearSeconds;
|
||||
}
|
||||
|
||||
public void setBeforeAppearSeconds(Long beforeAppearSeconds) {
|
||||
this.beforeAppearSeconds = beforeAppearSeconds;
|
||||
}
|
||||
|
||||
public Long getBeforeDisappearSeconds() {
|
||||
return beforeDisappearSeconds;
|
||||
}
|
||||
|
||||
public void setBeforeDisappearSeconds(Long beforeDisappearSeconds) {
|
||||
this.beforeDisappearSeconds = beforeDisappearSeconds;
|
||||
}
|
||||
|
||||
public String getMonsterImg() {
|
||||
return monsterImg;
|
||||
}
|
||||
|
||||
public void setMonsterImg(String monsterImg) {
|
||||
this.monsterImg = monsterImg;
|
||||
}
|
||||
|
||||
public String getHallNotifyClockImg() {
|
||||
return hallNotifyClockImg;
|
||||
}
|
||||
|
||||
public void setHallNotifyClockImg(String hallNotifyClockImg) {
|
||||
this.hallNotifyClockImg = hallNotifyClockImg;
|
||||
}
|
||||
|
||||
public String getRoomNotifyClockImg() {
|
||||
return roomNotifyClockImg;
|
||||
}
|
||||
|
||||
public void setRoomNotifyClockImg(String roomNotifyClockImg) {
|
||||
this.roomNotifyClockImg = roomNotifyClockImg;
|
||||
}
|
||||
|
||||
public Byte getNotifyType() {
|
||||
return notifyType;
|
||||
}
|
||||
|
||||
public void setNotifyType(Byte notifyType) {
|
||||
this.notifyType = notifyType;
|
||||
}
|
||||
|
||||
public Byte getDrawStrategy() {
|
||||
return drawStrategy;
|
||||
}
|
||||
|
||||
public void setDrawStrategy(Byte drawStrategy) {
|
||||
this.drawStrategy = drawStrategy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JSON.toJSONString(this);
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,40 @@
|
||||
package com.accompany.business.event.listener;
|
||||
|
||||
|
||||
import com.accompany.business.event.NewUserEvent;
|
||||
import com.accompany.business.service.user.UserInviteCodeService;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.xuanyin.flowteam.constant.FlowTeamConstant;
|
||||
import com.xuanyin.flowteam.service.FlowTeamMemberInviteUserBizService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class InviteCodeListener implements ApplicationListener<NewUserEvent> {
|
||||
|
||||
@Autowired
|
||||
private UserInviteCodeService userInviteCodeService;
|
||||
@Autowired
|
||||
private FlowTeamMemberInviteUserBizService flowTeamMemberInviteUserBizService;
|
||||
|
||||
@Async
|
||||
@Override
|
||||
public void onApplicationEvent(NewUserEvent event) {
|
||||
Users user = (Users) event.getSource();
|
||||
|
||||
Long uid = user.getUid();
|
||||
// 初始化用户邀请码
|
||||
userInviteCodeService.initUserInviteCode(uid);
|
||||
|
||||
|
||||
// 绑定与引流小组成员的邀请关系
|
||||
String inviteCode = user.getInviteCode();
|
||||
flowTeamMemberInviteUserBizService.saveFlowTeamMemberInviteUser(inviteCode, uid, FlowTeamConstant.UserSourceType.SELF);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,21 +0,0 @@
|
||||
package com.accompany.business.mybatismapper;
|
||||
|
||||
import com.accompany.business.model.Feedback;
|
||||
import com.accompany.business.model.FeedbackExample;
|
||||
import java.util.List;
|
||||
|
||||
public interface FeedbackMapper {
|
||||
int deleteByPrimaryKey(String feedbackId);
|
||||
|
||||
int insert(Feedback record);
|
||||
|
||||
int insertSelective(Feedback record);
|
||||
|
||||
List<Feedback> selectByExample(FeedbackExample example);
|
||||
|
||||
Feedback selectByPrimaryKey(String feedbackId);
|
||||
|
||||
int updateByPrimaryKeySelective(Feedback record);
|
||||
|
||||
int updateByPrimaryKey(Feedback record);
|
||||
}
|
@@ -8,7 +8,6 @@ import com.accompany.business.mybatismapper.AutoGenRobotMapper;
|
||||
import com.accompany.business.mybatismapper.GenAccountRecordMapper;
|
||||
import com.accompany.business.service.user.UsersService;
|
||||
import com.accompany.common.constant.Constant;
|
||||
import com.accompany.common.netease.neteaseacc.result.FileUploadRet;
|
||||
import com.accompany.common.netease.neteaseacc.result.TokenRet;
|
||||
import com.accompany.common.redis.RedisKey;
|
||||
import com.accompany.common.utils.CommonUtil;
|
||||
@@ -28,7 +27,6 @@ import com.accompany.core.util.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
@@ -60,39 +58,6 @@ public class AutoGenRobotService extends BaseService {
|
||||
|
||||
private static final String DEFAULT_NICK = "Molistar";
|
||||
|
||||
public void saveName(String name) {
|
||||
AutoGenRobot autoGenRobot = autoGenRobotMapper.selectByPrimaryKey(name);
|
||||
autoGenRobot = new AutoGenRobot();
|
||||
autoGenRobot.setNick(name);
|
||||
autoGenRobotMapper.insert(autoGenRobot);
|
||||
// if (autoGenRobot == null) {
|
||||
// autoGenRobot = new AutoGenRobot();
|
||||
// autoGenRobot.setNick(name);
|
||||
// autoGenRobotMapper.insert(autoGenRobot);
|
||||
// }
|
||||
}
|
||||
|
||||
public void uploadAvatar(File file) throws Exception {
|
||||
AutoGenRobotExample AutoGenRobotExample = new AutoGenRobotExample();
|
||||
AutoGenRobotExample.createCriteria().andAvatarIsNull();
|
||||
List<AutoGenRobot> autoGenRobotList = autoGenRobotMapper.selectByExample(AutoGenRobotExample);
|
||||
|
||||
File[] files = file.listFiles();
|
||||
int filesLength = files.length;
|
||||
int robcount = 0;
|
||||
for (File file2 : files) {
|
||||
FileUploadRet fileUploadRet = erBanNetEaseService.uploadFile(file2);
|
||||
if (fileUploadRet.getCode() == 200) {
|
||||
AutoGenRobot autoGenRobot = autoGenRobotList.get(robcount);
|
||||
String fileUrl = fileUploadRet.getUrl();
|
||||
autoGenRobot.setAvatar(fileUrl);
|
||||
autoGenRobotMapper.updateByPrimaryKey(autoGenRobot);
|
||||
robcount++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void batchGenRobAccount() throws Exception {
|
||||
AutoGenRobotExample AutoGenRobotExample = new AutoGenRobotExample();
|
||||
AutoGenRobotExample.createCriteria().andAvatarIsNotNull().andIsUsedEqualTo(new Byte("1"));
|
||||
@@ -139,12 +104,6 @@ public class AutoGenRobotService extends BaseService {
|
||||
throw e;
|
||||
}
|
||||
String uidStr = String.valueOf(account.getUid());
|
||||
try {
|
||||
TokenRet tokenRet = netEaseService.createNetEaseAcc(uidStr, account.getNeteaseToken(), "");
|
||||
} catch (Exception e) {
|
||||
logger.error("create robot netease account error", e);
|
||||
throw e;
|
||||
}
|
||||
try {
|
||||
logger.info("start create robot user info, erbanNo: {}, uid: {}", erbanNo, uidStr);
|
||||
Users users = new Users();
|
||||
@@ -159,8 +118,13 @@ public class AutoGenRobotService extends BaseService {
|
||||
logger.error("create robot user info error", e);
|
||||
throw e;
|
||||
}
|
||||
erBanNetEaseService.updateUserGenderOnly(account.getUid().toString(), autoGenRobot.getGender());
|
||||
|
||||
try {
|
||||
TokenRet tokenRet = netEaseService.createNetEaseAcc(uidStr, account.getNeteaseToken(),
|
||||
autoGenRobot.getNick(), autoGenRobot.getAvatar(), autoGenRobot.getGender().toString());
|
||||
} catch (Exception e) {
|
||||
logger.error("create robot netease account error", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -195,7 +159,7 @@ public class AutoGenRobotService extends BaseService {
|
||||
|
||||
String uidStr = String.valueOf(account.getUid());
|
||||
//TokenRet tokenRet = netEaseService.createNetEaseAcc(uidStr, account.getNeteaseToken(), "");
|
||||
TokenRet tokenRet = this.netEaseService.createNetEaseAccWithGender(uidStr, account.getNeteaseToken(), "", Constant.DEFAULT_NICK, "", gender.toString());
|
||||
TokenRet tokenRet = this.netEaseService.createNetEaseAcc(uidStr, account.getNeteaseToken(), Constant.DEFAULT_NICK, "", gender.toString());
|
||||
saveGenAccountRecord(account.getUid(), account.getErbanNo(), Constant.DefUser.LABOR_UNION, remark, adminName);
|
||||
num++;
|
||||
} catch (Exception e) {
|
||||
@@ -259,8 +223,8 @@ public class AutoGenRobotService extends BaseService {
|
||||
this.usersMapper.insertSelective(user);
|
||||
|
||||
String uidStr = String.valueOf(account.getUid());
|
||||
TokenRet tokenRet = this.netEaseService.createNetEaseAccWithGender(uidStr, account.getNeteaseToken(),
|
||||
"", Constant.DEFAULT_NICK, "", req.getGender().toString());
|
||||
TokenRet tokenRet = this.netEaseService.createNetEaseAcc(uidStr, account.getNeteaseToken(),
|
||||
Constant.DEFAULT_NICK, "", req.getGender().toString());
|
||||
saveGenAccountRecord(account.getUid(), account.getErbanNo(), req.getDefUser(), req.getRemark(), adminName);
|
||||
|
||||
return account.getUid();
|
||||
|
@@ -5,7 +5,6 @@ import com.accompany.business.model.BannerExample;
|
||||
import com.accompany.business.mybatismapper.BannerMapper;
|
||||
import com.accompany.business.vo.BannerVo;
|
||||
import com.accompany.common.constant.Constant;
|
||||
import com.accompany.common.netease.neteaseacc.result.FileUploadRet;
|
||||
import com.accompany.common.redis.RedisKey;
|
||||
import com.accompany.common.utils.BlankUtil;
|
||||
import com.accompany.core.service.SysConfService;
|
||||
@@ -216,18 +215,6 @@ public class BannerService extends BaseService {
|
||||
return banner;
|
||||
}
|
||||
|
||||
public void addBanner(FileUploadRet fileUploadRet, String title, Byte type, Integer seqNo) {
|
||||
Banner banner = new Banner();
|
||||
banner.setBannerName(title);
|
||||
banner.setBannerPic(fileUploadRet.getUrl());
|
||||
banner.setSeqNo(seqNo);
|
||||
banner.setSkipType(type);
|
||||
banner.setCreateTiem(new Date());
|
||||
String bannerStr = gson.toJson(banner);
|
||||
jedisService.hwrite(RedisKey.banner.getKey(), banner.getBannerId().toString(), bannerStr);
|
||||
bannerMapper.insertSelective(banner);
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新加载状态为1的banner
|
||||
*/
|
||||
|
@@ -11,29 +11,18 @@ import com.accompany.common.redis.RedisKey;
|
||||
import com.accompany.common.utils.BlankUtil;
|
||||
import com.accompany.common.utils.GsonUtil;
|
||||
import com.accompany.common.utils.StringUtils;
|
||||
import com.accompany.core.service.SysConfService;
|
||||
import com.accompany.core.service.base.BaseService;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.geronimo.mail.util.Base64;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Created by liuguofu on 2017/5/10.
|
||||
@@ -48,22 +37,6 @@ public class ErBanNetEaseService extends BaseService {
|
||||
// 网易限频返回码
|
||||
private static final Integer RATE_LIMIT_CODE = 416;
|
||||
|
||||
public UserInfoRet getUserInfo(String accid) throws Exception {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.UserUrl.get;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
JSONArray array = new JSONArray();
|
||||
array.add(accid);
|
||||
param.put("accids", array);
|
||||
String result = netEaseBaseClient.buildHttpPostParam(param).executePost();
|
||||
log.info("getUserInfo accid:{}, result:{}", accid, result);
|
||||
RubbishRet rubbishRet = gson.fromJson(result, RubbishRet.class);
|
||||
if (rubbishRet.getCode() != 200) {
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新网易云用户信息,目前只支持更新昵称和头像
|
||||
*
|
||||
@@ -73,35 +46,18 @@ public class ErBanNetEaseService extends BaseService {
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public BaseNetEaseRet updateUserInfo(String accid, String name, String icon) throws Exception {
|
||||
public BaseNetEaseRet updateUserInfo(String accid, String name, String icon, Byte gender) {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.UserUrl.updateUinfo;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
param.put("accid", accid);
|
||||
param.put("name", name);
|
||||
param.put("icon", icon);
|
||||
if (null != gender){
|
||||
param.put("gender", gender);
|
||||
}
|
||||
String result = netEaseBaseClient.buildHttpPostParam(param).executePost();
|
||||
BaseNetEaseRet baseNetEaseRet = gson.fromJson(result, BaseNetEaseRet.class);
|
||||
return baseNetEaseRet;
|
||||
}
|
||||
|
||||
/**
|
||||
* 只更新网易云性别,用于在用户第一次补全资料,性别一经补全,不可更改
|
||||
*
|
||||
* @param accid
|
||||
* @param gender
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public BaseNetEaseRet updateUserGenderOnly(String accid, int gender) throws Exception {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.UserUrl.updateUinfo;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
param.put("accid", accid);
|
||||
param.put("gender", gender);
|
||||
String result = netEaseBaseClient.buildHttpPostParam(param).executePost();
|
||||
BaseNetEaseRet baseNetEaseRet = gson.fromJson(result, BaseNetEaseRet.class);
|
||||
return baseNetEaseRet;
|
||||
return gson.fromJson(result, BaseNetEaseRet.class);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,7 +72,7 @@ public class ErBanNetEaseService extends BaseService {
|
||||
* @throws Exception
|
||||
* @Author yuanyi
|
||||
*/
|
||||
public BaseNetEaseRet updateUserInfoForUserAdmin(String accid, int gender, String icon, String name) throws Exception {
|
||||
public BaseNetEaseRet updateUserInfoForUserAdmin(String accid, int gender, String icon, String name) {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.UserUrl.updateUinfo;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
@@ -130,19 +86,6 @@ public class ErBanNetEaseService extends BaseService {
|
||||
return baseNetEaseRet;
|
||||
}
|
||||
|
||||
|
||||
public BaseNetEaseRet updateUserInfoOfExpand(String accid, String expand) throws Exception {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.UserUrl.updateUinfo;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
param.put("accid", accid);
|
||||
param.put("ex", expand);
|
||||
String result = netEaseBaseClient.buildHttpPostParam(param).executePost();
|
||||
BaseNetEaseRet baseNetEaseRet = gson.fromJson(result, BaseNetEaseRet.class);
|
||||
return baseNetEaseRet;
|
||||
}
|
||||
|
||||
/**
|
||||
* 加好友
|
||||
*
|
||||
@@ -153,7 +96,7 @@ public class ErBanNetEaseService extends BaseService {
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public BaseNetEaseRet addFriends(String accid, String faccid, String type, String msg) throws Exception {
|
||||
public BaseNetEaseRet addFriends(String accid, String faccid, String type, String msg) {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.FriendsUrl.friendAdd;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
@@ -167,7 +110,7 @@ public class ErBanNetEaseService extends BaseService {
|
||||
return baseNetEaseRet;
|
||||
}
|
||||
|
||||
public BaseNetEaseRet deleteFriends(String accid, String faccid) throws Exception {
|
||||
public BaseNetEaseRet deleteFriends(String accid, String faccid) {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.FriendsUrl.friendDelete;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
@@ -179,31 +122,6 @@ public class ErBanNetEaseService extends BaseService {
|
||||
return baseNetEaseRet;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置黑名单/静音
|
||||
*
|
||||
* @param accid 用户帐号,最大长度32字符,必须保证一个APP内唯一
|
||||
* @param targetAcc 被加黑或加静音的帐号
|
||||
* @param relationType 本次操作的关系类型,1:黑名单操作,2:静音列表操作
|
||||
* @param value 操作值,0:取消黑名单或静音,1:加入黑名单或静音
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public BaseNetEaseRet setSpecialRelation(String accid, String targetAcc, int relationType, int value)
|
||||
throws Exception {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.UserUrl.setSpecialRelation;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey,
|
||||
NetEaseConfig.neteaseAppSecret, url);
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
param.put("accid", accid);
|
||||
param.put("targetAcc", targetAcc);
|
||||
param.put("relationType", relationType);
|
||||
param.put("value", value);
|
||||
String result = netEaseBaseClient.buildHttpPostParam(param).executePost();
|
||||
BaseNetEaseRet baseNetEaseRet = gson.fromJson(result, BaseNetEaseRet.class);
|
||||
return baseNetEaseRet;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询聊天室信息
|
||||
*
|
||||
@@ -211,14 +129,13 @@ public class ErBanNetEaseService extends BaseService {
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public RoomRet getRoomMessage(long roomId) throws Exception {
|
||||
public RoomRet getRoomMessage(long roomId) {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.RoomUrl.get;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
param.put("roomid", roomId);
|
||||
param.put("needOnlineUserCount", true);
|
||||
String result = netEaseBaseClient.buildHttpPostParam(param).executePost2();
|
||||
String result = netEaseBaseClient.buildHttpPostParam(param).executePost();
|
||||
return gsonDefine.fromJson(result, RoomRet.class);
|
||||
}
|
||||
|
||||
@@ -231,10 +148,9 @@ public class ErBanNetEaseService extends BaseService {
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public RoomRet openRoom(String accid, String name, String ext) throws Exception {
|
||||
public RoomRet openRoom(String accid, String name, String ext) {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.RoomUrl.create;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
param.put("creator", accid);
|
||||
param.put("name", name);
|
||||
@@ -266,7 +182,7 @@ public class ErBanNetEaseService extends BaseService {
|
||||
if (!BlankUtil.isBlank(notifyExt)) {
|
||||
param.put("notifyExt", notifyExt);
|
||||
}
|
||||
String result = netEaseBaseClient.buildHttpPostParam(param).executePost2();
|
||||
String result = netEaseBaseClient.buildHttpPostParam(param).executePost();
|
||||
return gsonDefine.fromJson(result, RoomRet.class);
|
||||
}
|
||||
|
||||
@@ -279,7 +195,7 @@ public class ErBanNetEaseService extends BaseService {
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public CloseRoomRet toggleCloseStat(Long roomId, String operator, boolean valid) throws Exception {
|
||||
public CloseRoomRet toggleCloseStat(Long roomId, String operator, boolean valid) {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.RoomUrl.toggleCloseStat;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
@@ -392,11 +308,9 @@ public class ErBanNetEaseService extends BaseService {
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public RubbishRet sendChatRoomMsgNoResend(Long roomId, String msgId, String fromAccid, int msgType, String attach)
|
||||
throws Exception {
|
||||
public RubbishRet sendChatRoomMsgNoResend(Long roomId, String msgId, String fromAccid, int msgType, String attach) {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.RoomUrl.sendMsg;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
param.put("roomid", roomId);
|
||||
param.put("msgId", msgId);
|
||||
@@ -417,11 +331,9 @@ public class ErBanNetEaseService extends BaseService {
|
||||
}
|
||||
|
||||
|
||||
public RubbishRet setChatRoomMemberRole(Long roomId, String operator, String target, int opt, String optvalue, String notifyExt)
|
||||
throws Exception {
|
||||
public RubbishRet setChatRoomMemberRole(Long roomId, String operator, String target, int opt, String optvalue, String notifyExt) {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.RoomUrl.setMemberRole;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
param.put("roomid", roomId);
|
||||
param.put("operator", operator);
|
||||
@@ -468,13 +380,10 @@ public class ErBanNetEaseService extends BaseService {
|
||||
}
|
||||
|
||||
public RubbishRet sendSysAttachMsg(String from, int msgtype, String to, String attach, String pushcontent,
|
||||
String payload, String sound, int save, String option) throws Exception {
|
||||
String payload, String sound, int save, String option) {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.MsgUrl.sendAttachMsg;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
//过滤审核账号
|
||||
to = filterAuditSecMsg(to);
|
||||
if (StringUtils.isNotBlank(to)) {
|
||||
param.put("from", from);
|
||||
param.put("msgtype", msgtype);
|
||||
@@ -495,101 +404,11 @@ public class ErBanNetEaseService extends BaseService {
|
||||
return rubbishRet;
|
||||
}
|
||||
|
||||
/* 上传图片 */
|
||||
public String uploadImgBatch(File file) throws Exception {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.MsgUrl.uploadImg;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
File[] files = file.listFiles();
|
||||
String result = "";
|
||||
String str = "";
|
||||
// 遍历文件夹
|
||||
for (File file2 : files) {
|
||||
@SuppressWarnings("resource")
|
||||
FileInputStream fis = new FileInputStream(file2);
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
byte[] bys = new byte[1024];
|
||||
int len = 0;
|
||||
while ((len = fis.read(bys)) != -1) {
|
||||
baos.write(bys, 0, len);
|
||||
}
|
||||
String encode = new String(Base64.encode(baos.toByteArray()));
|
||||
param.put("content", encode);
|
||||
result = netEaseBaseClient.buildHttpPostParam(param).executePost();
|
||||
str = str + result + file2.getName() + "\n";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
public FileUploadRet uploadFile(File file) throws Exception {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.MsgUrl.uploadImg;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
String result = "";
|
||||
FileInputStream fis = new FileInputStream(file);
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
byte[] bys = new byte[1024];
|
||||
int len = 0;
|
||||
while ((len = fis.read(bys)) != -1) {
|
||||
baos.write(bys, 0, len);
|
||||
}
|
||||
String encode = new String(Base64.encode(baos.toByteArray()));
|
||||
param.put("content", encode);
|
||||
result = netEaseBaseClient.buildHttpPostParam(param).executePost();
|
||||
log.info("result=" + result);
|
||||
FileUploadRet fileUploadRet = gson.fromJson(result, FileUploadRet.class);
|
||||
return fileUploadRet;
|
||||
}
|
||||
|
||||
public FileUploadRet uploadMultipartFile(MultipartFile file) throws Exception {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.MsgUrl.uploadImg;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
String result = "";
|
||||
InputStream fis = file.getInputStream();
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
byte[] bys = new byte[1024];
|
||||
int len = 0;
|
||||
while ((len = fis.read(bys)) != -1) {
|
||||
baos.write(bys, 0, len);
|
||||
}
|
||||
String encode = new String(Base64.encode(baos.toByteArray()));
|
||||
param.put("content", encode);
|
||||
result = netEaseBaseClient.buildHttpPostParam(param).executePost();
|
||||
log.info("result=" + result);
|
||||
FileUploadRet fileUploadRet = gson.fromJson(result, FileUploadRet.class);
|
||||
return fileUploadRet;
|
||||
}
|
||||
|
||||
public FileUploadRet uploadFileByInputStream(InputStream inputStream) throws Exception {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.MsgUrl.uploadImg;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
byte[] bys = new byte[1024];
|
||||
int len = 0;
|
||||
while ((len = inputStream.read(bys)) != -1) {
|
||||
baos.write(bys, 0, len);
|
||||
}
|
||||
String encode = new String(Base64.encode(baos.toByteArray()));
|
||||
param.put("content", encode);
|
||||
String result = netEaseBaseClient.buildHttpPostParam(param).executePost();
|
||||
FileUploadRet fileUploadRet = gson.fromJson(result, FileUploadRet.class);
|
||||
return fileUploadRet;
|
||||
}
|
||||
|
||||
public RubbishRet sendBatchSysAttachMsg(String fromAccid, String toAccids, String attach, String pushcontent,
|
||||
String payload, String sound, int save, String option, Boolean isForcePush) throws Exception {
|
||||
String payload, String sound, int save, String option, Boolean isForcePush) {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.MsgUrl.sendBatchAttachMsg;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
//过滤审核账号
|
||||
toAccids = filterBatchAuditSecMsg(toAccids);
|
||||
if (StringUtils.isNotBlank(toAccids)) {
|
||||
param.put("fromAccid", fromAccid);
|
||||
param.put("toAccids", toAccids);
|
||||
@@ -629,10 +448,7 @@ public class ErBanNetEaseService extends BaseService {
|
||||
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.MsgUrl.sendBatchMsg;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
//过滤审核账号
|
||||
toAccids = filterBatchAuditSecMsg(toAccids);
|
||||
if (StringUtils.isNotBlank(toAccids)) {
|
||||
param.put("fromAccid", fromAccid);
|
||||
param.put("toAccids", toAccids);
|
||||
@@ -667,11 +483,7 @@ public class ErBanNetEaseService extends BaseService {
|
||||
String payload, String option, Integer msgSenderNoSense) throws Exception {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.MsgUrl.sendMsg;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
//https://api.netease.im/nimserver/msg/sendMsg.action
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
//过滤审核账号
|
||||
to = filterAuditSecMsg(to);
|
||||
if (StringUtils.isNotBlank(to)) {
|
||||
param.put("from", from);
|
||||
param.put("ope", ope);
|
||||
@@ -716,11 +528,7 @@ public class ErBanNetEaseService extends BaseService {
|
||||
String payload, String option, Integer msgSenderNoSense, Integer useYidun) throws Exception {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.MsgUrl.sendMsg;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
//https://api.netease.im/nimserver/msg/sendMsg.action
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
//过滤审核账号
|
||||
to = filterAuditSecMsg(to);
|
||||
if (StringUtils.isNotBlank(to)) {
|
||||
param.put("from", from);
|
||||
param.put("ope", ope);
|
||||
@@ -799,7 +607,7 @@ public class ErBanNetEaseService extends BaseService {
|
||||
return result;
|
||||
}
|
||||
|
||||
public String deleteRobotToRoom(Long roomId, String id) throws Exception {
|
||||
public String deleteRobotToRoom(Long roomId, String id) {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.RoomUrl.removeRobot;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
@@ -812,37 +620,6 @@ public class ErBanNetEaseService extends BaseService {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置临时禁言状态
|
||||
*
|
||||
* @param roomId: 房间id
|
||||
* @param operator: 操作者accid,必须是管理员或创建者
|
||||
* @param target: 被禁言的目标账号accid
|
||||
* @param muteDuration: 0:解除禁言;>0设置禁言的秒数,不能超过2592000秒(30天)
|
||||
* @param needNotify: 操作完成后是否需要发广播,true或false,默认true
|
||||
* @param notifyExt: 通知广播事件中的扩展字段,长度限制2048字符
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public RubbishRet temporaryMuteFromRoom(long roomId, String operator, String target, int muteDuration,
|
||||
String needNotify, String notifyExt) throws Exception {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.RoomUrl.temporaryMute;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
param.put("roomid", roomId);
|
||||
param.put("operator", operator);
|
||||
param.put("target", target);
|
||||
param.put("muteDuration", muteDuration);
|
||||
param.put("needNotify", needNotify);
|
||||
param.put("notifyExt", notifyExt);
|
||||
log.info("temporaryMuteFromRoom,roomid={},operator={},target={},muteDuration={},needNotify={},notifyExt={}",
|
||||
roomId, operator, target, muteDuration, needNotify, notifyExt);
|
||||
String result = netEaseBaseClient.buildHttpPostParam(param).executePost();
|
||||
log.info("禁言返回结果:{}", result);
|
||||
return gson.fromJson(result, RubbishRet.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列出队列中的所有元素
|
||||
*
|
||||
@@ -854,7 +631,7 @@ public class ErBanNetEaseService extends BaseService {
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
param.put("roomid", roomId);
|
||||
String result = netEaseBaseClient.buildHttpPostParam(param).executePost2();
|
||||
String result = netEaseBaseClient.buildHttpPostParam(param).executePost();
|
||||
RubbishRet rubbishRet = gson.fromJson(result, RubbishRet.class);
|
||||
if (rubbishRet.getCode() != 200) {
|
||||
log.error("queueList error, roomId:" + roomId + ", result:" + result);
|
||||
@@ -882,11 +659,9 @@ public class ErBanNetEaseService extends BaseService {
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public int queueOffer(long roomId, String key, String value, String operator, String transie)
|
||||
throws Exception {
|
||||
public int queueOffer(long roomId, String key, String value, String operator, String transie) {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.RoomUrl.queueOffer;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
param.put("roomid", roomId);
|
||||
param.put("key", key);
|
||||
@@ -909,14 +684,14 @@ public class ErBanNetEaseService extends BaseService {
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public int queuePoll(long roomId, String key) throws Exception {
|
||||
public int queuePoll(long roomId, String key) {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.RoomUrl.queuePoll;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
param.put("roomid", roomId);
|
||||
param.put("key", key);
|
||||
String result = netEaseBaseClient.buildHttpPostParam(param).executePost2();
|
||||
String result = netEaseBaseClient.buildHttpPostParam(param).executePost();
|
||||
return gson.fromJson(result, RubbishRet.class).getCode();
|
||||
}
|
||||
|
||||
@@ -926,7 +701,7 @@ public class ErBanNetEaseService extends BaseService {
|
||||
* @param roomId
|
||||
* @throws Exception
|
||||
*/
|
||||
public int queueDrop(Long roomId) throws Exception {
|
||||
public int queueDrop(Long roomId) {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.RoomUrl.queueDrop;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
@@ -948,10 +723,9 @@ public class ErBanNetEaseService extends BaseService {
|
||||
log.info("block accid=" + accid + "&result=" + result);
|
||||
}
|
||||
|
||||
public void unblock(String accid) throws Exception {
|
||||
public void unblock(String accid) {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.AccUrl.unblock;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
param.put("accid", accid);
|
||||
String result = netEaseBaseClient.buildHttpPostParam(param).executePost();
|
||||
@@ -965,7 +739,7 @@ public class ErBanNetEaseService extends BaseService {
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public CreateChatResult createGroupChat(GroupChatParam chatParam) throws Exception {
|
||||
public CreateChatResult createGroupChat(GroupChatParam chatParam) {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.GroupChatUrl.createChat;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
@@ -1192,23 +966,6 @@ public class ErBanNetEaseService extends BaseService {
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取群聊详细信息
|
||||
*
|
||||
* @param tid
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public String queryDetail(String tid) throws Exception {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.GroupChatUrl.queryDetail;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
param.put("tid", tid);
|
||||
String result = netEaseBaseClient.buildHttpPostParam(param).executePost();
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 主动退群
|
||||
*
|
||||
@@ -1287,68 +1044,6 @@ public class ErBanNetEaseService extends BaseService {
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询群成员
|
||||
*
|
||||
* @param tids 群id列表(数组)
|
||||
* @param ope 1:带上群成员列表 0:不带群成员列表,只返回群信息
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public String queryMembers(String tids, int ope) throws Exception {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.GroupChatUrl.query;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
param.put("tids", tids);
|
||||
param.put("ope", ope);
|
||||
String result = netEaseBaseClient.buildHttpPostParam(param).executePost();
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 移交群主
|
||||
*
|
||||
* @param tid
|
||||
* @param ownerUid 原群主
|
||||
* @param newownerUid 新群主
|
||||
* @param leave 1:群主解除群主后离开群,2:群主解除群主后成为普通成员
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public NetEaseResult changeOwner(String tid, String ownerUid, String newownerUid, int leave) throws Exception {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.GroupChatUrl.changeOwner;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
param.put("tid", tid);
|
||||
param.put("owner", ownerUid);
|
||||
param.put("newowner", newownerUid);
|
||||
param.put("leave", leave);
|
||||
String result = netEaseBaseClient.buildHttpPostParam(param).executePost();
|
||||
NetEaseResult ret = gson.fromJson(result, NetEaseResult.class);
|
||||
log.info("group-chat changeOwner tid: {}, params: {}, result: {}", tid, gson.toJson(param), result);
|
||||
if (!ret.isSuccess()) {
|
||||
log.error("Failed to change group-chat owner by netease. code: {}, desc: {}", ret.getCode(), ret.getDesc());
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public NetEaseMapResult queueBatchUpdate(Long roomId, Long roomUid, String queueInfo) throws Exception {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.RoomUrl.queueBatchUpdate;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
;
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
param.put("roomid", roomId);
|
||||
param.put("operator", roomUid);
|
||||
param.put("elements", queueInfo);
|
||||
String result = netEaseBaseClient.buildHttpPostParam(param).executePost();
|
||||
NetEaseMapResult ret = gson.fromJson(result, NetEaseMapResult.class);
|
||||
if (!ret.isSuccess()) {
|
||||
log.error("queueBatchUpdate roomId=" + roomId + "&roomUid=" + roomUid + "&queueInfo=" + queueInfo + "====result=" + result);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询存储在网易云通信服务器中的单人聊天历史消息,只能查询在保存时间范围内的消息
|
||||
* 1. 根据时间段查询点对点消息,每次最多返回100条;
|
||||
@@ -1387,43 +1082,6 @@ public class ErBanNetEaseService extends BaseService {
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量过滤审核账号小秘书消息
|
||||
*
|
||||
* @param toAccId
|
||||
* @return
|
||||
*/
|
||||
private String filterBatchAuditSecMsg(String toAccId) {
|
||||
String isFilter = this.jedisService.get(RedisKey.filter_audit_account_segment.getKey());
|
||||
String filterAccount = this.jedisService.get(RedisKey.audit_use_account.getKey());
|
||||
if ("true".equalsIgnoreCase(isFilter) && !org.springframework.util.StringUtils.isEmpty(filterAccount)) {
|
||||
List<String> toAccIds = gson.fromJson(toAccId, new TypeToken<List<String>>() {
|
||||
}.getType());
|
||||
List<String> filterIds = gson.fromJson(filterAccount, new TypeToken<List<String>>() {
|
||||
}.getType());
|
||||
toAccIds = toAccIds.stream().filter((accId) -> !filterIds.contains(accId)).collect(Collectors.toList());
|
||||
toAccId = gson.toJson(toAccIds);
|
||||
}
|
||||
return toAccId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 过滤审核账号小秘书消息
|
||||
*
|
||||
* @param toAccId
|
||||
* @return
|
||||
*/
|
||||
private String filterAuditSecMsg(String toAccId) {
|
||||
String isFilter = this.jedisService.get(RedisKey.filter_audit_account_segment.getKey());
|
||||
String filterAccount = this.jedisService.get(RedisKey.audit_use_account.getKey());
|
||||
if ("true".equalsIgnoreCase(isFilter) && !org.springframework.util.StringUtils.isEmpty(filterAccount)) {
|
||||
if (filterAccount.contains(toAccId)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return toAccId;
|
||||
}
|
||||
|
||||
public void delMsg(String deleteMsgId, Long timeTag, Integer type, String from, String to) {
|
||||
log.info("delMsg deleteMsgId : {}, timeTag : {}, type : {}, from : {}, to : {}", deleteMsgId, timeTag, type, from, to);
|
||||
try {
|
||||
@@ -1473,7 +1131,6 @@ public class ErBanNetEaseService extends BaseService {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.MsgUrl.delMsgOneWay;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient(NetEaseConfig.neteaseAppKey, NetEaseConfig.neteaseAppSecret, url);
|
||||
Map<String, Object> param = Maps.newHashMap(); //过滤审核账号
|
||||
to = filterAuditSecMsg(to);
|
||||
if (StringUtils.isNotBlank(to)) { // 要撤回消息的消息 ID
|
||||
param.put("deleteMsgid", deleteMsgId); // 待撤回消息的创建时间
|
||||
param.put("timetag", timeTag); // 消息发送者
|
||||
@@ -1493,15 +1150,4 @@ public class ErBanNetEaseService extends BaseService {
|
||||
return rubbishRet;
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
String url = NetEaseConstant.basicUrl + NetEaseConstant.RoomUrl.get;
|
||||
NetEaseBaseClient netEaseBaseClient = new NetEaseBaseClient("14ef7a0d0a84cb49bae1c22d78cf1ddf", "d91fbba1feff", url);
|
||||
;
|
||||
Map<String, Object> param = Maps.newHashMap();
|
||||
param.put("roomid", "577406660");
|
||||
param.put("needOnlineUserCount", true);
|
||||
String result = netEaseBaseClient.buildHttpPostParam(param).executePost2();
|
||||
System.out.println(result);
|
||||
}
|
||||
}
|
||||
|
@@ -1,80 +0,0 @@
|
||||
package com.accompany.business.service;
|
||||
|
||||
import com.accompany.business.model.Feedback;
|
||||
import com.accompany.business.mybatismapper.FeedbackMapper;
|
||||
import com.accompany.business.service.user.UsersService;
|
||||
import com.accompany.common.result.BusiResult;
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
import com.accompany.common.utils.UUIDUtil;
|
||||
import com.accompany.core.vo.UserVo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Created by 北岭山下 on 2017/7/18.
|
||||
*/
|
||||
@Service
|
||||
public class FeedbackService {
|
||||
|
||||
@Autowired
|
||||
private UsersService usersService;
|
||||
@Autowired
|
||||
private FeedbackMapper feedbackMapper;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger ( FeedbackService.class );
|
||||
public BusiResult feedbackUpdate ( Long uid, String feedbackDesc, String img,String contact){
|
||||
|
||||
|
||||
//判断用户是否存在
|
||||
//==============判断用户是否存在======================//
|
||||
UserVo userVo = usersService.getUserByUid ( uid ).getData ();
|
||||
if(userVo == null){
|
||||
LOGGER.warn ( "用户:"+uid+" ==============用户不存在==================" );
|
||||
return new BusiResult( BusiStatus.USERNOTEXISTS);
|
||||
}
|
||||
//创建feedbackID
|
||||
String feedbackId = UUIDUtil.get ();
|
||||
//写入feedback相关信息
|
||||
Feedback feedback = new Feedback ();
|
||||
feedback.setFeedbackDesc ( feedbackDesc );
|
||||
feedback.setFeedbackId ( feedbackId );
|
||||
feedback.setImgUrl ( img );
|
||||
feedback.setContact ( contact );
|
||||
feedback.setUid ( uid );
|
||||
try{
|
||||
insertFeedback (feedback);
|
||||
}catch(Exception e){
|
||||
LOGGER.error ( "用户:"+uid+"==============反馈失败=================" );
|
||||
return new BusiResult ( BusiStatus.BUSIERROR );
|
||||
}
|
||||
return new BusiResult ( BusiStatus.SUCCESS );
|
||||
|
||||
|
||||
}
|
||||
//feedback创建(插入一条Feedback)
|
||||
private void insertFeedback ( Feedback feedback){
|
||||
feedback.setCreateTime ( new Date ( ) );
|
||||
feedbackMapper.insertSelective ( feedback );
|
||||
}
|
||||
//
|
||||
//更新一条Feedback
|
||||
/*
|
||||
private int updateFeedBack(Feedback feedback){
|
||||
|
||||
}*/
|
||||
//获取一条Feedback
|
||||
private Feedback getFeedbackById(String feedbackId){
|
||||
return feedbackMapper.selectByPrimaryKey ( feedbackId );
|
||||
}
|
||||
//
|
||||
//获取所有的Feedback信息
|
||||
/*
|
||||
private List<Feedback>getAllFeedBackList(){
|
||||
}*/
|
||||
|
||||
|
||||
}
|
@@ -1,10 +1,8 @@
|
||||
package com.accompany.business.service;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.accompany.business.model.MsgPushRecord;
|
||||
import com.accompany.business.mybatismapper.MsgPushRecordMapper;
|
||||
import com.accompany.business.mybatismapper.UsersMapperExpend;
|
||||
import com.accompany.business.param.neteasepush.*;
|
||||
import com.accompany.common.constant.Attach;
|
||||
import com.accompany.common.constant.Constant;
|
||||
@@ -27,9 +25,6 @@ public class MsgPushService {
|
||||
@Autowired
|
||||
private MsgPushRecordMapper msgPushRecordMapper;
|
||||
|
||||
@Autowired
|
||||
private UsersMapperExpend usersMapperExpend;
|
||||
|
||||
@Autowired
|
||||
private AccountLoginRecordMapperExpand accountLoginRecordMapperExpand;
|
||||
|
||||
|
@@ -128,7 +128,7 @@ public class YidunCallbackService extends BaseService {
|
||||
// 更新用户房间头像
|
||||
usersMapper.updateUserRoom(users.getUid());
|
||||
|
||||
BaseNetEaseRet baseNetEaseRet = erBanNetEaseService.updateUserInfo(uidStr, users.getNick(), users.getAvatar());
|
||||
BaseNetEaseRet baseNetEaseRet = erBanNetEaseService.updateUserInfo(uidStr, users.getNick(), users.getAvatar(), null);
|
||||
if (200 != baseNetEaseRet.getCode()) {
|
||||
log.info("用户{}易盾头像审核回调taskId{}更新网易云账号信息异常异常编码={}", uidStr, taskId, baseNetEaseRet.getCode());
|
||||
throw new Exception("处理异常!");
|
||||
|
@@ -1,25 +0,0 @@
|
||||
package com.accompany.business.service.activities.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* Created By LeeNana on 2020/2/13.
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class RunawayPoolVo {
|
||||
/**
|
||||
* 暴走奖池
|
||||
*/
|
||||
private Byte poolType;
|
||||
|
||||
/**
|
||||
* 暴走状态时间
|
||||
*/
|
||||
private Long RunawayTime;
|
||||
}
|
@@ -1,25 +0,0 @@
|
||||
package com.accompany.business.service.activities.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* Created By LeeNana on 2020/2/13.
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class RunawayValueVo {
|
||||
/**
|
||||
* 暴走值
|
||||
*/
|
||||
private Integer value;
|
||||
|
||||
/**
|
||||
* 暴走值更新时间
|
||||
*/
|
||||
private Long RunawayTime;
|
||||
}
|
@@ -29,12 +29,10 @@ import com.accompany.common.config.SystemConfig;
|
||||
import com.accompany.common.constant.ApplicationConstant;
|
||||
import com.accompany.common.constant.Attach;
|
||||
import com.accompany.common.constant.Constant;
|
||||
import com.accompany.common.device.DeviceInfo;
|
||||
import com.accompany.common.netease.neteaseacc.result.BaseNetEaseRet;
|
||||
import com.accompany.common.redis.RedisKey;
|
||||
import com.accompany.common.result.BusiResult;
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
import com.accompany.common.utils.AppVersionUtil;
|
||||
import com.accompany.common.utils.DateTimeUtil;
|
||||
import com.accompany.core.exception.ServiceException;
|
||||
import com.accompany.core.model.Room;
|
||||
@@ -640,21 +638,6 @@ public class FansService extends ServiceImpl<FansMapper, Fans> {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回用户收藏房间
|
||||
*/
|
||||
public HashMap<String, Object> userFansRoomList(Long uid, Integer page, Integer pageSize, DeviceInfo deviceInfo) {
|
||||
if (ObjectUtil.isNotNull(deviceInfo) && versionCheck(deviceInfo.getAppVersion(), Constant.BigGooseConstant.big_goose_appver))
|
||||
return userFansRoomListV2(uid, page, pageSize);
|
||||
HashMap<String, Object> result = new HashMap<>();
|
||||
Integer count = fansRoomMapper.userFansRoomCount(uid);
|
||||
Integer totalPage = (count + pageSize - 1) / pageSize;
|
||||
String limit = String.format("%d,%d", (page - 1) * pageSize, pageSize);
|
||||
result.put("totalPage", totalPage);
|
||||
result.put("fansRoomList", fansRoomMapper.userFansRoom(uid, limit));
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户收藏房间
|
||||
*/
|
||||
@@ -771,7 +754,7 @@ public class FansService extends ServiceImpl<FansMapper, Fans> {
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<FansPersonVo> partTabFollowList(Long uid) throws Exception {
|
||||
public List<FansPersonVo> partTabFollowList(Long uid) {
|
||||
QueryWrapper<Fans> wrapper = new QueryWrapper<>();
|
||||
wrapper.lambda().eq(Fans::getLikeUid, uid);
|
||||
List<Fans> fansList = this.getBaseMapper().selectList(wrapper);
|
||||
@@ -814,24 +797,6 @@ public class FansService extends ServiceImpl<FansMapper, Fans> {
|
||||
return baseService.subList(0, 5, fansPersonVoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param currentAppVersion:当前app版本
|
||||
* @param needVersion:需要的版本Constant.BigGooseConstant.big_goose_appver
|
||||
* @return
|
||||
*/
|
||||
public Boolean versionCheck(String currentAppVersion, String needVersion) {
|
||||
if (com.aliyuncs.utils.StringUtils.isEmpty(currentAppVersion)) {
|
||||
logger.info("app首页请求没有携带版本信息...");
|
||||
return false;
|
||||
}
|
||||
if (AppVersionUtil.compareVersion(currentAppVersion, needVersion) < 0) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void checkFansRoomVoIsCrossPking(List<FansRoomVo> list) {
|
||||
if (CollectionUtils.isEmpty(list)) return;
|
||||
|
||||
|
@@ -10,7 +10,6 @@ import com.accompany.business.model.roomtab.RoomTab;
|
||||
import com.accompany.business.model.roomtab.RoomTabHome;
|
||||
import com.accompany.business.model.roomtab.RoomTabMap;
|
||||
import com.accompany.business.mybatismapper.RoomTabHomeMapper;
|
||||
import com.accompany.business.mybatismapper.miniGame.MiniGameRoomMapper;
|
||||
import com.accompany.business.service.ErBanNetEaseService;
|
||||
import com.accompany.business.service.firstpage.FirstPageBannerService;
|
||||
import com.accompany.business.service.follow.FansRoomService;
|
||||
@@ -61,7 +60,6 @@ import com.accompany.core.model.Room;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.accompany.core.service.SysConfService;
|
||||
import com.accompany.core.service.base.BaseService;
|
||||
import com.accompany.core.service.channel.ChannelContentPartitionService;
|
||||
import com.accompany.core.service.user.UsersBaseService;
|
||||
import com.accompany.core.vo.user.UserNameplateVo;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -129,8 +127,6 @@ public class HomeService extends BaseService {
|
||||
@Autowired
|
||||
private MiniGameService miniGameService;
|
||||
@Autowired
|
||||
private ChannelContentPartitionService channelContentPartitionService;
|
||||
@Autowired
|
||||
private UserBlackRecordService userBlackRecordService;
|
||||
|
||||
@Autowired
|
||||
@@ -593,8 +589,6 @@ public class HomeService extends BaseService {
|
||||
return topRoomTabHomeVos;
|
||||
}
|
||||
|
||||
// 渠道内容过滤
|
||||
list = channelContentPartitionService.filterByChannelContent(uid, deviceInfo, list, this::filterRoomTabHomeByChannel);
|
||||
// 过滤屏蔽房间
|
||||
List<Long> blackIdList = userBlackRecordService.getBlackIdList(uid, Constant.UserBlackType.room);
|
||||
List<Long> roomUidList = list.stream().map(RoomTabHome::getRoomUid).collect(Collectors.toList());
|
||||
@@ -813,8 +807,6 @@ public class HomeService extends BaseService {
|
||||
}
|
||||
topRoomTabVoList.add(topRoomTabHomeVo);
|
||||
}
|
||||
// 渠道内容过滤
|
||||
topRoomTabVoList = channelContentPartitionService.filterByChannelContent(uid, deviceInfo, topRoomTabVoList, this::filterTopRoomTabByChannel);
|
||||
//排序
|
||||
topRoomTabVoList = topRoomTabVoList.stream().sorted((x, y) -> {
|
||||
if (x.getIsTop() == y.getIsTop()) {
|
||||
@@ -1032,18 +1024,13 @@ public class HomeService extends BaseService {
|
||||
* @return
|
||||
*/
|
||||
public Long getRoomTabHomeOne(Long uid, DeviceInfo deviceInfo) {
|
||||
try {
|
||||
List<TopRoomTabHomeVo> list = this.getTopRoomHome(6);
|
||||
list = channelContentPartitionService.filterByChannelContent(uid, deviceInfo, list, this::filterTopRoomTabByChannel);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
List<Long> roomUids = list.stream().map(TopRoomTabHomeVo::getRoomUid).collect(Collectors.toList());
|
||||
Collections.shuffle(roomUids);
|
||||
return roomUids.get(0);
|
||||
}
|
||||
return null;
|
||||
} catch (IOException e) {
|
||||
throw new ServiceException(BusiStatus.SERVERBUSY);
|
||||
List<TopRoomTabHomeVo> list = this.getTopRoomHome(6);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
List<Long> roomUids = list.stream().map(TopRoomTabHomeVo::getRoomUid).collect(Collectors.toList());
|
||||
Collections.shuffle(roomUids);
|
||||
return roomUids.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Long chatPick() {
|
||||
|
@@ -1,42 +0,0 @@
|
||||
package com.accompany.business.service.home.filter;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.accompany.business.vo.home.PlayRoomVo;
|
||||
import com.accompany.core.base.DeviceInfoContextHolder;
|
||||
import com.accompany.core.base.SpringContextHolder;
|
||||
import com.accompany.core.base.UidContextHolder;
|
||||
import com.accompany.core.service.channel.ChannelContentPartitionService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: liaozetao
|
||||
* @date: 2023/8/30 17:43
|
||||
* @description:
|
||||
*/
|
||||
@Slf4j
|
||||
public class ChannelContentRoomFilter implements PlayRoomFilter<PlayRoomVo> {
|
||||
|
||||
private final ChannelContentPartitionService channelContentPartitionService;
|
||||
|
||||
public ChannelContentRoomFilter() {
|
||||
this.channelContentPartitionService = SpringContextHolder.getBeanOfClass(ChannelContentPartitionService.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doFilter(List<PlayRoomVo> playRooms) {
|
||||
if (CollectionUtil.isEmpty(playRooms)) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
List<Long> uidList = channelContentPartitionService.getChannelRommErbanList(UidContextHolder.get(), DeviceInfoContextHolder.get());
|
||||
if (CollectionUtil.isEmpty(uidList)) {
|
||||
return;
|
||||
}
|
||||
playRooms.removeIf(v -> !uidList.contains(v.getUid()));
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
@@ -113,8 +113,7 @@ public class HomeIndexServiceImpl implements HomeIndexService {
|
||||
PlayRoomFilterChain<PlayRoomVo> filterChain = new PlayRoomFilterChain<>(
|
||||
new BlackRoomFilter(),
|
||||
new ValidRoomFilter(roomList, userList),
|
||||
new SingleBroadcastRoomFilter(roomList),
|
||||
new ChannelContentRoomFilter()
|
||||
new SingleBroadcastRoomFilter(roomList)
|
||||
);
|
||||
filterChain.doFilter(playRooms);
|
||||
//装饰
|
||||
|
@@ -34,7 +34,6 @@ import com.accompany.core.mybatismapper.RoomMapper;
|
||||
import com.accompany.core.mybatismapper.RoomMapperExpand;
|
||||
import com.accompany.core.service.SysConfService;
|
||||
import com.accompany.core.service.base.BaseService;
|
||||
import com.accompany.core.service.channel.ChannelContentPartitionService;
|
||||
import com.accompany.core.vo.user.SearchVo;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.common.reflect.TypeToken;
|
||||
@@ -99,8 +98,6 @@ public class RoomSearchService extends BaseService {
|
||||
@Autowired
|
||||
private ElasticsearchClientV2 elasticsearchClient;
|
||||
@Autowired
|
||||
private ChannelContentPartitionService channelContentPartitionService;
|
||||
@Autowired
|
||||
private HallService hallService;
|
||||
@Autowired
|
||||
private HallManageService hallManageService;
|
||||
@@ -115,24 +112,6 @@ public class RoomSearchService extends BaseService {
|
||||
@Autowired
|
||||
private LevelService levelService;
|
||||
|
||||
/**
|
||||
* 对搜索结果集进行转换
|
||||
*
|
||||
* @param data
|
||||
* @return
|
||||
* @throws InvocationTargetException
|
||||
* @throws IllegalAccessException
|
||||
*/
|
||||
public List<SearchVo> map2SearchVo(List<Map<String, Object>> data) throws InvocationTargetException, IllegalAccessException {
|
||||
List<SearchVo> list = new ArrayList<>(data.size());
|
||||
for (Map<String, Object> map : data) {
|
||||
SearchVo searchVo = new SearchVo();
|
||||
BeanUtils.populate(searchVo, map);
|
||||
list.add(searchVo);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索接口
|
||||
*
|
||||
@@ -213,69 +192,6 @@ public class RoomSearchService extends BaseService {
|
||||
return searchVos;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索接口
|
||||
*
|
||||
* @param searchText
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @throws InvocationTargetException
|
||||
* @throws IllegalAccessException
|
||||
*/
|
||||
public List<SearchVo> searchV2(Long uid, String searchText, Integer searchType, Integer page, Integer pageSize, DeviceInfo deviceInfo) throws Exception {
|
||||
if (uid == null) {
|
||||
return search(uid, searchText, searchType, page, pageSize);
|
||||
}
|
||||
List<Long> validUidList = channelContentPartitionService.getChannelRommErbanList(uid, deviceInfo);
|
||||
if (CollectionUtils.isEmpty(validUidList)) {
|
||||
return search(uid, searchText, searchType, page, pageSize);
|
||||
}
|
||||
// 检查是否命中缓存
|
||||
String cacheKey = RedisKey.search_text_cache.getKey(searchText, searchType.toString());
|
||||
String result = jedisService.get(cacheKey);
|
||||
// 屏蔽房間/用户
|
||||
List<Long> blackIdList = userBlackRecordService.getBlackIdList(uid, Constant.UserBlackType.room);
|
||||
if (StringUtils.isNotBlank(result)) {
|
||||
logger.info("search cache found, key:{}, type:{}", searchText, searchType);
|
||||
List<SearchVo> searchVos = null;
|
||||
if (CollectionUtils.isEmpty(blackIdList)) {
|
||||
searchVos = gson.fromJson(result, new TypeToken<List<SearchVo>>() {
|
||||
}.getType());
|
||||
} else {
|
||||
// 过滤屏蔽房間
|
||||
searchVos = gson.fromJson(result, new TypeToken<List<SearchVo>>() {
|
||||
}.getType());
|
||||
searchVos = searchVos.stream().filter(it -> !blackIdList.contains(it.getUid())).collect(Collectors.toList());
|
||||
}
|
||||
return searchVos;
|
||||
}
|
||||
List<SearchVo> searchVos;
|
||||
if (searchType == 1) {
|
||||
searchVos = searchRoomByKeyV2(validUidList, searchText, (page - 1) * pageSize, pageSize);
|
||||
} else {
|
||||
searchVos = searchUserByKeyV2(validUidList, searchText, (page - 1) * pageSize, pageSize);
|
||||
}
|
||||
searchVos.forEach(searchVo -> searchVo.setRoomUid(null));
|
||||
searchVos = filterBlocked(searchVos);
|
||||
// 过滤屏蔽房間/用户
|
||||
if (CollectionUtils.isNotEmpty(blackIdList)) {
|
||||
searchVos = searchVos.stream().filter(it -> !blackIdList.contains(it.getUid())).collect(Collectors.toList());
|
||||
}
|
||||
// 缓存结果默认5秒
|
||||
jedisService.set(cacheKey, gson.toJson(searchVos));
|
||||
String expireSeconds = sysConfService.getDefaultSysConfValueById(Constant.SysConfId.SEARCH_CACHE_SECONDS, "5");
|
||||
jedisService.expire(cacheKey, Integer.parseInt(expireSeconds));
|
||||
return searchVos;
|
||||
}
|
||||
|
||||
public List<SearchVo> searchRoomByKeyV2(List<Long> uidList, String searchText, Integer start, Integer limit) {
|
||||
return roomMapperExpand.searchRoomByKeyV2(uidList, searchText, start, limit);
|
||||
}
|
||||
|
||||
public List<SearchVo> searchUserByKeyV2(List<Long> uidList, String searchText, Integer start, Integer limit) {
|
||||
return roomMapperExpand.searchUserByKeyV2(uidList, searchText, start, limit);
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> query(String searchText, Integer type, Integer page, Integer pageSize) throws IOException {
|
||||
logger.info("searchText before:{}", searchText);
|
||||
//转译特殊字符
|
||||
@@ -523,12 +439,7 @@ public class RoomSearchService extends BaseService {
|
||||
}
|
||||
|
||||
public List<SearchVo> searchByEs(Long uid, String searchText, Integer searchType, Integer page, Integer pageSize, DeviceInfo deviceInfo) throws Exception {
|
||||
List<Long> validUidList;
|
||||
if (uid == null) {
|
||||
validUidList = Collections.emptyList();
|
||||
} else {
|
||||
validUidList = channelContentPartitionService.getChannelRommErbanList(uid, deviceInfo);
|
||||
}
|
||||
List<Long> validUidList = new ArrayList<>();
|
||||
QueryBuilder queryBuilder;
|
||||
String index = null;
|
||||
if (SEARCH_TYPE_ROOM.equals(searchType)) {
|
||||
|
@@ -28,7 +28,6 @@ import com.accompany.core.exception.ServiceException;
|
||||
import com.accompany.core.model.Room;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.accompany.core.service.SysConfService;
|
||||
import com.accompany.core.service.channel.ChannelContentPartitionService;
|
||||
import com.accompany.core.service.common.JedisService;
|
||||
import com.accompany.core.service.user.UsersBaseService;
|
||||
import com.accompany.core.vo.RedisHashVo;
|
||||
@@ -73,8 +72,6 @@ public class SingleBroadcastPopularityServiceImpl extends ServiceImpl<SingleBroa
|
||||
private SysConfService sysConfService;
|
||||
@Autowired
|
||||
private SingleRoomRankService singleRoomRankService;
|
||||
@Autowired
|
||||
private ChannelContentPartitionService channelContentPartitionService;
|
||||
|
||||
private Gson gson = new Gson();
|
||||
|
||||
@@ -147,15 +144,10 @@ public class SingleBroadcastPopularityServiceImpl extends ServiceImpl<SingleBroa
|
||||
List<SingleBroadcastMainVO> resultList = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(cacheStr)) {
|
||||
resultList= gson.fromJson(cacheStr, new TypeToken<List<SingleBroadcastMainVO>>() {}.getType());
|
||||
// 缓存渠道内容过滤
|
||||
resultList = channelContentPartitionService.filterByChannelContent(uid, getDeviceInfo, resultList, this::filterSingleBroadcastMainVOByChannel);
|
||||
return resultList;
|
||||
}
|
||||
|
||||
List<SingleBroadcastCacheDto> cacheList = getAllSingleRoom();
|
||||
Boolean channelContentStatus = channelContentPartitionService.checkUserChannelContent(uid,getDeviceInfo);
|
||||
// 缓存渠道内容过滤
|
||||
cacheList = channelContentPartitionService.filterByChannelContent(uid, getDeviceInfo, cacheList, this::filterSingleBroadcastMainByChannel);
|
||||
|
||||
if(singleRoomSortId != null){
|
||||
cacheList = cacheList.stream().filter(a -> singleRoomSortId.equals(a.getSingleRoomSortId())).collect(Collectors.toList());
|
||||
@@ -202,10 +194,8 @@ public class SingleBroadcastPopularityServiceImpl extends ServiceImpl<SingleBroa
|
||||
}
|
||||
);
|
||||
|
||||
// 渠道过滤无需固化缓存
|
||||
if(!channelContentStatus){
|
||||
jedisService.set(redisKey, gson.toJson(resultList), 60);
|
||||
}
|
||||
jedisService.set(redisKey, gson.toJson(resultList), 60);
|
||||
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@@ -228,7 +218,6 @@ public class SingleBroadcastPopularityServiceImpl extends ServiceImpl<SingleBroa
|
||||
List<SingleBroadcastMainVO> singleBroadcastMainVOList;
|
||||
if(CollectionUtils.isNotEmpty(onceLookVoList)){
|
||||
// 缓存渠道内容过滤
|
||||
onceLookVoList = channelContentPartitionService.filterByChannelContent(uid, deviceInfo, onceLookVoList, this::filterSingleUserOnceLookVoByChannel);
|
||||
onceLookStatus = true;
|
||||
// 根据进入过的个播房的时间排序
|
||||
onceLookVoList = onceLookVoList.stream().sorted(Comparator.comparing(SingleUserOnceLookVo::getInRoomTime)).collect(Collectors.toList());
|
||||
@@ -277,8 +266,6 @@ public class SingleBroadcastPopularityServiceImpl extends ServiceImpl<SingleBroa
|
||||
recommendList = recommendList.stream().filter(a -> ! onceLookList.contains(a)).collect(Collectors.toList());
|
||||
}
|
||||
List<SingleBroadcastMainVO> singleBroadcastMainVOList = getSingleBroadcastMainVOList(recommendList);
|
||||
// 缓存渠道内容过滤
|
||||
singleBroadcastMainVOList = channelContentPartitionService.filterByChannelContent(uid, deviceInfo, singleBroadcastMainVOList, this::filterSingleBroadcastMainVOByChannel);
|
||||
// 判断 设置的推荐个播房的数量 + 历史数量 是否满足数量
|
||||
if(singleBroadcastMainVOList.size() + listSize < MAX_ONCE_LOOK_NUM){
|
||||
// 排除历史 和 设置推荐的个播房
|
||||
@@ -459,9 +446,6 @@ public class SingleBroadcastPopularityServiceImpl extends ServiceImpl<SingleBroa
|
||||
|
||||
List<SingleBroadcastCacheDto> cacheList = getAllSingleRoom();
|
||||
if (CollectionUtils.isEmpty(cacheList)) return resultList;
|
||||
// 按渠道内容过滤
|
||||
cacheList = channelContentPartitionService.filterByChannelContent(uid, getDeviceInfo, cacheList, this::filterSingleBroadcastMainByChannel);
|
||||
if (CollectionUtils.isEmpty(cacheList)) return resultList;
|
||||
|
||||
//置顶排序
|
||||
List<SingleBroadcastCacheDto> topOrderList = cacheList.stream().filter(singleBroadcastCacheDto -> Constant.SingleBroadcastIsTop.TOP.equals(singleBroadcastCacheDto.getIsTop()) && !singleBroadcastCacheDto.getTopOrder().equals(0) && singleBroadcastCacheDto.getIsMainShow() == (byte) 1).collect(Collectors.toList());
|
||||
|
@@ -40,7 +40,6 @@ import com.accompany.core.model.Room;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.accompany.core.service.SysConfService;
|
||||
import com.accompany.core.service.base.BaseService;
|
||||
import com.accompany.core.service.channel.ChannelContentPartitionService;
|
||||
import com.accompany.core.service.common.JedisService;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aliyuncs.utils.StringUtils;
|
||||
@@ -110,9 +109,6 @@ public class HomeRecommenResourceService extends ServiceImpl<HomeRecommenResourc
|
||||
@Autowired
|
||||
private SingleBroadcastPopularityService singleBroadcastPopularityService;
|
||||
|
||||
@Autowired
|
||||
private ChannelContentPartitionService channelContentPartitionService;
|
||||
|
||||
|
||||
public List<HomeRecommendResourceVo> currentRecommendResource() {
|
||||
List<HomeRecommendResourceVo> resultList = new ArrayList<>();
|
||||
@@ -226,14 +222,6 @@ public class HomeRecommenResourceService extends ServiceImpl<HomeRecommenResourc
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (CollectionUtils.isEmpty(playRoomVos)) return homeRecomRoomVo;
|
||||
try {
|
||||
// 渠道内容过滤
|
||||
playRoomVos = channelContentPartitionService.filterByChannelContent(resourceApplyVo.getUid(), resourceApplyVo.getDeviceInfo(), playRoomVos, this::filterPlayRoomVoByChannel);
|
||||
} catch (Exception e) {
|
||||
log.error("pickPermitRoom error,error={}", e);
|
||||
return homeRecomRoomVo;
|
||||
}
|
||||
if (CollectionUtils.isEmpty(playRoomVos)) return homeRecomRoomVo;
|
||||
List<PlayRoomVo> playRoomVoList = randomPickFromCollection(playRoomVos, 1);
|
||||
BeanUtils.copyProperties(playRoomVoList.get(0), homeRecomRoomVo);
|
||||
@@ -249,21 +237,11 @@ public class HomeRecommenResourceService extends ServiceImpl<HomeRecommenResourc
|
||||
*/
|
||||
public HomeRecomRoomVo pickBlindRoom(String resourceContent) {
|
||||
HomeRecommenResourceApplyVo resourceApplyVo = JSONObject.parseObject(resourceContent, HomeRecommenResourceApplyVo.class);
|
||||
String content = resourceApplyVo.getResourceContent();
|
||||
|
||||
HomeRecomRoomVo homeRecomRoomVo = new HomeRecomRoomVo();
|
||||
homeRecomRoomVo.setFailContext(Constant.BigGooseConstant.pick_fail_context);
|
||||
|
||||
List<RoomPlayType> roomPlayTypeList = roomPlayTypeMapper.allRoomPlayTypeList();
|
||||
|
||||
if (CollectionUtils.isEmpty(roomPlayTypeList)) return homeRecomRoomVo;
|
||||
try {
|
||||
// 渠道内容过滤
|
||||
roomPlayTypeList = channelContentPartitionService.filterByChannelContent(resourceApplyVo.getUid(), resourceApplyVo.getDeviceInfo(), roomPlayTypeList, this::filterRoomPlayTypeByChannel);
|
||||
} catch (Exception e) {
|
||||
log.error("pickBlindRoom error,error={}", e);
|
||||
return homeRecomRoomVo;
|
||||
}
|
||||
if (CollectionUtils.isEmpty(roomPlayTypeList)) return homeRecomRoomVo;
|
||||
|
||||
List<Long> roomUidList = roomPlayTypeList.stream().filter(roomPlayType -> {
|
||||
@@ -368,17 +346,6 @@ public class HomeRecommenResourceService extends ServiceImpl<HomeRecommenResourc
|
||||
//拿到
|
||||
List<String> erbanNoList = Arrays.stream(content.split(StrUtil.COMMA)).collect(Collectors.toList());
|
||||
|
||||
if (CollectionUtils.isEmpty(erbanNoList)) return homeRecomRoomVo;
|
||||
try {
|
||||
if (channelContentPartitionService.checkUserChannelContent(resourceApplyVo.getUid(), resourceApplyVo.getDeviceInfo())) {
|
||||
// 渠道内容过滤
|
||||
List<Long> channelRommErbanList = channelContentPartitionService.getChannelRommErbanList(resourceApplyVo.getUid(), resourceApplyVo.getDeviceInfo());
|
||||
erbanNoList = channelRommErbanList.stream().map(a -> String.valueOf(a)).collect(Collectors.toList());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("pickCustomRoom error,error={}", e);
|
||||
return homeRecomRoomVo;
|
||||
}
|
||||
if (CollectionUtils.isEmpty(erbanNoList)) return homeRecomRoomVo;
|
||||
|
||||
List<Long> uidList = new ArrayList<>();
|
||||
@@ -649,14 +616,6 @@ public class HomeRecommenResourceService extends ServiceImpl<HomeRecommenResourc
|
||||
//获取所有游戏房当前的游戏记录
|
||||
List<MiniGameSwitchRecord> miniGameSwitchRecordList = miniGameSwitchRecordMapper.pickGameRoom(mgRoomUidList, showMgIdList);
|
||||
|
||||
if (CollectionUtils.isEmpty(miniGameSwitchRecordList)) return homeRecomRoomVo;
|
||||
try {
|
||||
// 渠道内容过滤
|
||||
miniGameSwitchRecordList = channelContentPartitionService.filterByChannelContent(resourceApplyVo.getUid(), resourceApplyVo.getDeviceInfo(), miniGameSwitchRecordList, this::filterMiniGameSwitchRecordByChannel);
|
||||
} catch (Exception e) {
|
||||
log.error("pickGameRoomV2 error,error={}", e);
|
||||
return homeRecomRoomVo;
|
||||
}
|
||||
if (CollectionUtils.isEmpty(miniGameSwitchRecordList)) return homeRecomRoomVo;
|
||||
|
||||
Map<Byte, List<Long>> mgMap = miniGameSwitchRecordList.stream().filter(switchRecord -> {
|
||||
@@ -745,16 +704,7 @@ public class HomeRecommenResourceService extends ServiceImpl<HomeRecommenResourc
|
||||
|
||||
if (CollectionUtils.isEmpty(singleRoomList)) return homeRecomRoomVo;
|
||||
singleRoomList = singleRoomList.stream().filter(playRoomVoStr -> StringUtils.isNotEmpty(playRoomVoStr) && !ApplicationConstant.NULL_JSON_OBJECT.equalsIgnoreCase(playRoomVoStr)).collect(Collectors.toList());
|
||||
try {
|
||||
if (channelContentPartitionService.checkUserChannelContent(resourceApplyVo.getUid(), resourceApplyVo.getDeviceInfo())) {
|
||||
// 渠道内容过滤
|
||||
List<Long> channelRommErbanList = channelContentPartitionService.getChannelRommErbanList(resourceApplyVo.getUid(), resourceApplyVo.getDeviceInfo());
|
||||
singleRoomList = channelRommErbanList.stream().map(a -> String.valueOf(a)).collect(Collectors.toList());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("pickSingleRoom error,error={}", e);
|
||||
return homeRecomRoomVo;
|
||||
}
|
||||
|
||||
if (CollectionUtils.isEmpty(singleRoomList)) return homeRecomRoomVo;
|
||||
|
||||
List<Long> uidList = singleRoomList.stream().map(playRoomVoStr -> gson.fromJson(playRoomVoStr, PlayRoomVo.class)).filter(playRoomVo -> {
|
||||
@@ -817,39 +767,5 @@ public class HomeRecommenResourceService extends ServiceImpl<HomeRecommenResourc
|
||||
return runningRoomUidList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 组队开黑、热门房间列表按渠道过滤
|
||||
*
|
||||
* @param uidList
|
||||
* @param playRoomVos
|
||||
* @return
|
||||
*/
|
||||
public List<PlayRoomVo> filterPlayRoomVoByChannel(List<Long> uidList, List<PlayRoomVo> playRoomVos) {
|
||||
return playRoomVos.stream().filter(playRoomVo -> uidList.contains(playRoomVo.getUid())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 相亲房资源位按渠道过滤
|
||||
*
|
||||
* @param uidList
|
||||
* @param roomPlayTypes
|
||||
* @return
|
||||
*/
|
||||
public List<RoomPlayType> filterRoomPlayTypeByChannel(List<Long> uidList, List<RoomPlayType> roomPlayTypes) {
|
||||
return roomPlayTypes.stream().filter(roomPlayType -> uidList.contains(roomPlayType.getRoomUid())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 小游戏房资源位按渠道过滤
|
||||
*
|
||||
* @param uidList
|
||||
* @param miniGameSwitchRecords
|
||||
* @return
|
||||
*/
|
||||
public List<MiniGameSwitchRecord> filterMiniGameSwitchRecordByChannel(List<Long> uidList, List<MiniGameSwitchRecord> miniGameSwitchRecords) {
|
||||
return miniGameSwitchRecords.stream().filter(miniGameSwitchRecord -> uidList.contains(miniGameSwitchRecord.getRoomUid())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -1,35 +0,0 @@
|
||||
package com.accompany.business.service.test;
|
||||
|
||||
/**
|
||||
* Created by liuguofu on 2017/9/15.
|
||||
*/
|
||||
public class Client {
|
||||
|
||||
public static void business(String[] args) {
|
||||
//先要组装责任链
|
||||
Handler h1 = new GeneralManager();
|
||||
Handler h2 = new DeptManager();
|
||||
Handler h3 = new ProjectManager();
|
||||
h3.setSuccessor(h2);
|
||||
h2.setSuccessor(h1);
|
||||
|
||||
//开始测试
|
||||
String test1 = h3.handleFeeRequest("张三", 300);
|
||||
System.out.println("test1 = " + test1);
|
||||
String test2 = h3.handleFeeRequest("李四", 300);
|
||||
System.out.println("test2 = " + test2);
|
||||
System.out.println("---------------------------------------");
|
||||
|
||||
String test3 = h3.handleFeeRequest("张三", 700);
|
||||
System.out.println("test3 = " + test3);
|
||||
String test4 = h3.handleFeeRequest("李四", 700);
|
||||
System.out.println("test4 = " + test4);
|
||||
System.out.println("---------------------------------------");
|
||||
|
||||
String test5 = h3.handleFeeRequest("张三", 1500);
|
||||
System.out.println("test5 = " + test5);
|
||||
String test6 = h3.handleFeeRequest("李四", 1500);
|
||||
System.out.println("test6 = " + test6);
|
||||
}
|
||||
|
||||
}
|
@@ -1,35 +0,0 @@
|
||||
package com.accompany.business.service.test;
|
||||
|
||||
import com.aliyun.openservices.ons.api.*;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* Created by liuguofu on 2017/10/1.
|
||||
*/
|
||||
public class ConsumerTest {
|
||||
static String AccessKeySecret="x8YNPXkTmZsHfRL95KR49vMjbgAvNG";
|
||||
static String AccessKeySecretID="LTAI9dJXyTIlGzJT";
|
||||
public static void business(String[] args) {
|
||||
|
||||
Properties properties = new Properties();
|
||||
// 您在MQ控制台创建的ConsumerId
|
||||
properties.put(PropertyKeyConst.ConsumerId, "CID_gift_send_consumer");
|
||||
// 鉴权用AccessKey,在阿里云服务器管理控制台创建
|
||||
properties.put(PropertyKeyConst.AccessKey,AccessKeySecretID);
|
||||
// 鉴权用SecretKey,在阿里云服务器管理控制台创建
|
||||
properties.put(PropertyKeyConst.SecretKey, AccessKeySecret);
|
||||
// 设置 TCP 接入域名(此处以公共云公网环境接入为例)
|
||||
properties.put(PropertyKeyConst.ONSAddr,
|
||||
"http://onsaddr-internet.aliyun.com/rocketmq/nsaddr4client-internet");
|
||||
Consumer consumer = ONSFactory.createConsumer(properties);
|
||||
consumer.subscribe("erban_test_gift", "*", new MessageListener() {
|
||||
public Action consume(Message message, ConsumeContext context) {
|
||||
System.out.println("Receive: " + message);
|
||||
return Action.CommitMessage;
|
||||
}
|
||||
});
|
||||
consumer.start();
|
||||
System.out.println("Consumer Started");
|
||||
}
|
||||
}
|
@@ -1,35 +0,0 @@
|
||||
package com.accompany.business.service.test;
|
||||
|
||||
/**
|
||||
* Created by liuguofu on 2017/9/15.
|
||||
*/
|
||||
public class DeptManager extends Handler {
|
||||
|
||||
@Override
|
||||
public String handleFeeRequest(String user, double fee) {
|
||||
|
||||
String str = "";
|
||||
//部门经理的权限只能在1000以内
|
||||
if(fee < 1000)
|
||||
{
|
||||
//为了测试,简单点,只同意张三的请求
|
||||
if("张三".equals(user))
|
||||
{
|
||||
str = "成功:部门经理同意【" + user + "】的聚餐费用,金额为" + fee + "元";
|
||||
}else
|
||||
{
|
||||
//其他人一律不同意
|
||||
str = "失败:部门经理不同意【" + user + "】的聚餐费用,金额为" + fee + "元";
|
||||
}
|
||||
}else
|
||||
{
|
||||
//超过1000,继续传递给级别更高的人处理
|
||||
if(getSuccessor() != null)
|
||||
{
|
||||
return getSuccessor().handleFeeRequest(user, fee);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
}
|
@@ -1,35 +0,0 @@
|
||||
package com.accompany.business.service.test;
|
||||
|
||||
/**
|
||||
* Created by liuguofu on 2017/9/15.
|
||||
*/
|
||||
public class GeneralManager extends Handler {
|
||||
|
||||
@Override
|
||||
public String handleFeeRequest(String user, double fee) {
|
||||
|
||||
String str = "";
|
||||
//总经理的权限很大,只要请求到了这里,他都可以处理
|
||||
if(fee >= 1000)
|
||||
{
|
||||
//为了测试,简单点,只同意张三的请求
|
||||
if("张三".equals(user))
|
||||
{
|
||||
str = "成功:总经理同意【" + user + "】的聚餐费用,金额为" + fee + "元";
|
||||
}else
|
||||
{
|
||||
//其他人一律不同意
|
||||
str = "失败:总经理不同意【" + user + "】的聚餐费用,金额为" + fee + "元";
|
||||
}
|
||||
}else
|
||||
{
|
||||
//如果还有后继的处理对象,继续传递
|
||||
if(getSuccessor() != null)
|
||||
{
|
||||
return getSuccessor().handleFeeRequest(user, fee);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
}
|
@@ -1,30 +0,0 @@
|
||||
package com.accompany.business.service.test;
|
||||
|
||||
/**
|
||||
* Created by liuguofu on 2017/9/15.
|
||||
*/
|
||||
public abstract class Handler {
|
||||
/**
|
||||
* 持有下一个处理请求的对象
|
||||
*/
|
||||
protected Handler successor = null;
|
||||
/**
|
||||
* 取值方法
|
||||
*/
|
||||
public Handler getSuccessor() {
|
||||
return successor;
|
||||
}
|
||||
/**
|
||||
* 设置下一个处理请求的对象
|
||||
*/
|
||||
public void setSuccessor(Handler successor) {
|
||||
this.successor = successor;
|
||||
}
|
||||
/**
|
||||
* 处理聚餐费用的申请
|
||||
* @param user 申请人
|
||||
* @param fee 申请的钱数
|
||||
* @return 成功或失败的具体通知
|
||||
*/
|
||||
public abstract String handleFeeRequest(String user , double fee);
|
||||
}
|
@@ -1,51 +0,0 @@
|
||||
package com.accompany.business.service.test;
|
||||
|
||||
import com.aliyun.openservices.ons.api.*;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* Created by liuguofu on 2017/10/1.
|
||||
*/
|
||||
public class ProducerTest {
|
||||
static String AccessKeySecret="x8YNPXkTmZsHfRL95KR49vMjbgAvNG";
|
||||
static String AccessKeySecretID="LTAI9dJXyTIlGzJT";
|
||||
public static void business(String[] args) {
|
||||
Properties properties = new Properties();
|
||||
// 您在MQ控制台创建的Producer ID
|
||||
properties.put(PropertyKeyConst.ProducerId, "PID_gift_send_test");
|
||||
// 鉴权用AccessKey,在阿里云服务器管理控制台创建
|
||||
properties.put(PropertyKeyConst.AccessKey,AccessKeySecretID);
|
||||
// 鉴权用SecretKey,在阿里云服务器管理控制台创建
|
||||
properties.put(PropertyKeyConst.SecretKey, AccessKeySecret);
|
||||
// 设置 TCP 接入域名(此处以公共云的公网接入为例)
|
||||
properties.put(PropertyKeyConst.ONSAddr,
|
||||
"http://onsaddr-internet.aliyun.com/rocketmq/nsaddr4client-internet");
|
||||
Producer producer = ONSFactory.createProducer(properties);
|
||||
// 在发送消息前,必须调用start方法来启动Producer,只需调用一次即可
|
||||
producer.start();
|
||||
//循环发送消息
|
||||
while(true){
|
||||
Message msg = new Message( //
|
||||
// 在控制台创建的Topic,即该消息所属的Topic名称
|
||||
"erban_test_gift",
|
||||
// Message Tag,
|
||||
// 可理解为Gmail中的标签,对消息进行再归类,方便Consumer指定过滤条件在MQ服务器过滤
|
||||
"TagA",
|
||||
// Message Body
|
||||
// 任何二进制形式的数据, MQ不做任何干预,
|
||||
// 需要Producer与Consumer协商好一致的序列化和反序列化方式
|
||||
"Hello MQ".getBytes());
|
||||
// 设置代表消息的业务关键属性,请尽可能全局唯一,以方便您在无法正常收到消息情况下,可通过MQ控制台查询消息并补发
|
||||
// 注意:不设置也不会影响消息正常收发
|
||||
msg.setKey("ORDERID_100");
|
||||
// 发送消息,只要不抛异常就是成功
|
||||
// 打印Message ID,以便用于消息发送状态查询
|
||||
SendResult sendResult = producer.send(msg);
|
||||
System.out.println("Send Message success. Message ID is: " + sendResult.getMessageId());
|
||||
}
|
||||
// 在应用退出前,可以销毁Producer对象
|
||||
// 注意:如果不销毁也没有问题
|
||||
// producer.shutdown();
|
||||
}
|
||||
}
|
@@ -1,35 +0,0 @@
|
||||
package com.accompany.business.service.test;
|
||||
|
||||
/**
|
||||
* Created by liuguofu on 2017/9/15.
|
||||
*/
|
||||
public class ProjectManager extends Handler {
|
||||
|
||||
@Override
|
||||
public String handleFeeRequest(String user, double fee) {
|
||||
|
||||
String str = "";
|
||||
//项目经理权限比较小,只能在500以内
|
||||
if(fee < 500)
|
||||
{
|
||||
//为了测试,简单点,只同意张三的请求
|
||||
if("张三".equals(user))
|
||||
{
|
||||
str = "成功:项目经理同意【" + user + "】的聚餐费用,金额为" + fee + "元";
|
||||
}else
|
||||
{
|
||||
//其他人一律不同意
|
||||
str = "失败:项目经理不同意【" + user + "】的聚餐费用,金额为" + fee + "元";
|
||||
}
|
||||
}else
|
||||
{
|
||||
//超过500,继续传递给级别更高的人处理
|
||||
if(getSuccessor() != null)
|
||||
{
|
||||
return getSuccessor().handleFeeRequest(user, fee);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
}
|
@@ -48,7 +48,6 @@ import com.accompany.common.constant.ApplicationConstant;
|
||||
import com.accompany.common.constant.Constant;
|
||||
import com.accompany.common.device.DeviceInfo;
|
||||
import com.accompany.common.netease.neteaseacc.result.BaseNetEaseRet;
|
||||
import com.accompany.common.netease.neteaseacc.result.FileUploadRet;
|
||||
import com.accompany.common.redis.RedisKey;
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
import com.accompany.common.utils.*;
|
||||
@@ -60,7 +59,6 @@ import com.accompany.core.mybatismapper.UsersMapper;
|
||||
import com.accompany.core.service.SysConfService;
|
||||
import com.accompany.core.service.account.AccountService;
|
||||
import com.accompany.core.service.base.BaseService;
|
||||
import com.accompany.core.service.channel.ChannelContentPartitionService;
|
||||
import com.accompany.core.service.common.JedisService;
|
||||
import com.accompany.core.service.phone.PhoneAuthApplyRecordService;
|
||||
import com.accompany.core.service.user.UserCancelRecordService;
|
||||
@@ -88,8 +86,6 @@ import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.xuanyin.flowteam.constant.FlowTeamConstant;
|
||||
import com.xuanyin.flowteam.service.FlowTeamMemberInviteUserBizService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.http.Consts;
|
||||
@@ -101,8 +97,6 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StopWatch;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -179,24 +173,16 @@ public class UsersService extends BaseService {
|
||||
@Autowired
|
||||
private UserRoomCardService userRoomCardService;
|
||||
@Autowired
|
||||
private ChannelContentPartitionService channelContentPartitionService;
|
||||
@Autowired
|
||||
private PhoneAuthApplyRecordService phoneAuthApplyRecordService;
|
||||
@Autowired
|
||||
private RegionService regionService;
|
||||
@Autowired
|
||||
private RechargeUserService rechargeUserService;
|
||||
@Autowired
|
||||
private UserInviteCodeService userInviteCodeService;
|
||||
@Autowired
|
||||
private FlowTeamMemberInviteUserBizService flowTeamMemberInviteUserBizService;
|
||||
@Autowired
|
||||
private UserInOutRoomRecordService userInOutRoomRecordService;
|
||||
@Autowired
|
||||
private PartitionInfoService partitionInfoService;
|
||||
|
||||
private static String regEx = "^[0-9]*[1-9][0-9]*$";
|
||||
|
||||
public Users getUsersByUid(Long uid) {
|
||||
String userStr = this.jedisService.hget(RedisKey.user.getKey(), uid.toString());
|
||||
if (ApplicationConstant.NULL_JSON_OBJECT.equalsIgnoreCase(userStr)) {
|
||||
@@ -275,57 +261,6 @@ public class UsersService extends BaseService {
|
||||
return busiResult;
|
||||
}
|
||||
|
||||
public BusiResult<UserVo> getUserByUid(Long uid) {
|
||||
BusiResult<UserVo> busiResult = new BusiResult<UserVo>(BusiStatus.SUCCESS);
|
||||
Users user = getUsersByUid(uid);
|
||||
if (user == null) {
|
||||
Account account = accountService.getById(uid);
|
||||
if (account == null) {
|
||||
busiResult.setCode(BusiStatus.USERNOTEXISTS.value());
|
||||
busiResult.setMessage("用户不存在");
|
||||
return busiResult;
|
||||
}
|
||||
user = new Users();
|
||||
user.setUid(account.getUid());
|
||||
user.setErbanNo(account.getErbanNo());
|
||||
}
|
||||
UserLevelVo userLevelVo = levelService.getUserLevelVo(uid);
|
||||
CarportVo carport = carportService.getInUsedCarportByUid(uid);
|
||||
UserHeadwearVo userHeadwearVo = this.headwearService.getUserUsingHeadwearVo(uid);
|
||||
LiveUserInfoSkillVo userInfoSkillVo = liveAttestationService.getUserSkill(uid);
|
||||
//模厅信息
|
||||
HallMember hallMember = hallService.getHallMember(uid);
|
||||
UserExpandVo userExpand = userExpandService.getUserExpandVo(uid);
|
||||
UserNameplateVo userNameplateVo = userNameplateService.getUserUsingNameplateVo(uid);
|
||||
UserVo userVo = converToUserVo(user, userLevelVo, carport, userHeadwearVo, hallMember == null ? null : hallMember.getHallId(),
|
||||
userInfoSkillVo, userExpand);
|
||||
Account account = accountService.getById(uid);
|
||||
// TODO 延用之前代码的手机绑定判断规则
|
||||
userVo.setIsBindPhone(CommonUtil.checkPhoneFormat(user.getPhoneAreaCode(), user.getPhone()));
|
||||
// 是否绑定了登录密码
|
||||
userVo.setIsBindPasswd(!StringUtils.isEmpty(account.getPassword()));
|
||||
// 是否绑定了支付密码
|
||||
userVo.setIsBindPaymentPwd(StringUtils.isNotBlank(user.getPaymentPwd()));
|
||||
// 是否进行了实名认证
|
||||
userVo.setIsCertified(StringUtils.isNotBlank(user.getIdCardNum()) && StringUtils.isNotBlank(user.getRealName()));
|
||||
// 设置账户的登录方式
|
||||
userVo.setBindType(getBindType(account));
|
||||
List<PrivatePhoto> photos = privatePhotoService.getPrivatePhoto(uid);
|
||||
if (photos != null) {
|
||||
List<PrivatePhotoVo> photoListVo = privatePhotoService.converToPrivatePhotoListVo(photos);
|
||||
Collections.sort(photoListVo);
|
||||
userVo.setPrivatePhoto(photoListVo);
|
||||
}
|
||||
// 铭牌
|
||||
if (userNameplateVo != null) {
|
||||
userVo.setNameplatePic(userNameplateVo.getNameplateImage());
|
||||
userVo.setNameplateWord(userNameplateVo.getWord());
|
||||
userVo.setIsCustomWord(userNameplateVo.getIsCustomWord());
|
||||
}
|
||||
busiResult.setData(userVo);
|
||||
return busiResult;
|
||||
}
|
||||
|
||||
private Integer getBindType(Account account) {
|
||||
if (StringUtils.isNotEmpty(account.getWeixinOpenid())) {
|
||||
return Constant.AccountType.wx_account;
|
||||
@@ -428,8 +363,6 @@ public class UsersService extends BaseService {
|
||||
List<String> absSkillCardPics = skillCardUserRecordService.getUserAbsSkillCardPics(uid);
|
||||
userVo.setAbsCardPics(absSkillCardPics);
|
||||
userVo.setIsRechargeUser(rechargeUserService.isRechargeUser(uid));
|
||||
// 获取用户的角色(家族与公会)
|
||||
// getUserHallAndClanRole(userVo);
|
||||
return userVo;
|
||||
}
|
||||
|
||||
@@ -438,8 +371,7 @@ public class UsersService extends BaseService {
|
||||
if (user == null) {
|
||||
return new UserVo();
|
||||
}
|
||||
UserVo userVo = converToUserVo(user, null, null, null, null, null, null);
|
||||
return userVo;
|
||||
return converToUserVo(user, null, null, null, null, null, null);
|
||||
}
|
||||
|
||||
public List<UserVo> getUsersVoListByUids(List<Long> uids) {
|
||||
@@ -573,16 +505,10 @@ public class UsersService extends BaseService {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
public boolean isExist(Long uid) {
|
||||
Users users = getUsersByUid(uid);
|
||||
return users != null;
|
||||
}
|
||||
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
public BusiResult<UserVo> saveOrUpdateUserByUidV2(Users users, DeviceInfo deviceInfo) throws Exception {
|
||||
public UserVo saveOrUpdateUserByUidV2(Users users, DeviceInfo deviceInfo) {
|
||||
Account account = accountService.getById(users.getUid());
|
||||
if (account == null) {
|
||||
return new BusiResult<>(BusiStatus.USERNOTEXISTS);
|
||||
throw new ServiceException(BusiStatus.USERNOTEXISTS);
|
||||
}
|
||||
Users userDb = usersMapper.selectByPrimaryKey(users.getUid());
|
||||
String avatarUrl = users.getAvatar();
|
||||
@@ -641,32 +567,26 @@ public class UsersService extends BaseService {
|
||||
usersMapper.insertSelective(users);
|
||||
//用户注册的时候给用户创建钱包
|
||||
userPurseService.createUserPurse(users.getUid());
|
||||
Long uid = users.getUid();
|
||||
String inviteCode = users.getInviteCode();
|
||||
// 初始化用户邀请码
|
||||
userInviteCodeService.initUserInviteCode(uid);
|
||||
// 绑定与引流小组成员的邀请关系
|
||||
flowTeamMemberInviteUserBizService.saveFlowTeamMemberInviteUser(inviteCode, uid, FlowTeamConstant.UserSourceType.SELF);
|
||||
Byte gender = null != users.getGender() ? users.getGender() : Constant.UserGender.MALE;
|
||||
erBanNetEaseService.updateUserGenderOnly(String.valueOf(users.getUid()), gender);
|
||||
//新创建的用户
|
||||
applicationContext.publishEvent(new NewUserEvent(users));
|
||||
deleteUserRelateCaches(users);
|
||||
addCurrentDayUserCache(users);
|
||||
} else {
|
||||
checkCanUpdateUserInfo(users);
|
||||
operType = 1;
|
||||
users.setUpdateTime(date);
|
||||
usersBaseService.updateUser(users);
|
||||
}
|
||||
|
||||
String nick = users.getNick();
|
||||
String avatar = ObjectUtil.isNull(userDb) ? users.getAvatar() : userDb.getAvatar();
|
||||
String uidStr = String.valueOf(users.getUid());
|
||||
BaseNetEaseRet baseNetEaseRet = erBanNetEaseService.updateUserInfo(uidStr, nick, avatar);
|
||||
if (200 != baseNetEaseRet.getCode()) {
|
||||
Byte gender = null != users.getGender() ? users.getGender() : Constant.UserGender.MALE;
|
||||
BaseNetEaseRet baseNetEaseRet = erBanNetEaseService.updateUserInfo(uidStr, nick, avatar, gender);
|
||||
if (BusiStatus.SUCCESS.getCode() != baseNetEaseRet.getCode()) {
|
||||
log.info("更新网易云账号信息异常accid=" + uidStr + ",uid=" + users.getUid() + "异常编码=" + baseNetEaseRet.getCode());
|
||||
throw new Exception("更新账号信息异常");
|
||||
throw new ServiceException("更新账号信息异常");
|
||||
}
|
||||
|
||||
UserVo userVo = converToUserVo(users, null, null, null, null, null, null);
|
||||
userVo.setOperType(operType);
|
||||
userVo.setHasRegPacket(hasRegPacket);
|
||||
@@ -675,7 +595,7 @@ public class UsersService extends BaseService {
|
||||
userVo.setNewAvatar(jedisService.hget(RedisKey.user_avatar_under_review.getKey(), String.valueOf(users.getUid())));
|
||||
}
|
||||
applicationContext.publishEvent(new RoomCacheDealEvent(users.getUid()));
|
||||
return new BusiResult<>(userVo);
|
||||
return userVo;
|
||||
}
|
||||
|
||||
private void checkCanUpdateUserInfo(Users users) {
|
||||
@@ -762,12 +682,6 @@ public class UsersService extends BaseService {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String changeAvatarToNetease(String avatar) throws Exception {
|
||||
InputStream is = FileUtils.downloadFileInputStream(avatar);
|
||||
FileUploadRet fileUploadRet = erBanNetEaseService.uploadFileByInputStream(is);
|
||||
return fileUploadRet.getUrl();
|
||||
}
|
||||
|
||||
public int updateUserTime(Long uid) {
|
||||
return usersMapperExpend.updateUserTime(uid);
|
||||
}
|
||||
@@ -776,19 +690,6 @@ public class UsersService extends BaseService {
|
||||
return usersMapperExpend.updateUserTimeByErbanNo(erbanNo);
|
||||
}
|
||||
|
||||
|
||||
public BusiResult<List<UserVo>> searchUsersBykey(String key) {
|
||||
boolean rs = key.matches(regEx);
|
||||
BusiResult<List<UserVo>> busiResult = null;
|
||||
if (rs) {
|
||||
busiResult = getUserVosByErbanNo(Long.valueOf(key));
|
||||
} else {
|
||||
busiResult = searchUsersByNick(key);
|
||||
}
|
||||
return busiResult;
|
||||
|
||||
}
|
||||
|
||||
public BusiResult<List<UserVo>> getUserVosByErbanNo(Long erbanNo) {
|
||||
BusiResult<List<UserVo>> busiResult = new BusiResult<List<UserVo>>(BusiStatus.SUCCESS);
|
||||
Users users = getUserByErbanNo(erbanNo);
|
||||
@@ -937,7 +838,7 @@ public class UsersService extends BaseService {
|
||||
return new BusiResult(BusiStatus.PHONEINVALID);
|
||||
}
|
||||
|
||||
public Users convertUserParamToUsers(UserParam userParam) throws Exception {
|
||||
public Users convertUserParamToUsers(UserParam userParam) {
|
||||
Users users = new Users();
|
||||
users.setUid(userParam.getUid());
|
||||
users.setBirth(userParam.getBirth());
|
||||
@@ -1600,21 +1501,6 @@ public class UsersService extends BaseService {
|
||||
return RedisKey.user_room_car_num.getKey() + ":" + now + ":" + uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 渠道内容:今日新增记录缓存
|
||||
*
|
||||
* @param users
|
||||
*/
|
||||
public void addCurrentDayUserCache(Users users) throws IOException {
|
||||
log.info("新注册用户加入缓存:{}", gson.toJson(users));
|
||||
String key = RedisKey.current_day_new_user.getKey();
|
||||
|
||||
if (channelContentPartitionService.checkNewUserTime(new Date())) {
|
||||
jedisService.sadd(key, String.valueOf(users.getErbanNo()));
|
||||
channelContentPartitionService.dealSyncCache(Arrays.asList(users.getErbanNo()), false);
|
||||
}
|
||||
}
|
||||
|
||||
public Boolean boundPhone(Long uid, String phone, String code, String phoneAreaCode) throws Exception {
|
||||
if (usersBaseService.checkPhoneExists(phone)) {
|
||||
throw new ServiceException(BusiStatus.THE_PHONE_NUMBER_HAS_BEEN_REGISTERED);
|
||||
|
@@ -46,7 +46,7 @@
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="partitionId != null">
|
||||
and (hd.partition_flag = 0 or cg.partition_flag & #{partitionId} != 0)
|
||||
and (cg.partition_flag = 0 or cg.partition_flag & #{partitionId} != 0)
|
||||
</if>
|
||||
ORDER BY ds.dress_seq desc;
|
||||
</select>
|
||||
@@ -78,7 +78,7 @@
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="partitionId != null">
|
||||
and (ic.parititon_flag = 0 or cb.partition_flag & #{partitionId} != 0)
|
||||
and (cb.parititon_flag = 0 or cb.partition_flag & #{partitionId} != 0)
|
||||
</if>
|
||||
ORDER BY ds.dress_seq desc;
|
||||
</select>
|
||||
|
@@ -1,150 +0,0 @@
|
||||
<?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.accompany.business.mybatismapper.FeedbackMapper" >
|
||||
<resultMap id="BaseResultMap" type="com.accompany.business.model.Feedback" >
|
||||
<id column="feedback_id" property="feedbackId" jdbcType="VARCHAR" />
|
||||
<result column="uid" property="uid" jdbcType="BIGINT" />
|
||||
<result column="feedback_desc" property="feedbackDesc" jdbcType="VARCHAR" />
|
||||
<result column="img_url" property="imgUrl" jdbcType="VARCHAR" />
|
||||
<result column="contact" property="contact" jdbcType="VARCHAR" />
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause" >
|
||||
<where >
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or" >
|
||||
<if test="criteria.valid" >
|
||||
<trim prefix="(" suffix=")" prefixOverrides="and" >
|
||||
<foreach collection="criteria.criteria" item="criterion" >
|
||||
<choose >
|
||||
<when test="criterion.noValue" >
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue" >
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue" >
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue" >
|
||||
and ${criterion.condition}
|
||||
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List" >
|
||||
feedback_id, uid, feedback_desc, img_url, contact, create_time
|
||||
</sql>
|
||||
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.accompany.business.model.FeedbackExample" >
|
||||
select
|
||||
<if test="distinct" >
|
||||
distinct
|
||||
</if>
|
||||
'true' as QUERYID,
|
||||
<include refid="Base_Column_List" />
|
||||
from feedback
|
||||
<if test="_parameter != null" >
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null" >
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from feedback
|
||||
where feedback_id = #{feedbackId,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
|
||||
delete from feedback
|
||||
where feedback_id = #{feedbackId,jdbcType=VARCHAR}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.accompany.business.model.Feedback" >
|
||||
insert into feedback (feedback_id, uid, feedback_desc,
|
||||
img_url, contact, create_time
|
||||
)
|
||||
values (#{feedbackId,jdbcType=VARCHAR}, #{uid,jdbcType=BIGINT}, #{feedbackDesc,jdbcType=VARCHAR},
|
||||
#{imgUrl,jdbcType=VARCHAR}, #{contact,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.accompany.business.model.Feedback" >
|
||||
insert into feedback
|
||||
<trim prefix="(" suffix=")" suffixOverrides="," >
|
||||
<if test="feedbackId != null" >
|
||||
feedback_id,
|
||||
</if>
|
||||
<if test="uid != null" >
|
||||
uid,
|
||||
</if>
|
||||
<if test="feedbackDesc != null" >
|
||||
feedback_desc,
|
||||
</if>
|
||||
<if test="imgUrl != null" >
|
||||
img_url,
|
||||
</if>
|
||||
<if test="contact != null" >
|
||||
contact,
|
||||
</if>
|
||||
<if test="createTime != null" >
|
||||
create_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
||||
<if test="feedbackId != null" >
|
||||
#{feedbackId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="uid != null" >
|
||||
#{uid,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="feedbackDesc != null" >
|
||||
#{feedbackDesc,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="imgUrl != null" >
|
||||
#{imgUrl,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="contact != null" >
|
||||
#{contact,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null" >
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.accompany.business.model.Feedback" >
|
||||
update feedback
|
||||
<set >
|
||||
<if test="uid != null" >
|
||||
uid = #{uid,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="feedbackDesc != null" >
|
||||
feedback_desc = #{feedbackDesc,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="imgUrl != null" >
|
||||
img_url = #{imgUrl,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="contact != null" >
|
||||
contact = #{contact,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null" >
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
where feedback_id = #{feedbackId,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.accompany.business.model.Feedback" >
|
||||
update feedback
|
||||
set uid = #{uid,jdbcType=BIGINT},
|
||||
feedback_desc = #{feedbackDesc,jdbcType=VARCHAR},
|
||||
img_url = #{imgUrl,jdbcType=VARCHAR},
|
||||
contact = #{contact,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP}
|
||||
where feedback_id = #{feedbackId,jdbcType=VARCHAR}
|
||||
</update>
|
||||
</mapper>
|
@@ -25,31 +25,9 @@ import java.io.InputStreamReader;
|
||||
@RequestMapping("/gen")
|
||||
public class AutoGenRobotController {
|
||||
|
||||
// @Autowired
|
||||
private static final Logger logger = LoggerFactory.getLogger(AutoGenRobotController.class);
|
||||
|
||||
@Autowired
|
||||
private AutoGenRobotService autoGenRobotService;
|
||||
|
||||
@RequestMapping(value = "name", method = RequestMethod.GET)
|
||||
public void saveOrUpdateAuctionRival() throws Exception {
|
||||
File file = new File("E:\\robots\\name.txt");//Text文件
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file), "GBK"));//构造一个BufferedReader类来读取文件
|
||||
String name = null;
|
||||
while ((name = br.readLine()) != null) {//使用readLine方法,一次读一行
|
||||
autoGenRobotService.saveName(name);
|
||||
}
|
||||
br.close();
|
||||
File filePic = new File("E:\\robots\\avatar");//Text文件
|
||||
autoGenRobotService.uploadAvatar(filePic);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "avatar", method = RequestMethod.GET)
|
||||
public void genAvatar() throws Exception {
|
||||
File filePic = new File("E:\\avatar");//Text文件
|
||||
autoGenRobotService.uploadAvatar(filePic);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "acc", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public BaseResponseVO batchGenRobAccount() throws Exception {
|
||||
@@ -57,42 +35,4 @@ public class AutoGenRobotController {
|
||||
return new BaseResponseVO(BusiStatus.SUCCESS);
|
||||
}
|
||||
|
||||
/*@ResponseBody
|
||||
@RequestMapping(value = "bgacc", method = RequestMethod.GET)
|
||||
public String batchGenAccount(Integer size, Byte gender, String password, @RequestParam(defaultValue = "4") Byte defUser) throws Exception {
|
||||
if (gender != null && gender != 1 && gender != 2) {
|
||||
return "非法性别参数,必须为1或者2";
|
||||
}
|
||||
|
||||
ExecutorService execotor = Executors.newSingleThreadExecutor();
|
||||
execotor.execute(() -> {
|
||||
try {
|
||||
this.autoGenRobotService.batchGenAccount(size, gender, password, defUser);
|
||||
} catch (Exception e) {
|
||||
logger.error("批量生成账号失败", e);
|
||||
}
|
||||
});
|
||||
execotor.shutdown();
|
||||
|
||||
return "账号已经在生成中";
|
||||
}*/
|
||||
|
||||
public static void main(String args[]) {
|
||||
String str = "";
|
||||
int a = 68;
|
||||
int limit1 = 1320;
|
||||
int page = 20;
|
||||
int total = 5000;
|
||||
for (int i = 0; i < 220; i++) {
|
||||
|
||||
str = str + "INSERT INTO room_robot_group(robot_uid,group_no) " +
|
||||
"SELECT uid," + a + " FROM users WHERE def_user=3 ORDER BY uid ASC LIMIT " + limit1 + ",20; \n";
|
||||
limit1 += 20;
|
||||
a++;
|
||||
}
|
||||
System.out.println(str);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -1,57 +0,0 @@
|
||||
package com.accompany.business.controller;
|
||||
|
||||
import com.accompany.business.service.FeedbackService;
|
||||
import com.accompany.common.annotation.Authorization;
|
||||
import com.accompany.common.result.BusiResult;
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
import com.accompany.core.util.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
/**
|
||||
* Created by 北岭山下 on 2017/7/18.
|
||||
*/
|
||||
|
||||
/**
|
||||
* 用户反馈
|
||||
*/
|
||||
|
||||
@Controller
|
||||
|
||||
public class FeedBackController {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger ( FeedBackController.class );
|
||||
|
||||
@Autowired
|
||||
private FeedbackService feedbackService;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param uid 用户ID
|
||||
* @param feedbackDesc 反馈描述
|
||||
* @param img 反馈图片URL
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/feedback",method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
@Authorization
|
||||
public BusiResult appFeedback ( Long uid, String feedbackDesc, String img,String contact){
|
||||
|
||||
LOGGER.info ( "用户:"+uid+"发送反馈:"+ feedbackDesc );
|
||||
//输入参数检测
|
||||
if( StringUtils.isEmpty ( feedbackDesc ) || uid == 0L || uid == null){
|
||||
return new BusiResult(BusiStatus.PARAMETERILLEGAL);
|
||||
}
|
||||
BusiResult busiResult;
|
||||
busiResult = feedbackService.feedbackUpdate ( uid, feedbackDesc,img,contact);
|
||||
return busiResult;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -1,146 +0,0 @@
|
||||
package com.accompany.business.controller.activities.websocket;
|
||||
|
||||
import com.accompany.common.result.BusiResult;
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
import com.accompany.core.util.StringUtils;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.websocket.OnClose;
|
||||
import javax.websocket.OnError;
|
||||
import javax.websocket.OnOpen;
|
||||
import javax.websocket.Session;
|
||||
import javax.websocket.server.PathParam;
|
||||
import javax.websocket.server.ServerEndpoint;
|
||||
import java.io.IOException;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* Created By LeeNana on 2020/2/27.
|
||||
*/
|
||||
@Component
|
||||
@ServerEndpoint("/websocket/activity/{roomUid}")
|
||||
@Slf4j
|
||||
public class ActivitiesWebSocket {
|
||||
// 使用map来收集session,key为roomUid,value为同一个房间的用户集合
|
||||
private static final Map<String, Set<Session>> rooms = new ConcurrentHashMap<>();
|
||||
/**
|
||||
* 建立链接
|
||||
* @param session
|
||||
* @param roomUid
|
||||
*/
|
||||
@OnOpen
|
||||
public void open(Session session, @PathParam("roomUid") Long roomUid){
|
||||
try {
|
||||
log.info("open param, roomUid = {}, session = {}",roomUid, session);
|
||||
if (session == null){
|
||||
return;
|
||||
}
|
||||
String key = roomUid.toString();
|
||||
//判断转盘类型
|
||||
/*if (StringUtils.isNotEmpty(drawType)){
|
||||
ActivitiesDrawTypeEnum drawTypeEnum = ActivitiesDrawTypeEnum.getEnumByName(drawType);
|
||||
if (drawTypeEnum != null){
|
||||
key = drawTypeEnum.name().toLowerCase() + "_" + roomUid;
|
||||
}
|
||||
}*/
|
||||
// 将session按照房间Uid来存储,将各个房间的用户隔离
|
||||
if (!rooms.containsKey(key)) {
|
||||
// 创建房间不存在时,创建房间
|
||||
Set<Session> room = new HashSet<>();
|
||||
// 添加用户
|
||||
room.add(session);
|
||||
rooms.put(key, room);
|
||||
} else {
|
||||
// 房间已存在,直接添加用户到相应的房间
|
||||
rooms.get(key).add(session);
|
||||
}
|
||||
session.getBasicRemote().sendText(JSON.toJSONString(new BusiResult(BusiStatus.SUCCESS)));
|
||||
log.info("connect success!");
|
||||
} catch (Exception e){
|
||||
log.error("connect failed!", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭连接
|
||||
* @param session
|
||||
* @param roomUid
|
||||
*/
|
||||
@OnClose
|
||||
public void close(Session session, @PathParam("roomUid") Long roomUid){
|
||||
try {
|
||||
String key = roomUid.toString();
|
||||
//判断转盘类型
|
||||
/*if (StringUtils.isNotEmpty(drawType)){
|
||||
ActivitiesDrawTypeEnum drawTypeEnum = ActivitiesDrawTypeEnum.getEnumByName(drawType);
|
||||
if (drawTypeEnum != null){
|
||||
key = drawTypeEnum.name().toLowerCase() + "_" + roomUid;
|
||||
}
|
||||
}*/
|
||||
|
||||
if (rooms.containsKey(key)) {
|
||||
Set<Session> sessionSet = rooms.get(key);
|
||||
Iterator<Session> iterator = sessionSet.iterator();
|
||||
while(iterator.hasNext()) {
|
||||
Session o = iterator.next();
|
||||
if (o.equals(session)) {
|
||||
iterator.remove(); //注意这个地方
|
||||
log.info("disconnect success!");
|
||||
}
|
||||
}
|
||||
//rooms.get(key).remove(session);
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error("disconnect failed!", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 异常
|
||||
* @param session
|
||||
* @param error
|
||||
*/
|
||||
@OnError
|
||||
public void onError(Session session, Throwable error) {
|
||||
log.error("error");
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务端下发消息 按照房间Uid进行广播
|
||||
* @param roomUid
|
||||
* @param message
|
||||
*/
|
||||
public static void broadCast(Long roomUid, String message) {
|
||||
if (StringUtils.isEmpty(message)){
|
||||
return;
|
||||
}
|
||||
String key = roomUid.toString();
|
||||
//判断转盘类型
|
||||
/*if (StringUtils.isNotEmpty(drawType)){
|
||||
ActivitiesDrawTypeEnum drawTypeEnum = ActivitiesDrawTypeEnum.getEnumByName(drawType);
|
||||
if (drawTypeEnum != null){
|
||||
key = drawType + "_" + roomUid;
|
||||
}
|
||||
}*/
|
||||
if (rooms != null && !rooms.isEmpty() &&
|
||||
rooms.get(key) != null && !rooms.get(key).isEmpty()) {
|
||||
for(Session session : rooms.get(key)){
|
||||
if (session != null && session.isOpen()) {
|
||||
try {
|
||||
synchronized (session) {
|
||||
session.getBasicRemote().sendText(message);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error("broadcast failed!", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -18,7 +18,6 @@ import com.accompany.common.device.DeviceInfo;
|
||||
import com.accompany.common.result.BusiResult;
|
||||
import com.accompany.core.base.DeviceInfoContextHolder;
|
||||
import com.accompany.core.base.UidContextHolder;
|
||||
import com.accompany.core.service.channel.ChannelContentPartitionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
@@ -53,9 +52,6 @@ public class HomeController extends BaseController {
|
||||
@Autowired
|
||||
private HomeRecommenResourceService homeRecommenResourceService;
|
||||
|
||||
@Autowired
|
||||
private ChannelContentPartitionService channelContentPartitionService;
|
||||
|
||||
@Autowired
|
||||
private HomeIndexService homeIndexService;
|
||||
|
||||
@@ -68,7 +64,6 @@ public class HomeController extends BaseController {
|
||||
public BusiResult<List<DynamicVo>> getHomeDynamic(HttpServletRequest request, @RequestParam("uid") Long uid) throws Exception {
|
||||
DeviceInfo deviceInfo = getDeviceInfo(request);
|
||||
List<DynamicVo> dynamicVos = homeService.getHomeDynamic(uid);
|
||||
dynamicVos = channelContentPartitionService.filterByChannelContent(uid, deviceInfo, dynamicVos, homeService::filterHomeDynamicByChannel);
|
||||
return new BusiResult<>(dynamicVos);
|
||||
}
|
||||
|
||||
@@ -122,7 +117,7 @@ public class HomeController extends BaseController {
|
||||
|
||||
@ApiOperation("获取一个首页推荐房间uid")
|
||||
@GetMapping(value = "/tab/home/one")
|
||||
public BusiResult<Long> getRoomTabHomeOne() throws Exception {
|
||||
public BusiResult<Long> getRoomTabHomeOne() {
|
||||
Long roomUid = homeService.getRoomTabHomeOne(this.getUid(), getDeviceInfo(request));
|
||||
return new BusiResult<>(roomUid);
|
||||
}
|
||||
|
@@ -149,7 +149,7 @@ public class RoomController extends BaseController {
|
||||
if (Constant.RoomType.mini_game.equals(roomParam.getType())) {
|
||||
DeviceInfo deviceInfo = getDeviceInfo(request);
|
||||
//版本检查
|
||||
if (ObjectUtil.isNull(deviceInfo) || !roomService.versionCheck(deviceInfo.getAppVersion(), Constant.BigGooseConstant.big_goose_appver)) {
|
||||
if (ObjectUtil.isNull(deviceInfo)) {
|
||||
throw new ServiceException(BusiStatus.VERSION_TOO_LOW);
|
||||
}
|
||||
List<MiniGame> miniGameList = miniGameService.miniGameListByIsSHow(true);
|
||||
|
@@ -169,7 +169,7 @@ public class FansController extends BaseController {
|
||||
}
|
||||
checkUidIsSame(uid);
|
||||
DeviceInfo deviceInfo = getDeviceInfo(request);
|
||||
return new BusiResult(BusiStatus.SUCCESS, this.fansService.userFansRoomList(uid, page, pageSize, deviceInfo));
|
||||
return new BusiResult(BusiStatus.SUCCESS, this.fansService.userFansRoomListV2(uid, page, pageSize));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -90,8 +90,6 @@ public class UsersController extends BaseController {
|
||||
@Autowired
|
||||
private UserExpandService userExpandService;
|
||||
@Autowired
|
||||
private WorldService worldService;
|
||||
@Autowired
|
||||
private FirstChargeRewardService firstChargeRewardService;
|
||||
@Autowired
|
||||
private VipAuthItemService vipAuthItemService;
|
||||
@@ -329,60 +327,6 @@ public class UsersController extends BaseController {
|
||||
return new BusiResult(BusiStatus.SUCCESS, Lists.newArrayList());
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
@PostMapping("update")
|
||||
@Authorization
|
||||
public BusiResult<UserVo> saveOrUpdateUserByUid(UserParam userParam, DeviceInfo deviceInfo) {
|
||||
if (userParam == null || userParam.getUid() == null) {
|
||||
return new BusiResult<>(BusiStatus.PARAMETERILLEGAL);
|
||||
}
|
||||
if (!BlankUtil.isBlank(userParam.getNick())) {
|
||||
if (userParam.getNick().length() > 15) {
|
||||
return new BusiResult<>(BusiStatus.NICK_TOO_LONG);
|
||||
}
|
||||
}
|
||||
Users usersInfo = usersService.getUsersByUid(userParam.getUid());
|
||||
//不可修改头像的用户拦截
|
||||
Map<String, String> maps = jedisService.hgetAll(RedisKey.room_unchange.getKey());
|
||||
List<Long> uids = maps.keySet().stream().map(Long::parseLong).collect(Collectors.toList());
|
||||
if (uids.contains(userParam.getUid())
|
||||
&& !StringUtils.isBlank(userParam.getAvatar())
|
||||
&& !usersInfo.getAvatar().equalsIgnoreCase(userParam.getAvatar())) {
|
||||
return new BusiResult<>(BusiStatus.ROOM_UNCHANGE);
|
||||
}
|
||||
Users users = usersService.convertUserParamToUsers(userParam);
|
||||
return usersService.saveOrUpdateUserByUidV2(users, deviceInfo);
|
||||
}
|
||||
|
||||
|
||||
@SneakyThrows
|
||||
@PostMapping("updatev2")
|
||||
@Authorization
|
||||
public BusiResult<UserVo> updateUserV2(UserParam userParam, DeviceInfo deviceInfo) {
|
||||
if (userParam == null || userParam.getUid() == null) {
|
||||
return BusiResult.fail(BusiStatus.PARAMETERILLEGAL);
|
||||
}
|
||||
Users users = usersService.convertUserParamToUsers(userParam);
|
||||
return usersService.saveOrUpdateUserByUidV2(users, deviceInfo);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/test", method = RequestMethod.POST)
|
||||
public void test() {
|
||||
|
||||
/*
|
||||
* List<UserVo> list1; List<Long > list = new ArrayList <> ( ); list.add
|
||||
* ( 900183L );
|
||||
*
|
||||
* list1 = usersService.getUsersVoListByUids ( list );
|
||||
* System.out.println ("======="+list1.get ( 0 ).getNick () );
|
||||
*/
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add("18520395290");
|
||||
List<UserVo> list1 = usersService.getByPhone(list);
|
||||
System.out.println("========" + list1.get(0).getNick());
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping(value = "updaterobot", method = RequestMethod.POST)
|
||||
public String update() {
|
||||
try {
|
||||
@@ -765,15 +709,6 @@ public class UsersController extends BaseController {
|
||||
return new BusiResult(BusiStatus.SUCCESS, privacyPolicyVersionVo);
|
||||
}
|
||||
|
||||
|
||||
//@ApiOperation("用户头像审查(测试使用)")
|
||||
//@RequestMapping(value = "/reviewAvatar", method = RequestMethod.GET)
|
||||
public BusiResult latestPrivacyPolicy(String avatar) {
|
||||
usersService.reviewAvatar(this.getUid(), avatar);
|
||||
return new BusiResult(BusiStatus.SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 注销账号校验
|
||||
*
|
||||
|
@@ -25,9 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -36,7 +34,7 @@ import java.util.stream.Collectors;
|
||||
/**
|
||||
* 用户控制器 V2版本
|
||||
*/
|
||||
@Controller
|
||||
@RestController
|
||||
@RequestMapping("/user/v2")
|
||||
public class UsersV2Controller extends BaseController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(UsersV2Controller.class);
|
||||
@@ -49,8 +47,7 @@ public class UsersV2Controller extends BaseController {
|
||||
@Autowired
|
||||
private FansService fansService;
|
||||
|
||||
@RequestMapping(value = "/update", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
@PostMapping("/update")
|
||||
@Authorization
|
||||
public BusiResult saveOrUpdateUserByUidV2(UserParam userParam, DeviceInfo deviceInfo) {
|
||||
Long myUid = getUid();
|
||||
@@ -67,66 +64,65 @@ public class UsersV2Controller extends BaseController {
|
||||
}
|
||||
logger.info("v2/update param is userUid={},shareUid={},roomUid={}", userParam.getUid(),
|
||||
userParam.getShareUid(),userParam.getRoomUid());
|
||||
try {
|
||||
Users usersInfo = usersService.getUsersByUid(userParam.getUid());
|
||||
// 新用户第一次完善信息检查邀请码
|
||||
if (userParam.getInviteCode() != null) {
|
||||
userParam.setInviteCode(userParam.getInviteCode().toUpperCase());
|
||||
}
|
||||
if (isNewUser(usersInfo) && !StringUtils.isEmpty(userParam.getInviteCode())
|
||||
&& !StringUtils.isEmpty(deviceInfo.getDeviceId())) {
|
||||
BusiStatus check = inviteCodeService.checkInviteCode(userParam.getInviteCode(), deviceInfo.getDeviceId());
|
||||
if (check != null) {
|
||||
return new BusiResult(check);
|
||||
}
|
||||
Long inviteUid = inviteCodeService.getUidByInviteCode(userParam.getInviteCode());
|
||||
userParam.setInviteUid(inviteUid);
|
||||
} else {
|
||||
userParam.setInviteCode(null);
|
||||
}
|
||||
//不可修改头像的用户拦截
|
||||
Map<String, String> maps = jedisService.hgetAll(RedisKey.room_unchange.getKey());
|
||||
List<Long> uids = maps.keySet().stream().map(key -> Long.parseLong(key)).collect(Collectors.toList());
|
||||
if (uids.contains(userParam.getUid())
|
||||
&& !StringUtils.isEmpty(userParam.getAvatar())
|
||||
&& !usersInfo.getAvatar().equalsIgnoreCase(userParam.getAvatar())) {
|
||||
return new BusiResult(BusiStatus.ROOM_UNCHANGE);
|
||||
Users usersInfo = usersService.getUsersByUid(userParam.getUid());
|
||||
// 新用户第一次完善信息检查邀请码
|
||||
if (userParam.getInviteCode() != null) {
|
||||
userParam.setInviteCode(userParam.getInviteCode().toUpperCase());
|
||||
}
|
||||
if (isNewUser(usersInfo) && !StringUtils.isEmpty(userParam.getInviteCode())
|
||||
&& !StringUtils.isEmpty(deviceInfo.getDeviceId())) {
|
||||
BusiStatus check = inviteCodeService.checkInviteCode(userParam.getInviteCode(), deviceInfo.getDeviceId());
|
||||
if (check != null) {
|
||||
return new BusiResult(check);
|
||||
}
|
||||
Long inviteUid = inviteCodeService.getUidByInviteCode(userParam.getInviteCode());
|
||||
userParam.setInviteUid(inviteUid);
|
||||
} else {
|
||||
userParam.setInviteCode(null);
|
||||
}
|
||||
//不可修改头像的用户拦截
|
||||
Map<String, String> maps = jedisService.hgetAll(RedisKey.room_unchange.getKey());
|
||||
List<Long> uids = maps.keySet().stream().map(key -> Long.parseLong(key)).collect(Collectors.toList());
|
||||
if (uids.contains(userParam.getUid())
|
||||
&& !StringUtils.isEmpty(userParam.getAvatar())
|
||||
&& !usersInfo.getAvatar().equalsIgnoreCase(userParam.getAvatar())) {
|
||||
return new BusiResult(BusiStatus.ROOM_UNCHANGE);
|
||||
}
|
||||
|
||||
if (StringUtils.hasText(userParam.getNick())) {
|
||||
// 检查昵称是否合法
|
||||
if (userParam.getNick().length() > 15) {
|
||||
return new BusiResult(BusiStatus.NICK_TOO_LONG);
|
||||
}
|
||||
String filterNick = YidunCheckUtil.checkAndReplaceSensitiveWord(userParam.getNick());
|
||||
if (StringUtils.hasText(userParam.getNick())) {
|
||||
// 检查昵称是否合法
|
||||
if (userParam.getNick().length() > 15) {
|
||||
return new BusiResult(BusiStatus.NICK_TOO_LONG);
|
||||
}
|
||||
String filterNick = YidunCheckUtil.checkAndReplaceSensitiveWord(userParam.getNick());
|
||||
// String filterNick = SensitiveFilterUtil.getStringSensitiveFilter(userParam.getNick());
|
||||
// 需要去掉前后空格再去跟数据库比较,因为Users.setNick会进行trim操作
|
||||
if (!StringUtils.isEmpty(filterNick)) {
|
||||
filterNick = filterNick.trim();
|
||||
}
|
||||
userParam.setNick(filterNick);
|
||||
// 检查用户昵称是否重复
|
||||
Users nickUsers = usersBaseService.getUsersByNickOnly(userParam.getNick());
|
||||
if (nickUsers != null && !nickUsers.getUid().equals(userParam.getUid())) {
|
||||
return new BusiResult<>(BusiStatus.USER_NICK_EXISTED);
|
||||
}
|
||||
} else {
|
||||
if (!StringUtils.isEmpty(userParam.getNick()) && userParam.getNick().trim().length() == 0) {
|
||||
return new BusiResult(BusiStatus.NICK_ILLEGAL);
|
||||
}
|
||||
// 需要去掉前后空格再去跟数据库比较,因为Users.setNick会进行trim操作
|
||||
if (!StringUtils.isEmpty(filterNick)) {
|
||||
filterNick = filterNick.trim();
|
||||
}
|
||||
if (StringUtils.hasText(userParam.getUserDesc())) {
|
||||
userParam.setUserDesc(SensitiveFilterUtil.getStringSensitiveFilter(userParam.getUserDesc()));
|
||||
userParam.setNick(filterNick);
|
||||
// 检查用户昵称是否重复
|
||||
Users nickUsers = usersBaseService.getUsersByNickOnly(userParam.getNick());
|
||||
if (nickUsers != null && !nickUsers.getUid().equals(userParam.getUid())) {
|
||||
return new BusiResult<>(BusiStatus.USER_NICK_EXISTED);
|
||||
}
|
||||
if (StringUtils.hasText(userParam.getSignture())) {
|
||||
userParam.setSignture(SensitiveFilterUtil.getStringSensitiveFilter(userParam.getSignture()));
|
||||
} else {
|
||||
if (!StringUtils.isEmpty(userParam.getNick()) && userParam.getNick().trim().length() == 0) {
|
||||
return new BusiResult(BusiStatus.NICK_ILLEGAL);
|
||||
}
|
||||
logger.info("saveOrUpdateUserByUidV2 userParam: {}", JSONObject.toJSONString(userParam));
|
||||
Users users = usersService.convertUserParamToUsers(userParam);
|
||||
logger.info("saveOrUpdateUserByUidV2 users: {}", JSONObject.toJSONString(users));
|
||||
BusiResult<UserVo> busiResult = usersService.saveOrUpdateUserByUidV2(users, deviceInfo);
|
||||
// UserVo userVo = busiResult.getData();
|
||||
// 去除邀请红包和新人红包
|
||||
}
|
||||
if (StringUtils.hasText(userParam.getUserDesc())) {
|
||||
userParam.setUserDesc(SensitiveFilterUtil.getStringSensitiveFilter(userParam.getUserDesc()));
|
||||
}
|
||||
if (StringUtils.hasText(userParam.getSignture())) {
|
||||
userParam.setSignture(SensitiveFilterUtil.getStringSensitiveFilter(userParam.getSignture()));
|
||||
}
|
||||
logger.info("saveOrUpdateUserByUidV2 userParam: {}", JSONObject.toJSONString(userParam));
|
||||
Users users = usersService.convertUserParamToUsers(userParam);
|
||||
logger.info("saveOrUpdateUserByUidV2 users: {}", JSONObject.toJSONString(users));
|
||||
UserVo userVo = usersService.saveOrUpdateUserByUidV2(users, deviceInfo);
|
||||
// UserVo userVo = busiResult.getData();
|
||||
// 去除邀请红包和新人红包
|
||||
// if (busiResult.getCode() == 200 && userVo.getOperType() == 2) {
|
||||
// //Async异步执行红包邀请活动,用户首次注册,并且属于被人邀请人,则邀请人获得红包
|
||||
// if (userVo.isHasRegPacket()) {
|
||||
@@ -135,19 +131,11 @@ public class UsersV2Controller extends BaseController {
|
||||
// userPacketService.checkAndGetFirsetPacket(userParam.getUid());
|
||||
// }
|
||||
|
||||
if (com.accompany.common.utils.StringUtils.isNotBlank(users.getInviteCode())) {
|
||||
followEachOther(users.getUid(), users.getInviteCode());
|
||||
}
|
||||
|
||||
return busiResult;
|
||||
} catch (Exception e) {
|
||||
logger.error("saveOrUpdateUserByUidV2 error..uid=" + userParam.getUid(), e);
|
||||
if (e instanceof ServiceException) {
|
||||
return new BusiResult(BusiStatus.BUSIERROR, e.getMessage(), null);
|
||||
}
|
||||
return new BusiResult(BusiStatus.BUSIERROR);
|
||||
if (com.accompany.common.utils.StringUtils.isNotBlank(users.getInviteCode())) {
|
||||
followEachOther(users.getUid(), users.getInviteCode());
|
||||
}
|
||||
|
||||
return new BusiResult<>(userVo);
|
||||
}
|
||||
|
||||
@Async
|
||||
@@ -174,8 +162,7 @@ public class UsersV2Controller extends BaseController {
|
||||
return false;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/checkInviteUserInRoom", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
@GetMapping("/checkInviteUserInRoom")
|
||||
@Authorization
|
||||
public BusiResult<InviteUserInRoomStatusVO> checkInviteUserInRoom(String inviteCode) {
|
||||
Long myUid = getUid();
|
||||
|
@@ -30,16 +30,4 @@ public class AnchorFansTeamTaskTest extends CommonTest {
|
||||
anchorFansTeamService.finishedTask(1005062l,1005064l,task,todayStr);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testSaveUser(){
|
||||
Users u = new Users();
|
||||
u.setUid(2261l);
|
||||
try {
|
||||
usersService.saveOrUpdateUserByUidV2(u,null);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
System.out.println("u = " + u);
|
||||
}
|
||||
}
|
||||
|
@@ -1,101 +0,0 @@
|
||||
package servicetest;
|
||||
|
||||
import com.accompany.business.service.home.HomeService;
|
||||
import com.accompany.business.service.user.UsersService;
|
||||
import com.accompany.business.vo.roomtab.TopRoomTabHomeVo;
|
||||
import com.accompany.common.device.DeviceInfo;
|
||||
import com.accompany.common.redis.RedisKey;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.accompany.core.service.account.AccountService;
|
||||
import com.accompany.core.service.channel.ChannelContentPartitionService;
|
||||
import com.accompany.core.service.common.JedisService;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class ChannelContentServiceTest extends CommonTest {
|
||||
|
||||
@Autowired
|
||||
private HomeService homeService;
|
||||
@Autowired
|
||||
private UsersService usersService;
|
||||
@Autowired
|
||||
private ChannelContentPartitionService channelContentPartitionService;
|
||||
@Autowired
|
||||
private JedisService jedisService;
|
||||
@Autowired
|
||||
private AccountService accountService;
|
||||
|
||||
|
||||
@Test
|
||||
public void testTopRoomHome() {
|
||||
List<TopRoomTabHomeVo> list = homeService.getTopRoomHome(1);
|
||||
//list = homeService.filterByChannelContent(1351105l, new DeviceInfo(), list, homeService::filterTopRoomTabByChannel);
|
||||
System.out.println("运行结束.....");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCurrentDayUserCache() throws IOException {
|
||||
List<Long> list = Arrays.asList(4103830l,3619207l,1066130l,4291656l,5424417l,1635541l,2552958l,3584557l);
|
||||
for (Long erbanNo : list) {
|
||||
Users users = new Users();
|
||||
users.setErbanNo(erbanNo);
|
||||
usersService.addCurrentDayUserCache(users);
|
||||
}
|
||||
|
||||
System.out.println("运行结束.....");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCurrentDayUidList() throws IOException {
|
||||
List<Long> list = Arrays.asList(1351189l,1351188l);
|
||||
for (Long uid : list) {
|
||||
List<Long> uidList = channelContentPartitionService.getChannelRommErbanList(uid, new DeviceInfo());
|
||||
System.out.println("允许访问的房间66号:" + uidList.toString());
|
||||
}
|
||||
|
||||
|
||||
System.out.println("运行结束.....");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNewUserCache() throws IOException {
|
||||
String key = RedisKey.current_day_new_user.getKey();
|
||||
|
||||
Set<String> set = jedisService.smembers(key);
|
||||
for (String str : set) {
|
||||
System.out.println("遍历:" + str);
|
||||
}
|
||||
if (jedisService.sismember(key, String.valueOf(9125474l))) {
|
||||
System.out.println("有此缓存");
|
||||
}
|
||||
|
||||
System.out.println("运行结束.....");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAccountChannelByUid() {
|
||||
//Account account= accountService.getAccountChannelByUid(934999l);
|
||||
//System.out.println("运行结束:" + account.getChannel() + " " + account.getErbanNo());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testgetAccountChannelList() {
|
||||
List<String> channelList = accountService.getAccountChannelList();
|
||||
|
||||
System.out.println("运行结束:");
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void getMainPopularityAnchorListTest() throws Exception {
|
||||
//List<SingleBroadcastMainVO> list = singleBroadcastPopularityService.getMainPopularityAnchorList();
|
||||
System.out.println("运行结束:");
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -153,7 +153,7 @@ public class AccountManageService {
|
||||
//写缓存
|
||||
accountService.writeAche(account);
|
||||
String uidStr = String.valueOf(account.getUid());
|
||||
TokenRet tokenRet = netEaseService.createNetEaseAcc(uidStr, account.getNeteaseToken(), "");
|
||||
TokenRet tokenRet = netEaseService.createNetEaseAcc(uidStr, account.getNeteaseToken(), "", "", null);
|
||||
if (tokenRet.getCode() != 200) {
|
||||
log.info("注册云信账号失败,openid=" + openid + "&uid=" + uidStr + ",异常原因code=" + tokenRet.getCode());
|
||||
log.error("注册云信账号失败,openid=" + openid + "&uid=" + uidStr + ",异常原因code=" + tokenRet.getCode());
|
||||
@@ -245,7 +245,7 @@ public class AccountManageService {
|
||||
accountMapper.insert(account);
|
||||
accountService.writeAche(account);
|
||||
String uidStr = String.valueOf(account.getUid());
|
||||
TokenRet tokenRet = netEaseService.createNetEaseAcc(uidStr, account.getNeteaseToken(), "");
|
||||
TokenRet tokenRet = netEaseService.createNetEaseAcc(uidStr, account.getNeteaseToken(), "", "", null);
|
||||
if (tokenRet.getCode() != 200) {
|
||||
log.error("手机号码phone=" + phone + "注册异常,异常原因code=" + tokenRet.getCode());
|
||||
log.info("手机号码phone=" + phone + "注册异常,异常原因code=" + tokenRet.getCode());
|
||||
|
@@ -1,78 +0,0 @@
|
||||
package com.accompany.scheduler.task;
|
||||
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import com.accompany.common.constant.Constant;
|
||||
import com.accompany.common.redis.RedisKey;
|
||||
import com.accompany.core.model.channel.ChannelContentPartition;
|
||||
import com.accompany.core.service.channel.ChannelContentPartitionService;
|
||||
import com.accompany.core.service.common.JedisService;
|
||||
import com.accompany.scheduler.base.BaseTask;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 渠道内容定时器
|
||||
*/
|
||||
@Component
|
||||
public class RefreshCurrentTypeChannelTask extends BaseTask {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(RefreshCurrentTypeChannelTask.class);
|
||||
|
||||
@Autowired
|
||||
private JedisService jedisService;
|
||||
@Autowired
|
||||
private ChannelContentPartitionService channelContentPartitionService;
|
||||
|
||||
|
||||
/**
|
||||
* 每日5点刷新
|
||||
*/
|
||||
@Scheduled(cron = "0 0 5 * * ?")
|
||||
public void execute() throws Exception {
|
||||
logger.info("======================================刷新当日用户类型对应的渠道缓存开始======================================");
|
||||
if (!jedisService.exits(RedisKey.channel_content_record.getKey())) {
|
||||
channelContentPartitionService.initChannelContentCache();
|
||||
}
|
||||
|
||||
Map<String, String> resultMap = jedisService.hgetAll(RedisKey.channel_content_record.getKey());
|
||||
if (MapUtil.isEmpty(resultMap)) {
|
||||
jedisService.del(RedisKey.current_day_new_user.getKey());
|
||||
return;
|
||||
}
|
||||
|
||||
List<ChannelContentPartition> channelList = resultMap.entrySet().stream()
|
||||
.map(entry -> gson.fromJson(entry.getValue(), ChannelContentPartition.class)).filter(channelContentPartition -> Constant.ChannelUserType.current_day_user.equals(channelContentPartition.getUserType()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (CollectionUtils.isEmpty(channelList)) {
|
||||
jedisService.del(RedisKey.current_day_new_user.getKey());
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取对应渠道注册的所有新用户
|
||||
List<Long> allErbanNoList = channelContentPartitionService.getAllErbanNoList(channelList);
|
||||
|
||||
if (CollectionUtils.isEmpty(allErbanNoList)) {
|
||||
jedisService.del(RedisKey.current_day_new_user.getKey());
|
||||
return;
|
||||
}
|
||||
|
||||
allErbanNoList = allErbanNoList.stream().distinct().collect(Collectors.toList());
|
||||
|
||||
//先删除再写入
|
||||
channelContentPartitionService.dealSyncCache(allErbanNoList, true);
|
||||
logger.info("======================================刷新当日用户类型对应的渠道缓存结束======================================");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user