Skip to content

Commit

Permalink
S: Add NeisProperties, I: Add Sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
hhhello0507 committed Oct 3, 2024
1 parent b8fd990 commit 8ff4022
Show file tree
Hide file tree
Showing 15 changed files with 182 additions and 66 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package com.bestswlkh0310.graduating.graduatingserver.global.config

import com.bestswlkh0310.graduating.graduatingserver.global.exception.ErrorResponseSender
import com.bestswlkh0310.graduating.graduatingserver.global.exception.HttpExceptionFilter
import com.bestswlkh0310.graduating.graduatingserver.global.jwt.JwtAuthenticationFilter
import com.bestswlkh0310.graduating.graduatingserver.global.jwt.JwtExceptionFilter
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.http.HttpStatus
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.bestswlkh0310.graduating.graduatingserver.global.config
package com.bestswlkh0310.graduating.graduatingserver.global.jwt

import com.bestswlkh0310.graduating.graduatingserver.global.TokenExtractor
import com.bestswlkh0310.graduating.graduatingserver.infra.token.JwtClient
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.bestswlkh0310.graduating.graduatingserver.global.config
package com.bestswlkh0310.graduating.graduatingserver.global.jwt

import com.bestswlkh0310.graduating.graduatingserver.global.exception.CustomException
import com.bestswlkh0310.graduating.graduatingserver.global.exception.ErrorResponseSender
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.bestswlkh0310.graduating.graduatingserver.global.config
package com.bestswlkh0310.graduating.graduatingserver.global.jwt


import com.bestswlkh0310.graduating.graduatingserver.core.user.User
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.bestswlkh0310.graduating.graduatingserver.global.config
package com.bestswlkh0310.graduating.graduatingserver.global.jwt

import com.bestswlkh0310.graduating.graduatingserver.core.user.UserRepository
import com.bestswlkh0310.graduating.graduatingserver.core.user.getByUsername
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.bestswlkh0310.graduating.graduatingserver.infra.neis

