model

package
v0.0.0-...-d9e7967 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	DB        *mongo.Database
	DBMongoDB *mongo.Client
}

func (*Conn) Collection

func (c *Conn) Collection() *mongo.Collection

func (*Conn) CreateUser

func (c *Conn) CreateUser(u *User) (*User, error)

CreateUser ... данный мметод принемает и отдает одну и тожу ссылку, ... но сделал это для удобства и большей явности

func (*Conn) GetUser

func (c *Conn) GetUser(tgId int64) (*User, error)

func (*Conn) UpdateSpotifyToken

func (c *Conn) UpdateSpotifyToken(u *primitive.ObjectID, sToken *Spotify) error

type Spotify

type Spotify struct {
	Token *SpotifyToken `json:"token,omitempty" bson:"token,omitempty"`
}

type SpotifyToken

type SpotifyToken struct {
	Refresh string `json:"refresh" bson:"refresh"`
	User    string `json:"user" bson:"user"`
	Expired int64  `json:"expired" bson:"expired"`
}

type Telegram

type Telegram struct {
	Id    int64  `json:"id,omitempty" bson:"id,omitempty"`
	Login string `json:"login" bson:"login"`
}

type User

type User struct {
	Id primitive.ObjectID `json:"id" bson:"_id,omitempty"`

	Telegram Telegram `json:"telegram,omitempty" bson:"telegram,omitempty"`

	Spotify Spotify `json:"spotify,omitempty" bson:"spotify,omitempty"`

	CreateAt time.Time `json:"create_at,omitempty" bson:"create_at,omitempty"`
	UpdateAt time.Time `json:"update_at,omitempty" bson:"update_at,omitempty"`

	Active bool `json:"active,omitempty" bson:"active,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL