config

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseConfig

func ParseConfig()

Types

type AutoApiActionDefined

type AutoApiActionDefined struct {
	Name     string                       `json:"Name" yaml:"Name"`         //api操作名称
	Describe string                       `json:"Describe" yaml:"Describe"` //api操作具体描述内容
	Enable   bool                         `json:"Enable" yaml:"Enable"`     //是否启用
	Plugins  []AutoApiActionPluginDefined `json:"Plugins" yaml:"Plugins"`   //该api操作的插件列表
}

AutoApiActionDefined 单个autoApi使用插件的定义

type AutoApiActionPluginDefined

type AutoApiActionPluginDefined struct {
	Enable       bool                            `json:"Enable" yaml:"Enable"`             //是否启用
	Name         string                          `json:"Name" yaml:"Name"`                 //插件名称,如:API_SEARCH,必须为注册的插件
	ExtendParams extendparams.CommonExtendParams `json:"ExtendParams" yaml:"ExtendParams"` //扩展参数
	Remark       string                          `json:"Remark" yaml:"Remark"`             //备注,如使用的插件用途的具体描述
}

AutoApiActionPluginDefined 单个autoApi使用插件的定义

type AutoApiConfig

type AutoApiConfig struct {
	Apis         []AutoApiDefined                `json:"Apis" yaml:"Apis"`
	ExtendParams extendparams.CommonExtendParams `json:"ExtendParams" yaml:"ExtendParams"` //扩展参数
}

type AutoApiDataDefined

type AutoApiDataDefined struct {
	//结构
	DataName  string                `json:"DataName" yaml:"DataName"`   //数据名称,用于给数据区分存储来源,如表名
	AutoTable bool                  `json:"AutoTable" yaml:"AutoTable"` //是否自动建表,true:自动检查并创建表,false:不检查
	Fields    []AutoApiFieldDefined `json:"Fields" yaml:"Fields"`
	Comment   string                `json:"Comment" yaml:"Comment"` //数据名称,用于给数据区分存储来源,如表名
}

func (AutoApiDataDefined) FieldNames

func (a AutoApiDataDefined) FieldNames() []string

type AutoApiDefined

type AutoApiDefined struct {
	Name     string `json:"Name" yaml:"Name"`         //api总称
	ShowName string `json:"ShowName" yaml:"ShowName"` //展示名称(一般为中文)
	Version  string `json:"Version" yaml:"Version"`   //版本,v1/v2 这样,为空则默认使用最新版本

	LoadFile string `json:"LoadFile" yaml:"LoadFile"` //加载文件路径,有路径值则从该路径加载覆盖当前AutoApi

	Actions []AutoApiActionDefined `json:"Actions" yaml:"Actions"` //使用的插件列表

	Data AutoApiDataDefined `json:"Data" yaml:"Data"` //数据定义

	Comment string `json:"Comment" yaml:"Comment"` //备注/注释说明
}

AutoApiDefined 单个autoApi的定义

type AutoApiFieldDefined

type AutoApiFieldDefined struct {
	Name     string `json:"Name" yaml:"Name"`         //字段名,如:name
	ShowName string `json:"ShowName" yaml:"ShowName"` //展示名称(一般为中文)

	//类型, 可为:
	//	varchar(32)
	//	bigint unsigned
	//	int unsigned
	//	tinyint unsigned
	//	datetime(3)
	SqlType string `json:"SqlType" yaml:"SqlType"`

	Default string `json:"Default" yaml:"Default"` //默认值
	Comment string `json:"Comment" yaml:"Comment"` //备注/注释说明

	ExtendParams extendparams.CommonExtendParams `json:"ExtendParams" yaml:"ExtendParams"` //扩展参数
}

AutoApiFieldDefined 单个autoApi字段的定义

func (*AutoApiFieldDefined) CreateSql

func (f *AutoApiFieldDefined) CreateSql() string

func (*AutoApiFieldDefined) Type

type GinHandleParam

type GinHandleParam struct {
	Method      string
	Path        string
	HandlerFunc []gin.HandlerFunc

	//下面用于生成swagger文档
	SwaggerPaths       map[string]spec.PathItem //对应路由的swagger路径集合
	SwaggerDefinitions map[string]spec.Schema   //对应路由的swagger定义集合
}

type PluginData

type PluginData struct {
	Api    AutoApiDefined             //当前api信息
	Action AutoApiActionDefined       //当前action信息
	Plugin AutoApiActionPluginDefined //当前plugin信息
}

PluginData 插件使用的参数合集

Jump to

Keyboard shortcuts

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