release 0.1.3-beta (#19)

Co-authored-by: E99p1ant <[email protected]>
This commit is contained in:
Li4n0
2021-05-25 20:41:37 +08:00
committed by GitHub
co-authored by E99p1ant
parent 1144f67d37
commit cbbf3ba0ba
68 changed files with 640 additions and 197 deletions
+4 -4
View File
@@ -14,7 +14,7 @@ var _ record.Record = (*Record)(nil)
type Record struct {
Method string `gorm:"index" form:"method" json:"method"`
Path string `form:"path" json:"path"`
URI string `form:"uri" json:"uri"`
record.BaseRecord
RawRequest string `json:"raw_request" notice:"-"`
Rule Rule `gorm:"foreignKey:RuleName;references:Name;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;" form:"-" json:"-" notice:"-"`
@@ -37,7 +37,7 @@ func NewRecord(rule *Rule, flag, method, url, ip, area, raw string) (r *Record,
RequestTime: time.Now(),
},
Method: method,
Path: url,
URI: url,
RawRequest: raw,
Rule: *rule,
}
@@ -78,8 +78,8 @@ func ListRecords(c *gin.Context) {
if httpRecord.Method != "" {
db.Where("method = ?", httpRecord.Method)
}
if httpRecord.Path != "" {
db.Where("path like ?", "%"+httpRecord.Path+"%")
if httpRecord.URI != "" {
db.Where("path like ?", "%"+httpRecord.URI+"%")
}
if httpRecord.RemoteIP != "" {
db.Where("remote_ip = ?", httpRecord.RemoteIP)