Skip to content

Commit e1f0fa1

Browse files
authored
release 0.0.5 (#5)
2 parents 90e3898 + 3e61fdc commit e1f0fa1

File tree

5 files changed

+9
-3
lines changed

5 files changed

+9
-3
lines changed

docs/api/gotcha.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@ pet을 뽑기 할 수 있습니다.
1212
입력 가능한 type : `DEFAULT`
1313

1414
# Response
15-
성공시, 응답으로 뽑힌 펫의 이름과 비율을 반환합니다.
15+
성공시, 응답으로 뽑힌 펫의 id, 이름, 비율(뽑히는 확률)을 반환합니다.
1616

1717
``` json
1818
{
19+
"id" : "1",
1920
"name" : "CAT",
2021
"ratio" : "0.2"
2122
}
2223
```
24+
25+
펫의 id는 `https://render.gitanimals.org/lines/{username}?pet-id={id}` 와 같이 요청하면서, pet의 정보를 가져올 수 있습니다.

src/main/kotlin/org/gitanimals/gotcha/app/GotchaFacade.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ class GotchaFacade(
5353

5454
val personaId =
5555
renderApi.addPersona(token, gotchaResponse.idempotency, gotchaResponse.name)
56-
context.set("personaId", personaId)
5756

57+
gotchaResponse.id = personaId
5858
gotchaResponse
5959
}
6060
}

src/main/kotlin/org/gitanimals/gotcha/controller/GotchaController.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ class GotchaController(
2222

2323
val gotchaResponse = gotchaFacade.gotcha(token, gotchaType)
2424

25-
return GotchaResponse(gotchaResponse.name, gotchaResponse.point)
25+
checkNotNull(gotchaResponse.id)
26+
return GotchaResponse(gotchaResponse.id!!, gotchaResponse.name, gotchaResponse.point)
2627
}
2728

2829
@ResponseStatus(HttpStatus.BAD_REQUEST)
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.gitanimals.gotcha.controller.response
22

33
data class GotchaResponse(
4+
val id: String,
45
val name: String,
56
val ratio: String,
67
)

src/main/kotlin/org/gitanimals/gotcha/domain/response/GotchaResponse.kt

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package org.gitanimals.gotcha.domain.response
33
import java.util.*
44

55
data class GotchaResponse(
6+
var id: String? = null,
67
val name: String,
78
val ratio: String,
89
val point: String,

0 commit comments

Comments
 (0)