Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2de73fea00 | ||
|
|
4b73f086b1 | ||
|
|
c08950c10a | ||
|
|
d691648916 | ||
|
|
8060cdb508 | ||
|
|
50c23df124 | ||
|
|
04b8e5b03b | ||
|
|
dd95b8d8b1 | ||
|
|
dd9a692858 |
@@ -1,12 +1,14 @@
|
|||||||
package conf
|
package conf
|
||||||
|
|
||||||
type Base struct {
|
type Base struct {
|
||||||
Service string `yaml:"Service"` // 服务名称
|
Service string `yaml:"Service"` // 服务名称
|
||||||
Port string `yaml:"Port"` // 服务监听端口,0为自动随机端口
|
Port string `yaml:"Port"` // 服务监听端口,0为自动随机端口
|
||||||
Cache string `yaml:"Cache"` // REDIS缓存
|
Cache string `yaml:"Cache"` // REDIS缓存
|
||||||
SecretKey string `yaml:"SecretKey"` // 服务秘钥
|
SecretKey string `yaml:"SecretKey"` // 服务秘钥
|
||||||
BindIP string `yaml:"BindIP"` // 绑定IP
|
BindIP string `yaml:"BindIP"` // 绑定IP
|
||||||
Addr string `yaml:"Addr"`
|
Addr string `yaml:"Addr"`
|
||||||
|
OnMicroService bool `yaml:"OnMicroService"`
|
||||||
|
LoginUrl string `yaml:"LoginUrl"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type DBConf struct {
|
type DBConf struct {
|
||||||
@@ -48,11 +50,14 @@ type RpcConf struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type OssConf struct {
|
type OssConf struct {
|
||||||
|
Platform string `yaml:"Platform"` // oss平台:aliyun,tencent,huawei,aws,minio
|
||||||
Site string `yaml:"Site"` // oss站点HOST
|
Site string `yaml:"Site"` // oss站点HOST
|
||||||
Endpoint string `yaml:"Endpoint"` // oss服务接入地址
|
Endpoint string `yaml:"Endpoint"` // oss服务接入地址
|
||||||
Region string `yaml:"Region"` // oss服务区域
|
Region string `yaml:"Region"` // oss服务区域
|
||||||
AccessKeyID string `yaml:"AccessKeyId"` // oss AccessKeyId
|
AccessKeyID string `yaml:"AccessKeyId"` // oss AccessKeyId
|
||||||
AccessKeySecret string `yaml:"AccessKeySecret"` // oss AccessKeySecret
|
AccessKeySecret string `yaml:"AccessKeySecret"` // oss AccessKeySecret
|
||||||
|
UseSSL bool `yaml:"UseSSL"` // 是否使用SSL
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type MqConf struct {
|
type MqConf struct {
|
||||||
|
|||||||
14
oplog/new.go
Normal file
14
oplog/new.go
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
package oplog
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
|
||||||
|
"git.apinb.com/bsm-sdk/core/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
func New(endpoint string, data []*LogItem) {
|
||||||
|
jsonBytes, _ := json.Marshal(data)
|
||||||
|
|
||||||
|
go utils.HttpPost(endpoint, nil, jsonBytes)
|
||||||
|
|
||||||
|
}
|
||||||
18
oplog/types.go
Normal file
18
oplog/types.go
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
package oplog
|
||||||
|
|
||||||
|
type LogItem struct {
|
||||||
|
OpID uint `json:"op_id"`
|
||||||
|
OpName string `json:"op_name"`
|
||||||
|
OpType string `json:"op_type"`
|
||||||
|
Text string `json:"text"`
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
Type_Login string = "login"
|
||||||
|
Type_Logout string = "logout"
|
||||||
|
Type_Register string = "register"
|
||||||
|
Type_Update string = "update"
|
||||||
|
Type_Delete string = "delete"
|
||||||
|
Type_Query string = "query"
|
||||||
|
Type_Other string = "other"
|
||||||
|
)
|
||||||
@@ -21,13 +21,13 @@ type (
|
|||||||
// standard ID,Identity definition.
|
// standard ID,Identity definition.
|
||||||
Std_IDIdentity struct {
|
Std_IDIdentity struct {
|
||||||
ID uint `gorm:"primarykey;" json:"id"`
|
ID uint `gorm:"primarykey;" json:"id"`
|
||||||
Identity string `gorm:"column:identity;type:varchar(36);uniqueIndex;default:uuid_generate_v4()" json:"identity"` // 唯一标识,24位NanoID,36位为ULID
|
Identity string `gorm:"column:identity;type:varchar(36);uniqueIndex;" json:"identity"` // 唯一标识,24位NanoID,36位为ULID
|
||||||
}
|
}
|
||||||
|
|
||||||
// standard ID,Created,Updated,Deleted definition.
|
// standard ID,Created,Updated,Deleted definition.
|
||||||
Std_IICUDS struct {
|
Std_IICUDS struct {
|
||||||
ID uint `gorm:"primarykey;" json:"id"`
|
ID uint `gorm:"primarykey;" json:"id"`
|
||||||
Identity string `gorm:"column:identity;type:varchar(36);uniqueIndex;default:uuid_generate_v4()" json:"identity"` // 唯一标识,24位NanoID,36位为ULID
|
Identity string `gorm:"column:identity;type:varchar(36);uniqueIndex;" json:"identity"` // 唯一标识,24位NanoID,36位为ULID
|
||||||
CreatedAt time.Time `json:"created_at"`
|
CreatedAt time.Time `json:"created_at"`
|
||||||
UpdatedAt time.Time `json:"updated_at"`
|
UpdatedAt time.Time `json:"updated_at"`
|
||||||
DeletedAt gorm.DeletedAt `gorm:"index;" json:"deleted_at"`
|
DeletedAt gorm.DeletedAt `gorm:"index;" json:"deleted_at"`
|
||||||
@@ -51,7 +51,7 @@ type (
|
|||||||
// standard PassportID,PassportIdentity definition.
|
// standard PassportID,PassportIdentity definition.
|
||||||
Std_Passport struct {
|
Std_Passport struct {
|
||||||
PassportID uint `gorm:"column:passport_id;Index;" json:"passport_id"`
|
PassportID uint `gorm:"column:passport_id;Index;" json:"passport_id"`
|
||||||
PassportIdentity string `gorm:"column:passport_identity;type:varchar(36);Index;default:uuid_generate_v4()" json:"passport_identity"` // 用户唯一标识,24位NanoID,36位为ULID
|
PassportIdentity string `gorm:"column:passport_identity;type:varchar(36);Index;" json:"passport_identity"` // 用户唯一标识,24位NanoID,36位为ULID
|
||||||
}
|
}
|
||||||
|
|
||||||
// standard ID definition.
|
// standard ID definition.
|
||||||
@@ -61,7 +61,7 @@ type (
|
|||||||
|
|
||||||
// standard Identity definition.
|
// standard Identity definition.
|
||||||
Std_Identity struct {
|
Std_Identity struct {
|
||||||
Identity string `gorm:"column:identity;type:varchar(36);uniqueIndex;default:uuid_generate_v4()" json:"identity"` // 唯一标识,24位NanoID,36位为ULID
|
Identity string `gorm:"column:identity;type:varchar(36);uniqueIndex;" json:"identity"` // 唯一标识,24位NanoID,36位为ULID
|
||||||
}
|
}
|
||||||
|
|
||||||
// standard Status definition.
|
// standard Status definition.
|
||||||
|
|||||||
Reference in New Issue
Block a user