update
This commit is contained in:
@@ -26,8 +26,8 @@ paths:
|
||||
schema:
|
||||
$ref: "#/definitions/Feedback"
|
||||
- in: query
|
||||
name: session_id
|
||||
description: "Session ID"
|
||||
name: session_uuid
|
||||
description: "Session UUID"
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
@@ -45,8 +45,8 @@ paths:
|
||||
operationId: "getFeedbacks"
|
||||
parameters:
|
||||
- in: query
|
||||
name: session_id
|
||||
description: "Session ID"
|
||||
name: session_uuid
|
||||
description: "Session UUID"
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
|
||||
@@ -19,7 +19,7 @@ func NewFeedbackHandler(
|
||||
}
|
||||
|
||||
func (h *FeedbackHandler) CreateFeedback(params feedback.CreateFeedbackParams) middleware.Responder {
|
||||
err := h.feedback.Create(params.SessionID, params.Body)
|
||||
err := h.feedback.Create(params.SessionUUID, params.Body)
|
||||
if err != nil {
|
||||
return feedback.NewCreateFeedbackForbidden()
|
||||
}
|
||||
@@ -29,7 +29,7 @@ func (h *FeedbackHandler) CreateFeedback(params feedback.CreateFeedbackParams) m
|
||||
}
|
||||
|
||||
func (h *FeedbackHandler) GetFeedbacks(params feedback.GetFeedbacksParams) middleware.Responder {
|
||||
feedbacks, err := h.feedback.GetBySessionID(params.SessionID)
|
||||
feedbacks, err := h.feedback.GetBySessionID(params.SessionUUID)
|
||||
if err != nil {
|
||||
return feedback.NewGetFeedbacksForbidden()
|
||||
}
|
||||
|
||||
@@ -52,8 +52,8 @@ func init() {
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Session ID",
|
||||
"name": "session_id",
|
||||
"description": "Session UUID",
|
||||
"name": "session_uuid",
|
||||
"in": "query",
|
||||
"required": true
|
||||
}
|
||||
@@ -79,8 +79,8 @@ func init() {
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Session ID",
|
||||
"name": "session_id",
|
||||
"description": "Session UUID",
|
||||
"name": "session_uuid",
|
||||
"in": "query",
|
||||
"required": true
|
||||
}
|
||||
@@ -164,8 +164,8 @@ func init() {
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Session ID",
|
||||
"name": "session_id",
|
||||
"description": "Session UUID",
|
||||
"name": "session_uuid",
|
||||
"in": "query",
|
||||
"required": true
|
||||
}
|
||||
@@ -191,8 +191,8 @@ func init() {
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Session ID",
|
||||
"name": "session_id",
|
||||
"description": "Session UUID",
|
||||
"name": "session_uuid",
|
||||
"in": "query",
|
||||
"required": true
|
||||
}
|
||||
|
||||
@@ -40,11 +40,11 @@ type CreateFeedbackParams struct {
|
||||
In: body
|
||||
*/
|
||||
Body *models.Feedback
|
||||
/*Session ID
|
||||
/*Session UUID
|
||||
Required: true
|
||||
In: query
|
||||
*/
|
||||
SessionID string
|
||||
SessionUUID string
|
||||
}
|
||||
|
||||
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
|
||||
@@ -86,8 +86,8 @@ func (o *CreateFeedbackParams) BindRequest(r *http.Request, route *middleware.Ma
|
||||
res = append(res, errors.Required("body", "body", ""))
|
||||
}
|
||||
|
||||
qSessionID, qhkSessionID, _ := qs.GetOK("session_id")
|
||||
if err := o.bindSessionID(qSessionID, qhkSessionID, route.Formats); err != nil {
|
||||
qSessionUUID, qhkSessionUUID, _ := qs.GetOK("session_uuid")
|
||||
if err := o.bindSessionUUID(qSessionUUID, qhkSessionUUID, route.Formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
if len(res) > 0 {
|
||||
@@ -96,10 +96,10 @@ func (o *CreateFeedbackParams) BindRequest(r *http.Request, route *middleware.Ma
|
||||
return nil
|
||||
}
|
||||
|
||||
// bindSessionID binds and validates parameter SessionID from query.
|
||||
func (o *CreateFeedbackParams) bindSessionID(rawData []string, hasKey bool, formats strfmt.Registry) error {
|
||||
// bindSessionUUID binds and validates parameter SessionUUID from query.
|
||||
func (o *CreateFeedbackParams) bindSessionUUID(rawData []string, hasKey bool, formats strfmt.Registry) error {
|
||||
if !hasKey {
|
||||
return errors.Required("session_id", "query", rawData)
|
||||
return errors.Required("session_uuid", "query", rawData)
|
||||
}
|
||||
var raw string
|
||||
if len(rawData) > 0 {
|
||||
@@ -109,10 +109,10 @@ func (o *CreateFeedbackParams) bindSessionID(rawData []string, hasKey bool, form
|
||||
// Required: true
|
||||
// AllowEmptyValue: false
|
||||
|
||||
if err := validate.RequiredString("session_id", "query", raw); err != nil {
|
||||
if err := validate.RequiredString("session_uuid", "query", raw); err != nil {
|
||||
return err
|
||||
}
|
||||
o.SessionID = raw
|
||||
o.SessionUUID = raw
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
|
||||
// CreateFeedbackURL generates an URL for the create feedback operation
|
||||
type CreateFeedbackURL struct {
|
||||
SessionID string
|
||||
SessionUUID string
|
||||
|
||||
_basePath string
|
||||
// avoid unkeyed usage
|
||||
@@ -49,9 +49,9 @@ func (o *CreateFeedbackURL) Build() (*url.URL, error) {
|
||||
|
||||
qs := make(url.Values)
|
||||
|
||||
sessionIDQ := o.SessionID
|
||||
if sessionIDQ != "" {
|
||||
qs.Set("session_id", sessionIDQ)
|
||||
sessionUUIDQ := o.SessionUUID
|
||||
if sessionUUIDQ != "" {
|
||||
qs.Set("session_uuid", sessionUUIDQ)
|
||||
}
|
||||
|
||||
_result.RawQuery = qs.Encode()
|
||||
|
||||
@@ -32,11 +32,11 @@ type GetFeedbacksParams struct {
|
||||
// HTTP Request Object
|
||||
HTTPRequest *http.Request `json:"-"`
|
||||
|
||||
/*Session ID
|
||||
/*Session UUID
|
||||
Required: true
|
||||
In: query
|
||||
*/
|
||||
SessionID string
|
||||
SessionUUID string
|
||||
}
|
||||
|
||||
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
|
||||
@@ -50,8 +50,8 @@ func (o *GetFeedbacksParams) BindRequest(r *http.Request, route *middleware.Matc
|
||||
|
||||
qs := runtime.Values(r.URL.Query())
|
||||
|
||||
qSessionID, qhkSessionID, _ := qs.GetOK("session_id")
|
||||
if err := o.bindSessionID(qSessionID, qhkSessionID, route.Formats); err != nil {
|
||||
qSessionUUID, qhkSessionUUID, _ := qs.GetOK("session_uuid")
|
||||
if err := o.bindSessionUUID(qSessionUUID, qhkSessionUUID, route.Formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
if len(res) > 0 {
|
||||
@@ -60,10 +60,10 @@ func (o *GetFeedbacksParams) BindRequest(r *http.Request, route *middleware.Matc
|
||||
return nil
|
||||
}
|
||||
|
||||
// bindSessionID binds and validates parameter SessionID from query.
|
||||
func (o *GetFeedbacksParams) bindSessionID(rawData []string, hasKey bool, formats strfmt.Registry) error {
|
||||
// bindSessionUUID binds and validates parameter SessionUUID from query.
|
||||
func (o *GetFeedbacksParams) bindSessionUUID(rawData []string, hasKey bool, formats strfmt.Registry) error {
|
||||
if !hasKey {
|
||||
return errors.Required("session_id", "query", rawData)
|
||||
return errors.Required("session_uuid", "query", rawData)
|
||||
}
|
||||
var raw string
|
||||
if len(rawData) > 0 {
|
||||
@@ -73,10 +73,10 @@ func (o *GetFeedbacksParams) bindSessionID(rawData []string, hasKey bool, format
|
||||
// Required: true
|
||||
// AllowEmptyValue: false
|
||||
|
||||
if err := validate.RequiredString("session_id", "query", raw); err != nil {
|
||||
if err := validate.RequiredString("session_uuid", "query", raw); err != nil {
|
||||
return err
|
||||
}
|
||||
o.SessionID = raw
|
||||
o.SessionUUID = raw
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
|
||||
// GetFeedbacksURL generates an URL for the get feedbacks operation
|
||||
type GetFeedbacksURL struct {
|
||||
SessionID string
|
||||
SessionUUID string
|
||||
|
||||
_basePath string
|
||||
// avoid unkeyed usage
|
||||
@@ -49,9 +49,9 @@ func (o *GetFeedbacksURL) Build() (*url.URL, error) {
|
||||
|
||||
qs := make(url.Values)
|
||||
|
||||
sessionIDQ := o.SessionID
|
||||
if sessionIDQ != "" {
|
||||
qs.Set("session_id", sessionIDQ)
|
||||
sessionUUIDQ := o.SessionUUID
|
||||
if sessionUUIDQ != "" {
|
||||
qs.Set("session_uuid", sessionUUIDQ)
|
||||
}
|
||||
|
||||
_result.RawQuery = qs.Encode()
|
||||
|
||||
Reference in New Issue
Block a user