feat: stub for get user titles written
This commit is contained in:
parent
09d0d1eb4d
commit
6836cfa057
2 changed files with 29 additions and 3 deletions
|
|
@ -233,7 +233,7 @@ paths:
|
|||
# error:
|
||||
# type: string
|
||||
|
||||
/users:
|
||||
# /users:
|
||||
# get:
|
||||
# summary: Search user
|
||||
# parameters:
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import (
|
|||
"context"
|
||||
oapi "nyanimedb/api"
|
||||
sqlc "nyanimedb/sql"
|
||||
"time"
|
||||
|
||||
"github.com/jackc/pgx/v5"
|
||||
"github.com/oapi-codegen/runtime/types"
|
||||
|
|
@ -51,7 +52,32 @@ func (s Server) GetUsersUserId(ctx context.Context, req oapi.GetUsersUserIdReque
|
|||
|
||||
func (s Server) GetUsersUserIdTitles(ctx context.Context, request oapi.GetUsersUserIdTitlesRequestObject) (oapi.GetUsersUserIdTitlesResponseObject, error) {
|
||||
|
||||
// oapi_user_titles := make([]oapi.UserTitle, 0)
|
||||
var rate int32 = 9
|
||||
var review_id int64 = 3
|
||||
time := time.Date(2025, 1, 15, 10, 30, 0, 0, time.UTC)
|
||||
|
||||
return nil, nil
|
||||
var userTitles = []oapi.UserTitle{
|
||||
{
|
||||
UserId: 101,
|
||||
TitleId: 2001,
|
||||
Status: oapi.UserTitleStatusFinished,
|
||||
Rate: &rate,
|
||||
Ctime: &time,
|
||||
},
|
||||
{
|
||||
UserId: 102,
|
||||
TitleId: 2002,
|
||||
Status: oapi.UserTitleStatusInProgress,
|
||||
ReviewId: &review_id,
|
||||
Ctime: &time,
|
||||
},
|
||||
{
|
||||
UserId: 103,
|
||||
TitleId: 2003,
|
||||
Status: oapi.UserTitleStatusDropped,
|
||||
Ctime: &time,
|
||||
},
|
||||
}
|
||||
|
||||
return oapi.GetUsersUserIdTitles200JSONResponse(userTitles), nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue