use of com.code.server.db.model.ClubRecord in project summer by foxsugar.
the class ClubRecordService method addRecord.
public void addRecord(String clubId, RoomRecord roomRecord) {
ClubRecord clubRecord = clubRecordDao.getClubRecordById(clubId);
if (clubRecord == null) {
clubRecord = new ClubRecord();
clubRecord.setId(clubId);
}
List<RoomRecord> rc = clubRecord.getRecords();
// 有删除的战绩
if (rc == null) {
rc = new ArrayList<>();
// gameRecordService.decGameRecordCount(roomUid);
} else {
rc.add(roomRecord);
}
// 过长 删除第一个
if (rc.size() >= 20) {
rc.remove(0);
}
clubRecordDao.save(clubRecord);
// return userRecordDao.save(userRecords);
}
use of com.code.server.db.model.ClubRecord in project summer by foxsugar.
the class GameClubService method getClubRecord.
/**
* 获得俱乐部战绩
*
* @param msgKey
* @param userId
* @param clubId
* @return
*/
public int getClubRecord(KafkaMsgKey msgKey, long userId, String clubId) {
Club club = ClubManager.getInstance().getClubById(clubId);
if (club == null) {
return ErrorCode.CLUB_NO_THIS;
}
if (club.getPresident() != userId) {
return ErrorCode.CLUB_NOT_PRESIDENT;
}
ClubRecord clubRecord = clubRecordService.getClubRecordDao().getClubRecordById(clubId);
sendMsg(msgKey, new ResponseVo("clubService", "getClubRecord", clubRecord));
return 0;
}
Aggregations