add vendor

This commit is contained in:
Jay
2018-04-17 18:04:36 +08:00
parent a45b1f3603
commit 4fd4c7018e
494 changed files with 255023 additions and 9 deletions
+18 -2
View File
@@ -1,7 +1,11 @@
package account
import (
"log"
"git.trj.tw/golang/go-gallery/models"
"git.trj.tw/golang/go-gallery/modules/context"
"git.trj.tw/golang/go-gallery/modules/utils"
)
// UserLogin route
@@ -15,9 +19,21 @@ func UserLogin(c *context.Context) {
}
err := c.ShouldBind(&loginArg)
if err != nil {
c.NotFound("body not found")
c.DataFormat(nil)
return
}
c.Success("api success")
acc, err := models.GetAccount(loginArg.Account)
if err != nil {
log.Println(err)
c.ServerError(nil)
return
}
if acc == nil {
c.NotFound("User not found")
return
}
c.Success(utils.ToMap(acc))
}