yapi

package
v0.0.0-...-f0d4a1f Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetailToBasicModel

func DetailToBasicModel(detail *ProjectDetailInfo) *bo.HttpProject

Types

type ApiClient

type ApiClient struct{}

func NewApiClient

func NewApiClient() *ApiClient

func (*ApiClient) QueryHttpProjectInfo

func (y *ApiClient) QueryHttpProjectInfo(token string, apiIdList string) (*bo.HttpProject, error)

func (*ApiClient) QueryYapiProjectInfo

func (y *ApiClient) QueryYapiProjectInfo(token string, apiIdList string) (*ProjectDetailInfo, error)

QueryYapiProjectInfo 查询Yapi 基础信息

type ApiInfo

type ApiInfo struct {
	Id           int64           `json:"_id"`
	Method       string          `json:"method"`
	Path         string          `json:"path"`
	Title        string          `json:"title"`
	ReqQueryList []*ReqQueryItem `json:"req_query"`     // GET
	ReqBodyType  string          `json:"req_body_type"` // POST
	ReqBodyOther string          `json:"req_body_other"`
	ResBodyType  string          `json:"res_body_type"` // POST
	ResBody      string          `json:"res_body"`
}

type PageApiInfo

type PageApiInfo struct {
	Count int        `json:"count"`
	Total int        `json:"total"`
	List  []*ApiInfo `json:"list"`
}

type ProjectDetailInfo

type ProjectDetailInfo struct {
	ProjectInfo *ProjectInfo
	ApiList     []*ApiInfo
}

type ProjectInfo

type ProjectInfo struct {
	ID       int    `json:"_id"`
	Name     string `json:"name"`     // brick
	Basepath string `json:"basepath"` // /brick
}

type ReqQueryItem

type ReqQueryItem struct {
	Id       string `json:"_id"`
	Name     string `json:"name"`
	Example  string `json:"example"`
	Desc     string `json:"desc"`
	Required string `json:"required"`
}

type StructWrapper

type StructWrapper struct {
	Type        string                    `json:"type"`
	Properties  map[string]*StructWrapper `json:"properties"`
	Required    []string                  `json:"required"`
	Items       *StructWrapper            `json:"items"`
	Description string                    `json:"description"`
}

StructWrapper type(object, array, 基础类型)

func ConvertJsonStructWrap

func ConvertJsonStructWrap(json string) (res *StructWrapper, err error)

Jump to

Keyboard shortcuts

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