user_mock.go
970 字节
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
package repository
import "opp/models"
type UserMockRepository struct{}
var userInfo = &models.UserInfo{
Auth: "897ca746f46b11e98771000c29ad8d6d",
AccessToken: "897ca746f46b11e98771000c29ad8d7d",
RefreshToken: "897ca746f46b11e98771000c29ad8d8d",
}
func (r *UserMockRepository) GetUsersByMobile(mobile string) (v *models.Users, err error) {
v = &models.Users{
Username: "18065048389",
Password: "$2y$10$YWg7jPRVLBzc3kevokMkW.boswtCvhToqC.TappIwfqwJ.cI0efvy",
}
return
}
func (r *UserMockRepository) GetUserInfoByMobile(mobile string) (v *models.UserInfo, err error) {
v = userInfo
return
}
func (r *UserMockRepository) UpdateUserInfoById(m *models.UserInfo) (err error) {
return
}
func (r *UserMockRepository) GetUserInfoByAuthCode(authCode string) (v *models.UserInfo, err error) {
v = userInfo
return
}
func (r *UserMockRepository) GetUserInfoByRefreshToken(refreshToken string) (v *models.UserInfo, err error) {
v = userInfo
return
}