user.go
1.2 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
package repository
import "ability/models"
type IUserRepository interface {
GetUsersByMobile(mobile string) (v *models.Users, err error)
GetUserInfoByMobile(mobile string) (v *models.UserInfo, err error)
UpdateUserInfoById(m *models.UserInfo) (err error)
GetUserInfoByAuthCode(authCode string) (v *models.UserInfo, err error)
GetUserInfoByRefreshToken(refreshToken string) (v *models.UserInfo, err error)
}
func assertImplement() {
var _ IUserRepository = (*UserRepository)(nil)
}
type UserRepository struct{}
func (r *UserRepository) GetUsersByMobile(mobile string) (v *models.Users, err error) {
return models.GetUsersByMobile(mobile)
}
func (r *UserRepository) GetUserInfoByMobile(mobile string) (v *models.UserInfo, err error) {
return models.GetUserInfoByMobile(mobile)
}
func (r *UserRepository) UpdateUserInfoById(m *models.UserInfo) (err error) {
return models.UpdateUserInfoById(m)
}
func (r *UserRepository) GetUserInfoByAuthCode(authCode string) (v *models.UserInfo, err error) {
return models.GetUserInfoByAuthCode(authCode)
}
func (r *UserRepository)GetUserInfoByRefreshToken(refreshToken string) (v *models.UserInfo, err error) {
return models.GetUserInfoByRefreshToken(refreshToken)
}