feat: 商业化 P0 表名/状态常量与实体定义

This commit is contained in:
2026-07-31 13:21:37 +08:00
parent 0a7cd5b968
commit 64470d88c3
7 changed files with 93 additions and 0 deletions
+19
View File
@@ -54,3 +54,22 @@ const DefaultScoreThreshold = 75
// 免费用户每日效果图次数
const DefaultDailyEffectLimit = 3
// 支付订单状态
const (
PayStatusPending = "pending"
PayStatusPaid = "paid"
PayStatusClosed = "closed"
)
// 广告激励类型
const (
AdTypeEffectExtra = "effect_extra"
AdTypeVipTrial = "vip_trial"
)
// 会员开通来源
const (
MemberSourceVipPay = "vip_pay"
MemberSourceAdTrial = "ad_trial"
)
+5
View File
@@ -14,4 +14,9 @@ const (
TableNamePlanReview = "slogan_plan_review"
TableNameScoringRule = "slogan_scoring_rule"
TableNamePartnerStore = "slogan_partner_store"
TableNameMemberPlan = "slogan_member_plan"
TableNamePaymentOrder = "slogan_payment_order"
TableNameUserMember = "slogan_user_member"
TableNamePayNotifyLog = "slogan_pay_notify_log"
TableNameAdRewardLog = "slogan_ad_reward_log"
)
+12
View File
@@ -0,0 +1,12 @@
package entity
import "github.com/gogf/gf/v2/os/gtime"
type AdRewardLog struct {
Id int64 `orm:"id" json:"id"`
UserId int64 `orm:"user_id" json:"user_id"`
AdType string `orm:"ad_type" json:"ad_type"`
RewardKey string `orm:"reward_key" json:"reward_key"`
Status string `orm:"status" json:"status"`
CreatedAt *gtime.Time `orm:"created_at" json:"created_at"`
}
+14
View File
@@ -0,0 +1,14 @@
package entity
import "github.com/gogf/gf/v2/os/gtime"
type MemberPlan struct {
Id int64 `orm:"id" json:"id"`
Name string `orm:"name" json:"name"`
PriceFen int `orm:"price_fen" json:"price_fen"`
DurationDays int `orm:"duration_days" json:"duration_days"`
Features string `orm:"features" json:"features"` // 权益 JSON 数组字符串
Sort int `orm:"sort" json:"sort"`
Status int `orm:"status" json:"status"`
CreatedAt *gtime.Time `orm:"created_at" json:"created_at"`
}
+13
View File
@@ -0,0 +1,13 @@
package entity
import "github.com/gogf/gf/v2/os/gtime"
type PayNotifyLog struct {
Id int64 `orm:"id" json:"id"`
OrderNo string `orm:"order_no" json:"order_no"`
Body string `orm:"body" json:"body"`
Sign string `orm:"sign" json:"sign"`
RemoteIp string `orm:"remote_ip" json:"remote_ip"`
Status string `orm:"status" json:"status"`
CreatedAt *gtime.Time `orm:"created_at" json:"created_at"`
}
+17
View File
@@ -0,0 +1,17 @@
package entity
import "github.com/gogf/gf/v2/os/gtime"
type PaymentOrder struct {
Id int64 `orm:"id" json:"id"`
OrderNo string `orm:"order_no" json:"order_no"`
UserId int64 `orm:"user_id" json:"user_id"`
PlanId int64 `orm:"plan_id" json:"plan_id"`
AmountFen int `orm:"amount_fen" json:"amount_fen"`
Channel string `orm:"channel" json:"channel"`
Status string `orm:"status" json:"status"`
TradeNo string `orm:"trade_no" json:"trade_no"`
NotifyRaw string `orm:"notify_raw" json:"-"`
PaidAt *gtime.Time `orm:"paid_at" json:"paid_at"`
CreatedAt *gtime.Time `orm:"created_at" json:"created_at"`
}
+13
View File
@@ -0,0 +1,13 @@
package entity
import "github.com/gogf/gf/v2/os/gtime"
type UserMember struct {
Id int64 `orm:"id" json:"id"`
UserId int64 `orm:"user_id" json:"user_id"`
PlanId int64 `orm:"plan_id" json:"plan_id"`
ExpireAt *gtime.Time `orm:"expire_at" json:"expire_at"`
Source string `orm:"source" json:"source"`
CreatedAt *gtime.Time `orm:"created_at" json:"created_at"`
UpdatedAt *gtime.Time `orm:"updated_at" json:"updated_at"`
}