user_auth.go
1.2 KB
package repository
import "opp/models"
type IUserAuthRepository interface {
GetUserAuthByUserId(uid int64) (v *models.UserAuth, err error)
UpdateUserAuthById(m *models.UserAuth) (err error)
GetUserAuthByAuthCode(authCode string) (v *models.UserAuth, err error)
GetUserAuthByRefreshToken(refreshToken string) (v *models.UserAuth, err error)
GetUserAuthByToken(refreshToken string) (v *models.UserAuth, err error)
}
var _ IUserAuthRepository = (*UserAuthRepository)(nil)
type UserAuthRepository struct{}
func (r *UserAuthRepository) GetUserAuthByUserId(uid int64) (v *models.UserAuth, err error) {
return models.GetUserAuthByUserId(uid)
}
func (r *UserAuthRepository) UpdateUserAuthById(m *models.UserAuth) (err error) {
return models.UpdateUserAuthById(m)
}
func (r *UserAuthRepository) GetUserAuthByAuthCode(authCode string) (v *models.UserAuth, err error) {
return models.GetUserByAuthCode(authCode)
}
func (r *UserAuthRepository) GetUserAuthByRefreshToken(refreshToken string) (v *models.UserAuth, err error) {
return models.GetUserAuthByRefreshToken(refreshToken)
}
func (r *UserAuthRepository) GetUserAuthByToken(refreshToken string) (v *models.UserAuth, err error) {
return models.GetUserAuthByToken(refreshToken)
}