Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature/#233] 게시판 구현 #238

Merged
merged 20 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
6500c91
[feature/#233] NormalBoard entity, dto 수정
whitem4rk Feb 9, 2024
9868a36
[feature/#233] NormalBoard controller 수정
whitem4rk Feb 10, 2024
99ee007
[feature/#233] NormalBoard 전반적 수정
whitem4rk Feb 11, 2024
1784795
[feature/#233] NormalBoard Service 구현
whitem4rk Feb 12, 2024
65e4232
[feature/#233] NormalBoard repository 구현
whitem4rk Feb 13, 2024
e222515
[feature/#233] NormalBoard, Board 분리
whitem4rk Feb 13, 2024
b345784
[feature/#233] NormalBoard, Board 분리
whitem4rk Feb 14, 2024
47dd50c
[feature/#233] NormalBoard entity, dto TEST code
whitem4rk Feb 14, 2024
4cf9e5a
[feature/#233] NormalBoard repository TEST code
whitem4rk Feb 15, 2024
57338d9
[feature/#233] NormalBoard Service TEST code
whitem4rk Feb 16, 2024
bcf2dbb
[feature/#233] NormalBoard controller TEST code
whitem4rk Feb 17, 2024
3e9b839
[feature/#233] NormalBoard 설정 변경
whitem4rk Feb 18, 2024
4781c45
[feature/#233] NormalBoard IsPinned 기능 추가
whitem4rk Feb 18, 2024
774a314
[feature/#233] NormalBoard 세부 사항 수정
whitem4rk Feb 19, 2024
941cbd6
[feature/#233] NormalBoard Pin 관련 로직 수정
whitem4rk Feb 19, 2024
725c0cb
[feature/#233] NormalBoard test 코드 수정
whitem4rk Feb 19, 2024
b474df9
Merge branch 'master' of https://github.com/whitem4rk/Inhabas.com-api…
whitem4rk Feb 20, 2024
ff6152f
[feature/#233] NormalBoard 이미지, 파일 분리 조회 적용
whitem4rk Feb 20, 2024
ad680d3
[feature/#233] spotlessApply
whitem4rk Feb 20, 2024
02b4d67
[feature/#233] assertj 수정
whitem4rk Feb 20, 2024
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
Expand Up @@ -22,7 +22,7 @@

@Entity
@Table(
name = "user",
name = "USER",
uniqueConstraints = {
@UniqueConstraint(
name = "UNIQUE_PROVIDER_UID",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@ public GroupedOpenApi getIBASApi() {
.build();
}

@Bean
public GroupedOpenApi getBoardApi() {

return GroupedOpenApi.builder()
.group("게시판 관련")
.pathsToMatch("/board/**", "/**/**/**/comment/**", "/**/**/**/comments")
.build();
}

@Bean
@Profile("local")
public OpenAPI localOpenAPI() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public class WebSecurityConfig {
private static final String[] AUTH_WHITELIST_CLUB_ACTIVITY = {
"/club/activity/**", "/club/activities"
};
private static final String[] AUTH_WHITELIST_NORMAL_BOARD = {"/board/count"};

@Order(1)
@EnableGlobalMethodSecurity(prePostEnabled = true, jsr250Enabled = true)
Expand All @@ -85,6 +86,7 @@ public void configure(WebSecurity web) throws Exception {
.antMatchers(HttpMethod.GET, AUTH_WHITELIST_POLICY)
.antMatchers(HttpMethod.GET, AUTH_WHITELIST_SIGNUP)
.antMatchers(HttpMethod.GET, AUTH_WHITELIST_CLUB)
.antMatchers(HttpMethod.GET, AUTH_WHITELIST_NORMAL_BOARD)
.antMatchers(AUTH_WHITELIST_SWAGGER)
.antMatchers(AUTH_WHITELIST_STATIC)
.antMatchers(AUTH_WHITELIST_PATH);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
@Table(name = "ALBUM_BOARD")
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@EntityListeners(AuditingEntityListener.class)
@Inheritance(strategy = InheritanceType.JOINED)
@DiscriminatorValue("ALBUM")
public class AlbumBoard extends BaseBoard {

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.inhabas.api.domain.board.dto;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.PositiveOrZero;

import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@NoArgsConstructor
public class BoardCountDto {

@NotNull private String menuName;

@NotNull @PositiveOrZero private Integer count;

@Builder
public BoardCountDto(String menuName, Integer count) {
this.menuName = menuName;
this.count = count;
}
}

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@

import com.inhabas.api.domain.board.domain.BaseBoard;

public interface BaseBoardRepository extends JpaRepository<BaseBoard, Long> {}
public interface BaseBoardRepository
extends JpaRepository<BaseBoard, Long>, BaseBoardRepositoryCustom {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.inhabas.api.domain.board.repository;

import java.util.List;

import com.inhabas.api.domain.board.dto.BoardCountDto;

public interface BaseBoardRepositoryCustom {

List<BoardCountDto> countRowsGroupByMenuName(Integer menuGroupId);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.inhabas.api.domain.board.repository;

import static com.inhabas.api.domain.board.domain.QBaseBoard.baseBoard;
import static com.inhabas.api.domain.menu.domain.QMenu.*;

import java.util.List;

import lombok.RequiredArgsConstructor;

import com.inhabas.api.domain.board.dto.BoardCountDto;
import com.querydsl.core.types.Projections;
import com.querydsl.jpa.impl.JPAQueryFactory;

@RequiredArgsConstructor
public class BaseBoardRepositoryImpl implements BaseBoardRepositoryCustom {

private final JPAQueryFactory queryFactory;

@Override
public List<BoardCountDto> countRowsGroupByMenuName(Integer menuGroupId) {
return queryFactory
.select(
Projections.constructor(
BoardCountDto.class, menu.name.value, baseBoard.id.count().intValue()))
.from(menu)
.leftJoin(baseBoard)
.on(menu.id.eq(baseBoard.menu.id))
.where(menu.menuGroup.id.eq(menuGroupId))
.groupBy(menu.name)
.fetch();
}
}

This file was deleted.

This file was deleted.

Loading
Loading