46 lines
699 B
Go
46 lines
699 B
Go
package api
|
|
|
|
import (
|
|
"SciencesServer/app/common/api"
|
|
"SciencesServer/app/enterprise/controller/account"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
type Account struct{}
|
|
|
|
type (
|
|
accountLoginForm struct {
|
|
Mode int `json:"mode" form:"mode" binding:"required"`
|
|
}
|
|
|
|
accountRegisterForm struct {
|
|
}
|
|
)
|
|
|
|
func (a *Account) Login(c *gin.Context) {
|
|
form := new(accountLoginForm)
|
|
|
|
if err := api.Bind(form)(c); err != nil {
|
|
api.APIFailure(err.(error))(c)
|
|
return
|
|
}
|
|
data, err := account.NewLogin().Login()(account.LoginMode(form.Mode), nil)
|
|
api.APIResponse(err, data)
|
|
}
|
|
|
|
func (a *Account) Register() {
|
|
|
|
}
|
|
|
|
func (c *Account) BindName() {
|
|
|
|
}
|
|
|
|
func (c *Account) BindMobile() {
|
|
|
|
}
|
|
|
|
func (a *Account) Logout() {
|
|
|
|
}
|