Merge branch 'Arthur_API-Users' into Api_next-step2
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
# Conflicts: # Sources/API/Quarkus/src/main/java/org/acme/Hibernates/entities/GameEntity.java # Sources/API/Quarkus/src/main/resources/application.propertiesApi_next-step2
commit
48550769cf
@ -0,0 +1,25 @@
|
|||||||
|
package org.acme.Api.DTO;
|
||||||
|
|
||||||
|
import io.quarkus.hibernate.reactive.panache.common.ProjectedFieldName;
|
||||||
|
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||||
|
import org.acme.Hibernates.entities.UserStatsEntity;
|
||||||
|
|
||||||
|
@RegisterForReflection
|
||||||
|
public class UserDTO {
|
||||||
|
public Long id;
|
||||||
|
public String name;
|
||||||
|
public UserStatsDTO stats;
|
||||||
|
|
||||||
|
public UserDTO(Long id, String name,
|
||||||
|
@ProjectedFieldName("stats.nbVictories") Long nbVictories,
|
||||||
|
@ProjectedFieldName("stats.nbGames") Long nbGames,
|
||||||
|
@ProjectedFieldName("stats.highscore") Long highscore,
|
||||||
|
@ProjectedFieldName("stats.nbStrikes") Long nbStrikes,
|
||||||
|
@ProjectedFieldName("stats.nbSpares") Long nbSpares,
|
||||||
|
@ProjectedFieldName("stats.avgScore") Double avgScore,
|
||||||
|
@ProjectedFieldName("stats.avgPinsPerRound") Double avgPinsPerRound) {
|
||||||
|
this.id = id;
|
||||||
|
this.name = name;
|
||||||
|
this.stats = new UserStatsDTO(nbVictories, nbGames, highscore, nbStrikes, nbSpares, avgScore, avgPinsPerRound);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package org.acme.Api.DTO;
|
||||||
|
|
||||||
|
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||||
|
import org.acme.Hibernates.entities.UserStatsEntity;
|
||||||
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
|
@RegisterForReflection
|
||||||
|
public class UserStatsDTO {
|
||||||
|
public Long nbVictories;
|
||||||
|
public Long nbGames;
|
||||||
|
public Long highscore;
|
||||||
|
public Long nbStrikes;
|
||||||
|
public Long nbSpares;
|
||||||
|
public Double avgScore;
|
||||||
|
public Double avgPinsPerRound;
|
||||||
|
|
||||||
|
public UserStatsDTO(Long nbVictories, Long nbGames, Long highscore, Long nbStrikes, Long nbSpares, Double avgScore, Double avgPinsPerRound) {
|
||||||
|
this.nbVictories = nbVictories;
|
||||||
|
this.nbGames = nbGames;
|
||||||
|
this.highscore = highscore;
|
||||||
|
this.nbStrikes = nbStrikes;
|
||||||
|
this.nbSpares = nbSpares;
|
||||||
|
this.avgScore = avgScore;
|
||||||
|
this.avgPinsPerRound = avgPinsPerRound;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package org.acme.Api.DTO;
|
||||||
|
|
||||||
|
import io.quarkus.hibernate.reactive.panache.common.ProjectedFieldName;
|
||||||
|
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||||
|
|
||||||
|
@RegisterForReflection
|
||||||
|
public class UserTinyDTO {
|
||||||
|
public Long id;
|
||||||
|
public String name;
|
||||||
|
public UserTinyDTO(Long id, String name) {
|
||||||
|
this.id = id;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +0,0 @@
|
|||||||
package org.acme.Hibernates.entities;
|
|
||||||
|
|
||||||
public class StatEntity {
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in new issue