https://github.com/berquerant/weaver-pokemon-type
https://github.com/berquerant/weaver-pokemon-type
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/berquerant/weaver-pokemon-type
- Owner: berquerant
- Created: 2023-03-16T17:14:54.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-20T19:17:38.000Z (over 2 years ago)
- Last Synced: 2025-02-06T16:57:56.542Z (over 1 year ago)
- Language: Go
- Size: 85 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# weaver-pokemon-type
## Init
``` bash
make init
direnv allow
```
## Run
``` bash
docker compose up -d
make seed
make
./dist/server
```
## Dev
Run `weaver generate` and other code generations.
``` bash
make generate
```
## API
### /type
``` bash
❯ curl "localhost:21099/type" -d '{"name":"エスパー"}'
{"item":{"id":11,"name":"エスパー"}}
```
### /attack
``` bash
❯ curl "localhost:21099/attack" -d '{"id":11,"index":1}'|jq '.items[0]'
{
"pile": [
{
"id": 181,
"attack": {
"id": 11,
"name": "エスパー"
},
"defense": {
"id": 1,
"name": "ノーマル"
},
"multiplier": 1
}
],
"multiplier": 1
}
```
``` bash
❯ curl "localhost:21099/attack" -d '{"id":11,"index":2}'|jq '.items[0]'
{
"pile": [
{
"id": 181,
"attack": {
"id": 11,
"name": "エスパー"
},
"defense": {
"id": 1,
"name": "ノーマル"
},
"multiplier": 1
},
{
"id": 182,
"attack": {
"id": 11,
"name": "エスパー"
},
"defense": {
"id": 2,
"name": "ほのお"
},
"multiplier": 1
}
],
"multiplier": 1
}
```
### /defense
``` bash
❯ curl "localhost:21099/defense" -d '{"ids":[11]}'|jq '.items[0]'
{
"pile": [
{
"id": 119,
"attack": {
"id": 7,
"name": "かくとう"
},
"defense": {
"id": 11,
"name": "エスパー"
},
"multiplier": 0.5
}
],
"multiplier": 0.5
}
```
``` bash
❯ curl "localhost:21099/defense" -d '{"ids":[11,7]}'|jq '.items[0]'
{
"pile": [
{
"id": 65,
"attack": {
"id": 4,
"name": "でんき"
},
"defense": {
"id": 11,
"name": "エスパー"
},
"multiplier": 1
},
{
"id": 61,
"attack": {
"id": 4,
"name": "でんき"
},
"defense": {
"id": 7,
"name": "かくとう"
},
"multiplier": 1
}
],
"multiplier": 1
}
```