import com.bestswlkh0310.graduating.graduatingserver.common.parse
import com.bestswlkh0310.graduating.graduatingserver.global.config.Properties
import com.bestswlkh0310.graduating.graduatingserver.core.meal.MealEntity
import com.bestswlkh0310.graduating.graduatingserver.core.school.SchoolEntity
import com.bestswlkh0310.graduating.graduatingserver.core.meal.MealRepository
Expand All @@ -14,7 +13,7 @@ import java.time.LocalDateTime
@Component
class NeisMealHelper(
private val schoolRepository: SchoolRepository,
private val properties: Properties,
private val neisProperties: NeisProperties,
private val mealRepository: MealRepository,
@Qualifier("neis")
private val restClient: RestClient
Expand All @@ -28,7 +27,7 @@ class NeisMealHelper(
.uri { uriBuilder ->
uriBuilder
.path("hub/mealServiceDietInfo")
.queryParam("KEY", properties.neisApiKey)
.queryParam("KEY", neisProperties.apiKey)
.queryParam("Type", "json")
.queryParam("ATPT_OFCDC_SC_CODE", school.officeCode)
.queryParam("SD_SCHUL_CODE", school.code)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.bestswlkh0310.graduating.graduatingserver.infra.neis

import org.springframework.boot.context.properties.ConfigurationProperties
import org.springframework.boot.context.properties.bind.ConstructorBinding

@ConfigurationProperties(prefix = "neis")
class NeisProperties @ConstructorBinding constructor(
val apiKey: String,
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.bestswlkh0310.graduating.graduatingserver.infra.neis

import com.bestswlkh0310.graduating.graduatingserver.global.config.Properties
import com.bestswlkh0310.graduating.graduatingserver.core.graduating.GraduatingEntity
import com.bestswlkh0310.graduating.graduatingserver.core.school.SchoolEntity
import com.bestswlkh0310.graduating.graduatingserver.core.school.SchoolType
Expand All @@ -24,13 +23,13 @@ class NeisScheduleHelper(
private val graduatingRepository: GraduatingRepository,
@Qualifier("neis")
private val restClient: RestClient,
private val properties: Properties
private val neisProperties: NeisProperties
) {

fun importCsv(filePath: String) {
val file = File(filePath)
val parser = CSVParser.parse(file, StandardCharsets.UTF_8, CSVFormat.DEFAULT.withFirstRecordAsHeader())

parser.mapNotNull { record ->
val v = record.toList()
try {
Expand Down Expand Up @@ -63,10 +62,10 @@ class NeisScheduleHelper(
val result = arrayListOf<GraduatingEntity>()
try {
val response = restClient.get()
.uri { uriBuilder ->
.uri { uriBuilder ->
uriBuilder
.path("hub/SchoolSchedule")
.queryParam("KEY", properties.neisApiKey)
.queryParam("KEY", neisProperties.apiKey)
.queryParam("Type", "json")
.queryParam("ATPT_OFCDC_SC_CODE", school.officeCode)
.queryParam("SD_SCHUL_CODE", school.code)
Expand All @@ -77,7 +76,7 @@ class NeisScheduleHelper(
.retrieve()
.toEntity(NeisSchedulesRes::class.java)
.body

var includeGraduating = false
response?.SchoolSchedule?.let { res ->
res.mapNotNull { it?.row }
Expand Down
25 changes: 25 additions & 0 deletions Graduating-iOS/Graduating.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
objects = {

/* Begin PBXBuildFile section */
25064D392CAEFEFF00181796 /* GoogleSignIn in Frameworks */ = {isa = PBXBuildFile; productRef = 25064D382CAEFEFF00181796 /* GoogleSignIn */; };
25064D3B2CAEFEFF00181796 /* GoogleSignInSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 25064D3A2CAEFEFF00181796 /* GoogleSignInSwift */; };
250EAE242C7DE05500D9FF5E /* CombineMoya in Frameworks */ = {isa = PBXBuildFile; productRef = 250EAE232C7DE05500D9FF5E /* CombineMoya */; };
250EAE262C7DE05500D9FF5E /* Moya in Frameworks */ = {isa = PBXBuildFile; productRef = 250EAE252C7DE05500D9FF5E /* Moya */; };
250FD0852C74AF100070503B /* CombineMoya in Frameworks */ = {isa = PBXBuildFile; productRef = 250FD0842C74AF100070503B /* CombineMoya */; };
Expand Down Expand Up @@ -176,7 +178,9 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
25064D3B2CAEFEFF00181796 /* GoogleSignInSwift in Frameworks */,
250FD0852C74AF100070503B /* CombineMoya in Frameworks */,
25064D392CAEFEFF00181796 /* GoogleSignIn in Frameworks */,
25C962D42C7B07C500EB872E /* libData.a in Frameworks */,
25C962D12C7B07C000EB872E /* libModel.a in Frameworks */,
253DC2B22C7EBEAC0047C401 /* MyDesignSystem in Frameworks */,
Expand Down Expand Up @@ -292,6 +296,8 @@
250FD0862C74AF100070503B /* Moya */,
25C4CCF42C74B30600DB83B3 /* Then */,
253DC2B12C7EBEAC0047C401 /* MyDesignSystem */,
25064D382CAEFEFF00181796 /* GoogleSignIn */,
25064D3A2CAEFEFF00181796 /* GoogleSignInSwift */,
);
productName = Graduating;
productReference = 2560F1732C746C16007009E2 /* Graduating.app */;
Expand Down Expand Up @@ -440,6 +446,7 @@
250FD0832C74AF100070503B /* XCRemoteSwiftPackageReference "Moya" */,
25C4CCF32C74B30600DB83B3 /* XCRemoteSwiftPackageReference "Then" */,
253DC2B02C7EBEAC0047C401 /* XCRemoteSwiftPackageReference "my-ios-kit" */,
25064D372CAEFEFF00181796 /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */,
);
productRefGroup = 2560F1742C746C16007009E2 /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -981,6 +988,14 @@
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
25064D372CAEFEFF00181796 /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/google/GoogleSignIn-iOS";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 8.0.0;
};
};
250FD0832C74AF100070503B /* XCRemoteSwiftPackageReference "Moya" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/Moya/Moya";
Expand Down Expand Up @@ -1016,6 +1031,16 @@
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
25064D382CAEFEFF00181796 /* GoogleSignIn */ = {
isa = XCSwiftPackageProductDependency;
package = 25064D372CAEFEFF00181796 /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */;
productName = GoogleSignIn;
};
25064D3A2CAEFEFF00181796 /* GoogleSignInSwift */ = {
isa = XCSwiftPackageProductDependency;
package = 25064D372CAEFEFF00181796 /* XCRemoteSwiftPackageReference "GoogleSignIn-iOS" */;
productName = GoogleSignInSwift;
};
250EAE232C7DE05500D9FF5E /* CombineMoya */ = {
isa = XCSwiftPackageProductDependency;
package = 250FD0832C74AF100070503B /* XCRemoteSwiftPackageReference "Moya" */;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"originHash" : "809835623b93457091506cc3575358d02b8eb0375bfc0e2b7f06996cf058430c",
"originHash" : "e3c1180a8e38a74c7306c05087a0cb19db9d112d93d960a6d4f87d4ab491fe93",
"pins" : [
{
"identity" : "alamofire",
Expand All @@ -10,6 +10,60 @@
"version" : "5.9.1"
}
},
{
"identity" : "app-check",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/app-check.git",
"state" : {
"revision" : "21fe1af9be463a359aaf8d96789ef73fc3760d09",
"version" : "11.0.1"
}
},
{
"identity" : "appauth-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/openid/AppAuth-iOS.git",
"state" : {
"revision" : "c89ed571ae140f8eb1142735e6e23d7bb8c34cb2",
"version" : "1.7.5"
}
},
{
"identity" : "googlesignin-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleSignIn-iOS",
"state" : {
"revision" : "65fb3f1aa6ffbfdc79c4e22178a55cd91561f5e9",
"version" : "8.0.0"
}
},
{
"identity" : "googleutilities",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleUtilities.git",
"state" : {
"revision" : "53156c7ec267db846e6b64c9f4c4e31ba4cf75eb",
"version" : "8.0.2"
}
},
{
"identity" : "gtm-session-fetcher",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/gtm-session-fetcher.git",
"state" : {
"revision" : "a2ab612cb980066ee56d90d60d8462992c07f24b",
"version" : "3.5.0"
}
},
{
"identity" : "gtmappauth",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GTMAppAuth.git",
"state" : {
"revision" : "5d7d66f647400952b1758b230e019b07c0b4b22a",
"version" : "4.1.1"
}
},
{
"identity" : "moya",
"kind" : "remoteSourceControl",
Expand Down Expand Up @@ -37,6 +91,15 @@
"version" : "12.3.0"
}
},
{
"identity" : "promises",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/promises.git",
"state" : {
"revision" : "540318ecedd63d883069ae7f1ed811a2df00b6ac",
"version" : "2.4.0"
}
},
{
"identity" : "reactiveswift",
"kind" : "remoteSourceControl",
Expand Down
24 changes: 21 additions & 3 deletions Graduating-iOS/Graduating/Feature/Main/Profile/ProfileView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ struct ProfileView: View {

@EnvironmentObject private var router: Router
@Environment(\.openURL) private var openURL
@State private var isSheetPresent: Bool = false

var body: some View {
MyTopAppBar.default(
Expand All @@ -14,9 +15,13 @@ struct ProfileView: View {
VStack(spacing: 0) {
VStack(spacing: 8) {
MyAvatar(nil, type: .larger)
Text("이름")
.foreground(Colors.Label.alternative)
.myFont(.bodyR)
Button {
isSheetPresent = true
} label: {
Text("로그인 하기")
.foreground(Colors.Label.alternative)
.myFont(.bodyR)
}
}
.padding(.top, 16)
HStack(spacing: 12) {
Expand Down Expand Up @@ -48,5 +53,18 @@ struct ProfileView: View {
.padding(insets)
// .background(Colors.Background.normal)
}
.sheet(isPresented: $isSheetPresent) {
VStack(spacing: 10) {
AppleSignInButton {

}
GoogleSignInButton {

}
}
.padding(20)
.background(Colors.Background.normal)
.adjustedHeightSheet()
}
}
}
Loading

0 comments on commit 8ff4022

Please sign in to comment.