Skip to content

Commit

Permalink
Merge pull request #60 from ssu-student-union/feat/50-post
Browse files Browse the repository at this point in the history
 [feat] #50 자료집 리스트 api 구현
  • Loading branch information
qogustj authored Aug 18, 2024
2 parents 657b67c + 727bca9 commit a935c07
Show file tree
Hide file tree
Showing 18 changed files with 418 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package ussum.homepage.infra.jpa.comment.entity;

import static com.querydsl.core.types.PathMetadataFactory.*;

import com.querydsl.core.types.dsl.*;

import com.querydsl.core.types.PathMetadata;
import javax.annotation.processing.Generated;
import com.querydsl.core.types.Path;
import com.querydsl.core.types.dsl.PathInits;


/**
* QPostReplyCommentEntity is a Querydsl query type for PostReplyCommentEntity
*/
@Generated("com.querydsl.codegen.DefaultEntitySerializer")
public class QPostReplyCommentEntity extends EntityPathBase<PostReplyCommentEntity> {

private static final long serialVersionUID = 2085460932L;

private static final PathInits INITS = PathInits.DIRECT2;

public static final QPostReplyCommentEntity postReplyCommentEntity = new QPostReplyCommentEntity("postReplyCommentEntity");

public final ussum.homepage.infra.jpa.QBaseEntity _super = new ussum.homepage.infra.jpa.QBaseEntity(this);

public final StringPath content = createString("content");

//inherited
public final DateTimePath<java.time.LocalDateTime> createdAt = _super.createdAt;

public final NumberPath<Long> id = createNumber("id", Long.class);

public final DateTimePath<java.time.LocalDateTime> lastEditedAt = createDateTime("lastEditedAt", java.time.LocalDateTime.class);

public final QPostCommentEntity postCommentEntity;

//inherited
public final DateTimePath<java.time.LocalDateTime> updatedAt = _super.updatedAt;

public final ussum.homepage.infra.jpa.user.entity.QUserEntity userEntity;

public QPostReplyCommentEntity(String variable) {
this(PostReplyCommentEntity.class, forVariable(variable), INITS);
}

public QPostReplyCommentEntity(Path<? extends PostReplyCommentEntity> path) {
this(path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS));
}

public QPostReplyCommentEntity(PathMetadata metadata) {
this(metadata, PathInits.getFor(metadata, INITS));
}

public QPostReplyCommentEntity(PathMetadata metadata, PathInits inits) {
this(PostReplyCommentEntity.class, metadata, inits);
}

public QPostReplyCommentEntity(Class<? extends PostReplyCommentEntity> type, PathMetadata metadata, PathInits inits) {
super(type, metadata, inits);
this.postCommentEntity = inits.isInitialized("postCommentEntity") ? new QPostCommentEntity(forProperty("postCommentEntity"), inits.get("postCommentEntity")) : null;
this.userEntity = inits.isInitialized("userEntity") ? new ussum.homepage.infra.jpa.user.entity.QUserEntity(forProperty("userEntity")) : null;
}

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package ussum.homepage.infra.jpa.group.entity;

import static com.querydsl.core.types.PathMetadataFactory.*;

import com.querydsl.core.types.dsl.*;

import com.querydsl.core.types.PathMetadata;
import javax.annotation.processing.Generated;
import com.querydsl.core.types.Path;


/**
* QGroupEntity is a Querydsl query type for GroupEntity
*/
@Generated("com.querydsl.codegen.DefaultEntitySerializer")
public class QGroupEntity extends EntityPathBase<GroupEntity> {

private static final long serialVersionUID = 2011003894L;

public static final QGroupEntity groupEntity = new QGroupEntity("groupEntity");

public final ussum.homepage.infra.jpa.QBaseEntity _super = new ussum.homepage.infra.jpa.QBaseEntity(this);

//inherited
public final DateTimePath<java.time.LocalDateTime> createdAt = _super.createdAt;

public final EnumPath<GroupCode> groupCode = createEnum("groupCode", GroupCode.class);

public final NumberPath<Long> id = createNumber("id", Long.class);

public final StringPath name = createString("name");

//inherited
public final DateTimePath<java.time.LocalDateTime> updatedAt = _super.updatedAt;

public QGroupEntity(String variable) {
super(GroupEntity.class, forVariable(variable));
}

public QGroupEntity(Path<? extends GroupEntity> path) {
super(path.getType(), path.getMetadata());
}

public QGroupEntity(PathMetadata metadata) {
super(GroupEntity.class, metadata);
}

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package ussum.homepage.infra.jpa.member.entity;

import static com.querydsl.core.types.PathMetadataFactory.*;

import com.querydsl.core.types.dsl.*;

import com.querydsl.core.types.PathMetadata;
import javax.annotation.processing.Generated;
import com.querydsl.core.types.Path;
import com.querydsl.core.types.dsl.PathInits;


/**
* QMemberEntity is a Querydsl query type for MemberEntity
*/
@Generated("com.querydsl.codegen.DefaultEntitySerializer")
public class QMemberEntity extends EntityPathBase<MemberEntity> {

private static final long serialVersionUID = -2110901084L;

private static final PathInits INITS = PathInits.DIRECT2;

public static final QMemberEntity memberEntity = new QMemberEntity("memberEntity");

public final ussum.homepage.infra.jpa.QBaseEntity _super = new ussum.homepage.infra.jpa.QBaseEntity(this);

//inherited
public final DateTimePath<java.time.LocalDateTime> createdAt = _super.createdAt;

public final ussum.homepage.infra.jpa.group.entity.QGroupEntity groupEntity;

public final NumberPath<Long> id = createNumber("id", Long.class);

public final BooleanPath isAdmin = createBoolean("isAdmin");

public final EnumPath<MajorCode> majorCode = createEnum("majorCode", MajorCode.class);

public final EnumPath<MemberCode> memberCode = createEnum("memberCode", MemberCode.class);

//inherited
public final DateTimePath<java.time.LocalDateTime> updatedAt = _super.updatedAt;

public final ussum.homepage.infra.jpa.user.entity.QUserEntity userEntity;

public QMemberEntity(String variable) {
this(MemberEntity.class, forVariable(variable), INITS);
}

public QMemberEntity(Path<? extends MemberEntity> path) {
this(path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS));
}

public QMemberEntity(PathMetadata metadata) {
this(metadata, PathInits.getFor(metadata, INITS));
}

public QMemberEntity(PathMetadata metadata, PathInits inits) {
this(MemberEntity.class, metadata, inits);
}

public QMemberEntity(Class<? extends MemberEntity> type, PathMetadata metadata, PathInits inits) {
super(type, metadata, inits);
this.groupEntity = inits.isInitialized("groupEntity") ? new ussum.homepage.infra.jpa.group.entity.QGroupEntity(forProperty("groupEntity")) : null;
this.userEntity = inits.isInitialized("userEntity") ? new ussum.homepage.infra.jpa.user.entity.QUserEntity(forProperty("userEntity")) : null;
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class QPostFileEntity extends EntityPathBase<PostFileEntity> {
public final QPostEntity postEntity;

public final StringPath size = createString("size");
public final StringPath subCategory = createString("subCategory");

public final StringPath typeName = createString("typeName");

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package ussum.homepage.infra.jpa.reaction.entity;

import static com.querydsl.core.types.PathMetadataFactory.*;

import com.querydsl.core.types.dsl.*;

import com.querydsl.core.types.PathMetadata;
import javax.annotation.processing.Generated;
import com.querydsl.core.types.Path;
import com.querydsl.core.types.dsl.PathInits;


/**
* QPostReplyCommentReactionEntity is a Querydsl query type for PostReplyCommentReactionEntity
*/
@Generated("com.querydsl.codegen.DefaultEntitySerializer")
public class QPostReplyCommentReactionEntity extends EntityPathBase<PostReplyCommentReactionEntity> {

private static final long serialVersionUID = -139667017L;

private static final PathInits INITS = PathInits.DIRECT2;

public static final QPostReplyCommentReactionEntity postReplyCommentReactionEntity = new QPostReplyCommentReactionEntity("postReplyCommentReactionEntity");

public final NumberPath<Long> id = createNumber("id", Long.class);

public final ussum.homepage.infra.jpa.comment.entity.QPostReplyCommentEntity postReplyCommentEntity;

public final EnumPath<ussum.homepage.infra.jpa.postlike.entity.Reaction> reaction = createEnum("reaction", ussum.homepage.infra.jpa.postlike.entity.Reaction.class);

public final ussum.homepage.infra.jpa.user.entity.QUserEntity userEntity;

public QPostReplyCommentReactionEntity(String variable) {
this(PostReplyCommentReactionEntity.class, forVariable(variable), INITS);
}

public QPostReplyCommentReactionEntity(Path<? extends PostReplyCommentReactionEntity> path) {
this(path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS));
}

public QPostReplyCommentReactionEntity(PathMetadata metadata) {
this(metadata, PathInits.getFor(metadata, INITS));
}

public QPostReplyCommentReactionEntity(PathMetadata metadata, PathInits inits) {
this(PostReplyCommentReactionEntity.class, metadata, inits);
}

public QPostReplyCommentReactionEntity(Class<? extends PostReplyCommentReactionEntity> type, PathMetadata metadata, PathInits inits) {
super(type, metadata, inits);
this.postReplyCommentEntity = inits.isInitialized("postReplyCommentEntity") ? new ussum.homepage.infra.jpa.comment.entity.QPostReplyCommentEntity(forProperty("postReplyCommentEntity"), inits.get("postReplyCommentEntity")) : null;
this.userEntity = inits.isInitialized("userEntity") ? new ussum.homepage.infra.jpa.user.entity.QUserEntity(forProperty("userEntity")) : null;
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,23 @@ public class PostManageController {

private final PostManageService postManageService;

@GetMapping("/{boardCode}/posts")
@GetMapping("/{boardCode}/{groupCode}/posts")
public ResponseEntity<ApiResponse<?>> getBoardPostsList(@RequestParam(value = "page", defaultValue = "0") int page, @RequestParam(value = "take") int take,
@PathVariable(name = "boardCode") String boardCode) {
@PathVariable(name = "boardCode") String boardCode, @PathVariable(name = "groupCode") String groupCode) {

// PostListResponse postList = postService.getPostList(PageRequest.of(page, take, Sort.by("id").descending()), boardCode);
return ApiResponse.success(postManageService.getPostList(page, take, boardCode));
return ApiResponse.success(postManageService.getPostList(page, take, boardCode, groupCode));
}

@GetMapping("data/{majorCategory}/{middleCategory}/{subCategory}/posts")
public ResponseEntity<ApiResponse<?>> getDataPostsList(@RequestParam(value = "page", defaultValue = "0") int page, @RequestParam(value = "take") int take,
@PathVariable(name = "majorCategory") String majorCategory, @PathVariable(name = "middleCategory") String middleCategory,@PathVariable(name = "subCategory") String subCategory) {

// PostListResponse postList = postService.getPostList(PageRequest.of(page, take, Sort.by("id").descending()), boardCode);
return ApiResponse.success(postManageService.getDataList(page, take, majorCategory, middleCategory, subCategory));
}


@GetMapping("/{boardCode}/posts/{postId}")
public ResponseEntity<ApiResponse<?>> getBoardPost(@PathVariable(name = "boardCode") String boardCode,
@PathVariable(name = "postId") Long postId,
Expand Down
Loading

0 comments on commit a935c07

Please sign in to comment.