Search in sources :

Example 1 with Level

use of com.viadee.sonarQuest.entities.Level in project sonarQuest by viadee.

the class LevelController method updateLevel.

@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
public Level updateLevel(@PathVariable(value = "id") Long id, @RequestBody LevelDto levelDto) {
    Level level = this.levelRepository.findById(id);
    if (level != null) {
        level.setName(levelDto.getName());
        level.setMin(levelDto.getMin());
        level.setMax(levelDto.getMax());
        level = this.levelRepository.save(level);
    }
    return level;
}
Also used : Level(com.viadee.sonarQuest.entities.Level)

Example 2 with Level

use of com.viadee.sonarQuest.entities.Level in project sonarQuest by viadee.

the class DeveloperService method createDeveloper.

public Developer createDeveloper(DeveloperDto developerDto) {
    Developer developer;
    if (this.checkIfUsernameNotExists(developerDto)) {
        Level level1 = this.levelRepository.findById((long) 1);
        developer = this.developerRepository.save(new Developer(developerDto.getUsername(), (long) 0, (long) 0, level1, developerDto.getPicture(), developerDto.getAboutMe(), developerDto.getAvatarClass(), developerDto.getAvatarRace(), developerDto.getArtefacts(), developerDto.getAdventures(), developerDto.getParticipations()));
    } else {
        developer = null;
    }
    return developer;
}
Also used : Developer(com.viadee.sonarQuest.entities.Developer) Level(com.viadee.sonarQuest.entities.Level)

Aggregations

Level (com.viadee.sonarQuest.entities.Level)2 Developer (com.viadee.sonarQuest.entities.Developer)1