domain

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldEN = "English"
	FieldZH = "Chinese"

	PromotionStatusOver       = "over"
	PromotionStatusPreparing  = "preparing"
	PromotionStatusInProgress = "in-progress"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	TaskId   string
	TaskName Sentence
	Descs    Sentence
	Date     int64
	Points   int
}

type Origin

type Origin interface {
	Oringn() string
}

func NewOrigin

func NewOrigin(v string) (Origin, error)

type Promotion

type Promotion struct {
	Id        string
	Name      PromotionName
	Type      PromotionType
	Desc      PromotionDesc
	Way       PromotionWay
	RegUsers  []RegUser
	StartTime int64
	EndTime   int64
	Poster    string
	Host      string
	Intro     string
	Version   int
	IsStatic  bool
}

func (*Promotion) CountRegUsers added in v1.1.0

func (r *Promotion) CountRegUsers() int

func (*Promotion) Duration

func (r *Promotion) Duration() (string, error)

func (*Promotion) HasRegister

func (r *Promotion) HasRegister(u types.Account) bool

func (*Promotion) Status

func (r *Promotion) Status() (string, error)

type PromotionDesc

type PromotionDesc interface {
	PromotionDesc() string
}

PromotionDesc

func NewPromotionDesc

func NewPromotionDesc(v string) (PromotionDesc, error)

type PromotionName

type PromotionName interface {
	PromotionName() string
}

PronotionName

func NewPromotionName

func NewPromotionName(v string) (PromotionName, error)

type PromotionStatus added in v1.1.0

type PromotionStatus interface {
	PromotionStatus() string
}

func NewPromotionStatus added in v1.1.0

func NewPromotionStatus(v string) (PromotionStatus, error)

type PromotionType added in v1.1.0

type PromotionType interface {
	PromotionType() string
}

func NewPromotionType added in v1.1.0

func NewPromotionType(v string) (PromotionType, error)

type PromotionWay added in v1.1.0

type PromotionWay interface {
	PromotionWay() string
}

func NewPromotionWay added in v1.1.0

func NewPromotionWay(v string) (PromotionWay, error)

type RegUser

type RegUser struct {
	User      types.Account
	CreatedAt int64
	Origin    Origin
}

type Rule

type Rule struct {
	Descs     Sentence
	CreatedAt int64
	MaxPoints int
}

func (*Rule) IsValidPoint

func (r *Rule) IsValidPoint(point int) bool

type Sentence

type Sentence interface {
	Sentence(common.Language) string
	SentenceMap() map[string]string
	ENSentence() string
	ZHSentence() string
}

Sentence

func NewSentence

func NewSentence(en, zh string) (Sentence, error)

type Task

type Task struct {
	Id    string
	Names Sentence
	Rule  Rule
}

func (*Task) ToItem

func (r *Task) ToItem(point int) (Item, error)

type UserPoints

type UserPoints struct {
	User        types.Account
	PromotionId string
	Total       int
	Items       []Item
	Version     int
}

type UserRegistration

type UserRegistration = userdomain.UserRegInfo

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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