user_auth_mock.go
1.0 KB
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
package repository
import "opp/models"
var userAuth = &models.UserAuth{
AuthCode: "897ca746f46b11e98771000c29ad8d6d",
AccessToken: "897ca746f46b11e98771000c29ad8d7d",
RefreshToken: "897ca746f46b11e98771000c29ad8d8d",
}
type UserAuthMockRepository struct{}
func (r *UserAuthMockRepository) GetUserAuthByUserId(uid int64, deviceType int) (v *models.UserAuth, err error) {
v = userAuth
return
}
func (r *UserAuthMockRepository) UpdateUserAuthById(m *models.UserAuth) (err error) {
return
}
func (r *UserAuthMockRepository) GetUserAuthByAuthCode(authCode string) (v *models.UserAuth, err error) {
v = userAuth
return
}
func (r *UserAuthMockRepository) GetUserAuthByRefreshToken(refreshToken string) (v *models.UserAuth, err error) {
v = userAuth
return
}
func (r *UserAuthMockRepository) GetUserAuthByToken(refreshToken string) (v *models.UserAuth, err error) {
v = userAuth
return
}
func (r *UserAuthMockRepository) AddUserAuth(m *models.UserAuth) (err error) {
//_,err =models.AddUserAuth(m)
return
}