-
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.
* Fix | CAKK-25 | Test method ์ ๊ทผ์ ํ์ ์์ * Test | CAKK-25 | ์ผ์ดํฌ ์ต ์ฃผ์ธ ์ธ์ฆ ์๋ฃ ์, ์ ์ฑ ๋๋ฉ์ธ์ผ๋ก ์บก์ํ ๋ฐ ํ ์คํธ * Feature | CAKK-25 | ์ธ์ฆ ์ํ ์ฌ๋ถ ํ๋๋ฅผ ์ํ Converter ์ถ๊ฐ * Fix | CAKK-25 | ๋ฉ์๋ ๋ค์ด๋ฐ ๋ณ๊ฒฝ * Test | CAKK-25 | ์ธ์ฆ ์ ์ฑ ํ ์คํธ ์ถ๊ฐ * Refactor | CAKK-25 | ์ฌ์ ์ ์ ๋ณด ์ผ์ดํฌ์ต ์ฃผ์ธ ์ ๋ฐ์ดํธ ๋ก์ง ๋ฆฌํฉํ ๋ง * Feature | CAKK-25 | ์ผ์ดํฌ์ต ์ฃผ์ธ ํ๋ณด ์ฌ๋ถ ์กฐํ ๋ก์ง ์ถ๊ฐ ๋ฐ ํ ์คํธ * Fix | CAKK-25 | ์ผ์ดํฌ์ต ์์ฑ์ ๋กฌ๋ณต ์ ๊ฑฐ * Fix | CAKK-25 | ์ด๋๋ฏผ API ๋ถ๋ฆฌ * Feature | CAKK-25 | ์ฌ์ฅ๋ ์ธ์ฆ ์์ฒญ ๋ฆฌ์คํธ ๋ชฉ๋ก ์ดํ๋ฆฌ์ผ์ด์ ๋ก์ง ์ถ๊ฐ * Test | CAKK-25| ์ฌ์ฅ๋ ์ธ์ฆ ์์ฒญ ๋ชฉ๋ก ํตํฉ ํ ์คํธ ์ถ๊ฐ * Refactor | CAKK-25 | checkstyle ๋ฐ์ * Test | CAKK-25 | ๋น ์ก๋ ํ ์คํธ ์ถ๊ฐ ๋ฐ build ๋ฌธ์ ํด๊ฒฐ * Fix | CAKK-25 | ์ธ์ฆ ์ ์ฑ ์์ง๋๋ฅผ ์ํ ํจํค์ง ์์ * Fix | CAKK-25 | ์์ฒญ ๋ฐ์ดํฐ์ ๋ฐ๋ฅธ response ์์ * Fix | CAKK-25 | ์ฝ๋ ๋ฆฌ๋ทฐ ๋ฐ์ * Fix | CAKK-26 | dto ๋ค์ด๋ฐ ์์ * Feature | CAKK-26 | ์ธ์ฆ ์์ฒญ ์์ธ ๋ด์ฉ ์กฐํ ์ ํ๋ฆฌ์ผ์ด์ ๋ก์ง ์ถ๊ฐ * Feature | CAKK-26 | ์์ธ์กฐํ๋ฅผ ์ํ ์ฟผ๋ฆฌ ์ถ๊ฐ * Test | CAKK-26 | ์ธ์ฆ ์์ฒญ ์์ธ ๋ด์ฉ ํตํฉ ํ ์คํธ ์ถ๊ฐ * Refactor | CAKK-26 | checkstyle ๋ฐ์ * Fix | CAKK-26 | response data builder ์ฌ์ฉ์ผ๋ก ์์ * Chore | CAKK-35 | kotlin 2.0 ์ค์ * Chore | CAKK-35 | admin ๋ชจ๋ ์ค์ * Chore | CAKK-35 | admin ๋ชจ๋ ์ค์ * Refactor | CAKK-35 | admin ๊ด๋ จ ์ผ๋ถ ๋น์ฆ๋์ค ์ด๊ด * Fix | CAKK-36 | CakeShop Domain์์ ์ธ์ฆ ์ฐ๊ฒฐ ์ฌ๋ถ ์ํ ์ ๊ฑฐ * Refactor | CAKK-36 | ์ผ์ดํฌ์ต ์ฌ์ฅ๋ ์ธ์ฆ ์์ฒญ ๋ก์ง ๋ฆฌํฉํ ๋ง * Test | CAKK-36 | ์ผ์ดํฌ์ต ์ฌ์ฅ๋ ์ธ์ฆ ์์ฒญ ํ ์คํธ ๋ฆฌํฉํ ๋ง * Refactor | CAKK-36 | ๋ถํ์ํ ๋ฉ์๋ ์ ๊ฑฐ * Refactor | CAKK-36 | User Role์์ Business Owner์ ๊ฑฐ๋ก ์ธํ ๋ฆฌํฉํ ๋ง * Fix | CAKK-36 | ์ธ์ฆ ์์ฒญ ์, cakeShop nullable ์ ๊ฑฐ ๋ฐ ํ ์คํธ ์ ๊ฑฐ * Refactor | CAKK-36 | ์ธ์ฆ ์์ฒญ๊ณผ ๊ฒ์ฆ ๋ก์ง ๋ถ๋ฆฌ ๋ฆฌํฉํ ๋ง * Chore | CAKK-40 | ๋ชจ๋ ๊ฐ ์ค์ ์์ * Chore | CAKK-40 | ์ด๋๋ฏผ ๋ชจ๋ ์์กด์ฑ ์ถ๊ฐ * Test | CAKK-36 | ๋ก์ง ๋ฆฌํฉํ ๋ง์ผ๋ก ์ธํ ํ ์คํธ ๋ฆฌํฉํ ๋ง * Fix | CAKK-36 | ์ธ์ฆ ์ฌ๋ถ ํ๋๋ก ์ธํ ์ฟผ๋ฆฌ ์์ * Refactor | CAKK-36 | checkstyle ์ ์ฉ * Fix | CAKK-36 | sql file ํ ์ด๋ธ ๊ตฌ์กฐ ๋ณ๊ฒฝ์ผ๋ก ์์ * Refactor | CAKK-40 | BusinessInformation ๊ด๋ จ ๊ธฐ๋ฅ ์ด๊ด * Refactor | CAKK-36 | ์ฝ๋ ๋ฆฌ๋ทฐ ๋ฐ์ ๋ฐ ์ฌ์ฅ๋ ์ธ์ฆ ์น์ธ์์์ ๊ฒ์ฆ ๋ก์ง ์ถ๊ฐ * Test | CAKK-36 | ์ฌ์ฅ๋์ผ๋ก ์น์ธ ์, ๊ฒ์ฆ์ผ๋ก ์ธํ ํ ์คํธ ์ฝ๋ ์์ * Refactor | CAKK-42 | Cake ๊ด๋ จ ๊ธฐ๋ฅ ์ด๊ด * Chore | CAKK-42 | gitignore์ kotlin ๊ด๋ จ ์ถ๊ฐ * Refactor | CAKK-42 | kotlin lambda ๋ฆฌํฉํ ๋ง * Refactor | CAKK-42 | Cake ๊ด๋ จ ๊ธฐ๋ฅ ์ด๊ด * Refactor | CAKK-42 | CakeShop ์์ฑ Dto ๋ฐ Mapping ๋ฆฌํฉํ ๋ง * Refactor | CAKK-42 | ์ฝ๋ ๋ฆฌ๋ทฐ ๋ฐ์ * Refactor | CAKK-41 | ์ผ์ดํฌ ์ต ๊ด๋ จ ๊ธฐ๋ฅ ์ด๊ด * Refactor | CAKK-41 | Param์ Builder ์ถ * Refactor | CAKK-41 | api ์ค๊ณ ์์ * Refactor | CAKK-41 | ์ผ์ดํฌ ์ต ๊ด๋ จ ๊ธฐ๋ฅ ์ด๊ด * Refactor | CAKK-41 | kotlin ๊ด๋ จ ์ค์ * Refactor | CAKK-41 | kotlin ๊ด๋ จ ์ค์ * Refactor | CAKK-54 | ์ผ์ดํฌ ํํธ ๊ธฐ๋ฅ ๋ฆฌํฉํ ๋ง * Refactor | CAKK-54 | ๋๋ฉ์ธ์ ํ์ฉํ ๋ฆฌํฉํ ๋ง * Refactor | CAKK-54 | ์ ํ๋ฆฌ์ผ์ด์ ๋น์ฆ๋์ค ๋ฆฌํฉํ ๋ง * Test | CAKK-54 | ํํธ ์ทจ์ ๊ด๋ จ TC ์ถ๊ฐ ์์ฑ * Refactor | CAKK-54 | fetch join์ ํ์ฉํ ๋ฆฌํฉํ * Refactor | CAKK-54 | fetch join์ ํ์ฉํ ๋ฆฌํฉํ ๋ง * Refactor | CAKK-54 | ๋ฏธ์ฌ์ฉ ๋ฉ์๋ ์ ๊ฑฐ * Test | CAKK-54 | ํ ์คํธ ์ฝ๋ ์์ * Refactor | CAKK-54 | ์ฝ๋ ๋ฆฌ๋ทฐ ๋ฐ์ * Test | CAKK-54 | Test ๊ด๋ จ Sql ์คํฌ๋ฆฝํธ ์์ * Refactor | CAKK-55 | ์ผ์ดํฌ์ต ํํธ ๋ฐ ๊ธฐ๋๋ผ์ ๊ธฐ๋ฅ ๋ฆฌํฉํ ๋ง * Refactor | CAKK-55 | Redis Repository์ ์ถ์ํ ์ ์ฉ * Refactor | CAKK-55 | ์ผ์ดํฌ ์ต ํํธ, ๊ธฐ๋๋ผ์ ๋ฉ์๋ ๋ฆฌํฉํ ๋ง * Refactor | CAKK-55 | ๋ฏธ์ฌ์ฉ ๋ฉ์๋ ์ญ์ * Refactor | CAKK-55 | Facade ํจํด ์ ์ฉ * Test | CAKK-55 | ๋ฆฌํฉํ ๋ง ๋ก์ง ํ ์คํธ ์์ฑ * Chore | CAKK-55 | Fixture Monkey ๋ฒ์ ์ * Chore | CAKK-55 | test ํ์ผ ๊ฒฝ๋ก ์ถ๊ฐ * Fix | CAKK-56 | git ์ถฉ๋ ํด๊ฒฐ * Fix | CAKK-56 | git ์ถฉ๋ ํด๊ฒฐ * Refactor | CAKK-56 | checkstyle ๋ฐ์ --------- Co-authored-by: ๊นํ์ฉ <[email protected]> Co-authored-by: TAEYONG KIM <[email protected]>
- Loading branch information
1 parent
9ee7343
commit 3aef33c
Showing
34 changed files
with
531 additions
and
234 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
22 changes: 4 additions & 18 deletions
22
cakk-api/src/main/java/com/cakk/api/service/like/LikeService.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,40 +1,26 @@ | ||
package com.cakk.api.service.like; | ||
|
||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
import com.cakk.api.annotation.DistributedLock; | ||
import com.cakk.common.enums.ReturnCode; | ||
import com.cakk.common.exception.CakkException; | ||
import com.cakk.domain.mysql.entity.shop.CakeShop; | ||
import com.cakk.domain.mysql.entity.user.User; | ||
import com.cakk.domain.mysql.repository.reader.CakeShopLikeReader; | ||
import com.cakk.domain.mysql.facade.user.UserLikeFacade; | ||
import com.cakk.domain.mysql.repository.reader.CakeShopReader; | ||
import com.cakk.domain.mysql.repository.writer.CakeShopLikeWriter; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class LikeService { | ||
|
||
private final CakeShopReader cakeShopReader; | ||
private final CakeShopLikeReader cakeShopLikeReader; | ||
private final CakeShopLikeWriter cakeShopLikeWriter; | ||
|
||
@Transactional(readOnly = true) | ||
public void validateLikeCount(final User user, final Long cakeShopId) { | ||
final int likeCount = cakeShopLikeReader.countByCakeShopIdAndUser(cakeShopId, user); | ||
|
||
if (likeCount >= 50) { | ||
throw new CakkException(ReturnCode.MAX_CAKE_SHOP_LIKE); | ||
} | ||
} | ||
private final UserLikeFacade userCakeFacade; | ||
|
||
@DistributedLock(key = "#cakeShopId") | ||
public void likeCakeShop(final User user, final Long cakeShopId) { | ||
final CakeShop cakeShop = cakeShopReader.findById(cakeShopId); | ||
final CakeShop cakeShop = cakeShopReader.findByIdWithLike(cakeShopId); | ||
|
||
cakeShopLikeWriter.like(cakeShop, user); | ||
userCakeFacade.likeCakeShop(user, cakeShop); | ||
} | ||
} |
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
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.