auth_controller.go
827 字节
package controllers
import (
"github.com/linmadan/egglib-go/web/beego"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/auth/command"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/auth/service"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
)
type AuthController struct {
beego.BaseController
}
// Login PC端登录
func (controller *AuthController) Login() {
authService := &service.AuthService{}
loginCommand := &command.LoginCommand{}
_ = controller.Unmarshal(loginCommand)
resp, err := authService.Login(loginCommand)
controller.Response(resp, err)
}
func (controller *AuthController) User() {
userAuth := controller.Ctx.Input.GetData(domain.UserAuth{}).(*domain.UserAuth)
controller.Response(map[string]interface{}{
"user": userAuth,
}, nil)
}