Skip to content

Commit 6577ade

Browse files
authored
Merge branch 'dev' into feature/#13/schedule/v1
2 parents 44e4416 + fd9775e commit 6577ade

File tree

104 files changed

+4628
-12
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+4628
-12
lines changed

.github/pull_request_template.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# 🔀 Pull Request
22
<!-- PR 제목 컨벤션 -> [BE/feat] pr 제목 -->
3+
34
## 🏷 PR 타입(Type)
45
아래에서 이번 PR의 종류를 선택해주세요.
56

@@ -9,34 +10,32 @@
910
- [ ] Chore (환경 설정 / 빌드 / 기타 작업)
1011
- [ ] Docs (문서 작업)
1112

12-
---
13-
1413
## 🍗 관련 이슈
14+
1515
- close #번호
1616

17-
---
1817

1918
## 📝 개요(Summary)
19+
2020
<!-- 이번 PR이 어떤 작업인지 간단히 설명해주세요. -->
2121

22-
---
2322

2423
## 🔧 코드 설명 & 변경 이유(Code Description)
24+
2525
<!-- 어떤 코드를 작성/수정했는지, 왜 이런 방식으로 구현했는지 -->
2626

27-
---
2827

2928
## 🧪 테스트 절차(Test Plan)
29+
3030
<!--※ 테스트가 필요한 경우에만 작성 -->
3131

32-
---
3332

3433
## 🔄 API 변경 / 흐름 영향(API & Flow Impact)
34+
3535
<!-- API 스펙 변경 또는 기존 흐름에 영향이 있는 경우 **필수로 작성** -->
3636

37-
---
3837

3938
## 👀 리뷰 포인트(Notes for Reviewer)
39+
4040
<!-- 리뷰어에게 특별히 확인받고 싶은 내용을 작성 -->
4141

42-
---
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Auto Close Issues on Dev Merge
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
branches:
7+
- dev
8+
9+
jobs:
10+
close-issues:
11+
if: github.event.pull_request.merged == true
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Extract issue numbers from PR body
16+
id: extract
17+
run: |
18+
echo "PR Body:"
19+
echo "${{ github.event.pull_request.body }}"
20+
21+
# extract "#숫자" 패턴만 추출
22+
ISSUES=$(echo "${{ github.event.pull_request.body }}" | grep -oE '#[0-9]+' | tr -d '#')
23+
24+
echo "ISSUES=$ISSUES" >> $GITHUB_ENV
25+
26+
- name: Close issues
27+
uses: peter-evans/close-issue@v3
28+
if: env.ISSUES != ''
29+
with:
30+
issue-number: ${{ env.ISSUES }}
31+
comment: "Automatically closed because the related PR was merged into dev."
32+
state: closed
33+
token: ${{ secrets.GITHUB_TOKEN }}

src/main/generated/.gitkeep

Whitespace-only changes.

src/main/java/back/kalender/KalenderApplication.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
import org.springframework.boot.SpringApplication;
44
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
import org.springframework.scheduling.annotation.EnableScheduling;
56

