feat: regenerated go oapi
This commit is contained in:
parent
bd868bb724
commit
128a33824a
3 changed files with 11 additions and 64 deletions
|
|
@ -226,7 +226,7 @@ paths:
|
|||
'500':
|
||||
description: Unknown server error
|
||||
security:
|
||||
XsrfAuthHeader: []
|
||||
- XsrfAuthHeader: []
|
||||
'/users/{user_id}/titles':
|
||||
get:
|
||||
operationId: getUserTitles
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import (
|
|||
|
||||
const (
|
||||
JwtAuthCookiesScopes = "JwtAuthCookies.Scopes"
|
||||
XsrfAuthHeaderScopes = "XsrfAuthHeader.Scopes"
|
||||
)
|
||||
|
||||
// Defines values for ReleaseSeason.
|
||||
|
|
@ -174,12 +175,6 @@ type UserTitleMini struct {
|
|||
// UserTitleStatus User's title status
|
||||
type UserTitleStatus string
|
||||
|
||||
// AccessToken defines model for accessToken.
|
||||
type AccessToken = string
|
||||
|
||||
// CsrfToken defines model for csrfToken.
|
||||
type CsrfToken = string
|
||||
|
||||
// Cursor defines model for cursor.
|
||||
type Cursor = string
|
||||
|
||||
|
|
@ -229,17 +224,6 @@ type UpdateUserJSONBody struct {
|
|||
UserDesc *string `json:"user_desc,omitempty"`
|
||||
}
|
||||
|
||||
// UpdateUserParams defines parameters for UpdateUser.
|
||||
type UpdateUserParams struct {
|
||||
// AccessToken JWT access token.
|
||||
AccessToken AccessToken `form:"access_token" json:"access_token"`
|
||||
|
||||
// XSRFTOKEN Anti-CSRF token (Double Submit Cookie pattern).
|
||||
// Stored in non-HttpOnly cookie, readable by JavaScript.
|
||||
// Must be echoed in `X-XSRF-TOKEN` header for state-changing requests (POST/PUT/PATCH/DELETE).
|
||||
XSRFTOKEN CsrfToken `form:"XSRF-TOKEN" json:"XSRF-TOKEN"`
|
||||
}
|
||||
|
||||
// GetUserTitlesParams defines parameters for GetUserTitles.
|
||||
type GetUserTitlesParams struct {
|
||||
Cursor *Cursor `form:"cursor,omitempty" json:"cursor,omitempty"`
|
||||
|
|
@ -297,7 +281,7 @@ type ServerInterface interface {
|
|||
GetUsersId(c *gin.Context, userId string, params GetUsersIdParams)
|
||||
// Partially update a user account
|
||||
// (PATCH /users/{user_id})
|
||||
UpdateUser(c *gin.Context, userId int64, params UpdateUserParams)
|
||||
UpdateUser(c *gin.Context, userId int64)
|
||||
// Get user titles
|
||||
// (GET /users/{user_id}/titles)
|
||||
GetUserTitles(c *gin.Context, userId string, params GetUserTitlesParams)
|
||||
|
|
@ -524,46 +508,7 @@ func (siw *ServerInterfaceWrapper) UpdateUser(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
c.Set(JwtAuthCookiesScopes, []string{})
|
||||
|
||||
// Parameter object where we will unmarshal all parameters from the context
|
||||
var params UpdateUserParams
|
||||
|
||||
{
|
||||
var cookie string
|
||||
|
||||
if cookie, err = c.Cookie("access_token"); err == nil {
|
||||
var value AccessToken
|
||||
err = runtime.BindStyledParameterWithOptions("simple", "access_token", cookie, &value, runtime.BindStyledParameterOptions{Explode: true, Required: true})
|
||||
if err != nil {
|
||||
siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter access_token: %w", err), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
params.AccessToken = value
|
||||
|
||||
} else {
|
||||
siw.ErrorHandler(c, fmt.Errorf("Query argument access_token is required, but not found"), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
var cookie string
|
||||
|
||||
if cookie, err = c.Cookie("XSRF-TOKEN"); err == nil {
|
||||
var value CsrfToken
|
||||
err = runtime.BindStyledParameterWithOptions("simple", "XSRF-TOKEN", cookie, &value, runtime.BindStyledParameterOptions{Explode: true, Required: true})
|
||||
if err != nil {
|
||||
siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter XSRF-TOKEN: %w", err), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
params.XSRFTOKEN = value
|
||||
|
||||
} else {
|
||||
siw.ErrorHandler(c, fmt.Errorf("Query argument XSRF-TOKEN is required, but not found"), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
}
|
||||
c.Set(XsrfAuthHeaderScopes, []string{})
|
||||
|
||||
for _, middleware := range siw.HandlerMiddlewares {
|
||||
middleware(c)
|
||||
|
|
@ -572,7 +517,7 @@ func (siw *ServerInterfaceWrapper) UpdateUser(c *gin.Context) {
|
|||
}
|
||||
}
|
||||
|
||||
siw.Handler.UpdateUser(c, userId, params)
|
||||
siw.Handler.UpdateUser(c, userId)
|
||||
}
|
||||
|
||||
// GetUserTitles operation middleware
|
||||
|
|
@ -745,6 +690,8 @@ func (siw *ServerInterfaceWrapper) DeleteUserTitle(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
c.Set(XsrfAuthHeaderScopes, []string{})
|
||||
|
||||
for _, middleware := range siw.HandlerMiddlewares {
|
||||
middleware(c)
|
||||
if c.IsAborted() {
|
||||
|
|
@ -811,6 +758,8 @@ func (siw *ServerInterfaceWrapper) UpdateUserTitle(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
c.Set(XsrfAuthHeaderScopes, []string{})
|
||||
|
||||
for _, middleware := range siw.HandlerMiddlewares {
|
||||
middleware(c)
|
||||
if c.IsAborted() {
|
||||
|
|
@ -999,7 +948,6 @@ func (response GetUsersId500Response) VisitGetUsersIdResponse(w http.ResponseWri
|
|||
|
||||
type UpdateUserRequestObject struct {
|
||||
UserId int64 `json:"user_id"`
|
||||
Params UpdateUserParams
|
||||
Body *UpdateUserJSONRequestBody
|
||||
}
|
||||
|
||||
|
|
@ -1476,11 +1424,10 @@ func (sh *strictHandler) GetUsersId(ctx *gin.Context, userId string, params GetU
|
|||
}
|
||||
|
||||
// UpdateUser operation middleware
|
||||
func (sh *strictHandler) UpdateUser(ctx *gin.Context, userId int64, params UpdateUserParams) {
|
||||
func (sh *strictHandler) UpdateUser(ctx *gin.Context, userId int64) {
|
||||
var request UpdateUserRequestObject
|
||||
|
||||
request.UserId = userId
|
||||
request.Params = params
|
||||
|
||||
var body UpdateUserJSONRequestBody
|
||||
if err := ctx.ShouldBindJSON(&body); err != nil {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ patch:
|
|||
Fields not provided in the request body remain unchanged.
|
||||
operationId: updateUser
|
||||
security:
|
||||
XsrfAuthHeader: []
|
||||
- XsrfAuthHeader: []
|
||||
parameters:
|
||||
# - $ref: '../parameters/xsrf_token_header.yaml'
|
||||
- name: user_id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue