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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
text=auto eol=lf
3 changes: 2 additions & 1 deletion app-main/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ ext {
spotless {
java {
target '**/*.java'
lineEndings 'UNIX'

// 네이버 자바 컨벤션 적용
importOrder("java","javax","org","net","com","") // import 순서 정리
importOrder("java", "javax", "org", "net", "com", "") // import 순서 정리
removeUnusedImports()

// 네이버 코딩 컨벤션 XML 파일 사용
Expand Down
2 changes: 1 addition & 1 deletion app-main/gradle/flyway/flyway-config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ flyway {
locations = ["filesystem:src/main/resources/db/migration"]

// 5. 환경별 추가 설정
switch(env) {
switch (env) {
case "test":
logger.lifecycle("🧪 Applying TEST(CI) Flyway configuration")
outOfOrder = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
package net.causw.app.main.api.dto.board;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import net.causw.app.main.domain.community.board.entity.Board;
import net.causw.app.main.domain.user.account.enums.user.Role;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BoardOfCircleResponseDto {
@Schema(description = "게시판 id 값", example = "uuid 형식의 String 값입니다.")
private String id;
@Schema(description = "게시판 이름", example = "board_example")
private String name;
@Schema(description = "작성 가능 여부", example = "true")
private Boolean writable;
@Schema(description = "삭제 여부", example = "false")
private Boolean isDeleted;
@Schema(description = "게시글 id", example = "uuid 형식의 String 값입니다.")
private String postId;
@Schema(description = "게시글 제목", example = "post_title_example")
private String postTitle;
@Schema(description = "게시글 작성자 이름", example = "post_writer_example")
private String postWriterName;
@Schema(description = "게시글 작성자 id", example = "uuid 형식의 String 값입니다.")
private String postWriterStudentId;
@Schema(description = "게시글 생성 시간", example = "2024-01-26T18:40:40.643Z")
private LocalDateTime postCreatedAt;
@Schema(description = "게시글 댓글 개수", example = "12")
private Long postNumComment;
// Board의 CreateRoles는 List가 ","로 이어진 형태로 존재. "," 기준으로 split해서 List<String>으로 변환 후 userRole과 비교
public static Boolean isWriteable(Board board, Set<Role> userRoles) {
List<String> createRolesList = Arrays.asList(board.getCreateRoles().split(","));
return userRoles.stream()
.map(Role::getValue)
.anyMatch(createRolesList::contains);
}
}
package net.causw.app.main.api.dto.board;

import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;
import java.util.Set;

import net.causw.app.main.domain.community.board.entity.Board;
import net.causw.app.main.domain.user.account.enums.user.Role;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

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

@Schema(description = "게시판 id 값", example = "uuid 형식의 String 값입니다.")
private String id;

@Schema(description = "게시판 이름", example = "board_example")
private String name;

@Schema(description = "작성 가능 여부", example = "true")
private Boolean writable;

@Schema(description = "삭제 여부", example = "false")
private Boolean isDeleted;

@Schema(description = "게시글 id", example = "uuid 형식의 String 값입니다.")
private String postId;

@Schema(description = "게시글 제목", example = "post_title_example")
private String postTitle;

@Schema(description = "게시글 작성자 이름", example = "post_writer_example")
private String postWriterName;

@Schema(description = "게시글 작성자 id", example = "uuid 형식의 String 값입니다.")
private String postWriterStudentId;

@Schema(description = "게시글 생성 시간", example = "2024-01-26T18:40:40.643Z")
private LocalDateTime postCreatedAt;

@Schema(description = "게시글 댓글 개수", example = "12")
private Long postNumComment;

// Board의 CreateRoles는 List가 ","로 이어진 형태로 존재. "," 기준으로 split해서 List<String>으로 변환 후 userRole과 비교
public static Boolean isWriteable(Board board, Set<Role> userRoles) {
List<String> createRolesList = Arrays.asList(board.getCreateRoles().split(","));
return userRoles.stream()
.map(Role::getValue)
.anyMatch(createRolesList::contains);
}
}
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
package net.causw.app.main.api.dto.circle;
import java.util.List;
import net.causw.app.main.api.dto.board.BoardOfCircleResponseDto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Builder
@AllArgsConstructor
public class CircleBoardsResponseDto {
@Schema(description = "동아리 정보", example = "동아리 responseDTO 객체를 반환합니다.")
private CircleResponseDto circle;
@Schema(description = "동아리 게시판 리스트", example = "동아리의 속한 게시판 목록을 List<BoardOfCircleResponseDto> 객체(리스트)로 반환합니다.")
private List<BoardOfCircleResponseDto> boardList;
public static CircleBoardsResponseDto from(
CircleResponseDto circle,
List<BoardOfCircleResponseDto> boardList) {
return CircleBoardsResponseDto.builder()
.circle(circle)
.boardList(boardList)
.build();
}
}
package net.causw.app.main.api.dto.circle;

import java.util.List;

import net.causw.app.main.api.dto.board.BoardOfCircleResponseDto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@Builder
@AllArgsConstructor
public class CircleBoardsResponseDto {

@Schema(description = "동아리 정보", example = "동아리 responseDTO 객체를 반환합니다.")
private CircleResponseDto circle;

@Schema(description = "동아리 게시판 리스트", example = "동아리의 속한 게시판 목록을 List<BoardOfCircleResponseDto> 객체(리스트)로 반환합니다.")
private List<BoardOfCircleResponseDto> boardList;

public static CircleBoardsResponseDto from(
CircleResponseDto circle,
List<BoardOfCircleResponseDto> boardList) {
return CircleBoardsResponseDto.builder()
.circle(circle)
.boardList(boardList)
.build();
}

}
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
package net.causw.app.main.api.dto.circle;
import net.causw.app.main.api.dto.user.UserResponseDto;
import net.causw.app.main.domain.campus.circle.enums.CircleMemberStatus;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Builder
@AllArgsConstructor
public class CircleMemberResponseDto {
@Schema(description = "동아리원 고유 ID", example = "동아리원의 UUID 형식 유저 고유 ID 값입니다.")
private String id;
@Schema(description = "동아리원의 상태입니다.", example = "MEMBER")
private CircleMemberStatus status;
@Schema(description = "동아리 정보")
private CircleResponseDto circle;
@Schema(description = "유저 정보")
private UserResponseDto user;
}
package net.causw.app.main.api.dto.circle;

import net.causw.app.main.api.dto.user.UserResponseDto;
import net.causw.app.main.domain.campus.circle.enums.CircleMemberStatus;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@Builder
@AllArgsConstructor
public class CircleMemberResponseDto {

@Schema(description = "동아리원 고유 ID", example = "동아리원의 UUID 형식 유저 고유 ID 값입니다.")
private String id;

@Schema(description = "동아리원의 상태입니다.", example = "MEMBER")
private CircleMemberStatus status;

@Schema(description = "동아리 정보")
private CircleResponseDto circle;

@Schema(description = "유저 정보")
private UserResponseDto user;

}
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
package net.causw.app.main.api.dto.circle;
import java.time.LocalDateTime;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Builder
@AllArgsConstructor
public class CirclesResponseDto {
@Schema(description = "동아리 ID", example = "UUID 형식의 동아리 고유 ID String 값입니다.")
private String id;
@Schema(description = "동아리 이름", example = "소프트웨어학부 특별기구 ICT위원회 동문 네트워크")
private String name;
@Schema(description = "동아리 메인 이미지(nullable)", example = "String")
private String mainImage;
@Schema(description = "동아리 설명", example = "ICT위원회는 동문 네트워크 서비스를 만드는 특별기구이자 동아리입니다.")
private String description;
@Schema(description = "동아리장 ID", example = "UUID 형식의 동아리장 ID(PK) String 값입니다.")
private String leaderId;
@Schema(description = "동아리장 이름", example = "정상제")
private String leaderName;
@Schema(description = "동아리원 숫자", example = "7")
private Long numMember;
@Schema(description = "동아리 삭제 여부", example = "false")
private Boolean isDeleted;
@Schema(description = "유저의 동아리 가입 여부\n(User Role ADMIN 일 시 항상 true)", example = "false")
private Boolean isJoined;
@Schema(description = "동아리 생성 일시", example = "2024-02-04T16:11:02.342644")
private LocalDateTime createdAt;
@Schema(description = "동아리 가입 시점\n(User Role ADMIN 일 시 항상 API 호출 시점)", example = "2024-02-04T16:11:02.342644")
private LocalDateTime joinedAt;
@Schema(description = "동아리 모집 종료 날짜", example = "2024-10-10")
private LocalDateTime recruitEndDate;
@Schema(description = "동아리 모집 여부", example = "false")
private Boolean isRecruit;
}
package net.causw.app.main.api.dto.circle;

import java.time.LocalDateTime;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@Builder
@AllArgsConstructor
public class CirclesResponseDto {
@Schema(description = "동아리 ID", example = "UUID 형식의 동아리 고유 ID String 값입니다.")
private String id;

@Schema(description = "동아리 이름", example = "소프트웨어학부 특별기구 ICT위원회 동문 네트워크")
private String name;

@Schema(description = "동아리 메인 이미지(nullable)", example = "String")
private String mainImage;

@Schema(description = "동아리 설명", example = "ICT위원회는 동문 네트워크 서비스를 만드는 특별기구이자 동아리입니다.")
private String description;

@Schema(description = "동아리장 ID", example = "UUID 형식의 동아리장 ID(PK) String 값입니다.")
private String leaderId;

@Schema(description = "동아리장 이름", example = "정상제")
private String leaderName;

@Schema(description = "동아리원 숫자", example = "7")
private Long numMember;

@Schema(description = "동아리 삭제 여부", example = "false")
private Boolean isDeleted;

@Schema(description = "유저의 동아리 가입 여부\n(User Role ADMIN 일 시 항상 true)", example = "false")
private Boolean isJoined;

@Schema(description = "동아리 생성 일시", example = "2024-02-04T16:11:02.342644")
private LocalDateTime createdAt;

@Schema(description = "동아리 가입 시점\n(User Role ADMIN 일 시 항상 API 호출 시점)", example = "2024-02-04T16:11:02.342644")
private LocalDateTime joinedAt;

@Schema(description = "동아리 모집 종료 날짜", example = "2024-10-10")
private LocalDateTime recruitEndDate;

@Schema(description = "동아리 모집 여부", example = "false")
private Boolean isRecruit;

}
Loading
Loading