Skip to content

Commit

Permalink
feat: add field series for subject v0 res (#565)
Browse files Browse the repository at this point in the history
  • Loading branch information
everpcpc authored May 26, 2024
1 parent a2dd226 commit abb3ee4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion openapi/components/subject_v0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ required:
- platform
- volumes
- eps
- series
- total_episodes
- rating
- images
Expand All @@ -34,6 +35,10 @@ properties:
summary:
title: Summary
type: string
series:
title: Series
type: boolean
description: 是否为书籍系列的主条目
nsfw:
title: Nsfw
type: boolean
Expand All @@ -47,7 +52,7 @@ properties:
platform:
title: Platform
type: string
description: TV, Web, 欧美剧, PS4...
description: TV, Web, 欧美剧, DLC...
images:
$ref: "./subject_image.yaml"
infobox:
Expand Down
1 change: 1 addition & 0 deletions web/handler/subject/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ func convertModelSubject(s model.Subject, totalEpisode int64) res.SubjectV0 {
Doing: s.Doing,
},
TypeID: s.TypeID,
Series: s.Series,
Locked: s.Locked(),
NSFW: s.NSFW,
Rating: res.Rating{
Expand Down
3 changes: 2 additions & 1 deletion web/res/subject.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ type SubjectV0 struct {
ID model.SubjectID `json:"id"`
Eps uint32 `json:"eps"`
Volumes uint32 `json:"volumes"`
Redirect model.SubjectID `json:"-"`
Series bool `json:"series"`
Locked bool `json:"locked"`
NSFW bool `json:"nsfw"`
TypeID model.SubjectType `json:"type"`
Redirect model.SubjectID `json:"-"`
}

type SlimSubjectV0 struct {
Expand Down

0 comments on commit abb3ee4

Please sign in to comment.