๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ199

[์˜ค๋ฅ˜] Transactional์˜ ๋ฒ”์œ„์—์„œ ๋ฒ—์–ด๋‚˜ dirty checking์ด ๋˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ ๋ฌธ์ œ ์ƒํ™ฉ plannerMapper ์•ˆ์˜ ๋””๋ฒ„๊ทธ๋ฌธ๋“ค์€ ๋ชจ๋‘ ์ˆ˜ํ–‰๋˜๋‚˜ pUsers.updateNickname()์ด ์‹คํ–‰๋˜์ง€ ์•Š์Œ ๋˜ํ•œ insert query๊ฐ€ ๋‚˜๊ฐ€๋‚˜ db์— ๋ฐ˜์˜๋˜์ง€ ์•Š์œผ๋ฉฐ, plannerRepository.save()๊ฐ€ ์‹คํ–‰๋˜์ง€ ์•Š์Œ UserService @Transactional public void signupPlanner(Users users, PlannerSignupReqDto reqDto) { Users pUsers = findUserByEmail(users.getEmail()); pUsers.updateNickname(reqDto.getNickname()); Planner planner = plannerMapper.toEntity(pUsers, reqDto); plannerRe.. 2023. 8. 13.
[์ง€์‹] ๋ฉ”์„œ๋“œ ์ฐธ์กฐ์™€ ์ƒ์„ฑ์ž ์ฐธ์กฐ @Transactional(readOnly = true) public void checkUserIsRegistered(Users users) { if (hasPlanner(users)) throw new PlannerDuplicateRegistrationException(); if (hasCustomer(users)) throw new CustomerDuplicateRegistrationException(); } PlannerDuplicateRegistrationException::new์™€ ๊ฐ™์ด ๋ฉ”์„œ๋“œ ์ฐธ์กฐ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ๋Š” ๋‹ค๋ฅธ ๋ฉ”์„œ๋“œ๋กœ ๋žŒ๋‹ค์‹์„ ์ „๋‹ฌํ•˜๊ฑฐ๋‚˜ ์ธํ„ฐํŽ˜์ด์Šค๋กœ์˜ ๋ณ€ํ™˜์„ ํ•  ๋•Œ ๋“ฑ์— ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ์ƒ์„ฑ์ž๋ฅผ ํ˜ธ์ถœํ•˜๋Š” ๊ฒฝ์šฐ์—๋Š” ์ƒ์„ฑ์ž ์•ž์— ํด๋ž˜์Šค ์ด๋ฆ„์„ ๋ช…์‹œํ•˜์—ฌ ์‚ฌ์šฉํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. 2023. 7. 28.
[์˜ค๋ฅ˜] ์ƒ์† ๊ด€๊ณ„์˜ Entity์— @Builder ์ ์šฉ ์‹œ ์ด์Šˆ ๋ฌธ์ œ ์ƒํ™ฉ Planner๊ฐ€ User๋ฅผ ์ƒ์†๋ฐ›๊ณ  ์žˆ๊ณ , ๋‘˜ ๋‹ค์—๊ฒŒ @Builder๋ฅผ ์„ ์–ธํ•œ ์ƒํ™ฉ @SuppressWarnings("checkstyle:RegexpMultiline") @NoArgsConstructor @Getter @Entity public class Users extends BaseTimeEntity { ... @Builder public Users(String email, String nickname, String imageUrl, AuthProvider authProvider, String authProviderId) { this.email = email; this.nickname = nickname; this.imageUrl = imageUrl; this.authProvider = .. 2023. 7. 26.
[AWS S3] ๋ฒ„ํ‚ท ์ƒ์„ฑํ•˜๊ธฐ OAuth2 ์ ์šฉ์ด ๋”œ๋ ˆ์ด ๋ผ์„œ aws ์„ค์ •์ด๋ผ๋„ ํ•˜๊ธฐ... 1. ๋ฒ„ํ‚ท ์ƒ์„ฑํ•˜๊ธฐ ์‚ฌ์šฉ์ž๋“ค์ด ์‚ฌ์ง„ ์—…๋กœ๋“œ/๋‹ค์šด๋กœ๋“œํ•  ์ˆ˜ ์žˆ์–ด์•ผ ํ•˜๊ธฐ ๋•Œ๋ฌธ์— public์œผ๋กœ ๋Œ๋ฆฌ๊ธฐ ๋ฒ„ํ‚ท ๋ฒ„์ „ ๊ด€๋ฆฌ๋ž‘ ๊ธฐ๋ณธ ์•”ํ˜ธํ™”๋Š” ์ผ๋‹จ ๋น„ํ™œ์„ฑํ™”๋กœ ์„ค์ •ํ–ˆ๋‹ค. 1. public access ์„ค์ • ์•„์ง public access๋Š” ๋ถˆ๊ฐ€๋Šฅํ•˜๊ธฐ ๋•Œ๋ฌธ์— policy๋ฅผ ๋งŒ๋“ค์–ด ์ ์šฉํ•ด์•ผ ํ•œ๋‹ค. ๋ฒ„ํ‚ท > ๊ถŒํ•œ > ๋ฒ„ํ‚ท ์ •์ฑ… > ์ •์ฑ… ์ƒ์„ฑ๊ธฐ๋กœ ๋“ค์–ด๊ฐ€ ์„ค์ •ํ•ด์•ผ ํ•œ๋‹ค. https://awspolicygen.s3.amazonaws.com/policygen.html - effet : ์ ‘๊ทผํ•˜๋Š” ์‚ฌ๋žŒ์„ ์„ ํƒํ•  ๊ฒƒ์ธ๊ฐ€ - principal : ์ ‘๊ทผํ•˜๋Š” ์‚ฌ๋žŒ ์„ ํƒ - actions : getObject, putObject, deleteObject (์„œ๋น„์Šค์— ๋งž๊ฒŒ ์„ค์ •) - .. 2023. 7. 13.