Skip to content

Commit

Permalink
[force-merge] Merge pull request #21 from LikelionUniv/feature/community
Browse files Browse the repository at this point in the history
Feature/community -> main (for mypage FE work)
  • Loading branch information
HwangJerry authored Oct 8, 2023
2 parents 34d3301 + e4c170f commit cf50dae
Show file tree
Hide file tree
Showing 121 changed files with 1,979 additions and 1,172 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ out/
### env file ###
.env.dev
.env.*

### .DS_Store ignore ###
.DS_Store
46 changes: 26 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
plugins {
id 'java'
id 'java-library'
id 'org.springframework.boot' version '2.7.13'
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
}

group = 'likelion.univ'
version = '0.0.1-SNAPSHOT'

java {
sourceCompatibility = '17'
}
allprojects {
group = 'likelion.univ'
version = '0.0.1-SNAPSHOT'

configurations {
compileOnly {
extendsFrom annotationProcessor
java {
sourceCompatibility = 17
targetCompatibility = 17
}
repositories {
mavenCentral()
}
dependencies {
// implementation 'org.springframework.boot:spring-boot-starter'
// annotationProcessor('org.springframework.boot:spring-boot-configuration-processor:3.0.4')
}
}

Expand All @@ -30,21 +34,23 @@ subprojects {
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

sourceCompatibility = 17
targetCompatibility = 17

group = 'likelion.univ'
version = '0.0.1-SNAPSHOT'

repositories {
mavenCentral()
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
}
}
test {
useJUnitPlatform()
}
}
bootJar {
enabled = false
}

23 changes: 1 addition & 22 deletions likelion-admin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
plugins {
id 'java'
}

group = 'likelion.univ'
version = '0.0.1-SNAPSHOT'

repositories {
mavenCentral()
}

dependencies {

implementation 'org.springframework.boot:spring-boot-starter-validation'
testImplementation platform('org.junit:junit-bom:5.9.1')
testImplementation 'org.junit.jupiter:junit-jupiter'
Expand All @@ -28,14 +18,3 @@ dependencies {
implementation project(':likelion-infrastructure')
}

test {
useJUnitPlatform()
}

bootJar {
enabled = true
}

jar {
enabled = true
}
2 changes: 1 addition & 1 deletion likelion-admin/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ spring:
spring:
config:
activate:
on-profile: prod
on-profile: prod
27 changes: 3 additions & 24 deletions likelion-client/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
plugins {
id 'java'
}

group = 'likelion.univ'
version = '0.0.1-SNAPSHOT'

repositories {
mavenCentral()
}

dependencies {
/* pageable */
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'

/* security */
implementation 'org.springframework.boot:spring-boot-starter-security'
/* swagger */
Expand All @@ -23,6 +11,8 @@ dependencies {
testImplementation platform('org.junit:junit-bom:5.9.1')
testImplementation 'org.junit.jupiter:junit-jupiter'



/* core 모듈 추가 */
implementation project(':likelion-core')
/* redis 모듈 추가 */
Expand All @@ -35,14 +25,3 @@ dependencies {
implementation project(':likelion-infrastructure')
}

test {
useJUnitPlatform()
}

bootJar {
enabled = true
}

jar {
enabled = true
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import likelion.univ.auth.usecase.SignUpUseCase;
import likelion.univ.auth.dto.request.SignUpRequestDto;
import likelion.univ.response.SuccessResponse;
import likelion.univ.utils.AuthentiatedUserUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

Expand All @@ -23,6 +24,7 @@ public class AuthController {
private final RequestIdTokenUseCase requestIdTokenUseCase;
private final SignUpUseCase signUpUseCase;
private final RefreshTokenUseCase refreshTokenUseCase;
private final AuthentiatedUserUtils userUtils;

@Operation(summary = "id token 발급", description = "인가 코드로 id token을 발급받습니다.")
@GetMapping("/{logintype}/idtoken")
Expand Down Expand Up @@ -60,4 +62,10 @@ public SuccessResponse<Object> refreshToken(
AccountTokenDto accountTokenDto = refreshTokenUseCase.execute(refreshToken);
return SuccessResponse.of(accountTokenDto);
}

@Operation(summary = "로그인 유저 Id 반환", description = "(for client only) 로그인 중인 유저의 Id를 얻습니다.")
@GetMapping("/loginuserid")
public SuccessResponse<?> getLoginUserId() {
return SuccessResponse.of(userUtils.getCurrentUserId());
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
package likelion.univ.comment.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import likelion.univ.comment.dto.CommentCreateChildRequestDto;
import likelion.univ.comment.dto.CommentCreateParentRequestDto;
import likelion.univ.comment.dto.CommentUpdateRequestDto;
import likelion.univ.comment.repository.CommentReadRepository;
import likelion.univ.comment.usecase.*;
import likelion.univ.domain.comment.dto.CommentDetailResponseDto;
import likelion.univ.response.SuccessResponse;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/v1/community/comments")
@Tag(name = "댓글", description = "댓글 API")
public class CommentController {
private final CreateParentCommentUseCase createParentCommentUseCase;
private final CreateChildCommentUseCase createChildCommentUseCase;
private final UpdateCommentUseCase updateCommentUseCase;
private final SoftDeleteCommentUseCase softDeleteCommentUseCase;
private final HardDeleteCommentUseCase hardDeleteCommentUseCase;
private final CommentReadRepository commentReadRepository;

/* read */
@Operation(summary = "댓글 조회", description = "게시글에 대한 댓글을 최신순으로 조회합니다.")
@GetMapping("/of/{postId}")
public SuccessResponse<?> getComments(@PathVariable Long postId) {
List<CommentDetailResponseDto> response = commentReadRepository.findAll(postId);
return SuccessResponse.of(response);
}


/* command */
@Operation(summary = "댓글 작성", description = "부모 댓글을 생성합니다.")
@PostMapping("/parent")
public SuccessResponse<?> createParentComment(@RequestBody CommentCreateParentRequestDto request) {
return createParentCommentUseCase.execute(request);
}

@Operation(summary = "대댓글 작성", description = "자식 댓글을 생성합니다.")
@PostMapping("/child")
public SuccessResponse<?> createChildComment(@RequestBody CommentCreateChildRequestDto request) {
return createChildCommentUseCase.execute(request);
}

@Operation(summary = "댓글 내용 수정", description = "댓글의 내용(body only)을 수정합니다.")
@PatchMapping("/{commentId}")
public SuccessResponse<?> updateComment(@PathVariable Long commentId, @RequestBody CommentUpdateRequestDto request) {
return updateCommentUseCase.execute(commentId, request);
}

@Operation(summary = "댓글 삭제", description = "댓글을 soft delete 합니다.")
@PatchMapping("/disable/{commentId}")
public SuccessResponse<?> deleteCommentSoft(@PathVariable Long commentId) {
return softDeleteCommentUseCase.execute(commentId);// soft delete
}

@Operation(summary = "댓글 완전 삭제", description = "댓글을 hard delete 합니다.")
@DeleteMapping("/{commentId}")
public SuccessResponse<?> deleteCommentHard(@PathVariable Long commentId) {
return hardDeleteCommentUseCase.execute(commentId);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package likelion.univ.comment.dto;

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

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@Data
@Builder
@AllArgsConstructor
public class CommentCreateChildRequestDto {
@NotNull
@Schema(description = "게시글 id")
private Long postId;
@NotNull
@Schema(description = "대댓글을 다는 댓글 id")
private Long parentCommentId;
@NotBlank
@Schema(description = "대댓글 내용", example = "대댓글 내용입니다.")
private String body;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package likelion.univ.comment.dto;

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

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@Data
@Builder
@AllArgsConstructor
public class CommentCreateParentRequestDto {
@NotNull
@Schema(description = "댓글을 다는 게시글 id")
private Long postId;
@NotBlank
@Schema(description = "댓글 내용", example = "댓글 내용입니다.")
private String body;
}
Loading

0 comments on commit cf50dae

Please sign in to comment.