Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update :: self-study time #383

Merged
merged 8 commits into from
Jul 20, 2024
Merged

update :: self-study time #383

merged 8 commits into from
Jul 20, 2024

Conversation

m2ri1
Copy link
Contributor

@m2ri1 m2ri1 commented Jul 15, 2024

๐Ÿ’ก ๊ฐœ์š”
profile์ด dev์ผ ๋•Œ ์ž์Šต์‹ ์ฒญ์ด "00:00-23:59"์‹œ์— ๋ชจ๋‘ ๊ฐ€๋Šฅํ•˜๋„๋ก ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค.

๐Ÿ“ƒ ์ž‘์—…๋‚ด์šฉ
ValidDayOfWeekAndHourUtil ์—์„œ selfStudyProperties๊ฐ’์— ๋”ฐ๋ผ ์ž์Šต์‹ ์ฒญ์„ ๋‹ค๋ฅด๊ฒŒ ์ œํ•œํ•˜๋„๋ก ์ž‘์—…ํ•˜์˜€์Šต๋‹ˆ๋‹ค

๐Ÿ”€ ๋ณ€๊ฒฝ์‚ฌํ•ญ
application-dev.yml, application-prod.yml์— self-study allowedTime ์„ค์ •์„ ์ถ”๊ฐ€ํ•˜์˜€์Šต๋‹ˆ๋‹ค

Comment on lines 28 to 31
val allowedTime = selfStudyProperties.allowedTime ?: throw BasicException(ErrorCode.BAD_REQUEST);
val allowedStartTime = LocalTime.parse(allowedTime.split("-")[0])
val allowedEndTime = LocalTime.parse(allowedTime.split("-")[1])

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ด๊ฑฐ split("-") ๋‘๋ฒˆ์ด๋‚˜ ํ˜ธ์ถœํ•ด์„œ ์“ฐ๋Š”๊ฒƒ ๊ฐ™์€๋ฐ split("-")์œผ๋กœ ๋ฐ˜ํ™˜๋œ ๊ฒฐ๊ณผ๋ฅผ ๋ณ€์ˆ˜๋กœ ๋‹ด์•„๋‘๊ณ  [0] [1] ์ฐธ์กฐํ•ด์„œ ์“ฐ๋Š”๊ฒŒ ๋” ๋‚˜์•„๋ณด์—ฌ์š” ๊ทธ๋ƒฅ allowedTime์„ String[] ๋ณ€์ˆ˜๋กœ ๋‹ด์•„๋‘๊ณ  ์“ฐ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validateCancel ๋ถ€๋ถ„๋„ ๋งˆ์ฐฌ๊ฐ€์ง€๊ตฌ์š”!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋ฆฌ๋ทฐ ๊ฐ์‚ฌ๋“œ๋ฆฝ๋‹ˆ๋‹ค
properties์—์„œ allowedStartTime, allowedEndTime ๋‘ ๊ฐ’์„ ๋ฐ›๋„๋ก ๋กœ์ง ์ˆ˜์ •ํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค

@Configuration
@ConfigurationProperties(prefix = "self-study")
class SelfStudyProperties {
var allowedTime: String? = null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๊ธฐ๋ณธ๊ฐ’์„ null๋กœ ์ดˆ๊ธฐํ™”ํ•˜๊ธฐ๋ณด๋‹ค๋Š” ๊ทธ๋ƒฅ prod ํ™˜๊ฒฝ์—์„œ์˜ ๊ธฐ๋ณธ ๊ฐ’์œผ๋กœ (8~9์‹œ ์‚ฌ์ด) ๋‘๋Š”๊ฒŒ ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”. ์•„๋‹ˆ๋ฉด ๊ทธ๋ƒฅ ์•„์˜ˆ ๊ธฐ๋ณธ๊ฐ’์„ ๋‘์ง€ ๋ง๊ฑฐ๋‚˜?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allowedTime์„ ์ฐจ๋ผ๋ฆฌ ํ•˜๋‚˜๋งŒ ๋ฐ›์•„์„œ splitํ•˜์ง€๋ง๊ณ  properties ์ž์ฒด์—์„œ allowedStartTime, allowedEndTime ๋‘๊ฐœ๋ฅผ ๋ฐ›์•„์„œ ์จ๋„ ๋  ๊ฒƒ ๊ฐ™์•„์š” ๊ทธ๋Ÿฌ๋ฉด #383 (comment) ์ด ๋ฆฌ๋ทฐ๋„ ํ•ด๊ฒฐ๊ฐ€๋Šฅํ•  ๊ฒƒ ๊ฐ™์•„์š”!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1630ed9
properties์—์„œ allowedStartTime, allowedEndTime์„ ๋ฐ›์•„ ์‹ ์ฒญ ํ—ˆ์šฉ์‹œ๊ฐ„์„ ์ œํ•œํ•˜๋„๋ก ๋กœ์ง ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์•„์ง๋„ null๋กœ ๊ธฐ๋ณธ๊ฐ’์„ ๋„ฃ์–ด๋†“๊ณ ์žˆ๋Š”๋ฐ์š”? ์ˆ˜์ • ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.

Copy link
Contributor

@esperar esperar Jul 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Configuration
@ConfigurationProperties(prefix = "self-study")
class SelfStudyProperties(
  val allowedStartTime,
  val allowedEndTime
)

์ด๋Ÿฐ์‹์œผ๋กœ์š”

Copy link
Contributor Author

@m2ri1 m2ri1 Jul 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

04b821c
prod ํ™˜๊ฒฝ์—์„œ์˜ ๊ธฐ๋ณธ๊ฐ’์œผ๋กœ ์ดˆ๊ธฐํ™”ํ•˜๊ณ , dev ํ™˜๊ฒฝ์—์„œ๋Š” ๊ฐ’์„ ์˜ค๋ฒ„๋ผ์ด๋“œ ํ•  ์ˆ˜ ์žˆ๋„๋ก ์ˆ˜์ •ํ•˜์˜€์Šต๋‹ˆ๋‹ค

Comment on lines 37 to 38
val currentTime = currentTime ?: LocalDateTime.now()
val dayOfWeek = currentTime.dayOfWeek
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currentTime ๊ทธ๋ƒฅ ํด๋ž˜์Šค ์ƒ์„ฑ์ž๋กœ ๋ฐ›์ง€ ๋ง๊ณ  ์—†์• ๋ฒ„๋ฆฌ๊ณ  validate ํ•จ์ˆ˜ ํ˜ธ์ถœ๋˜๋Š” ์‹œ์ ์— now๋ฅผ ํ˜ธ์ถœํ•˜๋Š”๊ฒŒ ์ข‹์•„๋ณด์ด๋Š”๋ฐ ์–ด๋–ป๊ฒŒ ์ƒ๊ฐํ•˜์‹œ๋‚˜์š”?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

876ccd7
๋ฆฌ๋ทฐ ๋ฐ˜์˜ํ•ด์„œ ๋”์šฑ ๊ฐœ์„ ์‹œ์ผœ ๋ณด์•˜์Šต๋‹ˆ๋‹ค! ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค

@m2ri1 m2ri1 merged commit 72cf03a into develop Jul 20, 2024
1 check passed
@m2ri1 m2ri1 deleted the feat/selfstudy-timeset branch July 20, 2024 09:48
@m2ri1 m2ri1 restored the feat/selfstudy-timeset branch July 23, 2024 11:31
@m2ri1 m2ri1 deleted the feat/selfstudy-timeset branch August 8, 2024 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants