b_login.go 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. package bll
  2. import (
  3. "context"
  4. "net/http"
  5. "yx-dataset-server/app/schema"
  6. )
  7. // ILogin Login业务逻辑接口
  8. type ILogin interface {
  9. // GetCaptchaID 获取图形验证码信息
  10. GetCaptchaID(ctx context.Context, length int) (*schema.LoginCaptcha, error)
  11. // ResCaptcha 生成并响应图形验证码
  12. ResCaptcha(ctx context.Context, w http.ResponseWriter, captchaID string, width, height int) error
  13. // GenerateToken 生成令牌
  14. GenerateToken(ctx context.Context, userID string) (*schema.LoginTokenInfo, error)
  15. // DestroyToken 销毁令牌
  16. DestroyToken(ctx context.Context, tokenString string) error
  17. // RefreshToken 刷新令牌
  18. RefreshToken(ctx context.Context) (*schema.LoginTokenInfo, error)
  19. // Verify 登录验证
  20. Verify(ctx context.Context, userName, password string) (*schema.User, error)
  21. // GetUserInfo 获取当前用户登录信息
  22. GetUserInfo(ctx context.Context) (*schema.UserLoginInfo, error)
  23. // UpdatePassword 更新当前用户登录密码
  24. UpdatePassword(ctx context.Context, params schema.UpdatePasswordParam) error
  25. // Unsubscribe 用户注销
  26. Unsubscribe(ctx context.Context, userId, tokenStr string) error
  27. // LoginBySms 通过短信验证码登录
  28. LoginBySms(ctx context.Context, params schema.SmsLoginParam) error
  29. }