实现了门店奖励的增删改查

This commit is contained in:
2025-06-17 18:11:27 +08:00
parent 427e70f94e
commit e21353df23
23 changed files with 659 additions and 42 deletions

View File

@ -1,10 +1,87 @@
package model
import (
"github.com/gogf/gf/v2/os/gtime"
)
// Reward 奖励表
type Reward struct {
Id int64 `json:"id" dc:"奖励ID" orm:"id,primary"`
RewardTypeId int64 `json:"rewardTypeId" dc:"奖励类型ID" orm:"reward_type_id"`
RewardTypeName string `json:"rewardTypeName" dc:"奖励类型名称" orm:"reward_type_name"`
Name string `json:"name" dc:"奖励名称如100积分、5元优惠券" orm:"name"`
Description string `json:"description" dc:"奖励描述" orm:"description"`
Source int `json:"source" dc:"来源1=系统内置2=门店自定义" orm:"source"`
StoreId int64 `json:"storeId" dc:"门店ID系统内置奖励为NULL" orm:"store_id"`
Value int64 `json:"value" dc:"奖励值(如积分数额、优惠金额)" orm:"value"`
Status int `json:"status" dc:"状态1=正常0=禁用" orm:"status"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间" orm:"created_at"`
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间" orm:"updated_at"`
DeletedAt *gtime.Time `json:"deletedAt" dc:"软删除时间戳" orm:"deleted_at"`
}
type RewardListIn struct {
// RewardCreateIn 创建奖励入参
type RewardCreateIn struct {
OperatorId int64
OperatorRole string
RewardTypeId int64
Name string
Description string
Source int
StoreId int64
Value int64
Status int
}
// RewardCreateOut 创建奖励出参
type RewardCreateOut struct {
Id int64
}
// RewardUpdateIn 更新奖励入参
type RewardUpdateIn struct {
OperatorId int64
OperatorRole string
Id int64
RewardTypeId int64
Name string
Description string
StoreId int64
Value int64
Status int
}
// RewardUpdateOut 更新奖励出参
type RewardUpdateOut struct {
Success bool
}
// RewardDeleteIn 删除奖励入参
type RewardDeleteIn struct {
Id int64
OperatorId int64
OperatorRole string
}
// RewardDeleteOut 删除奖励出参
type RewardDeleteOut struct {
Success bool
}
// RewardListIn 奖励列表查询入参
type RewardListIn struct {
OperatorId int64
OperatorRole string
Page int
Size int
Name string
StoreId int64
RewardTypeId int64
Status int
Source int
}
// RewardListOut 奖励列表查询出参
type RewardListOut struct {
List []Reward
Total int