first
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
package config
|
||||
|
||||
type Amqp struct {
|
||||
Host string `mapstructure:"host" json:"host" yaml:"host"` // 服务器地址
|
||||
Port int `mapstructure:"port" json:"port" yaml:"port"` // 服务器端口
|
||||
Password string `mapstructure:"password" json:"password" yaml:"password"` // 密码
|
||||
User string `mapstructure:"user" json:"user" yaml:"user"`
|
||||
Vhost string `mapstructure:"vhost" json:"vhost" yaml:"vhost"`
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package config
|
||||
|
||||
type App struct {
|
||||
ApiUrl string `mapstructure:"apiUrl" json:"apiUrl" yaml:"apiUrl"`
|
||||
SecretKey string `mapstructure:"secretKey" json:"secretKey" yaml:"secretKey"`
|
||||
ImagePrefix string `mapstructure:"imagePrefix" json:"imagePrefix" yaml:"imagePrefix"`
|
||||
Platform string `mapstructure:"platform" json:"platform" yaml:"platform"`
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package config
|
||||
|
||||
var C Config
|
||||
|
||||
type Config struct {
|
||||
Port int `mapstructure:"port" json:"port" yaml:"port"`
|
||||
Env string `mapstructure:"env" json:"Env" yaml:"Env"`
|
||||
Mysql Mysql `mapstructure:"mysql" json:"mysql" yaml:"mysql"`
|
||||
Log Log `mapstructure:"log" json:"log" yaml:"log"`
|
||||
Redis Redis `mapstructure:"redis" json:"redis" yaml:"redis"`
|
||||
Jwt Jwt `mapstructure:"jwt" json:"jwt" yaml:"jwt"`
|
||||
Oss Oss `mapstructure:"oss" json:"oss" yaml:"oss"`
|
||||
Snowflake int64 `mapstructure:"snowflake" json:"snowflake" yaml:"snowflake"`
|
||||
Dysms Dysms `mapstructure:"dysms" json:"dysms" yaml:"dysms"`
|
||||
Wechat Wechat `mapstructure:"wechat" json:"wechat" yaml:"wechat"`
|
||||
App App `mapstructure:"app" json:"app" yaml:"app"`
|
||||
SuperKangaroo SuperKangaroo `mapstructure:"superKangaroo" json:"superKangaroo" yaml:"superKangaroo"`
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package config
|
||||
|
||||
type Dysms struct {
|
||||
DysmsAccessKey string `mapstructure:"dysms-access-key" json:"dysms-access-key" yaml:"dysms-access-key"`
|
||||
DysmsAccessSecret string `mapstructure:"dysms-access-secret" json:"dysms-access-secret" yaml:"dysms-access-secret"`
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package config
|
||||
|
||||
type Jwt struct {
|
||||
SignKey string `mapstructure:"sign-key" json:"sign-key" yaml:"sign-key"` // 私钥
|
||||
Ttl int `mapstructure:"ttl" json:"ttl" yaml:"ttl"` // 过期时间 小时
|
||||
Algo string `mapstructure:"algo" json:"algo" yaml:"algo"` // 加密方式
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package config
|
||||
|
||||
type Log struct {
|
||||
FilePath string `mapstructure:"file-path" json:"file-path" yaml:"file-path"` // 日志目录
|
||||
FileName string `mapstructure:"file-name" json:"file-name" yaml:"file-name"` // 日志名称
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package config
|
||||
|
||||
type Mysql struct {
|
||||
Host string `mapstructure:"host" json:"host" yaml:"host"` // 服务器地址
|
||||
Port int `mapstructure:"port" json:"port" yaml:"port"` // 端口
|
||||
DbName string `mapstructure:"db-name" json:"db-name" yaml:"db-name"` // 数据库名
|
||||
Username string `mapstructure:"username" json:"username" yaml:"username"` // 数据库用户名
|
||||
Password string `mapstructure:"password" json:"password" yaml:"password"` // 数据库密码
|
||||
MaxIdleConns int `mapstructure:"max-idle-cons" json:"MaxIdleConns" yaml:"max-idle-cons"` // 空闲中的最大连接数
|
||||
MaxOpenConns int `mapstructure:"max-open-cons" json:"MaxOpenConns" yaml:"max-open-cons"` // 打开到数据库的最大连接数
|
||||
Debug bool `mapstructure:"debug" json:"debug" yaml:"debug"` // 是否开启Gorm全局日志
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package config
|
||||
|
||||
type Oss struct {
|
||||
OssAccessKey string `mapstructure:"oss-access-key" json:"oss-access-key" yaml:"oss-access-key"`
|
||||
OssAccessKeySecret string `mapstructure:"oss-access-key-secret" json:"oss-access-key-secret" yaml:"oss-access-key-secret"`
|
||||
OssBucket string `mapstructure:"oss-bucket" json:"oss-bucket" yaml:"oss-bucket"`
|
||||
OssEndpoint string `mapstructure:"oss-endpoint" json:"oss-endpoint" yaml:"oss-endpoint"`
|
||||
OssCustomDomainName string `mapstructure:"oss-custom-domain-name" json:"oss-custom-domain-name" yaml:"oss-custom-domain-name"`
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package config
|
||||
|
||||
type Redis struct {
|
||||
Host string `mapstructure:"host" json:"host" yaml:"host"` // 服务器地址
|
||||
Port int `mapstructure:"port" json:"port" yaml:"port"` // 服务器端口
|
||||
Password string `mapstructure:"password" json:"password" yaml:"password"` // 密码
|
||||
PoolSize int `mapstructure:"pool-size" json:"pool-size" yaml:"pool-size"` // 连接池大小
|
||||
Db int `mapstructure:"db" json:"db" yaml:"db"` // 数据库
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package config
|
||||
|
||||
type SuperKangaroo struct {
|
||||
ApiUrl string `mapstructure:"apiUrl" json:"apiUrl" yaml:"apiUrl"`
|
||||
SecretKey string `mapstructure:"secretKey" json:"secretKey" yaml:"secretKey"`
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package config
|
||||
|
||||
type Wechat struct {
|
||||
AppId string `mapstructure:"app-id" json:"app-id" yaml:"app-id"`
|
||||
AppSecret string `mapstructure:"app-secret" json:"app-secret" yaml:"app-secret"`
|
||||
TestPayAppId string `mapstructure:"test-pay-app-id" json:"test-pay-app-id" yaml:"test-pay-app-id"`
|
||||
SinglePayNotifyUrl string `mapstructure:"single-pay-notify-url" json:"single-pay-notify-url" yaml:"single-pay-notify-url"` // 单项支付回调地址
|
||||
SingleRefundNotifyUrl string `mapstructure:"single-refund-notify-url" json:"single-refund-notify-url" yaml:"single-refund-notify-url"` // 单项退款回调地址
|
||||
MemberPayNotifyUrl string `mapstructure:"member-pay-notify-url" json:"member-pay-notify-url" yaml:"member-pay-notify-url"` // 会员支付回调地址
|
||||
MemberRefundNotifyUrl string `mapstructure:"member-refund-notify-url" json:"member-refund-notify-url" yaml:"member-refund-notify-url"` // 会员退款回调地址
|
||||
NotifyDomain string `mapstructure:"notify-domain" json:"notify-domain" yaml:"notify-domain"`
|
||||
Pay1281030301 Pay1281030301 `mapstructure:"pay-1281030301" json:"pay-1281030301" yaml:"pay-1281030301"`
|
||||
}
|
||||
|
||||
// Pay1281030301 app
|
||||
type Pay1281030301 struct {
|
||||
MchId string `mapstructure:"mch-id" json:"mch-id" yaml:"mch-id"` // 商户号
|
||||
V3ApiSecret string `mapstructure:"v3-api-secret" json:"v3-api-secret" yaml:"v3-api-secret"` // 商户APIv3密钥
|
||||
MchCertificateSerialNumber string `mapstructure:"mch-certificate-serial-number" json:"mch-certificate-serial-number" yaml:"mch-certificate-serial-number"` // 商户证书序列号
|
||||
PlatformCerts string `mapstructure:"platform-certs" json:"platform-certs" yaml:"platform-certs"` // 平台证书
|
||||
PrivateKey string `mapstructure:"private-key" json:"private-key" yaml:"private-key"`
|
||||
Certificate string `mapstructure:"certificate" json:"certificate" yaml:"certificate"`
|
||||
}
|
||||
Reference in New Issue
Block a user