openapi

package
v0.0.0-...-1920916 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package openapi provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.11.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

func RegisterHandlers

func RegisterHandlers(router *gin.Engine, si ServerInterface) *gin.Engine

RegisterHandlers creates http.Handler with routing matching OpenAPI spec.

func RegisterHandlersWithOptions

func RegisterHandlersWithOptions(router *gin.Engine, si ServerInterface, options GinServerOptions) *gin.Engine

RegisterHandlersWithOptions creates http.Handler with additional options

Types

type AddThirdpartyJSONBody

type AddThirdpartyJSONBody = AddThirdpartyRequest

AddThirdpartyJSONBody defines parameters for AddThirdparty.

type AddThirdpartyJSONRequestBody

type AddThirdpartyJSONRequestBody = AddThirdpartyJSONBody

AddThirdpartyJSONRequestBody defines body for AddThirdparty for application/json ContentType.

type AddThirdpartyRequest

type AddThirdpartyRequest struct {
	Url string `json:"url"`
}

AddThirdpartyRequest defines model for AddThirdpartyRequest.

type AddTimerecordJSONBody

type AddTimerecordJSONBody = AddTimerecordRequest

AddTimerecordJSONBody defines parameters for AddTimerecord.

type AddTimerecordJSONRequestBody

type AddTimerecordJSONRequestBody = AddTimerecordJSONBody

AddTimerecordJSONRequestBody defines body for AddTimerecord for application/json ContentType.

type AddTimerecordRequest

type AddTimerecordRequest struct {
	Employee  uint64          `json:"employee"`
	EntryTime TimerecordTime  `json:"entry_time"`
	ExitTime  *TimerecordTime `json:"exit_time,omitempty"`
}

AddTimerecordRequest defines model for AddTimerecordRequest.

type AddTimerecordResponse

type AddTimerecordResponse struct {
	Employee  uint64          `json:"employee"`
	EntryTime TimerecordTime  `json:"entry_time"`
	ExitTime  *TimerecordTime `json:"exit_time,omitempty"`
	ID        uint64          `json:"id"`
}

AddTimerecordResponse defines model for AddTimerecordResponse.

type CreateEmployeeJSONBody

type CreateEmployeeJSONBody = CreateEmployeeRequest

CreateEmployeeJSONBody defines parameters for CreateEmployee.

type CreateEmployeeJSONRequestBody

type CreateEmployeeJSONRequestBody = CreateEmployeeJSONBody

CreateEmployeeJSONRequestBody defines body for CreateEmployee for application/json ContentType.

type CreateEmployeeRequest

type CreateEmployeeRequest struct {
	Meta    Meta   `json:"meta"`
	Name    string `json:"name"`
	PhotoID uint64 `json:"photo_id"`
}

CreateEmployeeRequest defines model for CreateEmployeeRequest.

type CreateEmployeeResponse

type CreateEmployeeResponse struct {
	ID      uint64 `json:"id"`
	Meta    Meta   `json:"meta"`
	Name    string `json:"name"`
	PhotoID uint64 `json:"photo_id"`
}

CreateEmployeeResponse defines model for CreateEmployeeResponse.

type DeleteEmployeeParams

type DeleteEmployeeParams struct {
	// Employee ID
	ID uint64 `form:"id" json:"id"`
}

DeleteEmployeeParams defines parameters for DeleteEmployee.

type DeleteEmployeeResponse

type DeleteEmployeeResponse struct {
	Message string `json:"message"`
}

DeleteEmployeeResponse defines model for DeleteEmployeeResponse.

type DownloadImageParams

type DownloadImageParams struct {
	// Image ID
	ID uint64 `form:"id" json:"id"`
}

DownloadImageParams defines parameters for DownloadImage.

type Employee

type Employee struct {
	ID      uint64 `json:"id"`
	Meta    Meta   `json:"meta"`
	Name    string `json:"name"`
	PhotoID uint64 `json:"photo_id"`
}

Employee defines model for Employee.

type EmployeeBase

type EmployeeBase struct {
	Meta    Meta   `json:"meta"`
	Name    string `json:"name"`
	PhotoID uint64 `json:"photo_id"`
}

EmployeeBase defines model for EmployeeBase.

type Error

type Error struct {
	Error string `json:"error"`
}

Error defines model for Error.

type GetEmployeeParams

type GetEmployeeParams struct {
	// Employee ID
	ID uint64 `form:"id" json:"id"`
}

GetEmployeeParams defines parameters for GetEmployee.

type GetEmployeeResponse

type GetEmployeeResponse struct {
	ID      uint64 `json:"id"`
	Meta    Meta   `json:"meta"`
	Name    string `json:"name"`
	PhotoID uint64 `json:"photo_id"`
}

