telebot_info

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

Types

type APIResponseItemInfo

type APIResponseItemInfo struct {
	Code    int          `json:"code"`
	Message string       `json:"message"`
	Data    *TeleBotInfo `json:"data"`
}

type APIResponseItemInfoList

type APIResponseItemInfoList struct {
	Code    int                          `json:"code"`
	Message string                       `json:"message"`
	Data    *APIResponseItemInfoListData `json:"data"`
}

type APIResponseItemInfoListData

type APIResponseItemInfoListData struct {
	Items []TeleBotInfo `json:"items"`
	Total int64         `json:"total"`
}

type TeleBotInfo

type TeleBotInfo struct {
	model.Model

	TelegramId        int64  `json:"telegram_id" form:"telegram_id" gorm:"column:telegram_id;not null;"`
	TelegramUsername  string `json:"telegram_username" form:"telegram_username" gorm:"column:telegram_username;"`
	TelegramUsernames string `json:"telegram_usernames" form:"telegram_usernames" gorm:"column:telegram_usernames;"`
	TelegramBotToken  string `json:"telegram_bot_token" form:"telegram_bot_token" gorm:"column:telegram_bot_token;not null;"`

	FirstName string `json:"first_name" form:"first_name" gorm:"column:first_name;"`
	LastName  string `json:"last_name" form:"last_name" gorm:"column:last_name;"`
	IsForum   bool   `json:"is_forum" form:"is_forum" gorm:"column:is_forum;"`
	IsBot     bool   `json:"is_bot" form:"is_bot" gorm:"column:is_bot;"`
	IsPremium bool   `json:"is_premium" form:"is_premium" gorm:"column:is_premium;"`

	// 核验请求id
	ById string `json:"by_id" form:"by_id" gorm:"-"`

	Page   int    `json:"-" form:"page" gorm:"-"`
	Size   int    `json:"-" form:"size" gorm:"-"`
	Filter string `json:"-" form:"filter" gorm:"-"`
}

func GetAll

func GetAll() ([]*TeleBotInfo, int64, error)

func GetByAccoundPlatformId

func GetByAccoundPlatformId(teleUsername string) (*TeleBotInfo, error)

func GetById

func GetById(teleId int64) (*TeleBotInfo, error)

func (*TeleBotInfo) Count

func (r *TeleBotInfo) Count() int64

func (*TeleBotInfo) Create

func (r *TeleBotInfo) Create() error

func (*TeleBotInfo) Delete

func (r *TeleBotInfo) Delete() error

删除 无条件,默认删除30天过期用户

func (*TeleBotInfo) GetInfo

func (r *TeleBotInfo) GetInfo() (*TeleBotInfo, error)

func (*TeleBotInfo) GetList

func (u *TeleBotInfo) GetList() ([]*TeleBotInfo, int64, error)

需鉴权使用

func (*TeleBotInfo) TableName

func (c *TeleBotInfo) TableName() string

func (*TeleBotInfo) Update

func (r *TeleBotInfo) Update() error

Jump to

Keyboard shortcuts

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