handlers

package
v0.0.0-...-eb19f60 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: GPL-3.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultPageNumber = 20
)

Variables

View Source
var Validator = validator.New()

Functions

This section is empty.

Types

type CommonResponse

type CommonResponse struct {
	Code      uint64      `json:"code"`
	Namespace string      `json:"namespace,omitempty"`
	Message   string      `json:"message,omitempty"`
	Data      interface{} `json:"data,omitempty"`
}

type HAPI

type HAPI struct {
	Committer     connector.Committer  `inject:"t"`
	RepoAPI       models.RepoAPI       `inject:"t"`
	RepoAPIParams models.RepoAPIParams `inject:"t"`
	RepoProject   models.RepoProject   `inject:"t"`
}

HAPI 操作者

func NewHAPI

func NewHAPI() *HAPI

NewHAPI 获取操作对象

func (*HAPI) Delete

func (p *HAPI) Delete(ctx *gin.Context)

func (*HAPI) Get

func (p *HAPI) Get(ctx *gin.Context)

func (*HAPI) Inject

func (p *HAPI) Inject(params map[string]interface{})

Inject 初始化函数

func (*HAPI) Post

func (p *HAPI) Post(ctx *gin.Context)

func (*HAPI) Put

func (p *HAPI) Put(ctx *gin.Context)

type HAPIParams

type HAPIParams struct {
	Committer     connector.Committer  `inject:"t"`
	RepoAPIParams models.RepoAPIParams `inject:"t"`
}

HAPIParams 操作者

func NewHAPIParams

func NewHAPIParams() *HAPIParams

NewHAPIParams 获取操作对象

func (*HAPIParams) Delete

func (p *HAPIParams) Delete(ctx *gin.Context)

func (*HAPIParams) Inject

func (p *HAPIParams) Inject(params map[string]interface{})

Inject 初始化函数

func (*HAPIParams) Post

func (p *HAPIParams) Post(ctx *gin.Context)

type HAPIs

type HAPIs struct {
	Committer connector.Committer `inject:"t"`
	RepoAPI   models.RepoAPI      `inject:"t"`
}

HAPIs 操作者

func NewHAPIs

func NewHAPIs() *HAPIs

NewHAPIs 获取操作对象

func (*HAPIs) Get

func (p *HAPIs) Get(ctx *gin.Context)

func (*HAPIs) Inject

func (p *HAPIs) Inject(params map[string]interface{})

Inject 初始化函数

type HFieldType

type HFieldType struct {
	Committer     connector.Committer  `inject:"t"`
	RepoFieldType models.RepoFieldType `inject:"t"`
}

HFieldType 操作者

func NewHFieldType

func NewHFieldType() *HFieldType

NewHFieldType 获取操作对象

func (*HFieldType) Get

func (p *HFieldType) Get(ctx *gin.Context)

func (*HFieldType) Inject

func (p *HFieldType) Inject(params map[string]interface{})

Inject 初始化函数

type HProject

type HProject struct {
	Committer   connector.Committer `inject:"t"`
	RepoProject models.RepoProject  `inject:"t"`
}

HProject 操作者

func NewHProject

func NewHProject() *HProject

NewHProject 获取操作对象

func (*HProject) Get

func (p *HProject) Get(ctx *gin.Context)

func (*HProject) Inject

func (p *HProject) Inject(params map[string]interface{})

Inject 初始化函数

func (*HProject) Post

func (p *HProject) Post(ctx *gin.Context)

func (*HProject) Put

func (p *HProject) Put(ctx *gin.Context)

type HProjectStatus

type HProjectStatus struct {
	Committer         connector.Committer      `inject:"t"`
	RepoProjectStatus models.RepoProjectStatus `inject:"t"`
}

HProjectStatus 操作者

func NewHProjectStatus

func NewHProjectStatus() *HProjectStatus

NewHProjectStatus 获取操作对象

func (*HProjectStatus) Get

func (p *HProjectStatus) Get(ctx *gin.Context)

func (*HProjectStatus) Inject

func (p *HProjectStatus) Inject(params map[string]interface{})

Inject 初始化函数

type HProjects

type HProjects struct {
	Committer   connector.Committer `inject:"t"`
	RepoProject models.RepoProject  `inject:"t"`
}

