feat : script service
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-01-23 14:48:44 +08:00
parent ab78141e7d
commit b3c49eaa34
17 changed files with 485 additions and 84 deletions
+7 -4
View File
@@ -12,11 +12,14 @@ import (
"time"
)
func GetContextDB(ctx context.Context, db *gorm.DB) (*gorm.DB, error) {
if err := db.Use(&TracePlugin{}); err != nil {
return nil, err
func init() {
if err := DB.Use(&TracePlugin{}); err != nil {
panic(err)
}
return db.WithContext(ctx), nil
}
func GetContextDB(ctx context.Context) (*gorm.DB, error) {
return DB.WithContext(ctx), nil
}
type SQL struct {