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: include field PrsnAppearEps in subject persons response #616

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions domain/relation.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type SubjectPersonRelation struct {

PersonID model.PersonID
SubjectID model.SubjectID
Eps string
}

type SubjectCharacterRelation struct {
Expand Down
1 change: 1 addition & 0 deletions internal/model/relation.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type SubjectPersonRelation struct {
Person Person
Subject Subject
TypeID uint16
Eps string
}

type SubjectCharacterRelation struct {
Expand Down
1 change: 1 addition & 0 deletions internal/person/mysql_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func (r mysqlRepo) GetSubjectRelated(
rel[i] = domain.SubjectPersonRelation{
PersonID: relation.PersonID,
TypeID: relation.PrsnPosition,
Eps: relation.PrsnAppearEps,
}
}

Expand Down
1 change: 1 addition & 0 deletions internal/person/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
Person: persons[rel.PersonID],
Subject: sub,
TypeID: rel.TypeID,
Eps: rel.Eps,

Check warning on line 68 in internal/person/service.go

View check run for this annotation

Codecov / codecov/patch

internal/person/service.go#L68

Added line #L68 was not covered by tests
}
}

Expand Down
5 changes: 5 additions & 0 deletions openapi/v0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2961,6 +2961,7 @@ components:
- type
- career
- relation
- eps
type: object
properties:
id:
Expand All @@ -2987,6 +2988,10 @@ components:
relation:
title: Relation
type: string
eps:
title: Eps
type: string
description: 参与章节/曲目
UserCharacterCollection:
title: UserCharacterCollection
required:
Expand Down
1 change: 1 addition & 0 deletions web/handler/subject/related_persons.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
Career: rel.Person.Careers(),
Type: rel.Person.Type,
ID: rel.Person.ID,
Eps: rel.Eps,

Check warning on line 65 in web/handler/subject/related_persons.go

View check run for this annotation

Codecov / codecov/patch

web/handler/subject/related_persons.go#L65

Added line #L65 was not covered by tests
}
}

Expand Down
1 change: 1 addition & 0 deletions web/res/subject.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ type SubjectRelatedPerson struct {
Career []string `json:"career"`
Type uint8 `json:"type"`
ID model.PersonID `json:"id" doc:"person ID"`
Eps string `json:"eps" doc:"episodes participated"`
}

type Actor struct {
Expand Down