chore(alerting): struct names and url refactoring

This commit is contained in:
bergquist
2016-05-04 14:58:00 +02:00
parent 74d5410a38
commit 47070f2d1f
8 changed files with 27 additions and 25 deletions

View File

@@ -32,7 +32,7 @@ func SetNewAlertState(cmd *m.UpdateAlertStateCommand) error {
alert.State = cmd.NewState
sess.Id(alert.Id).Update(&alert)
log := m.AlertStateLog{
log := m.AlertState{
AlertId: cmd.AlertId,
OrgId: cmd.AlertId,
NewState: cmd.NewState,
@@ -47,8 +47,8 @@ func SetNewAlertState(cmd *m.UpdateAlertStateCommand) error {
})
}
func GetAlertStateLogByAlertId(cmd *m.GetAlertsStateLogCommand) error {
alertLogs := make([]m.AlertStateLog, 0)
func GetAlertStateLogByAlertId(cmd *m.GetAlertsStateCommand) error {
alertLogs := make([]m.AlertState, 0)
if err := x.Where("alert_id = ?", cmd.AlertId).Desc("created").Find(&alertLogs); err != nil {
return err

View File

@@ -82,7 +82,7 @@ func TestAlertingStateAccess(t *testing.T) {
})
Convey("should have two event state logs", func() {
query := &m.GetAlertsStateLogCommand{
query := &m.GetAlertsStateCommand{
AlertId: 1,
OrgId: 1,
}

View File

@@ -42,7 +42,7 @@ func addAlertMigrations(mg *Migrator) {
mg.AddMigration("create alert_rules_updates table v1", NewAddTableMigration(alert_changes))
alert_state_log := Table{
Name: "alert_state_log",
Name: "alert_state",
Columns: []*Column{
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
{Name: "alert_id", Type: DB_BigInt, Nullable: false},