-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from Team-Walkie/mvc/seungmin
챌린지 api swagger에 적용
- Loading branch information
Showing
17 changed files
with
261 additions
and
36 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
28 changes: 28 additions & 0 deletions
28
src/main/java/com/whyranoid/walkie/domain/BadgeCollection.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,28 @@ | ||
package com.whyranoid.walkie.domain; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import javax.persistence.*; | ||
import javax.validation.constraints.NotNull; | ||
|
||
@Entity | ||
@Getter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class BadgeCollection { | ||
|
||
@Id | ||
@Column(name = "collection_id", nullable = false) | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long collectionId; | ||
|
||
@NotNull | ||
@Column(name = "user_id", nullable = false) | ||
private Long userId; | ||
|
||
@NotNull | ||
@Column(name = "badge_id", nullable = false) | ||
private Long badgeId; | ||
} |
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
25 changes: 25 additions & 0 deletions
25
src/main/java/com/whyranoid/walkie/dto/ChallengeDetailDto.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,25 @@ | ||
package com.whyranoid.walkie.dto; | ||
|
||
import com.whyranoid.walkie.domain.Walkie; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
public class ChallengeDetailDto { | ||
|
||
ChallengeDto challenge; | ||
|
||
List<Walkie> walkies; | ||
|
||
@Builder | ||
public ChallengeDetailDto(ChallengeDto challenge, List<Walkie> walkies) { | ||
this.challenge = challenge; | ||
this.walkies = walkies; | ||
} | ||
} |
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
3 changes: 3 additions & 0 deletions
3
src/main/java/com/whyranoid/walkie/dto/response/ApiResponse.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 |
---|---|---|
@@ -1,12 +1,15 @@ | ||
package com.whyranoid.walkie.dto.response; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@Builder | ||
public class ApiResponse { | ||
|
||
@Schema(example = "200") | ||
Integer status; | ||
@Schema(example = "성공!") | ||
String message; | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/com/whyranoid/walkie/dto/response/ChallengePreviewDto.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 com.whyranoid.walkie.dto.response; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.*; | ||
|
||
@Getter | ||
@Setter | ||
@Builder | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class ChallengePreviewDto { | ||
|
||
@Schema(example = "1") | ||
private Long challengeId; | ||
|
||
@Schema(example = "C") | ||
private Character category; | ||
|
||
@Schema(example = "햄버거 세트 불태우기") | ||
private String name; | ||
|
||
@Schema(example = "N") | ||
private Character status; | ||
|
||
@Schema(example = "0") | ||
private Integer progress; | ||
|
||
@Schema(example = "1") | ||
private Integer newFlag; | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/com/whyranoid/walkie/repository/BadgeRepository.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,22 @@ | ||
package com.whyranoid.walkie.repository; | ||
|
||
import com.whyranoid.walkie.domain.BadgeCollection; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Repository; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
import javax.persistence.EntityManager; | ||
import javax.persistence.PersistenceContext; | ||
|
||
@Repository | ||
@Transactional | ||
@RequiredArgsConstructor | ||
public class BadgeRepository { | ||
@PersistenceContext | ||
private final EntityManager em; | ||
|
||
public void insertBadgeCollection(BadgeCollection badgeCollection) { | ||
em.persist(badgeCollection); | ||
} | ||
|
||
} |
Oops, something went wrong.