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