Documentation ¶
Index ¶
- type SQL
- func (sql *SQL) DeleteByAnimeID(ctx context.Context, animeID int64) (int, error)
- func (sql *SQL) DeleteNotInList(ctx context.Context, username string, ids []int64) (int, error)
- func (sql *SQL) Get(ctx context.Context, data entity.GetUserAnimeRequest) ([]*entity.UserAnime, int, int, error)
- func (sql *SQL) GetOldUsernames(ctx context.Context) ([]string, int, error)
- func (sql *SQL) IsOld(ctx context.Context, username string) (bool, int, error)
- func (sql *SQL) Update(ctx context.Context, data entity.UserAnime) (int, error)
- type UserAnime
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SQL ¶
type SQL struct {
// contains filtered or unexported fields
}
SQL contains functions for user sql database.
func (*SQL) DeleteByAnimeID ¶ added in v0.3.2
DeleteByAnimeID to delete by anime id.
func (*SQL) DeleteNotInList ¶ added in v0.3.0
DeleteNotInList to delete anime not in list.
func (*SQL) Get ¶
func (sql *SQL) Get(ctx context.Context, data entity.GetUserAnimeRequest) ([]*entity.UserAnime, int, int, error)
Get to get user anime.
func (*SQL) GetOldUsernames ¶ added in v0.3.0
GetOldUsernames to get old usernames.
type UserAnime ¶
type UserAnime struct { ID int64 `gorm:"primaryKey"` Username string `gorm:"index:username_index"` AnimeID int64 `gorm:"index:anime_id_index"` Status entity.Status Score int Episode int StartDay int StartMonth int StartYear int EndDay int EndMonth int EndYear int Priority entity.Priority IsRewatching bool RewatchCount int RewatchValue entity.RewatchValue Tags string Comment string CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt }
UserAnime is user_anime database model.
Click to show internal directories.
Click to hide internal directories.