HProjects 操作者

func NewHProjects

func NewHProjects() *HProjects

NewHProjects 获取操作对象

func (*HProjects) Get

func (p *HProjects) Get(ctx *gin.Context)

func (*HProjects) Inject

func (p *HProjects) Inject(params map[string]interface{})

Inject 初始化函数

type MyQueue

type MyQueue struct {
	List *list.List
}

***************************** *** Method: Get *****************************

type QueryDeleteAPI

type QueryDeleteAPI struct {
	ID int64 `form:"id" validate:"required"`
}

type QueryDeleteAPIParams

type QueryDeleteAPIParams struct {
	ID int64 `form:"id" validate:"required"`
}

type QueryGetAPI

type QueryGetAPI struct {
	ID int `form:"id" validate:"required"`
}

type QueryGetAPIs

type QueryGetAPIs struct {
	ProjectID int `form:"pid" validate:"required"`
	Page      int `form:"page"`
	Number    int `form:"num"`
}

type QueryGetProject

type QueryGetProject struct {
	ID int `form:"id" validate:"required"`
}

QueryGetProject

type QueryGetProjects

type QueryGetProjects struct {
	Status string `form:"status"`
	Page   int    `form:"page"`
	Number int    `form:"num"`
}

QueryGetProjects 请求对象

type ReqPostAPI

type ReqPostAPI struct {
	ProjectID    int    `json:"project_id" validate:"required"`
	Name         string `json:"name" validate:"required"`
	Path         string `json:"path" validate:"required"`
	HttpMethodID int    `json:"http_method_id" validate:"required"`
	Description  string `json:"description"`
}

type ReqPostAPIParams

type ReqPostAPIParams struct {
	APIID         int64  `form:"aid" validate:"required"`
	ParentID      int64  `form:"parent_id"`
	APIParamsType int    `json:"api_params_type" validate:"required"`
	Key           string `json:"key" validate:"required"`
	FieldType     string `json:"field_type" validate:"required"`
	IsList        bool   `json:"is_list"`
	Required      bool   `json:"required"`
	Description   string `json:"description"`
	Sample        string `json:"sample"`
}

type ReqPostProject

type ReqPostProject struct {
	Name             string `json:"name" validate:"required"`
	Address          string `json:"address,omitempty"`
	Host             string `json:"host,omitempty"`
	ContactName      string `json:"contact_name"`
	ContactCellphone string `json:"contact_cellphone"`
	Brokerage        int64  `json:"brokerage"`
	Deposit          int64  `json:"deposit,omitempty"`
	Refund           int64  `json:"refund,omitempty"`
}

ReqPostProject

type ReqPutAPI

type ReqPutAPI struct {
	ID           int64  `json:"id" validate:"required"`
	Name         string `json:"name" validate:"required"`
	Path         string `json:"path" validate:"required"`
	HttpMethodID int    `json:"http_method_id" validate:"required"`
	Description  string `json:"description"`
}

type ReqPutProject

type ReqPutProject struct {
	ID               int    `json:"id" validate:"required"`
	Address          string `json:"address,omitempty"`
	Host             string `json:"host,omitempty"`
	ContactName      string `json:"contact_name"`
	ContactCellphone string `json:"contact_cellphone"`
	Brokerage        int64  `json:"brokerage"`
	Deposit          int64  `json:"deposit,omitempty"`
	Refund           int64  `json:"refund,omitempty"`
	Status           string `json:"status" validate:"required"`
}

ReqPutProject

type RespDeleteAPI

type RespDeleteAPI struct {
	CommonResponse
}

type RespDeleteAPIParams

type RespDeleteAPIParams struct {
	CommonResponse
}

type RespGetAPI

type RespGetAPI struct {
	CommonResponse
}

type RespGetAPIItem

type RespGetAPIItem struct {
	ID           int64  `json:"id"`
	ProjectID    int    `json:"project_id"`
	ProjectName  string `json:"project_name"`
	Name         string `json:"name"`
	Path         string `json:"path"`
	HttpMethodID int    `json:"http_method_id"`
	HttpMethod   string `json:"http_method"`
	Description  string `json:"description"`
	Status       string `json:"status"`

	RespGetAPIParamsData RespGetAPIParamsData `json:"params"`
}

