func (r *AuthRepository) CreateAccessToken(accessToken string, user models.User) models.Accesstoken {
	var token = models.Accesstoken{
		Token:  accessToken,
		UserID: user.ID,
	}
	r.db.Create(&token)
	return token
}
CreateAccessToken repository returns auth access Token
package repositories
import (
	"errors"
	"github.com/bahattincinic/messenger-challenge/domain/models"
	"github.com/jinzhu/gorm"
)
type AuthRepository struct {
	db *gorm.DB
}
type IAuthRepository interface {
	CreateAccessToken(accessToken string, user models.User) models.Accesstoken
	GetUser(username string, password string) (user models.User, err error)
	CreateUser(username string, password string, fullname string) models.User
	CheckAccessToken(token string) (accessToken models.Accesstoken, err error)
}
func NewAuthRepo(db *gorm.DB) *AuthRepository {
	return &AuthRepository{
		db: db,
	}
}