实现了门店奖励的增删改查
This commit is contained in:
@ -17,7 +17,7 @@ type RewardTypes struct {
|
||||
Description interface{} // 奖励类型描述
|
||||
Source interface{} // 来源:1=系统默认,2=门店自定义
|
||||
StoreId interface{} // 门店ID,系统默认类型为NULL
|
||||
Status interface{} // 状态:1=正常,0=禁用
|
||||
Status interface{} // 状态:1=正常,2=禁用
|
||||
CreatedAt *gtime.Time // 创建时间
|
||||
UpdatedAt *gtime.Time // 更新时间
|
||||
DeletedAt *gtime.Time // 软删除时间戳
|
||||
|
||||
@ -19,7 +19,7 @@ type Rewards struct {
|
||||
Source interface{} // 来源:1=系统内置,2=门店自定义
|
||||
StoreId interface{} // 门店ID,系统内置奖励为NULL
|
||||
Value interface{} // 奖励值(如积分数额、优惠金额)
|
||||
Status interface{} // 状态:1=正常,0=禁用
|
||||
Status interface{} // 状态:1=正常,2=禁用
|
||||
CreatedAt *gtime.Time // 创建时间
|
||||
UpdatedAt *gtime.Time // 更新时间
|
||||
DeletedAt *gtime.Time // 软删除时间戳
|
||||
|
||||
@ -15,7 +15,7 @@ type UserTasks struct {
|
||||
Id interface{} // 用户任务唯一标识符
|
||||
UserId interface{} // 用户ID
|
||||
TaskId interface{} // 任务ID
|
||||
Status interface{} // 任务状态:1=已领取,2=进行中,3=已完成,4=已取消
|
||||
Status interface{} // 任务状态:1=进行中,2=已完成中,3=未完成
|
||||
SerialNumber interface{} // 流水号,确保用户任务唯一性
|
||||
CreatedAt *gtime.Time // 创建时间
|
||||
UpdatedAt *gtime.Time // 更新时间
|
||||
|
||||
@ -15,7 +15,7 @@ type RewardTypes struct {
|
||||
Description string `json:"description" orm:"description" description:"奖励类型描述"` // 奖励类型描述
|
||||
Source int `json:"source" orm:"source" description:"来源:1=系统默认,2=门店自定义"` // 来源:1=系统默认,2=门店自定义
|
||||
StoreId int64 `json:"storeId" orm:"store_id" description:"门店ID,系统默认类型为NULL"` // 门店ID,系统默认类型为NULL
|
||||
Status int `json:"status" orm:"status" description:"状态:1=正常,0=禁用"` // 状态:1=正常,0=禁用
|
||||
Status int `json:"status" orm:"status" description:"状态:1=正常,2=禁用"` // 状态:1=正常,2=禁用
|
||||
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"` // 创建时间
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"` // 更新时间
|
||||
DeletedAt *gtime.Time `json:"deletedAt" orm:"deleted_at" description:"软删除时间戳"` // 软删除时间戳
|
||||
|
||||
@ -16,8 +16,8 @@ type Rewards struct {
|
||||
Description string `json:"description" orm:"description" description:"奖励描述"` // 奖励描述
|
||||
Source int `json:"source" orm:"source" description:"来源:1=系统内置,2=门店自定义"` // 来源:1=系统内置,2=门店自定义
|
||||
StoreId int64 `json:"storeId" orm:"store_id" description:"门店ID,系统内置奖励为NULL"` // 门店ID,系统内置奖励为NULL
|
||||
Value float64 `json:"value" orm:"value" description:"奖励值(如积分数额、优惠金额)"` // 奖励值(如积分数额、优惠金额)
|
||||
Status int `json:"status" orm:"status" description:"状态:1=正常,0=禁用"` // 状态:1=正常,0=禁用
|
||||
Value uint64 `json:"value" orm:"value" description:"奖励值(如积分数额、优惠金额)"` // 奖励值(如积分数额、优惠金额)
|
||||
Status int `json:"status" orm:"status" description:"状态:1=正常,2=禁用"` // 状态:1=正常,2=禁用
|
||||
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"` // 创建时间
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"` // 更新时间
|
||||
DeletedAt *gtime.Time `json:"deletedAt" orm:"deleted_at" description:"软删除时间戳"` // 软删除时间戳
|
||||
|
||||
@ -10,14 +10,14 @@ import (
|
||||
|
||||
// UserTasks is the golang structure for table user_tasks.
|
||||
type UserTasks struct {
|
||||
Id int64 `json:"id" orm:"id" description:"用户任务唯一标识符"` // 用户任务唯一标识符
|
||||
UserId int64 `json:"userId" orm:"user_id" description:"用户ID"` // 用户ID
|
||||
TaskId int64 `json:"taskId" orm:"task_id" description:"任务ID"` // 任务ID
|
||||
Status int `json:"status" orm:"status" description:"任务状态:1=已领取,2=进行中,3=已完成,4=已取消"` // 任务状态:1=已领取,2=进行中,3=已完成,4=已取消
|
||||
SerialNumber string `json:"serialNumber" orm:"serial_number" description:"流水号,确保用户任务唯一性"` // 流水号,确保用户任务唯一性
|
||||
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"` // 创建时间
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"` // 更新时间
|
||||
CompletedAt *gtime.Time `json:"completedAt" orm:"completed_at" description:"任务完成时间"` // 任务完成时间
|
||||
DeletedAt *gtime.Time `json:"deletedAt" orm:"deleted_at" description:"软删除时间戳"` // 软删除时间戳
|
||||
StoreId int64 `json:"storeId" orm:"store_id" description:"门店 id"` // 门店 id
|
||||
Id int64 `json:"id" orm:"id" description:"用户任务唯一标识符"` // 用户任务唯一标识符
|
||||
UserId int64 `json:"userId" orm:"user_id" description:"用户ID"` // 用户ID
|
||||
TaskId int64 `json:"taskId" orm:"task_id" description:"任务ID"` // 任务ID
|
||||
Status int `json:"status" orm:"status" description:"任务状态:1=进行中,2=已完成中,3=未完成"` // 任务状态:1=进行中,2=已完成中,3=未完成
|
||||
SerialNumber string `json:"serialNumber" orm:"serial_number" description:"流水号,确保用户任务唯一性"` // 流水号,确保用户任务唯一性
|
||||
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"` // 创建时间
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"` // 更新时间
|
||||
CompletedAt *gtime.Time `json:"completedAt" orm:"completed_at" description:"任务完成时间"` // 任务完成时间
|
||||
DeletedAt *gtime.Time `json:"deletedAt" orm:"deleted_at" description:"软删除时间戳"` // 软删除时间戳
|
||||
StoreId int64 `json:"storeId" orm:"store_id" description:"门店 id"` // 门店 id
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user