GetEmployeeResponse defines model for GetEmployeeResponse.

type GetImageDescriptionParams

type GetImageDescriptionParams struct {
	// Image ID
	ID uint64 `form:"id" json:"id"`
}

GetImageDescriptionParams defines parameters for GetImageDescription.

type GetImageDescriptionResponse

type GetImageDescriptionResponse struct {
	ID   uint64 `json:"id"`
	Path string `json:"path"`
}

GetImageDescriptionResponse defines model for GetImageDescriptionResponse.

type GinServerOptions

type GinServerOptions struct {
	BaseURL     string
	Middlewares []MiddlewareFunc
}

GinServerOptions provides options for the Gin server.

type Image

type Image struct {
	ID   uint64 `json:"id"`
	Path string `json:"path"`
}

Image defines model for Image.

type LastTimerecordByEmploeeIDParams

type LastTimerecordByEmploeeIDParams struct {
	// Employee ID
	ID uint64 `form:"id" json:"id"`
}

LastTimerecordByEmploeeIDParams defines parameters for LastTimerecordByEmploeeID.

type LastTimerecordByEmploeeIDResponse

type LastTimerecordByEmploeeIDResponse struct {
	Employee  uint64          `json:"employee"`
	EntryTime TimerecordTime  `json:"entry_time"`
	ExitTime  *TimerecordTime `json:"exit_time,omitempty"`
	ID        uint64          `json:"id"`
}

LastTimerecordByEmploeeIDResponse defines model for LastTimerecordByEmploeeIDResponse.

type ListEmployeesResponse

type ListEmployeesResponse = []Employee

ListEmployeesResponse defines model for ListEmployeesResponse.

type ListThirdpartyResponse

type ListThirdpartyResponse = []string

ListThirdpartyResponse defines model for ListThirdpartyResponse.

type ListTimerecordResponse

type ListTimerecordResponse = []Timerecord

ListTimerecordResponse defines model for ListTimerecordResponse.

type Meta

type Meta struct {
	AdditionalProperties map[string]interface{} `json:"-"`
}

Meta defines model for Meta.

func (Meta) Get

func (a Meta) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for Meta. Returns the specified element and whether it was found

func (Meta) MarshalJSON

func (a Meta) MarshalJSON() ([]byte, error)

Override default JSON handling for Meta to handle AdditionalProperties

func (*Meta) Set

func (a *Meta) Set(fieldName string, value interface{})

Setter for additional properties for Meta

func (*Meta) UnmarshalJSON

func (a *Meta) UnmarshalJSON(b []byte) error

Override default JSON handling for Meta to handle AdditionalProperties

type MiddlewareFunc

type MiddlewareFunc func(c *gin.Context)

type RecognizeEmployeeResponse

type RecognizeEmployeeResponse struct {
	ID      uint64 `json:"id"`
	Meta    Meta   `json:"meta"`
	Name    string `json:"name"`
	PhotoID uint64 `json:"photo_id"`
}

RecognizeEmployeeResponse defines model for RecognizeEmployeeResponse.

type ServerInterface

type ServerInterface interface {
	// Upload image on server
	// (POST /image/upload)
	UploadImage(c *gin.Context)
	// Get image description
	// (GET /images/data)
	GetImageDescription(c *gin.Context, params GetImageDescriptionParams)
	// Download image from server
	// (GET /images/file)
	DownloadImage(c *gin.Context, params DownloadImageParams)
	// Create new employee
	// (POST /staff/add)
	CreateEmployee(c *gin.Context)
	// Get all staff
	// (GET /staff/all)
	ListEmployees(c *gin.Context)
	// Delete employee
	// (DELETE /staff/delete)
	DeleteEmployee(c *gin.Context, params DeleteEmployeeParams)
	// Get employee
	// (GET /staff/get)
	GetEmployee(c *gin.Context, params GetEmployeeParams)
	// Recognize employee
	// (POST /staff/recognize)
	RecognizeEmployee(c *gin.Context)
	// Update employee
	// (PUT /staff/update)
	UpdateEmployee(c *gin.Context)
	// Add new thirdparty link
	// (POST /thirdparty/add)
	AddThirdparty(c *gin.Context)
	// Get thirdparty list of links
	// (GET /thirdparty/all)
	ListThirdparty(c *gin.Context)
	// Save timerecord event about staff
	// (POST /timerecord/add)
	AddTimerecord(c *gin.Context)
	// Get list of all timerecord events
	// (GET /timerecord/all)
	ListTimerecord(c *gin.Context)
	// Get last timerecord by employee
	// (GET /timerecord/lastbyemployee)
	LastTimerecordByEmploeeID(c *gin.Context, params LastTimerecordByEmploeeIDParams)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) AddThirdparty