type RespGetAPIParamsData

type RespGetAPIParamsData struct {
	Headers   []*RespGetAPIParamsItem `json:"headers"`
	Queries   []*RespGetAPIParamsItem `json:"queries"`
	Requests  []*RespGetAPIParamsItem `json:"requests"`
	Responses []*RespGetAPIParamsItem `json:"responses"`
}

type RespGetAPIParamsDataItem

type RespGetAPIParamsDataItem struct {
	Item *RespGetAPIParamsItem `json:"item"` // 自己

	SubParams []*RespGetAPIParamsDataItem `json:"sub_params"` // 子参数,自有 FieldType == object才可以
}

func (*RespGetAPIParamsDataItem) Rang

func (*RespGetAPIParamsDataItem) RangItems

type RespGetAPIParamsItem

type RespGetAPIParamsItem struct {
	ID            int64  `json:"id"`
	ParentID      int64  `json:"parent_id"`
	APIID         int64  `json:"api_id"`
	APIParamsType int    `json:"api_params_type"`
	Key           string `json:"key"`
	FieldType     string `json:"field_type"`
	IsList        bool   `json:"is_list"`
	Required      bool   `json:"required"`
	Description   string `json:"description"`
	Sample        string `json:"sample"`
}

type RespGetAPIs

type RespGetAPIs struct {
	CommonResponse
}

type RespGetAPIsItem

type RespGetAPIsItem struct {
	ID           int64  `json:"id"`
	ProjectID    int    `json:"project_id"`
	ProjectName  string `json:"project_name"`
	Name         string `json:"name"`
	Path         string `json:"path"`
	HttpMethodID int    `json:"http_method_id"`
	HttpMethod   string `json:"http_method"`
	Description  string `json:"description"`
	Status       string `json:"status"`
}

type RespGetFieldType

type RespGetFieldType struct {
	CommonResponse
}

type RespGetFieldTypeItem

type RespGetFieldTypeItem struct {
	ID          int    `json:"id"`
	Type        string `json:"type"`
	Description string `json:"description"`
}

type RespGetProject

type RespGetProject struct {
	CommonResponse
}

type RespGetProjectItem

type RespGetProjectItem struct {
	ID               int    `json:"id"`
	Name             string `json:"name"`
	Address          string `json:"address"`
	Host             string `json:"host"`
	ContactName      string `json:"contact_name"`
	ContactCellphone string `json:"contact_cellphone"`
	Brokerage        int64  `json:"brokerage"`
	Deposit          int64  `json:"deposit"`
	Refund           int64  `json:"refund"`
	Status           string `json:"status"`
}

RespGetProjectItem

type RespGetProjectStatus

type RespGetProjectStatus struct {
	CommonResponse
}

type RespGetProjectStatusItem

type RespGetProjectStatusItem struct {
	ID          string `json:"id"`
	Description string `json:"description"`
}

type RespGetProjects

type RespGetProjects struct {
	CommonResponse
}

type RespGetProjectsItem

type RespGetProjectsItem struct {
	ID               int       `json:"id"`
	Name             string    `json:"name"`
	Address          string    `json:"address"`
	Host             string    `json:"host"`
	ContactName      string    `json:"contact_name"`
	ContactCellphone string    `json:"contact_cellphone"`
	Brokerage        int64     `json:"brokerage"`
	Deposit          int64     `json:"deposit"`
	Refund           int64     `json:"refund"`
	Status           string    `json:"status"`
	CreatedAt        time.Time `json:"-"`
	UpdatedAt        time.Time `json:"-"`
	CreateTime       string    `json:"create_time"`
	UpdateTime       string    `json:"update_time"`
}

type RespPostAPI

type RespPostAPI struct {
	CommonResponse
}

type RespPostAPIParams

type RespPostAPIParams struct {
	CommonResponse
}

type RespPostProject

type RespPostProject struct {
	CommonResponse
}

type RespPutAPI

type RespPutAPI struct {
	CommonResponse
}

type RespPutProject

type RespPutProject struct {
	CommonResponse
}

Jump to

Keyboard shortcuts

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