|
@@ -177,7 +177,7 @@ func (r *Registry) ValidateApplication(key string, reply *models.Application) er
|
|
|
app := cacheValue.(*models.Application)
|
|
|
setApplication(reply, app)
|
|
|
} else {
|
|
|
- err = db.First(reply, id).Error
|
|
|
+ err = db.First(reply, "record_id = ?", id).Error
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
@@ -187,7 +187,7 @@ func (r *Registry) ValidateApplication(key string, reply *models.Application) er
|
|
|
}
|
|
|
|
|
|
if reply.AppKey != key {
|
|
|
- return errors.New("app key not match.")
|
|
|
+ return errors.New("app key not match")
|
|
|
}
|
|
|
|
|
|
return nil
|
|
@@ -482,6 +482,7 @@ func (r *Registry) QueryRules(args *models.Rule, reply *[]models.Rule) error {
|
|
|
|
|
|
return nil
|
|
|
}
|
|
|
+
|
|
|
// CreateEvent create event
|
|
|
func (r *Registry) CreateEvent(args *models.Event, reply *rpcs.ReplyEmptyResult) error {
|
|
|
db, err := getDB()
|
|
@@ -489,4 +490,4 @@ func (r *Registry) CreateEvent(args *models.Event, reply *rpcs.ReplyEmptyResult)
|
|
|
return err
|
|
|
}
|
|
|
return db.Save(args).Error
|
|
|
-}
|
|
|
+}
|