Fixed RankingPoints Vue
This commit is contained in:
parent
06219f4b5c
commit
ccba1fcab1
@ -40,7 +40,7 @@ dependencies {
|
|||||||
|
|
||||||
compile 'org.springframework.boot:spring-boot-starter-tomcat'
|
compile 'org.springframework.boot:spring-boot-starter-tomcat'
|
||||||
//compile 'org.springframework.boot:spring-boot-starter-security'
|
//compile 'org.springframework.boot:spring-boot-starter-security'
|
||||||
//compile 'org.springframework.boot:spring-boot-starter-actuator'
|
compile 'org.springframework.boot:spring-boot-starter-actuator'
|
||||||
//compile 'org.springframework.boot:spring-boot-starter-aop'
|
//compile 'org.springframework.boot:spring-boot-starter-aop'
|
||||||
//ompile group: 'org.springframework.boot', name: 'spring-boot-starter-mail', version: '1.2.0.RELEASE'
|
//ompile group: 'org.springframework.boot', name: 'spring-boot-starter-mail', version: '1.2.0.RELEASE'
|
||||||
|
|
||||||
|
|||||||
@ -389,7 +389,8 @@ public class Controller {
|
|||||||
List<RankingListHelper> sendBackUsers = new LinkedList<>();
|
List<RankingListHelper> sendBackUsers = new LinkedList<>();
|
||||||
List<Object[]> rankingUsers = userRepository.getRankingList();
|
List<Object[]> rankingUsers = userRepository.getRankingList();
|
||||||
for (Object[] obj : rankingUsers) {
|
for (Object[] obj : rankingUsers) {
|
||||||
RankingListHelper tmp = new RankingListHelper((String) obj[1], (int) obj[2]);
|
RankingListHelper tmp = new RankingListHelper((String) obj[1], (Integer) obj[2]);
|
||||||
|
System.out.println(tmp);
|
||||||
sendBackUsers.add(tmp);
|
sendBackUsers.add(tmp);
|
||||||
}
|
}
|
||||||
return ResponseEntity.status(200).body(new Gson().toJson(sendBackUsers));
|
return ResponseEntity.status(200).body(new Gson().toJson(sendBackUsers));
|
||||||
|
|||||||
@ -3,11 +3,11 @@ package hhn.labsw.bugageocaching.helper;
|
|||||||
public class RankingListHelper {
|
public class RankingListHelper {
|
||||||
|
|
||||||
private String username;
|
private String username;
|
||||||
private int ranking_Points;
|
private int rankingPointsSum;
|
||||||
|
|
||||||
public RankingListHelper(String username, int ranking_Points) {
|
public RankingListHelper(String username, int ranking_Points) {
|
||||||
this.username = username;
|
this.username = username;
|
||||||
this.ranking_Points = ranking_Points;
|
this.rankingPointsSum = ranking_Points;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUsername() {
|
public String getUsername() {
|
||||||
@ -19,10 +19,15 @@ public class RankingListHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getRanking_Points() {
|
public int getRanking_Points() {
|
||||||
return ranking_Points;
|
return rankingPointsSum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRanking_Points(int ranking_Points) {
|
public void setRanking_Points(int ranking_Points) {
|
||||||
this.ranking_Points = ranking_Points;
|
this.rankingPointsSum = ranking_Points;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "( " + username + " | " + rankingPointsSum + " )";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,7 +16,7 @@ public interface UserRepository extends CrudRepository<User, Integer> {
|
|||||||
"WHERE u.id = ui.user_id\n" +
|
"WHERE u.id = ui.user_id\n" +
|
||||||
"AND u.id = ur.user_id\n" +
|
"AND u.id = ur.user_id\n" +
|
||||||
"order by ranking_points_sum DESC\n" +
|
"order by ranking_points_sum DESC\n" +
|
||||||
"LIMIT 100;", nativeQuery = true)
|
"LIMIT 10;", nativeQuery = true)
|
||||||
List<Object[]> getRankingList();
|
List<Object[]> getRankingList();
|
||||||
|
|
||||||
@Query(value = "SELECT Rang\n" +
|
@Query(value = "SELECT Rang\n" +
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user