func (siw *ServerInterfaceWrapper) AddThirdparty(c *gin.Context)

AddThirdparty operation middleware

func (*ServerInterfaceWrapper) AddTimerecord

func (siw *ServerInterfaceWrapper) AddTimerecord(c *gin.Context)

AddTimerecord operation middleware

func (*ServerInterfaceWrapper) CreateEmployee

func (siw *ServerInterfaceWrapper) CreateEmployee(c *gin.Context)

CreateEmployee operation middleware

func (*ServerInterfaceWrapper) DeleteEmployee

func (siw *ServerInterfaceWrapper) DeleteEmployee(c *gin.Context)

DeleteEmployee operation middleware

func (*ServerInterfaceWrapper) DownloadImage

func (siw *ServerInterfaceWrapper) DownloadImage(c *gin.Context)

DownloadImage operation middleware

func (*ServerInterfaceWrapper) GetEmployee

func (siw *ServerInterfaceWrapper) GetEmployee(c *gin.Context)

GetEmployee operation middleware

func (*ServerInterfaceWrapper) GetImageDescription

func (siw *ServerInterfaceWrapper) GetImageDescription(c *gin.Context)

GetImageDescription operation middleware

func (*ServerInterfaceWrapper) LastTimerecordByEmploeeID

func (siw *ServerInterfaceWrapper) LastTimerecordByEmploeeID(c *gin.Context)

LastTimerecordByEmploeeID operation middleware

func (*ServerInterfaceWrapper) ListEmployees

func (siw *ServerInterfaceWrapper) ListEmployees(c *gin.Context)

ListEmployees operation middleware

func (*ServerInterfaceWrapper) ListThirdparty

func (siw *ServerInterfaceWrapper) ListThirdparty(c *gin.Context)

ListThirdparty operation middleware

func (*ServerInterfaceWrapper) ListTimerecord

func (siw *ServerInterfaceWrapper) ListTimerecord(c *gin.Context)

ListTimerecord operation middleware

func (*ServerInterfaceWrapper) RecognizeEmployee

func (siw *ServerInterfaceWrapper) RecognizeEmployee(c *gin.Context)

RecognizeEmployee operation middleware

func (*ServerInterfaceWrapper) UpdateEmployee

func (siw *ServerInterfaceWrapper) UpdateEmployee(c *gin.Context)

UpdateEmployee operation middleware

func (*ServerInterfaceWrapper) UploadImage

func (siw *ServerInterfaceWrapper) UploadImage(c *gin.Context)

UploadImage operation middleware

type Timerecord

type Timerecord struct {
	Employee  uint64          `json:"employee"`
	EntryTime TimerecordTime  `json:"entry_time"`
	ExitTime  *TimerecordTime `json:"exit_time,omitempty"`
	ID        uint64          `json:"id"`
}

Timerecord defines model for Timerecord.

type TimerecordBase

type TimerecordBase struct {
	Employee  uint64          `json:"employee"`
	EntryTime TimerecordTime  `json:"entry_time"`
	ExitTime  *TimerecordTime `json:"exit_time,omitempty"`
}

TimerecordBase defines model for TimerecordBase.

type TimerecordTime

type TimerecordTime struct {
	PhotoId uint64    `json:"photo_id"`
	Time    time.Time `json:"time"`
}

TimerecordTime defines model for TimerecordTime.

type UpdateEmployeeJSONBody

type UpdateEmployeeJSONBody = UpdateEmployeeRequest

UpdateEmployeeJSONBody defines parameters for UpdateEmployee.

type UpdateEmployeeJSONRequestBody

type UpdateEmployeeJSONRequestBody = UpdateEmployeeJSONBody

UpdateEmployeeJSONRequestBody defines body for UpdateEmployee for application/json ContentType.

type UpdateEmployeeRequest

type UpdateEmployeeRequest struct {
	ID      uint64 `json:"id"`
	Meta    Meta   `json:"meta"`
	Name    string `json:"name"`
	PhotoID uint64 `json:"photo_id"`
}

UpdateEmployeeRequest defines model for UpdateEmployeeRequest.

type UpdateEmployeeResponse

type UpdateEmployeeResponse struct {
	ID      uint64 `json:"id"`
	Meta    Meta   `json:"meta"`
	Name    string `json:"name"`
	PhotoID uint64 `json:"photo_id"`
}

UpdateEmployeeResponse defines model for UpdateEmployeeResponse.

type UploadImageResponse

type UploadImageResponse struct {
	ID   uint64 `json:"id"`
	Path string `json:"path"`
}

UploadImageResponse defines model for UploadImageResponse.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL