From 5fbc08cf65eac0dc0b017899e9e0f9a687b933f8 Mon Sep 17 00:00:00 2001 From: konrad Date: Tue, 6 Mar 2018 13:43:07 +0100 Subject: [PATCH] fmt --- models/log_action.go | 4 ++-- models/models.go | 2 +- models/user.go | 8 ++++---- routes/api/v1/publishers_add_update.go | 1 - 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/models/log_action.go b/models/log_action.go index 3fde04b..474e2bb 100644 --- a/models/log_action.go +++ b/models/log_action.go @@ -5,7 +5,7 @@ type ActionType int // Define action types const ( - ActionTypeUnknown ActionType = -1 + ActionTypeUnknown ActionType = -1 ActionTypeBookAdded ActionType = iota ActionTypeBookUpdated ActionTypeBookDeleted @@ -28,4 +28,4 @@ const ( func logAction(actionType ActionType, user *User, itemID int64) (err error) { _, err = x.Insert(UserLog{Log: actionType, UserID: user.ID, ItemID: itemID}) return -} \ No newline at end of file +} diff --git a/models/models.go b/models/models.go index 523f97a..e9f8da7 100644 --- a/models/models.go +++ b/models/models.go @@ -63,7 +63,7 @@ func SetEngine() (err error) { if total < 1 { Config.FirstUser.IsAdmin = true // Make the first user admin - _, err = CreateUser(Config.FirstUser, &User{ID:0}) + _, err = CreateUser(Config.FirstUser, &User{ID: 0}) if err != nil { return err } diff --git a/models/user.go b/models/user.go index 29b1765..a989a02 100644 --- a/models/user.go +++ b/models/user.go @@ -26,11 +26,11 @@ type User struct { // UserLog logs user actions type UserLog struct { - ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id"` - UserID int64 `xorm:"int(11)" json:"userID"` + ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id"` + UserID int64 `xorm:"int(11)" json:"userID"` Log ActionType `xorm:"int(11)" json:"log"` - ItemID int64 `xorm:"int(11)" json:"itemID"` - Time int64 `xorm:"created" json:"time"` + ItemID int64 `xorm:"int(11)" json:"itemID"` + Time int64 `xorm:"created" json:"time"` } // TableName returns the table name for users diff --git a/routes/api/v1/publishers_add_update.go b/routes/api/v1/publishers_add_update.go index 647d6fb..a8ab863 100644 --- a/routes/api/v1/publishers_add_update.go +++ b/routes/api/v1/publishers_add_update.go @@ -84,6 +84,5 @@ func PublisherAddOrUpdate(c echo.Context) error { } }*/ - return c.JSON(http.StatusOK, newPublisher) }