Files
arenax-server/internal/model/reward.go
2025-06-09 09:25:11 +08:00

83 lines
3.4 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package model
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
)
// Reward 奖励信息
type Reward struct {
g.Meta `orm:"table:rewards"`
ID int64 `json:"id" orm:"id,primary"` // 奖励ID
RewardTypeID int64 `json:"rewardTypeId" orm:"reward_type_id,not null"` // 奖励类型ID
RewardScope int `json:"rewardScope" orm:"reward_scope,not null,default:2"` // 奖励范围1=系统奖励2=门店奖励
Name string `json:"name" orm:"name,not null"` // 奖励名称
Code string `json:"code" orm:"code,unique"` // 奖励编号
Description string `json:"description" orm:"description"` // 奖励描述
Status int `json:"status" orm:"status,default:1"` // 状态1=启用2=禁用
Stock int `json:"stock" orm:"stock,default:0"` // 奖励库存0表示无限制
StartAt *gtime.Time `json:"startAt" orm:"start_at"` // 奖励有效开始时间
ExpireAt *gtime.Time `json:"expireAt" orm:"expire_at"` // 奖励有效结束时间
}
type RewardCreateIn struct {
OperatorId int64 // 操作人ID
OperatorRole string // 操作人角色
RewardTypeID int64 // 奖励类型ID
RewardScope int // 奖励范围1=系统奖励2=门店奖励
Name string // 奖励名称
Description string // 奖励描述
Status int // 状态1=启用2=禁用
Stock int // 奖励库存0表示无限制
StartAt *gtime.Time // 奖励有效开始时间
ExpireAt *gtime.Time // 奖励有效结束时间
StoreIDs []int64 // 关联门店ID列表仅门店奖励需要
}
type RewardUpdateIn struct {
ID int64 // 奖励ID
OperatorId int64 // 操作人ID
OperatorRole string // 操作人角色
RewardTypeID int64 // 奖励类型ID
RewardScope int // 奖励范围1=系统奖励2=门店奖励
Name string // 奖励名称
Description string // 奖励描述
Status int // 状态1=启用2=禁用
Stock int // 奖励库存0表示无限制
StartAt *gtime.Time // 奖励有效开始时间
ExpireAt *gtime.Time // 奖励有效结束时间
StoreIDs []int64 // 关联门店ID列表仅门店奖励需要
}
type RewardListIn struct {
OperatorId int64 // 操作人ID
OperatorRole string // 操作人角色
Page int // 页码
Size int // 每页数量
StoreID *int64 // 门店ID用于过滤门店可见的奖励
RewardTypeID int64 // 奖励类型ID
Name string // 奖励名称(模糊查询)
Status int // 状态1=启用2=禁用
RewardScope int // 奖励范围1=系统奖励2=门店奖励
}
type RewardListOut struct {
List []Reward // 奖励列表
Total int // 总记录数
}
type RewardDeleteIn struct {
ID int64 // 奖励ID
OperatorId int64 // 操作人ID
OperatorRole string // 操作人角色
}
type RewardDetailIn struct {
ID int64 // 奖励ID
}
type RewardDetailOut struct {
*Reward
StoreIDs []int64 // 关联门店ID列表仅门店奖励有值
}