update
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user