-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v1.2.0
- Loading branch information
Showing
64 changed files
with
1,801 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
* @char-yb @dbscks97 @kwanok | ||
* @char-yb @dbscks97 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Develop Deploy | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
commit_hash: | ||
description: 'commit_hash' | ||
required: true | ||
|
||
env: | ||
DOCKERHUB_IMAGE_NAME: walwal-server | ||
|
||
jobs: | ||
build-deploy: | ||
runs-on: ubuntu-latest | ||
environment: DEV | ||
steps: | ||
# EC2로 배포 | ||
- name: Deploy to EC2 Server | ||
uses: appleboy/[email protected] | ||
env: | ||
IMAGE_FULL_URL: ${{ steps.metadata.outputs.tags }} | ||
DOCKERHUB_IMAGE_NAME: ${{ env.DOCKERHUB_IMAGE_NAME }} | ||
with: | ||
host: ${{ secrets.EC2_HOST }} | ||
username: ${{ secrets.EC2_USERNAME }} | ||
key: ${{ secrets.EC2_PRIVATE_KEY }} | ||
envs: IMAGE_FULL_URL, DOCKERHUB_IMAGE_NAME # docker-compose.yml 에서 사용할 환경 변수 | ||
debug: true | ||
script: | | ||
echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin | ||
docker compose up -d | ||
docker exec -d nginx nginx -s reload | ||
docker image prune -a -f | ||
## Slack | ||
- name: Slack Alarm | ||
uses: 8398a7/action-slack@v3 | ||
with: | ||
status: ${{ job.status }} | ||
author_name: GitHub-Actions CI/CD | ||
fields: repo,message,commit,author,ref,job,took | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required | ||
if: always() # Pick up events even if the job fails or is canceled. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Production Deploy | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'version' | ||
required: true | ||
|
||
env: | ||
DOCKERHUB_IMAGE_NAME: walwal-server | ||
|
||
jobs: | ||
build-deploy: | ||
runs-on: ubuntu-latest | ||
environment: PROD | ||
steps: | ||
- name: Deploy to EC2 Server | ||
uses: appleboy/ssh-action@master | ||
env: | ||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | ||
IMAGE_FULL_URL: ${{ steps.metadata.outputs.tags }} | ||
with: | ||
host: ${{ secrets.EC2_HOST }} | ||
username: ${{ secrets.EC2_USERNAME }} | ||
key: ${{ secrets.EC2_PRIVATE_KEY }} | ||
envs: IMAGE_FULL_URL # docker-compose.yaml 에서 사용할 환경 변수 | ||
script: | | ||
aws s3 cp ${{ env.S3_COPY_PATH }} docker-compose.yaml | ||
echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin | ||
docker pull ${{ env.IMAGE_FULL_URL }} | ||
docker compose up -d | ||
docker image prune -a -f | ||
## Slack | ||
- name: Slack Alarm | ||
uses: 8398a7/action-slack@v3 | ||
with: | ||
status: ${{ job.status }} | ||
author_name: GitHub-Actions CI/CD | ||
fields: repo,message,commit,author,ref,job,took | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required | ||
if: always() # Pick up events even if the job fails or is canceled. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/main/java/com/depromeet/stonebed/domain/comment/api/CommentController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.depromeet.stonebed.domain.comment.api; | ||
|
||
import com.depromeet.stonebed.domain.comment.application.CommentService; | ||
import com.depromeet.stonebed.domain.comment.dto.request.CommentCreateRequest; | ||
import com.depromeet.stonebed.domain.comment.dto.response.CommentCreateResponse; | ||
import com.depromeet.stonebed.domain.comment.dto.response.CommentFindResponse; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import jakarta.validation.Valid; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@Tag(name = "9. [댓글]", description = "댓글 관련 API입니다.") | ||
@RequestMapping("/comments") | ||
@RestController | ||
@RequiredArgsConstructor | ||
public class CommentController { | ||
|
||
private final CommentService commentService; | ||
|
||
@Operation(summary = "댓글 작성", description = "댓글을 작성합니다.") | ||
@PostMapping | ||
public ResponseEntity<CommentCreateResponse> commentCreate( | ||
@RequestBody @Valid CommentCreateRequest request) { | ||
return ResponseEntity.status(HttpStatus.CREATED) | ||
.body(commentService.createComment(request)); | ||
} | ||
|
||
@Operation(summary = "댓글 조회", description = "댓글을 조회합니다.") | ||
@GetMapping | ||
public CommentFindResponse commentFind(@RequestParam Long recordId) { | ||
return commentService.findCommentsByRecordId(recordId); | ||
} | ||
} |
Oops, something went wrong.