-
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.
Browse files
Browse the repository at this point in the history
Feat/#42 backend swagger
- Loading branch information
Showing
56 changed files
with
1,006 additions
and
1,352 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
51 changes: 51 additions & 0 deletions
51
backend/core/src/main/java/com/rollthedice/backend/global/config/SwaggerConfig.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,51 @@ | ||
package com.rollthedice.backend.global.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; | ||
|
||
import java.util.List; | ||
|
||
@Configuration | ||
public class SwaggerConfig { | ||
private final String JWT = "JWT"; | ||
private final String BEARER = "Bearer"; | ||
|
||
@Bean | ||
public OpenAPI openAPI() { | ||
SecurityRequirement securityRequirement = new SecurityRequirement().addList(JWT); | ||
return new OpenAPI() | ||
.servers(getServers()) | ||
.info(getInfo()) | ||
.addSecurityItem(securityRequirement) | ||
.components(getComponents()); | ||
} | ||
|
||
private List<Server> getServers() { | ||
return List.of(new Server() | ||
.url("/api") | ||
.description("백엔드 api 서버") | ||
); | ||
} | ||
|
||
private Info getInfo() { | ||
return new Info() | ||
.title("Roll The Dice API") | ||
.description("요약된 뉴스를 AR로 재미있게 즐기는 서비스") | ||
.version("demo"); | ||
} | ||
|
||
private Components getComponents() { | ||
return new Components().addSecuritySchemes(JWT, new SecurityScheme() | ||
.name(JWT) | ||
.type(SecurityScheme.Type.HTTP) | ||
.scheme(BEARER) | ||
.bearerFormat(JWT) | ||
); | ||
} | ||
} |
301 changes: 159 additions & 142 deletions
301
iOS/RollTheDice/RollTheDice.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
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,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>UIAppFonts</key> | ||
<array> | ||
<string>Pretendard-Black.otf</string> | ||
<string>Pretendard-Bold.otf</string> | ||
<string>Pretendard-ExtraBold.otf</string> | ||
<string>Pretendard-ExtraLight.otf</string> | ||
<string>Pretendard-Light.otf</string> | ||
<string>Pretendard-Medium.otf</string> | ||
<string>Pretendard-Regular.otf</string> | ||
<string>Pretendard-SemiBold.otf</string> | ||
<string>Pretendard-Thin.otf</string> | ||
</array> | ||
</dict> | ||
</plist> |
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,34 @@ | ||
// | ||
// Font.swift | ||
// RollTheDice | ||
// | ||
// Created by Subeen on 3/14/24. | ||
// | ||
|
||
import SwiftUI | ||
|
||
extension Font { | ||
|
||
// Bold | ||
static let pretendardBold40: Font = .custom("Pretendard-Bold", size: 40) | ||
static let pretendardBold32: Font = .custom("Pretendard-Bold", size: 32) | ||
static let pretendardBold24: Font = .custom("Pretendard-Bold", size: 24) | ||
static let pretendardBold14: Font = .custom("Pretendard-Bold", size: 14) | ||
static let pretendardBold12: Font = .custom("Pretendard-Bold", size: 12) | ||
|
||
// Regular | ||
static let pretendardRegular20: Font = .custom("Pretendard-Regular", size: 20) | ||
static let pretendardRegular14: Font = .custom("Pretendard-Regular", size: 14) | ||
|
||
} | ||
|
||
|
||
/// 폰트가 추가되었는지 확인 | ||
func checkFontFile() { | ||
for fontFamily in UIFont.familyNames { | ||
for fontName in UIFont.fontNames(forFamilyName: fontFamily) { | ||
print(fontName) | ||
} | ||
} | ||
} | ||
|
Binary file added
BIN
+1.49 MB
iOS/RollTheDice/RollTheDice/Resources/Font/Pretendard/Pretendard-Black.otf
Binary file not shown.
Binary file added
BIN
+1.5 MB
iOS/RollTheDice/RollTheDice/Resources/Font/Pretendard/Pretendard-Bold.otf
Binary file not shown.
Binary file added
BIN
+1.5 MB
iOS/RollTheDice/RollTheDice/Resources/Font/Pretendard/Pretendard-ExtraBold.otf
Binary file not shown.
Binary file added
BIN
+1.47 MB
iOS/RollTheDice/RollTheDice/Resources/Font/Pretendard/Pretendard-ExtraLight.otf
Binary file not shown.
Binary file added
BIN
+1.53 MB
iOS/RollTheDice/RollTheDice/Resources/Font/Pretendard/Pretendard-Light.otf
Binary file not shown.
Binary file added
BIN
+1.51 MB
iOS/RollTheDice/RollTheDice/Resources/Font/Pretendard/Pretendard-Medium.otf
Binary file not shown.
Binary file added
BIN
+1.5 MB
iOS/RollTheDice/RollTheDice/Resources/Font/Pretendard/Pretendard-Regular.otf
Binary file not shown.
Binary file added
BIN
+1.51 MB
iOS/RollTheDice/RollTheDice/Resources/Font/Pretendard/Pretendard-SemiBold.otf
Binary file not shown.
Binary file added
BIN
+1.42 MB
iOS/RollTheDice/RollTheDice/Resources/Font/Pretendard/Pretendard-Thin.otf
Binary file not shown.
6 changes: 6 additions & 0 deletions
6
iOS/RollTheDice/RollTheDice/Resources/ImageAssets.xcassets/SignIn/Contents.json
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,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...ce/RollTheDice/Resources/ImageAssets.xcassets/SignIn/appleLoginBtn.imageset/Contents.json
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,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "appleLoginBtn.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+14.7 KB
...ollTheDice/Resources/ImageAssets.xcassets/SignIn/appleLoginBtn.imageset/appleLoginBtn.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
...ce/RollTheDice/Resources/ImageAssets.xcassets/SignIn/kakaoLoginBtn.imageset/Contents.json
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,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "kakaoLoginBtn.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+7.83 KB
...ollTheDice/Resources/ImageAssets.xcassets/SignIn/kakaoLoginBtn.imageset/kakaoLoginBtn.pdf
Binary file not shown.
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
85 changes: 85 additions & 0 deletions
85
iOS/RollTheDice/RollTheDice/Source/General/CustomNavigationBar/CustomNavigationBar.swift
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,85 @@ | ||
// | ||
// CustomNavigationBar.swift | ||
// DittoCommunity | ||
// | ||
// Created by Subeen on 2023/11/25. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct CustomNavigationBar: View { | ||
let title: String | ||
|
||
let isDisplayLeadingBtn: Bool | ||
let isDisplayTrailingBtn: Bool | ||
|
||
let leadingItems: [(Image, () -> Void)] | ||
let trailingItems: [(Image, () -> Void)] | ||
|
||
init( | ||
title: String = "", | ||
isDisplayLeadingBtn: Bool = true, | ||
isDisplayTrailingBtn: Bool = true, | ||
leadingItems: [(Image, () -> Void)] = [(Image("chevron.left"), {})], | ||
trailingItems: [(Image, () -> Void)] = [(Image("chevron.left"), {})] | ||
) { | ||
self.title = title | ||
self.isDisplayLeadingBtn = isDisplayLeadingBtn | ||
self.isDisplayTrailingBtn = isDisplayTrailingBtn | ||
self.leadingItems = leadingItems | ||
self.trailingItems = trailingItems | ||
} | ||
|
||
var body: some View { | ||
HStack(spacing: 0) { | ||
if isDisplayLeadingBtn { | ||
// ForEach(leadingItems, id:\.self) { item in | ||
// Button( | ||
// action: { | ||
// item.1() | ||
// }, | ||
// label: { | ||
// leadingItems[index].0 | ||
// .foregroundStyle(.basicWhite) | ||
// } | ||
// ) | ||
// } | ||
} | ||
|
||
Spacer() | ||
|
||
Text(title) | ||
.foregroundStyle(.basicWhite) | ||
|
||
Spacer() | ||
|
||
if isDisplayTrailingBtn { | ||
ForEach(trailingItems.indices) { index in | ||
Button( | ||
action: { | ||
trailingItems[index].1() | ||
}, | ||
label: { | ||
trailingItems[index].0 | ||
.foregroundStyle(.basicWhite) | ||
} | ||
) | ||
} | ||
} | ||
} | ||
.padding(.horizontal, 20) | ||
.frame(height: 44) | ||
} | ||
} | ||
|
||
struct IdentifiableImage: Identifiable { | ||
let id = UUID() | ||
let image: Image | ||
} | ||
|
||
struct CustomNavigationBar_Previews: PreviewProvider { | ||
static var previews: some View { | ||
CustomNavigationBar() | ||
.previewLayout(.sizeThatFits) | ||
} | ||
} |
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,16 @@ | ||
// | ||
// Path.swift | ||
// RollTheDice | ||
// | ||
// Created by Subeen on 3/10/24. | ||
// | ||
|
||
import Foundation | ||
|
||
class PathModel: ObservableObject { | ||
@Published var paths: [PathType] | ||
|
||
init(paths: [PathType] = []) { // 빈 배열로 초기화. 앱 실행시 특정 화면을 보여주고 싶다면 해당 뷰로 초기화할 것. | ||
self.paths = paths | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
iOS/RollTheDice/RollTheDice/Source/Model/Path/PathType.swift
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,12 @@ | ||
// | ||
// PathType.swift | ||
// RollTheDice | ||
// | ||
// Created by Subeen on 3/10/24. | ||
// | ||
|
||
import Foundation | ||
|
||
enum PathType: Hashable { | ||
case chatView(isAiMode: Bool) | ||
} |
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
Oops, something went wrong.