-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[Add] 관심 아티스트/포트폴리오 추가
- Loading branch information
Showing
58 changed files
with
1,541 additions
and
0 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
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
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,40 @@ | ||
package umc.meme.shop.config; | ||
|
||
import io.swagger.v3.oas.models.Components; | ||
import io.swagger.v3.oas.models.OpenAPI; | ||
import io.swagger.v3.oas.models.info.Info; | ||
import io.swagger.v3.oas.models.security.SecurityRequirement; | ||
import io.swagger.v3.oas.models.security.SecurityScheme; | ||
import io.swagger.v3.oas.models.servers.Server; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class SwaggerConfig { | ||
// http://localhost:8080/swagger-ui/index.html#/ | ||
@Bean | ||
public OpenAPI MemeAPI() { | ||
Info info = new Info() | ||
.title("MEME_SERVICE API Docs") | ||
.description("MEME_SERVICE API 명세서입니다.") | ||
.version("1.0.0"); | ||
|
||
String jwtSchemeName = "accessToken"; | ||
// API 요청헤더에 인증정보 포함 | ||
SecurityRequirement securityRequirement = new SecurityRequirement().addList(jwtSchemeName); | ||
|
||
// SecuritySchemes 등록 | ||
Components components = new Components() | ||
.addSecuritySchemes(jwtSchemeName, new SecurityScheme() | ||
.name(jwtSchemeName) | ||
.type(SecurityScheme.Type.HTTP) // HTTP 방식 | ||
.scheme("bearer") | ||
.bearerFormat("JWT")); | ||
|
||
return new OpenAPI() | ||
.addServersItem(new Server().url("/")) | ||
.info(info) | ||
.addSecurityItem(securityRequirement) | ||
.components(components); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/umc/meme/shop/domain/artist/controller/ArtistController.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,30 @@ | ||
package umc.meme.shop.domain.artist.controller; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.web.bind.annotation.*; | ||
import umc.meme.shop.domain.artist.dto.request.ArtistProfileDto; | ||
import umc.meme.shop.domain.review.dto.request.UpdateReviewDto; | ||
import umc.meme.shop.domain.artist.service.ArtistService; | ||
import umc.meme.shop.global.SuccessStatus; | ||
import umc.meme.shop.global.response.ApiResponse; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/api/v1") | ||
public class ArtistController { | ||
private final ArtistService artistService; | ||
|
||
@Operation(summary = "아티스트 프로필 관리") | ||
@PatchMapping("/mypage/{userId}/profile/artist") | ||
public ApiResponse updateProfile(@PathVariable Long userId, @RequestBody ArtistProfileDto profileDto){ | ||
return ApiResponse.SuccessResponse(SuccessStatus.PROFILE_UPDATE); | ||
} | ||
|
||
@Operation(summary = "리뷰 관리", description = "block 상태를 통해 리뷰 공개 유무를 결정할 수 있는 API입니다.") | ||
@PatchMapping("/artist/review") | ||
public ApiResponse updateReview(@RequestBody UpdateReviewDto reviewDto){ | ||
return ApiResponse.SuccessResponse(SuccessStatus.REVIEW_UPDATE); | ||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/umc/meme/shop/domain/artist/dto/request/ArtistProfileDto.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,26 @@ | ||
package umc.meme.shop.domain.artist.dto.request; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import umc.meme.shop.domain.artist.entity.enums.AvailableTime; | ||
import umc.meme.shop.domain.artist.entity.enums.Gender; | ||
import umc.meme.shop.domain.artist.entity.enums.MakeupLocation; | ||
import umc.meme.shop.domain.artist.entity.enums.Region; | ||
import umc.meme.shop.domain.portfolio.entity.enums.Category; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ArtistProfileDto { | ||
private String profileImg; | ||
private String nickname; | ||
private Gender gender; | ||
private String introduction; | ||
private List<Region> region; | ||
private List<Category> specialization; | ||
private MakeupLocation makeupLocation; | ||
private AvailableTime availableTime; | ||
} |
84 changes: 84 additions & 0 deletions
84
src/main/java/umc/meme/shop/domain/artist/dto/response/ArtistDto.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,84 @@ | ||
package umc.meme.shop.domain.artist.dto.response; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import umc.meme.shop.domain.artist.entity.Artist; | ||
import umc.meme.shop.domain.artist.entity.enums.*; | ||
import umc.meme.shop.domain.favorite.entity.FavoriteArtist; | ||
import umc.meme.shop.domain.portfolio.dto.response.PortfolioDto; | ||
import umc.meme.shop.domain.portfolio.entity.enums.Category; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
@Getter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ArtistDto { | ||
private Long artistId; | ||
|
||
private Gender gender; | ||
|
||
private String nickname; | ||
|
||
private String profileImg; | ||
|
||
private String introduction; | ||
|
||
private WorkExperience workExperience; | ||
|
||
private List<Region> region; | ||
|
||
private List<Category> specialization; | ||
|
||
private MakeupLocation makeupLocation; | ||
|
||
private List<PortfolioDto> portfolioDtoList; | ||
|
||
public static ArtistDto from(Artist artist){ | ||
List<PortfolioDto> portfolioDtoList = artist.getPortfolioList() | ||
.stream() | ||
.map(PortfolioDto::from) | ||
.toList(); | ||
|
||
return ArtistDto.builder() | ||
.gender(artist.getGender()) | ||
.nickname(artist.getNickname()) | ||
.profileImg(artist.getProfileImg()) | ||
.introduction(artist.getIntroduction()) | ||
.workExperience(artist.getWorkExperience()) | ||
.region(artist.getRegion()) | ||
.specialization(artist.getSpecialization()) | ||
.makeupLocation(artist.getMakeupLocation()) | ||
.portfolioDtoList(portfolioDtoList) | ||
.build(); | ||
} | ||
|
||
//관심 아티스트 | ||
public static ArtistDto from(FavoriteArtist favoriteArtist){ | ||
Artist artist = favoriteArtist.getArtist(); | ||
List<PortfolioDto> portfolioDtoList = artist.getPortfolioList() | ||
.stream() | ||
.map(PortfolioDto::from) | ||
.toList(); | ||
|
||
return ArtistDto.builder() | ||
.gender(artist.getGender()) | ||
.nickname(artist.getNickname()) | ||
.profileImg(artist.getProfileImg()) | ||
.introduction(artist.getIntroduction()) | ||
.workExperience(artist.getWorkExperience()) | ||
.region(artist.getRegion()) | ||
.specialization(artist.getSpecialization()) | ||
.makeupLocation(artist.getMakeupLocation()) | ||
.portfolioDtoList(portfolioDtoList) | ||
.build(); | ||
} | ||
|
||
} | ||
|
||
|
73 changes: 73 additions & 0 deletions
73
src/main/java/umc/meme/shop/domain/artist/entity/Artist.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,73 @@ | ||
package umc.meme.shop.domain.artist.entity; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import umc.meme.shop.domain.artist.entity.enums.*; | ||
import umc.meme.shop.domain.portfolio.entity.Portfolio; | ||
import umc.meme.shop.domain.portfolio.entity.enums.Category; | ||
|
||
import java.util.Date; | ||
import java.util.List; | ||
|
||
@Builder | ||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Entity | ||
public class Artist { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "artist_id") | ||
private Long artistId; | ||
|
||
@Column(nullable = false, length = 20) | ||
private String name; | ||
|
||
@Enumerated(EnumType.STRING) | ||
@Column(nullable = false) | ||
private Gender gender; | ||
|
||
@Column(nullable = false, length = 40) | ||
private String email; | ||
|
||
@Column(nullable = false, length = 40) | ||
private String nickname; | ||
|
||
@Column(nullable = false) | ||
private String profileImg; | ||
|
||
@Column(nullable = false, length = 500) | ||
private String introduction = "안녕하세요! 저는 ___입니다!"; | ||
|
||
@Enumerated(EnumType.STRING) | ||
@Column(nullable = false) | ||
private WorkExperience workExperience; | ||
|
||
@Enumerated(EnumType.STRING) | ||
// @Column(nullable = false) | ||
private List<Region> region; | ||
|
||
@Enumerated(EnumType.STRING) | ||
// @Column(nullable = false) | ||
private List<Category> specialization; | ||
|
||
@Enumerated(EnumType.STRING) | ||
@Column(nullable = false) | ||
private MakeupLocation makeupLocation; | ||
|
||
@Column(nullable = true) | ||
private String shopLocation; //샵의 위치 | ||
|
||
@Column(nullable = true) | ||
private Date inactiveDate; | ||
|
||
@Enumerated(EnumType.STRING) | ||
@Column(nullable = true) | ||
private AvailableTime availableTime; | ||
|
||
@OneToMany(cascade = CascadeType.ALL, mappedBy = "artist") | ||
private List<Portfolio> portfolioList; | ||
} |
5 changes: 5 additions & 0 deletions
5
src/main/java/umc/meme/shop/domain/artist/entity/enums/AvailableTime.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,5 @@ | ||
package umc.meme.shop.domain.artist.entity.enums; | ||
|
||
public enum AvailableTime { | ||
MON, TUE, WED, THU, FRI, SAT, SUN | ||
} |
5 changes: 5 additions & 0 deletions
5
src/main/java/umc/meme/shop/domain/artist/entity/enums/Gender.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,5 @@ | ||
package umc.meme.shop.domain.artist.entity.enums; | ||
|
||
public enum Gender { | ||
MALE, FEMALE | ||
} |
5 changes: 5 additions & 0 deletions
5
src/main/java/umc/meme/shop/domain/artist/entity/enums/MakeupLocation.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,5 @@ | ||
package umc.meme.shop.domain.artist.entity.enums; | ||
|
||
public enum MakeupLocation { | ||
SHOP, VISIT, BOTH | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/umc/meme/shop/domain/artist/entity/enums/Region.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,8 @@ | ||
package umc.meme.shop.domain.artist.entity.enums; | ||
|
||
public enum Region { | ||
JONGNO, JUNG, YONGSAN, SEONGDONG, GWANGJIN, DONGDAEMUN, | ||
JUNGNANG, SEONGBUK, GANGBUK, DOBONG, NOWON, EUNPYEONG, | ||
SEODAEMUN, MAPO, YANGCHEON, GANGSEO, GURO, GEUMCHEON, | ||
YEONGDEUNGPO, DONGJAK, GWANAK, SEOCHO, GANGNAM, SONGPA, GANGDONG | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/umc/meme/shop/domain/artist/entity/enums/WorkExperience.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,7 @@ | ||
package umc.meme.shop.domain.artist.entity.enums; | ||
|
||
public enum WorkExperience { | ||
ONE, TWO, THREE, FOUR, | ||
FIVE, SIX, SEVEN, EIGHT, | ||
NINE, TEN | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/umc/meme/shop/domain/artist/repository/ArtistRepository.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,7 @@ | ||
package umc.meme.shop.domain.artist.repository; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import umc.meme.shop.domain.artist.entity.Artist; | ||
|
||
public interface ArtistRepository extends JpaRepository<Artist, Long> { | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/umc/meme/shop/domain/artist/service/ArtistService.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,15 @@ | ||
package umc.meme.shop.domain.artist.service; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import umc.meme.shop.domain.artist.repository.ArtistRepository; | ||
import umc.meme.shop.domain.reservation.repository.ReservationRepository; | ||
|
||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class ArtistService { | ||
private final ArtistRepository artistRepository; | ||
private final ReservationRepository reservationRepository; | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/umc/meme/shop/domain/favorite/entity/FavoriteArtist.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,29 @@ | ||
package umc.meme.shop.domain.favorite.entity; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import umc.meme.shop.domain.artist.entity.Artist; | ||
import umc.meme.shop.domain.model.entity.Model; | ||
|
||
@Builder | ||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Entity | ||
public class FavoriteArtist { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long favoriteArtistId; | ||
|
||
@ManyToOne | ||
@JoinColumn(name="model_id", nullable = false) | ||
private Model model; | ||
|
||
@ManyToOne | ||
@JoinColumn(name="artist_id", nullable = false) | ||
private Artist artist; | ||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/umc/meme/shop/domain/favorite/entity/FavoritePortfolio.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,29 @@ | ||
package umc.meme.shop.domain.favorite.entity; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import umc.meme.shop.domain.model.entity.Model; | ||
import umc.meme.shop.domain.portfolio.entity.Portfolio; | ||
|
||
@Builder | ||
@Getter | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Entity | ||
public class FavoritePortfolio { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long favoritePortfolioId; | ||
|
||
@ManyToOne | ||
@JoinColumn(name="model_id", nullable = false) | ||
private Model model; | ||
|
||
@ManyToOne | ||
@JoinColumn(name="portfolio_id", nullable = false) | ||
private Portfolio portfolio; | ||
} |
Oops, something went wrong.