67
@SpringBootApplication
8+
@EnableScheduling
79
public class KalenderApplication {
810

911
public static void main(String[] args) {
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
package back.kalender.domain.artist.controller;
2+
3+
import back.kalender.domain.artist.dto.response.ArtistListResponse;
4+
import back.kalender.domain.artist.dto.response.ArtistResponse;
5+
import back.kalender.domain.artist.service.ArtistService;
6+
import back.kalender.global.exception.ErrorResponse;
7+
import io.swagger.v3.oas.annotations.Operation;
8+
import io.swagger.v3.oas.annotations.media.Content;
9+
import io.swagger.v3.oas.annotations.media.Schema;
10+
import io.swagger.v3.oas.annotations.responses.ApiResponse;
11+
import io.swagger.v3.oas.annotations.responses.ApiResponses;
12+
import io.swagger.v3.oas.annotations.tags.Tag;
13+
import lombok.RequiredArgsConstructor;
14+
import org.springframework.http.ResponseEntity;
15+
import org.springframework.web.bind.annotation.*;
16+
17+
import java.util.List;
18+
19+
@Tag(name = "Artist", description = "아티스트 조회 및 팔로우 관련 API")
20+
@RestController
21+
@RequestMapping("api/v1/artist")
22+
@RequiredArgsConstructor
23+
public class ArtistController {
24+
25+
private final ArtistService artistService;
26+
27+
@Operation(summary = "전체 아티스트 조회", description = "등록된 전체 아티스트 목록을 조회합니다.")
28+
@ApiResponses({
29+
@ApiResponse(responseCode = "200", description = "조회 성공",
30+
content = @Content(schema = @Schema(implementation = ArtistListResponse.class)))
31+
})
32+
@GetMapping
33+
public ResponseEntity<ArtistListResponse> getAllArtists() {
34+
List<ArtistResponse> artistResponses = artistService.getAllArtists();
35+
return ResponseEntity.ok(new ArtistListResponse(artistResponses));
36+
}
37+
38+
@Operation(summary = "팔로우한 아티스트 조회", description = "사용자가 팔로우한 아티스트 목록을 조회합니다.")
39+
@ApiResponses({
40+
@ApiResponse(responseCode = "200", description = "조회 성공",
41+
content = @Content(schema = @Schema(implementation = ArtistListResponse.class)))
42+
})
43+
@GetMapping("/following")
44+
public ResponseEntity<ArtistListResponse> getFollowingArtists() {
45+
Long userId = 1L;
46+
List<ArtistResponse> followedArtistResponses = artistService.getAllFollowedArtists(userId);
47+
return ResponseEntity.ok(new ArtistListResponse(followedArtistResponses));
48+
}
49+
50+
@Operation(summary = "아티스트 팔로우", description = "사용자가 특정 아티스트를 팔로우합니다.")
51+
@ApiResponses({
52+
@ApiResponse(responseCode = "200", description = "팔로우 성공"),
53+
@ApiResponse(responseCode = "404", description = "아티스트를 찾을 수 없음",
54+
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
55+
@ApiResponse(responseCode = "409", description = "이미 팔로우 중",
56+
content = @Content(schema = @Schema(implementation = ErrorResponse.class)))
57+
})
58+
@PostMapping("/{artistId}/follow")
59+
public ResponseEntity<Void> followArtist(
60+
@PathVariable Long artistId) {
61+
Long userId = 1L;
62+
artistService.followArtist(userId,artistId);
63+
return ResponseEntity.ok().build();
64+
}
65+
66+
@Operation(summary = "아티스트 언팔로우", description = "사용자가 특정 아티스트 팔로우를 취소합니다.")
67+
@ApiResponses({
68+
@ApiResponse(responseCode = "204", description = "언팔로우 성공"),
69+
@ApiResponse(responseCode = "400", description = "팔로우 상태가 아님",
70+
content = @Content(schema = @Schema(implementation = ErrorResponse.class)))
71+
})
72+
@DeleteMapping("/{artistId}/unfollow")
73+
public ResponseEntity<Void> unfollowArtist(
74+
@PathVariable Long artistId) {
75+
Long userId = 1L;
76+
artistService.unfollowArtist(userId,artistId);
77+
return ResponseEntity.noContent().build();
78+
}
79+
80+
}

src/main/java/back/kalender/domain/artist/dto/request/.gitkeep

Whitespace-only changes.

src/main/java/back/kalender/domain/artist/dto/response/.gitkeep

Whitespace-only changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package back.kalender.domain.artist.dto.response;
2+
3+
import java.util.List;
4+
5+
public record ArtistListResponse(
6+
List<ArtistResponse> artists
7+
) {}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package back.kalender.domain.artist.dto.response;
2+
3+
import back.kalender.domain.artist.entity.Artist;
4+
5+
public record ArtistResponse(
6+
Long artistId,
7+
String name,
8+
String imageUrl
9+
) {
10+
public static ArtistResponse from(Artist artist) {
11+
return new ArtistResponse(artist.getId(), artist.getName(), artist.getImageUrl());
12+
}
13+
14+
}

src/main/java/back/kalender/domain/artist/entity/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)