user.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
package repository
import "opp/models"
type IUserRepository interface {
GetUsersById(uid int64) (v *models.User, err error)
GetUsersByMobile(mobile string) (v *models.User, err error)
UpdateUserInfo(m *models.User) (err error)
}
var _ IUserRepository = (*UserRepository)(nil)
type UserRepository struct{}
func (r *UserRepository) GetUsersById(uid int64) (v *models.User, err error) {
return models.GetUsersById(uid)
}
func (r *UserRepository) GetUsersByMobile(mobile string) (v *models.User, err error) {
return models.GetUserByMobile(mobile)
}
func (r *UserRepository) UpdateUserInfo(m *models.User) (err error) {
return models.UpdateUsersById(m)
}
type IUserCompanyRepository interface {
GetUserCompanyByUserId(uid int64, companyId int64) (v *models.UserCompany, err error)
}
var _ IUserCompanyRepository = (*UserCompanyRepository)(nil)
type UserCompanyRepository struct{}
func (r *UserCompanyRepository) GetUserCompanyByUserId(uid int64, companyId int64) (v *models.UserCompany, err error) {
return models.GetUserCompanyByUserId(uid, companyId)
}