release revsuit vBeta0.1.0 (#15)

Co-authored-by: E99p1ant <[email protected]>
This commit is contained in:
Li4n0
2021-05-16 12:11:35 +08:00
committed by GitHub
co-authored by E99p1ant
parent b39ee101f9
commit 5b63e90390
98 changed files with 2357 additions and 623 deletions
+7 -7
View File
@@ -14,15 +14,15 @@ type Rule interface {
}
type BaseRule struct {
Rule `gorm:"-" json:"-"`
ID uint `gorm:"primarykey" form:"id" json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Rule `gorm:"-" json:"-" yaml:"-"`
ID uint `gorm:"primarykey" form:"id" json:"id" yaml:"-"`
CreatedAt time.Time `json:"created_at" yaml:"-"`
UpdatedAt time.Time `json:"updated_at" yaml:"-"`
Name string `gorm:"index;unique;not null;" form:"name" json:"name"`
FlagFormat string `gorm:"unique;not null;" form:"flag_format" json:"flag_format"`
FlagFormat string `gorm:"unique;not null;" form:"flag_format" json:"flag_format" yaml:"flag_format"`
flagCatcher *regexp.Regexp `gorm:"-" json:"-"`
Rank int `gorm:"default:0" json:"rank" form:"rank"`
PushToClient bool `gorm:"default:false;not null;" form:"push_to_client" json:"push_to_client"`
PushToClient bool `gorm:"default:false;not null;" form:"push_to_client" json:"push_to_client" yaml:"push_to_client"`
Notice bool `gorm:"default:false;not null;" form:"notice" json:"notice"`
}
@@ -51,7 +51,7 @@ func (br BaseRule) Match(s string) (flag, flagGroup string, vars map[string]stri
}
flag = matched[0]
if len(matched) > 1 && len(groupNames) == 0 {
if len(matched) > 1 && groupNames[1] == "" {
flagGroup = matched[1]
}