Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: relation between person and character #61

Merged
merged 2 commits into from
Dec 28, 2021
Merged

Conversation

MoguCloud
Copy link
Contributor

@MoguCloud MoguCloud commented Dec 28, 2021

现实-虚拟人物关联

获取虚拟人物相关联的现实人物

GET /v0/characters/{character_id}/persons

Example

GET /v0/characters/1/persons

[
    {
        "id": 3818, 
        "name": "福山潤", 
        "type": 1, 
        "images": {
            "large": "https://lain.bgm.tv/pic/crt/l/7b/3a/1_crt_8V556.jpg?r=1603459589", 
            "medium": "https://lain.bgm.tv/pic/crt/m/7b/3a/1_crt_8V556.jpg?r=1603459589", 
            "small": "https://lain.bgm.tv/pic/crt/s/7b/3a/1_crt_8V556.jpg?r=1603459589", 
            "grid": "https://lain.bgm.tv/pic/crt/g/7b/3a/1_crt_8V556.jpg?r=1603459589"
        }, 
        "subject_id": 8, 
        "subject_name": "コードギアス 反逆のルルーシュR2", 
        "subject_name_cn": "Code Geass 反叛的鲁路修R2"
    }
]

获取现实人物相关联的虚拟人物

GET /v0/persons/{person_id}/characters

Example

GET /v0/persons/3818/characters

[
    {
        "id": 1, 
        "name": "ルルーシュ・ランペルージ", 
        "type": 1, 
        "images": {
            "large": "https://lain.bgm.tv/pic/crt/l/7b/3a/1_crt_8V556.jpg?r=1603459589", 
            "medium": "https://lain.bgm.tv/pic/crt/m/7b/3a/1_crt_8V556.jpg?r=1603459589", 
            "small": "https://lain.bgm.tv/pic/crt/s/7b/3a/1_crt_8V556.jpg?r=1603459589", 
            "grid": "https://lain.bgm.tv/pic/crt/g/7b/3a/1_crt_8V556.jpg?r=1603459589"
        }, 
        "subject_id": 8, 
        "subject_name": "コードギアス 反逆のルルーシュR2", 
        "subject_name_cn": "Code Geass 反叛的鲁路修R2"
    }
]

@trim21
Copy link
Contributor

trim21 commented Dec 28, 2021

写一下具体响应的例子

@codecov
Copy link

codecov bot commented Dec 28, 2021

Codecov Report

Merging #61 (f33e5cb) into master (929e218) will decrease coverage by 0.06%.
The diff coverage is 97.05%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #61      +/-   ##
==========================================
- Coverage   98.76%   98.70%   -0.07%     
==========================================
  Files          52       52              
  Lines        1942     2005      +63     
==========================================
+ Hits         1918     1979      +61     
- Misses         24       26       +2     
Impacted Files Coverage Δ
pol/api/v0/character.py 97.01% <90.00%> (-1.30%) ⬇️
pol/api/v0/person.py 94.52% <90.00%> (-0.87%) ⬇️
pol/api/v0/models/__init__.py 100.00% <100.00%> (ø)
pol/db/const.py 91.17% <100.00%> (+0.55%) ⬆️
tests/app/api_v0/test_character.py 100.00% <100.00%> (ø)
tests/app/api_v0/test_person.py 100.00% <100.00%> (ø)
tests/conftest.py 100.00% <100.00%> (ø)
pol/server.py 97.43% <0.00%> (ø)
pol/api/v0/depends/auth/schema.py 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 929e218...f33e5cb. Read the comment docs.

pol/api/v0/character.py Outdated Show resolved Hide resolved
pol/api/v0/person.py Outdated Show resolved Hide resolved
@trim21
Copy link
Contributor

trim21 commented Dec 28, 2021

不要force push,影响review…

@trim21 trim21 mentioned this pull request Dec 28, 2021
47 tasks
pol/api/v0/person.py Outdated Show resolved Hide resolved
pol/api/v0/character.py Outdated Show resolved Hide resolved
@trim21 trim21 merged commit 30e1a58 into bangumi:master Dec 28, 2021
@trim21
Copy link
Contributor

trim21 commented Jan 16, 2022

在吗,能不能看一下这个issue(
#87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants