You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1005 B
Go

1 month ago
package price
import "time"
// PriceType 价格类型
type PriceType int8
const (
TypeArticle PriceType = 1 // 文章
TypeColumn PriceType = 2 // 专栏
)
// Price 价格管理实体
type Price struct {
ID uint64 `json:"id" xorm:"pk autoincr 'id'"`
TargetID uint64 `json:"target_id" xorm:"not null 'target_id'"` // 目标ID文章ID或专栏ID
Type PriceType `json:"type" xorm:"not null 'type'"` // 价格类型
Amount int64 `json:"amount" xorm:"not null 'amount'"` // 价格(分)
AdminID uint64 `json:"admin_id" xorm:"not null 'admin_id'"` // 管理员ID
CreatedAt time.Time `json:"created_at" xorm:"created 'created_at'"`
UpdatedAt time.Time `json:"updated_at" xorm:"updated 'updated_at'"`
DeletedAt *time.Time `json:"deleted_at" xorm:"deleted 'deleted_at'"`
}
// DefaultPrice 默认价格(分)
const (
DefaultArticlePrice = 1000 // 文章默认价格10元
DefaultColumnPrice = 10000 // 专栏默认价格100元
)