use of com.code.server.db.model.UserRecord in project summer by foxsugar.
the class GameUserService method getUserRecodeByUserId.
/**
* 查询战绩
*
* @param msgKey
* @return
*/
public int getUserRecodeByUserId(KafkaMsgKey msgKey, String roomType) {
UserRecord userRecord = userRecordService.getUserRecordByUserId(msgKey.getUserId());
List<RoomRecord> roomRecordList = new ArrayList<>();
if (userRecord != null && userRecord.getRecord() != null && userRecord.getRecord().getRoomRecords().containsKey(roomType)) {
roomRecordList.addAll(userRecord.getRecord().getRoomRecords().get(roomType));
}
ResponseVo vo = new ResponseVo("userService", "getUserRecodeByUserId", roomRecordList);
sendMsg(msgKey, vo);
return 0;
}
use of com.code.server.db.model.UserRecord in project summer by foxsugar.
the class UserRecordService method addRecord.
/**
* 添加一条战绩 超过指定条数后删除第一条
* @param userid
* @param roomRecord
* @return
*/
public UserRecord addRecord(long userid, RoomRecord roomRecord) {
UserRecord userRecords = userRecordDao.findOne(userid);
RoomRecord rc = userRecords.getRecord().addRoomRecord(roomRecord);
// 有删除的战绩
if (rc != null) {
long roomUid = rc.getId();
gameRecordService.decGameRecordCount(roomUid);
}
return userRecordDao.save(userRecords);
}
Aggregations