user_mock.go 970 字节
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
}