Setting up Gamification for test phase
LocationBasedServices/sumoc-backend/pipeline/head This commit looks good
LocationBasedServices/sumoc-backend/pipeline/head This commit looks good
This commit is contained in:
@@ -2,4 +2,5 @@
|
||||
SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/sumoc
|
||||
SPRING_DATASOURCE_USERNAME=postgres
|
||||
SPRING_DATASOURCE_PASSWORD=admin
|
||||
nominatim.base-url=http://nominatim:8080/
|
||||
nominatim.base-url=http://nominatim:8080/
|
||||
FCM_DECRYPTION_KEY=BM+x/GG//VyFd5fhCJaffH3PQIs+9rVgdhLsZo9o3HCtqCSqFx5HVY7s7wTxdAOi
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
package SuMoC.backend.gamification.badges;
|
||||
package SuMoC.backend.seed;
|
||||
|
||||
import SuMoC.backend.gamification.badges.BadgeRepository;
|
||||
import SuMoC.backend.gamification.badges.BadgeService;
|
||||
import SuMoC.backend.gamification.badges.mapper.BadgeMapper;
|
||||
import SuMoC.backend.gamification.badges.models.Badge;
|
||||
import SuMoC.backend.gamification.badges.models.BadgeCategory;
|
||||
import SuMoC.backend.gamification.badges.models.BadgeDTO;
|
||||
import jakarta.transaction.Transactional;
|
||||
import kotlin.collections.ArrayDeque;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.context.annotation.Profile;
|
||||
@@ -45,11 +45,11 @@ public class DevUserSeeder implements CommandLineRunner {
|
||||
|
||||
Long positionIndex = 1L;
|
||||
for (var user : pgMembers) {
|
||||
addDummyStats(user, positionIndex);
|
||||
addDummyStats(user);
|
||||
positionIndex++;
|
||||
}
|
||||
for (var user : defaultTestUsers) {
|
||||
addDummyStats(user, positionIndex);
|
||||
addDummyStats(user);
|
||||
positionIndex++;
|
||||
}
|
||||
//List<User> nTestUsers = seedNtestUsers(10);
|
||||
@@ -261,31 +261,31 @@ public class DevUserSeeder implements CommandLineRunner {
|
||||
return createdUsers;
|
||||
}
|
||||
|
||||
private void addDummyStats(User user, Long positionIndex) {
|
||||
private void addDummyStats(User user) {
|
||||
user.getStats().addToStat(
|
||||
Timeframe.WEEKLY,
|
||||
"XP",
|
||||
100L * positionIndex
|
||||
0
|
||||
);
|
||||
user.getStats().addToStat(
|
||||
Timeframe.WEEKLY,
|
||||
"CO2_SAVED",
|
||||
500L * positionIndex
|
||||
0
|
||||
);
|
||||
user.getStats().addToStat(
|
||||
Timeframe.WEEKLY,
|
||||
"KM_CYCLED",
|
||||
20L * positionIndex
|
||||
0
|
||||
);
|
||||
user.getStats().addToStat(
|
||||
Timeframe.WEEKLY,
|
||||
"KM_WALKED",
|
||||
10L * positionIndex
|
||||
0
|
||||
);
|
||||
user.getStats().addToStat(
|
||||
Timeframe.WEEKLY,
|
||||
"KM_PUBLIC_TRANSPORT",
|
||||
15L * positionIndex
|
||||
0
|
||||
);
|
||||
userRepository.save(user);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user