httpapi

package
v2.11.7 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Search(c *gin.Context)

@tags admin-http-api @accept json @produce json @param Authorization header string true "bearer token" @param "query string" query httpapi.HttpApiSearchRequest true "search http apis" @success 200 {object} response.Response{data=httpapi.HttpApiSearchData} @failure 400 {object} response.ErrorResponse "code: 400-001(Bad Request), 400-002(request validation failed)" @failure 401 {object} response.ErrorResponse "code: 401-001(Unauthorized)" @failure 403 {object} response.ErrorResponse "code: 403-001(Forbidden)" @failure 500 {object} response.ErrorResponse "code: 500-001(Internal Server Error)" @router /api/admin/http-api [get]

Types

type HttpApiData

type HttpApiData struct {
	Id        uint      `json:"id" mapstructure:"id" validate:"required"`
	Method    string    `json:"method" mapstructure:"method" validate:"required"`
	Path      string    `json:"path" mapstructure:"path" validate:"required"`
	CreatedAt time.Time `json:"created_at" mapstructure:"created_at" validate:"required" format:"date-time"`
	UpdatedAt time.Time `json:"updated_at" mapstructure:"updated_at" validate:"required" format:"date-time"`
}

func (*HttpApiData) Fill

func (data *HttpApiData) Fill(m *model.HttpApi)

type HttpApiSearchData

type HttpApiSearchData struct {
	HttpApis                      []HttpApiData `json:"http_apis" mapstructure:"http_apis" validate:"required"`
	pagination.PaginationResponse `mapstructure:",squash"`
}

type HttpApiSearchRequest

type HttpApiSearchRequest struct {
	Method string `form:"method" schema:"method,omitempty" structs:"method,omitempty"`
	Path   string `form:"path" schema:"path,omitempty" structs:"path,omitempty"`
	pagination.PaginationRequest
}

type Rule

type Rule struct {
	Object string `json:"object" binding:"required,startswith=/"`
	Action string `json:"action" binding:"required,oneof=GET POST PUT PATCH DELETE"`
}

Jump to

Keyboard shortcuts

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