コード例 #1
0
  @Override
  public GameRoom create(final GameRoomDto.Create createDto) throws JsonProcessingException {
    final GameRoom gameRoom = modelMapper.map(createDto, GameRoom.class);

    if (gameRoomRepository.findOneByOwnerAndEnabled(createDto.getOwner(), Enabled.TRUE) != null) {
      log.error(
          "owner duplicated exception. {} : {}",
          createDto.getOwner().getId(),
          createDto.getOwner().getNickname());
      throw new OwnerDuplicatedException("[" + createDto.getOwner().getEmail() + "] 중복된 방장 입니다.");
    }

    fillInitData(gameRoom);

    return gameRoomRepository.save(gameRoom);
  }
コード例 #2
0
 @Override
 public List<GameRoom> getAllByEnabled(Enabled enabled) {
   return gameRoomRepository.findAllByEnabled(enabled);
 }
コード例 #3
0
 @Override
 public GameRoom getByIdAndEnabled(Long id, Enabled enabled) {
   return gameRoomRepository.findOneByIdAndEnabled(id, enabled);
 }
コード例 #4
0
 @Override
 public GameRoom update(GameRoom gameRoom) {
   return gameRoomRepository.save(gameRoom);
 }
コード例 #5
0
 @Override
 public Page<GameRoom> getAllByEnabled(Enabled enabled, Pageable pageable) {
   return gameRoomRepository.findAllByEnabled(enabled, pageable);
 }