Skip to content

Commit

Permalink
release: 0.7.1 (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
devxb authored Nov 2, 2024
2 parents 53c9a73 + aca9a03 commit 53a0eaa
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/api/auction/get_persona_types.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Get my products

선택가능한 persona type들을 반환합ㅂ니다.
선택가능한 persona type들을 반환합니다.

## Request

Expand Down
2 changes: 1 addition & 1 deletion docs/api/auction/get_total_product_count.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Get total product count

총 상품수를 조회합니다
총 상품수를 조회합니다.

실시간 업데이트 되지 않으며, 최소 1시간에 한번 업데이트 됩니다.

Expand Down
2 changes: 1 addition & 1 deletion docs/api/auction/register_product.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Register product

shop에 product를 등록한다.
shop에 product를 등록합니다.

## Request

Expand Down
4 changes: 2 additions & 2 deletions docs/api/identity/login.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ LOCAL_ADMIN : `http://localhost:5173?jwt={jwtToken}`

1. `GET https://api.gitanimals.org/logins/oauth/github` 로 요청.

2. 깃허브 로그인 페이지로 리다이렉트
2. 깃허브 로그인 페이지로 리다이렉트.

3. 로그인 성공하면, 등록한 url 로 임시토큰 전달.

4. 임시토큰을 서버의 `GET https://api.gitanimals.org/logins/oauth/github/tokens?code={3번에서 받은 임시토큰}` 전달
4. 임시토큰을 서버의 `GET https://api.gitanimals.org/logins/oauth/github/tokens?code={3번에서 받은 임시토큰}` 전달.

5. 서버에 등록한 url로 임시토큰 응답.
2 changes: 1 addition & 1 deletion docs/api/render/chage_my_background.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Change my background

배경을 변경합니다
배경을 변경합니다.

## Request
### HTTP METHOD : `PUT`
Expand Down
2 changes: 1 addition & 1 deletion docs/api/static/get_static_personas.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ persona들의 정적 파일을 조회합니다.
### url : `https://static.gitanimals.org/personas/{persona-type}`

### Path variable
- persona-type: 정적파일을 조회할 persona의 tytpe을 지정합니다.
- persona-type: 정적파일을 조회할 persona의 type을 지정합니다.

## Response

Expand Down
8 changes: 8 additions & 0 deletions src/main/kotlin/org/gitanimals/identity/domain/User.kt
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,17 @@ class User(

fun decreasePoint(point: Long) {
this.points -= point

require(points >= 0) {
"cannot decrease points cause point is \"${this.points}\""
}
}

fun increasePoint(point: Long) {
if (point < 0) {
continue
}

this.points += point
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,18 @@ class BuyBackgroundFacade(

init {
backgroundBuyOrchestrator = orchestratorFactory.create<String>("buy background facade")
.start({
val sale = saleService.getByTypeAndItem(SaleType.BACKGROUND, it)
.startWithContext({ context, item ->
val sale = saleService.getByTypeAndItem(SaleType.BACKGROUND, item)
val user = identityApi.getUserByToken(context.decodeContext("token", String::class))

require(sale.getCount() > 0) {
"Cannot buy item : \"${sale.type}\" cause its count : \"${sale.getCount()}\" == 0"
}

require(user.points.toLong() >= sale.price) {
"Cannot buy item: \"${sale.type}\" cause not enough points"
}

sale
})
.joinWithContext(
Expand Down

0 comments on commit 53a0eaa

Please sign in to comment.