update .gitignore
This commit is contained in:
35
app/common/model/activity_apply.go
Normal file
35
app/common/model/activity_apply.go
Normal file
@ -0,0 +1,35 @@
|
||||
package model
|
||||
|
||||
// ActivityApply 活动申请数据模型
|
||||
type ActivityApply struct {
|
||||
Model
|
||||
Local
|
||||
MUid uint64 `gorm:"column:m_uid;type:int;default:0;comment:用户manage_uuid" json:"-"`
|
||||
Mode ActivityInstanceMode `gorm:"column:mode;type:tinyint(1);default:1;comment:活动模式" json:"mode"`
|
||||
ActivityInstanceBasic
|
||||
Content string `gorm:"column:title;type:text;default:null;comment:活动详情" json:"content"`
|
||||
MaxNumber int `gorm:"column:max_number;type:int(6);default:0;comment:报名限制人数,0不做限制" json:"max_number"`
|
||||
Status ActivityApplyStatus `gorm:"column:status;type:tinyint(1);default:0;comment:审核状态" json:"status"`
|
||||
ModelDeleted
|
||||
ModelAt
|
||||
}
|
||||
|
||||
// ActivityApplyStatus 审核状态
|
||||
type ActivityApplyStatus int
|
||||
|
||||
const (
|
||||
// ActivityApplyStatusForRevoke 撤销
|
||||
ActivityApplyStatusForRevoke ActivityApplyStatus = iota - 1
|
||||
// ActivityApplyStatusForExamining 审核中
|
||||
ActivityApplyStatusForExamining
|
||||
// ActivityApplyStatusForPass 审核通过
|
||||
ActivityApplyStatusForPass
|
||||
)
|
||||
|
||||
func (m *ActivityApply) TableName() string {
|
||||
return "activity_apply"
|
||||
}
|
||||
|
||||
func NewActivityApply() *ActivityApply {
|
||||
return &ActivityApply{}
|
||||
}
|
15
app/common/model/activity_examine.go
Normal file
15
app/common/model/activity_examine.go
Normal file
@ -0,0 +1,15 @@
|
||||
package model
|
||||
|
||||
type ActivityExamine struct {
|
||||
Model
|
||||
ModelDeleted
|
||||
ModelAt
|
||||
}
|
||||
|
||||
func (m *ActivityExamine) TableName() string {
|
||||
return "activity_examine"
|
||||
}
|
||||
|
||||
func NewActivityExamine() *ActivityExamine {
|
||||
return &ActivityExamine{}
|
||||
}
|
62
app/common/model/activity_instance.go
Normal file
62
app/common/model/activity_instance.go
Normal file
@ -0,0 +1,62 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
// ActivityInstance 活动数据模型
|
||||
type ActivityInstance struct {
|
||||
Model
|
||||
Local
|
||||
Identity int `gorm:"column:identity;type:tinyint(3);default:0;comment:身份来源" json:"-"`
|
||||
Mode ActivityInstanceMode `gorm:"column:mode;type:tinyint(1);default:1;comment:活动模式" json:"mode"`
|
||||
ActivityInstanceBasic
|
||||
Content string `gorm:"column:title;type:text;default:null;comment:活动详情" json:"content"`
|
||||
MaxNumber int `gorm:"column:max_number;type:int(6);default:0;comment:报名限制人数,0不做限制" json:"max_number"`
|
||||
Status ActivityInstanceStatus `gorm:"column:status;type:tinyint(1);default:1;comment:活动状态(1:显示,2:隐藏)" json:"status"`
|
||||
ModelDeleted
|
||||
ModelAt
|
||||
}
|
||||
|
||||
// ActivityInstanceBasic 活动基本信息
|
||||
type ActivityInstanceBasic struct {
|
||||
Title string `gorm:"column:title;type:varchar(50);default:null;comment:活动名称" json:"title"`
|
||||
BeginAt time.Time `gorm:"column:begin_at;type:datetime;not null;comment:活动开始" json:"begin_at"`
|
||||
FinishAt time.Time `gorm:"column:finish_at;type:datetime;not null;comment:活动结束时间" json:"finish_at"`
|
||||
JoinDeadline time.Time `gorm:"column:join_deadline;type:datetime;not null;comment:报名截止时间" json:"join_deadline"`
|
||||
}
|
||||
|
||||
// ActivityInstanceMode 活动类型
|
||||
type ActivityInstanceMode int
|
||||
|
||||
const (
|
||||
// ActivityInstanceModeForOrdinary 普通活动
|
||||
ActivityInstanceModeForOrdinary ActivityInstanceMode = iota + 1
|
||||
// ActivityInstanceModeForCharge 收费活动
|
||||
ActivityInstanceModeForCharge
|
||||
)
|
||||
|
||||
// ActivityInstanceStatus 活动状态
|
||||
type ActivityInstanceStatus int
|
||||
|
||||
const (
|
||||
// ActivityInstanceStatusForShow 状态显示
|
||||
ActivityInstanceStatusForShow ActivityInstanceStatus = iota + 1
|
||||
// ActivityInstanceStatusForHidden 状态隐藏
|
||||
ActivityInstanceStatusForHidden
|
||||
)
|
||||
|
||||
func (m *ActivityInstanceBasic) IsOngoing() bool {
|
||||
now := time.Now()
|
||||
return m.BeginAt.Before(now) && m.FinishAt.After(now)
|
||||
}
|
||||
|
||||
func (m *ActivityInstanceBasic) IsCanJoin() bool {
|
||||
return m.JoinDeadline.After(time.Now())
|
||||
}
|
||||
|
||||
func (m *ActivityInstance) TableName() string {
|
||||
return "activity_instance"
|
||||
}
|
||||
|
||||
func NewActivityInstance() *ActivityInstance {
|
||||
return &ActivityInstance{}
|
||||
}
|
27
app/common/model/activity_join.go
Normal file
27
app/common/model/activity_join.go
Normal file
@ -0,0 +1,27 @@
|
||||
package model
|
||||
|
||||
type ActivityJoin struct {
|
||||
Model
|
||||
MUid uint64 `gorm:"column:m_uid;type:int;default:0;comment:用户manage_uuid" json:"-"`
|
||||
ActivityID uint64 `gorm:"column:activity_id;type:int(11);default:0;comment:活动ID" json:"activity_id"`
|
||||
Status ActivityJoinStatus `gorm:"column:status;type:tinyint(1);default:1;comment:报名状态(-1:取消,1:报名成功)" json:"status"`
|
||||
ModelDeleted
|
||||
ModelAt
|
||||
}
|
||||
|
||||
type ActivityJoinStatus int
|
||||
|
||||
const (
|
||||
// ActivityJoinStatusForCancel 报名取消
|
||||
ActivityJoinStatusForCancel ActivityJoinStatus = iota - 1
|
||||
// ActivityJoinStatusForSuccess 报名成功
|
||||
ActivityJoinStatusForSuccess ActivityJoinStatus = iota
|
||||
)
|
||||
|
||||
func (m *ActivityJoin) TableName() string {
|
||||
return "activity_join"
|
||||
}
|
||||
|
||||
func NewActivityJoin() *ActivityJoin {
|
||||
return &ActivityJoin{}
|
||||
}
|
15
app/common/model/bill_instance.go
Normal file
15
app/common/model/bill_instance.go
Normal file
@ -0,0 +1,15 @@
|
||||
package model
|
||||
|
||||
type BillInstance struct {
|
||||
Model
|
||||
ModelDeleted
|
||||
ModelAt
|
||||
}
|
||||
|
||||
func (m *BillInstance) TableName() string {
|
||||
return "bill_instance"
|
||||
}
|
||||
|
||||
func NewBillInstance() *BillInstance {
|
||||
return &BillInstance{}
|
||||
}
|
Reference in New Issue
Block a user