Compare commits
No commits in common. "759679990abee04aacbb300af60cfbb5118c61cd" and "51bf7b6f7e4c2bcbd4266f207280aecf05bbb2f9" have entirely different histories.
759679990a
...
51bf7b6f7e
4 changed files with 7 additions and 64 deletions
|
|
@ -326,29 +326,7 @@ paths:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: object
|
$ref: '#/components/schemas/UserTitle'
|
||||||
required:
|
|
||||||
- user_id
|
|
||||||
- title_id
|
|
||||||
- status
|
|
||||||
properties:
|
|
||||||
user_id:
|
|
||||||
type: integer
|
|
||||||
format: int64
|
|
||||||
title_id:
|
|
||||||
type: integer
|
|
||||||
format: int64
|
|
||||||
status:
|
|
||||||
$ref: '#/components/schemas/UserTitleStatus'
|
|
||||||
rate:
|
|
||||||
type: integer
|
|
||||||
format: int32
|
|
||||||
review_id:
|
|
||||||
type: integer
|
|
||||||
format: int64
|
|
||||||
ctime:
|
|
||||||
type: string
|
|
||||||
format: date-time
|
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: Title successfully added to user
|
description: Title successfully added to user
|
||||||
|
|
|
||||||
|
|
@ -226,23 +226,11 @@ type GetUsersUserIdTitlesParams struct {
|
||||||
Fields *string `form:"fields,omitempty" json:"fields,omitempty"`
|
Fields *string `form:"fields,omitempty" json:"fields,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddUserTitleJSONBody defines parameters for AddUserTitle.
|
|
||||||
type AddUserTitleJSONBody struct {
|
|
||||||
Ctime *time.Time `json:"ctime,omitempty"`
|
|
||||||
Rate *int32 `json:"rate,omitempty"`
|
|
||||||
ReviewId *int64 `json:"review_id,omitempty"`
|
|
||||||
|
|
||||||
// Status User's title status
|
|
||||||
Status UserTitleStatus `json:"status"`
|
|
||||||
TitleId int64 `json:"title_id"`
|
|
||||||
UserId int64 `json:"user_id"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// UpdateUserJSONRequestBody defines body for UpdateUser for application/json ContentType.
|
// UpdateUserJSONRequestBody defines body for UpdateUser for application/json ContentType.
|
||||||
type UpdateUserJSONRequestBody UpdateUserJSONBody
|
type UpdateUserJSONRequestBody UpdateUserJSONBody
|
||||||
|
|
||||||
// AddUserTitleJSONRequestBody defines body for AddUserTitle for application/json ContentType.
|
// AddUserTitleJSONRequestBody defines body for AddUserTitle for application/json ContentType.
|
||||||
type AddUserTitleJSONRequestBody AddUserTitleJSONBody
|
type AddUserTitleJSONRequestBody = UserTitle
|
||||||
|
|
||||||
// Getter for additional properties for Title. Returns the specified
|
// Getter for additional properties for Title. Returns the specified
|
||||||
// element and whether it was found
|
// element and whether it was found
|
||||||
|
|
|
||||||
|
|
@ -108,30 +108,7 @@ post:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: object
|
$ref: '../schemas/UserTitle.yaml'
|
||||||
required:
|
|
||||||
- user_id
|
|
||||||
- title_id
|
|
||||||
- status
|
|
||||||
properties:
|
|
||||||
user_id:
|
|
||||||
type: integer
|
|
||||||
format: int64
|
|
||||||
title_id:
|
|
||||||
type: integer
|
|
||||||
format: int64
|
|
||||||
status:
|
|
||||||
$ref: ../schemas/enums/UserTitleStatus.yaml
|
|
||||||
rate:
|
|
||||||
type: integer
|
|
||||||
format: int32
|
|
||||||
review_id:
|
|
||||||
type: integer
|
|
||||||
format: int64
|
|
||||||
ctime:
|
|
||||||
type: string
|
|
||||||
format: date-time
|
|
||||||
|
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: Title successfully added to user
|
description: Title successfully added to user
|
||||||
|
|
|
||||||
|
|
@ -140,9 +140,9 @@ func UserTitleStatus2Sqlc(s *[]oapi.UserTitleStatus) ([]sqlc.UsertitleStatusT, e
|
||||||
}
|
}
|
||||||
|
|
||||||
func UserTitleStatus2Sqlc1(s *oapi.UserTitleStatus) (*sqlc.UsertitleStatusT, error) {
|
func UserTitleStatus2Sqlc1(s *oapi.UserTitleStatus) (*sqlc.UsertitleStatusT, error) {
|
||||||
var sqlc_status sqlc.UsertitleStatusT = sqlc.UsertitleStatusTFinished
|
var sqlc_status sqlc.UsertitleStatusT
|
||||||
if s == nil {
|
if s == nil {
|
||||||
return &sqlc_status, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
switch *s {
|
switch *s {
|
||||||
|
|
@ -304,7 +304,7 @@ func (s Server) GetUsersUserIdTitles(ctx context.Context, request oapi.GetUsersU
|
||||||
tmp := fmt.Sprint(*t.Title.ReleaseYear)
|
tmp := fmt.Sprint(*t.Title.ReleaseYear)
|
||||||
new_cursor.Param = &tmp
|
new_cursor.Param = &tmp
|
||||||
case "rating":
|
case "rating":
|
||||||
tmp := strconv.FormatFloat(*t.Title.Rating, 'f', -1, 64) // падает
|
tmp := strconv.FormatFloat(*t.Title.Rating, 'f', -1, 64)
|
||||||
new_cursor.Param = &tmp
|
new_cursor.Param = &tmp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -369,7 +369,7 @@ func (s Server) AddUserTitle(ctx context.Context, request oapi.AddUserTitleReque
|
||||||
|
|
||||||
params := sqlc.InsertUserTitleParams{
|
params := sqlc.InsertUserTitleParams{
|
||||||
UserID: request.UserId,
|
UserID: request.UserId,
|
||||||
TitleID: request.Body.TitleId,
|
TitleID: request.Body.Title.Id,
|
||||||
Status: *status,
|
Status: *status,
|
||||||
Rate: request.Body.Rate,
|
Rate: request.Body.Rate,
|
||||||
ReviewID: request.Body.ReviewId,
|
ReviewID: request.Body.ReviewId,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue