-
Notifications
You must be signed in to change notification settings - Fork 15
/
auth.go
42 lines (35 loc) · 1.03 KB
/
auth.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// ================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// You can delete these comments if you wish manually maintain this interface file.
// ================================================================================
package service
import (
"context"
"github.com/iimeta/iim-client/internal/model"
)
type (
IAuth interface {
// 注册接口
Register(ctx context.Context, params model.RegisterReq) error
// 登录接口
Login(ctx context.Context, params model.LoginReq) (res *model.LoginRes, err error)
// 退出登录接口
Logout(ctx context.Context) error
// 账号找回接口
Forget(ctx context.Context, params model.ForgetReq) error
// Token 刷新接口
Refresh(ctx context.Context) (*model.RefreshRes, error)
}
)
var (
localAuth IAuth
)
func Auth() IAuth {
if localAuth == nil {
panic("implement not found for interface IAuth, forgot register?")
}
return localAuth
}
func RegisterAuth(i IAuth) {
localAuth = i
}