user_auth_mock.go 1.0 KB
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
}