diff --git a/backend/src/main/java/com/openisle/controller/ActivityController.java b/backend/src/main/java/com/openisle/controller/ActivityController.java index 2ea603735..4cbe4db0f 100644 --- a/backend/src/main/java/com/openisle/controller/ActivityController.java +++ b/backend/src/main/java/com/openisle/controller/ActivityController.java @@ -1,7 +1,9 @@ package com.openisle.controller; +import com.openisle.dto.ActivityDto; import com.openisle.dto.MilkTeaInfoDto; import com.openisle.dto.MilkTeaRedeemRequest; +import com.openisle.mapper.ActivityMapper; import com.openisle.model.Activity; import com.openisle.model.ActivityType; import com.openisle.model.User; @@ -12,6 +14,7 @@ import org.springframework.security.core.Authentication; import org.springframework.web.bind.annotation.*; import java.util.List; +import java.util.stream.Collectors; @RestController @RequestMapping("/api/activities") @@ -19,10 +22,13 @@ import java.util.List; public class ActivityController { private final ActivityService activityService; private final UserService userService; + private final ActivityMapper activityMapper; @GetMapping - public List list() { - return activityService.list(); + public List list() { + return activityService.list().stream() + .map(activityMapper::toDto) + .collect(Collectors.toList()); } @GetMapping("/milk-tea") diff --git a/backend/src/main/java/com/openisle/dto/ActivityDto.java b/backend/src/main/java/com/openisle/dto/ActivityDto.java new file mode 100644 index 000000000..75e71ee17 --- /dev/null +++ b/backend/src/main/java/com/openisle/dto/ActivityDto.java @@ -0,0 +1,21 @@ +package com.openisle.dto; + +import com.openisle.model.ActivityType; +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * DTO representing an activity without participant details. + */ +@Data +public class ActivityDto { + private Long id; + private String title; + private String icon; + private String content; + private LocalDateTime startTime; + private LocalDateTime endTime; + private ActivityType type; + private boolean ended; +} diff --git a/backend/src/main/java/com/openisle/mapper/ActivityMapper.java b/backend/src/main/java/com/openisle/mapper/ActivityMapper.java new file mode 100644 index 000000000..5c273f7f1 --- /dev/null +++ b/backend/src/main/java/com/openisle/mapper/ActivityMapper.java @@ -0,0 +1,23 @@ +package com.openisle.mapper; + +import com.openisle.dto.ActivityDto; +import com.openisle.model.Activity; +import org.springframework.stereotype.Component; + +/** Mapper for activity entities. */ +@Component +public class ActivityMapper { + + public ActivityDto toDto(Activity a) { + ActivityDto dto = new ActivityDto(); + dto.setId(a.getId()); + dto.setTitle(a.getTitle()); + dto.setIcon(a.getIcon()); + dto.setContent(a.getContent()); + dto.setStartTime(a.getStartTime()); + dto.setEndTime(a.getEndTime()); + dto.setType(a.getType()); + dto.setEnded(a.isEnded()); + return dto; + } +} diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index f3c220f42..f4e59995c 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -10,7 +10,8 @@ spring.jpa.hibernate.ddl-auto=update app.jwt.secret=${JWT_SECRET:jwt_sec} app.jwt.reason-secret=${JWT_REASON_SECRET:jwt_reason_sec} app.jwt.reset-secret=${JWT_RESET_SECRET:jwt_reset_sec} -app.jwt.expiration=${JWT_EXPIRATION:86400000} +# 30 days +app.jwt.expiration=${JWT_EXPIRATION:2592000000} # Password strength: LOW, MEDIUM or HIGH app.password.strength=${PASSWORD_STRENGTH:LOW} diff --git a/frontend_nuxt/assets/global.css b/frontend_nuxt/assets/global.css index 6ad583063..40558002c 100644 --- a/frontend_nuxt/assets/global.css +++ b/frontend_nuxt/assets/global.css @@ -16,6 +16,7 @@ --menu-text-color: black; --scroller-background-color: rgba(130, 175, 180, 0.5); --normal-background-color: rgb(241, 241, 241); + --lottery-background-color: rgb(241, 241, 241); --login-background-color: rgb(248, 248, 248); --login-background-color-hover: #e0e0e0; --text-color: black; @@ -42,6 +43,7 @@ --menu-selected-background-color: rgba(255, 255, 255, 0.1); --menu-text-color: white; --normal-background-color: #000000; + --lottery-background-color: #4e4e4e; --login-background-color: #575757; --login-background-color-hover: #717171; --text-color: #eee; diff --git a/frontend_nuxt/components/AchievementList.vue b/frontend_nuxt/components/AchievementList.vue index 4131339f1..1f84ec9de 100644 --- a/frontend_nuxt/components/AchievementList.vue +++ b/frontend_nuxt/components/AchievementList.vue @@ -130,6 +130,7 @@ const selectMedal = async (medal) => { .achievements-list-item-description { font-size: 14px; color: #666; + text-align: center; } .not_completed { @@ -162,7 +163,10 @@ const selectMedal = async (medal) => { } .achievements-list-item { - min-width: calc(50% - 30px); + width: calc(50% - 27px); + align-items: center; + justify-content: center; + gap: 10px; } } diff --git a/frontend_nuxt/components/HeaderComponent.vue b/frontend_nuxt/components/HeaderComponent.vue index df31e940b..71ed1735d 100644 --- a/frontend_nuxt/components/HeaderComponent.vue +++ b/frontend_nuxt/components/HeaderComponent.vue @@ -50,11 +50,12 @@