auth_service.go 388 B

12345678910111213141516171819202122
  1. package service
  2. import (
  3. "demo/api/v1/common"
  4. )
  5. type AuthService struct{}
  6. func NewAuthService() *AuthService {
  7. return &AuthService{}
  8. }
  9. func (as *AuthService) Login(req *common.LoginReq) *common.LoginRes {
  10. // 假设成功返回
  11. return &common.LoginRes{
  12. Message: "Login successful",
  13. Data: map[string]interface{}{
  14. "email": req.Email,
  15. "password": req.Password,
  16. },
  17. }
  18. }