Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
package com.example.hackathon.domain.activity.dto;

import lombok.Getter;
import lombok.*;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ActivityResponseDto {

private Long id;
Expand All @@ -15,26 +19,6 @@ public class ActivityResponseDto {

private boolean isTodayActivity = false;

public ActivityResponseDto(
Long id,
String title,
String subtitle,
String description,
int point,
int sortOrder,
boolean isTodayActivity,
boolean isCustom
) {
this.id = id;
this.title = title;
this.subtitle = subtitle;
this.description = description;
this.point = point;
this.sortOrder = sortOrder;
this.isTodayActivity = isTodayActivity;
this.isCustom = isCustom;
}

public ActivityResponseDto(
Long id,
String title,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ public Response<Void> recordActivityHistory(
}

}
/**/
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
package com.example.hackathon.domain.activityhistory.dto;

import lombok.Getter;
import lombok.*;

import java.time.LocalDateTime;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ActivityHistoryResponseDto {

private Long id;
private Long activityId;
private Long userId;
private Integer point;
private Boolean attendStatus;
private LocalDateTime regDt;

public ActivityHistoryResponseDto(Long id, Long activityId, Long userId, Integer point, Boolean attendStatus, LocalDateTime regDt) {
this.id = id;
this.activityId = activityId;
this.userId = userId;
this.point = point;
this.attendStatus = attendStatus;
this.regDt = regDt;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public Response<List<CategoryResponseDto>> getAllCategories() {
return Response.ok(categoryService.getAllCategories());
}

@Operation(summary = "특정 상위 카테고리 하위 조회 API", description = "특정 카테고리의 하위 카테고리를 조회합니다.")
@GetMapping("/parent/{parentCode}")
public Response<List<CategoryResponseDto>> getCategoriesByParentCode(@AuthUser String parentCode) {
return Response.ok(categoryService.getCategoriesByParentCode(parentCode));
}
// @Operation(summary = "특정 상위 카테고리 하위 조회 API", description = "특정 카테고리의 하위 카테고리를 조회합니다.")
// @GetMapping("/parent/{parentCode}")
// public Response<List<CategoryResponseDto>> getCategoriesByParentCode(@AuthUser String parentCode) {
// return Response.ok(categoryService.getCategoriesByParentCode(parentCode));
// }
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
package com.example.hackathon.domain.category.dto;

import lombok.*;

import java.time.LocalDateTime;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class CategoryResponseDto {

private Long id;
Expand All @@ -10,12 +17,4 @@ public class CategoryResponseDto {
private Integer sortOrder;
private LocalDateTime regDt;

public CategoryResponseDto(Long id, String description, String parentCode, Integer sortOrder,
LocalDateTime regDt) {
this.id = id;
this.description = description;
this.parentCode = parentCode;
this.sortOrder = sortOrder;
this.regDt = regDt;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
import com.example.hackathon.global.BaseEntity;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.ToString;

import java.time.LocalDateTime;

@Entity
@Getter
@Table(name = "CATEGORY")
@ToString
public class Category extends BaseEntity {

@Id
Expand All @@ -36,7 +38,6 @@ public class Category extends BaseEntity {
@Column(name="CATEGORY_TYPE")
private CategoryType categoryType;


// 기본 생성자
public Category() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
import com.example.hackathon.domain.category.dto.CategoryResponseDto;
import com.example.hackathon.domain.category.entity.Category;
import com.example.hackathon.domain.category.repository.CategoryRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.stream.Collectors;

@Service
@Slf4j
public class CategoryService {

private final CategoryRepository categoryRepository;
Expand All @@ -21,6 +24,10 @@ public CategoryService(CategoryRepository categoryRepository) {
public List<CategoryResponseDto> getAllCategories() {
return categoryRepository.findAllByOrderBySortOrderAsc()
.stream()
.map(category -> {
log.info("category : {}", category);
return category;
})
.map(this::convertToDto)
.collect(Collectors.toList());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ public Response<?> kakaoLogin(@RequestParam("code") String code) {
return Response.ok(jwtToken);
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.example.hackathon.global.config;

import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class JacksonConfig {
@Bean
public Jackson2ObjectMapperBuilderCustomizer jsonCustomizer() {
return builder -> builder.modules(new JavaTimeModule());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@


import java.io.IOException;
import java.util.Collections;

@Component
public class JwtAuthenticationFilter extends OncePerRequestFilter {
Expand Down Expand Up @@ -61,7 +62,7 @@ protected void doFilterInternal(
new UsernamePasswordAuthenticationToken(
user,
null,
null
Collections.emptyList() // ✅ 반드시 authorities 포함
);

SecurityContextHolder.getContext().setAuthentication(authentication);
Expand Down