app

package
v0.0.0-...-8cce4fe Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cache

func Cache() *cache

Cache 获取缓存组件实例

func Db

func Db(confName string) *gorm.DB

Db 获取数据库连接

参数:
confName 数据库配置名称

func DbConf

func DbConf() *databaseConf

DbConf 读取数据库配置信息

func Request

func Request(ctx *gin.Context) *request

Request 获取请求实例

func Response

func Response(ctx *gin.Context) *response

Response 获取response实例

Types

type Conf

type Conf struct {
	Module      string       `yaml:"module"`       //项目名称,与go.mod中module保持一致
	Env         string       `yaml:"env"`          //当前运行环境, dev 开发环境,test 测试环境,prod 生产环境
	UpdateMain  bool         `yaml:"update_main"`  //创建或更新模型时是否重新生成入口文件main.go, 默认为true
	Debug       bool         `yaml:"debug"`        //是否开启调试模式
	ServerHost  string       `yaml:"server_host"`  //服务器地址或域名
	ServerPort  string       `yaml:"server_port"`  //服务运行的端口
	CrossDomain *crossDomain `yaml:"cross_domain"` //跨域请求配置
	Upload      *upload      `yaml:"upload"`       //上传配置
	Water       *Water       `yaml:"water"`        //水印配置
	StaticDir   string       `yaml:"static_dir"`   //静态资源目录
}

Conf 应用配置

func Config

func Config() *Conf

Config 读取app应用配置

type FontInfo

type FontInfo struct {
	Size     float64 `yaml:"size"`     //文字大小
	Message  string  `yaml:"message"`  //文字内容
	Position int     `yaml:"position"` //文字存放位置
	Dx       int     `yaml:"dx"`       //文字x轴留白距离
	Dy       int     `yaml:"dy"`       //文字y轴留白距离
	R        uint8   `yaml:"r"`        //文字颜色值RGBA中的R值
	G        uint8   `yaml:"g"`        //文字颜色值RGBA中的G值
	B        uint8   `yaml:"b"`        //文字颜色值RGBA中的B值
	A        uint8   `yaml:"a"`        //文字颜色值RGBA中的A值
}

FontInfo 水印文字配置信息

type Water

type Water struct {
	Enable    bool     `yaml:"enable"`     //是否启用水印
	WaterFont string   `yaml:"water_font"` //水印字体路径
	Conf      FontInfo `yaml:"conf"`       //水印配置
}

Water 图片上传水印设置

Directories

Path Synopsis
Package route 路由
Package route 路由
vuecmf
controller
Package controller 控制器
Package controller 控制器
helper
Package helper 助手工具
Package helper 助手工具
middleware
Package middleware 中间件
Package middleware 中间件
model
Package model 模型
Package model 模型
service
Package service 服务
Package service 服务

Jump to

Keyboard shortcuts

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