add vendor
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user