subscriptionservice

package
v0.0.0-...-a73f17b Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Subscription

type Subscription struct {
	bun.BaseModel `bun:"table:subscription_subscription,alias:sub"`
	ID            int64     `json:"id" bun:",pk,autoincrement"`
	ChatID        int64     `json:"chatId" bun:",unique"`
	Threshold     uint32    `json:"threshold"`
	IsActive      bool      `json:"isActive" bun:",nullzero,notnull,default:true"`
	CreatedAt     time.Time `json:"createdAt" bun:",nullzero,notnull,default:current_timestamp"`
	UpdatedAt     time.Time `json:"updatedAt" bun:",nullzero,notnull,default:current_timestamp"`
}

type SubscriptionService

type SubscriptionService struct {
	// contains filtered or unexported fields
}

func NewSubscriptionService

func NewSubscriptionService(db *bun.DB) SubscriptionService

func (*SubscriptionService) GetAll

func (s *SubscriptionService) GetAll() ([]Subscription, error)

func (*SubscriptionService) SetPrize

func (ss *SubscriptionService) SetPrize(chatID int64, limit uint32) error

func (*SubscriptionService) SoftDelete

func (ss *SubscriptionService) SoftDelete(chatID int64) error

func (*SubscriptionService) Subscribe

func (ss *SubscriptionService) Subscribe(chatID int64, limit uint32) (*Subscription, error)

Jump to

Keyboard shortcuts

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