新增本地获取任务列表,对接任务列表加入存储数据库功能

This commit is contained in:
chy
2025-06-17 09:06:41 +08:00
parent 76671693a4
commit ba2e44fb21
29 changed files with 592 additions and 144 deletions

View File

@ -0,0 +1,27 @@
// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package do
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
)
// StoreTaskRewards is the golang structure of table store_task_rewards for DAO operations like Where/Data.
type StoreTaskRewards struct {
g.Meta `orm:"table:store_task_rewards, do:true"`
Id interface{} // 奖励唯一标识符
TaskId interface{} // 任务ID关联tasks表的id
StoreId interface{} // 门店ID
Name interface{} // 奖励名称
RewardTypeId interface{} // 奖励类型ID
TotalNum interface{} // 奖励总数
UsedNum interface{} // 已使用数量
LimitNum interface{} // 限制数量
CoverImage interface{} // 封面图URL
CreatedAt *gtime.Time // 创建时间
UpdatedAt *gtime.Time // 更新时间
DeletedAt *gtime.Time // 软删除时间戳
}

View File

@ -11,10 +11,15 @@ import (
// Tasks is the golang structure of table tasks for DAO operations like Where/Data.
type Tasks struct {
g.Meta `orm:"table:tasks, do:true"`
Id interface{} // 任务唯一标识符
QqNetbarTaskId interface{} // QQ网吧任务ID
CreatedAt *gtime.Time // 创建时间
UpdatedAt *gtime.Time // 更新时间
DeletedAt *gtime.Time // 软删除时间戳
g.Meta `orm:"table:tasks, do:true"`
Id interface{} // 任务唯一标识符
QqNetbarTaskId interface{} // QQ网吧任务ID
CreatedAt *gtime.Time // 创建时间
UpdatedAt *gtime.Time // 更新时间
DeletedAt *gtime.Time // 软删除时间戳
QqNetbarTaskName interface{} // QQ网吧任务名称
QqNetbarTaskMemo interface{} // 任务描述
QqNetbarTaskRules interface{} // 任务规则
GameId interface{} // 游戏唯一id
StoreId interface{} // 门店 id
}

View File

@ -0,0 +1,25 @@
// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package entity
import (
"github.com/gogf/gf/v2/os/gtime"
)
// StoreTaskRewards is the golang structure for table store_task_rewards.
type StoreTaskRewards struct {
Id int64 `json:"id" orm:"id" description:"奖励唯一标识符"` // 奖励唯一标识符
TaskId int64 `json:"taskId" orm:"task_id" description:"任务ID关联tasks表的id"` // 任务ID关联tasks表的id
StoreId string `json:"storeId" orm:"store_id" description:"门店ID"` // 门店ID
Name string `json:"name" orm:"name" description:"奖励名称"` // 奖励名称
RewardTypeId string `json:"rewardTypeId" orm:"reward_type_id" description:"奖励类型ID"` // 奖励类型ID
TotalNum int `json:"totalNum" orm:"total_num" description:"奖励总数"` // 奖励总数
UsedNum int `json:"usedNum" orm:"used_num" description:"已使用数量"` // 已使用数量
LimitNum int `json:"limitNum" orm:"limit_num" description:"限制数量"` // 限制数量
CoverImage string `json:"coverImage" orm:"cover_image" description:"封面图URL"` // 封面图URL
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:"软删除时间戳"` // 软删除时间戳
}

View File

@ -10,9 +10,14 @@ import (
// Tasks is the golang structure for table tasks.
type Tasks struct {
Id int64 `json:"id" orm:"id" description:"任务唯一标识符"` // 任务唯一标识符
QqNetbarTaskId string `json:"qqNetbarTaskId" orm:"qq_netbar_task_id" description:"QQ网吧任务ID"` // QQ网吧任务ID
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:"软删除时间戳"` // 软删除时间戳
Id int64 `json:"id" orm:"id" description:"任务唯一标识符"` // 任务唯一标识符
QqNetbarTaskId string `json:"qqNetbarTaskId" orm:"qq_netbar_task_id" description:"QQ网吧任务ID"` // QQ网吧任务ID
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:"软删除时间戳"` // 软删除时间戳
QqNetbarTaskName string `json:"qqNetbarTaskName" orm:"qq_netbar_task_name" description:"QQ网吧任务名称"` // QQ网吧任务名称
QqNetbarTaskMemo string `json:"qqNetbarTaskMemo" orm:"qq_netbar_task_memo" description:"任务描述"` // 任务描述
QqNetbarTaskRules string `json:"qqNetbarTaskRules" orm:"qq_netbar_task_rules" description:"任务规则"` // 任务规则
GameId int64 `json:"gameId" orm:"game_id" description:"游戏唯一id"` // 游戏唯一id
StoreId int64 `json:"storeId" orm:"store_id" description:"门店 id"` // 门店 id
}

View File

@ -0,0 +1,22 @@
package model
import (
"github.com/gogf/gf/v2/frame/g"
"time"
)
type StoreTaskReward struct {
g.Meta `orm:"table:store_task_rewards"`
Id int64 `orm:"id" json:"id"` // 奖励唯一标识符
TaskId int64 `orm:"task_id" json:"task_id"` // 任务ID关联tasks表的id
StoreId string `orm:"store_id" json:"store_id"` // 门店ID
Name string `orm:"name" json:"name"` // 奖励名称
RewardTypeId string `orm:"reward_type_id" json:"reward_type_id"` // 奖励类型ID
TotalNum int32 `orm:"total_num" json:"total_num"` // 奖励总数
UsedNum int32 `orm:"used_num" json:"used_num"` // 已使用数量
LimitNum int32 `orm:"limit_num" json:"limit_num"` // 限制数量
CoverImage string `orm:"cover_image" json:"cover_image"` // 封面图URL
CreatedAt time.Time `orm:"created_at" json:"created_at"` // 创建时间
UpdatedAt time.Time `orm:"updated_at" json:"updated_at"` // 更新时间
DeletedAt time.Time `orm:"deleted_at" json:"deleted_at"` // 软删除时间戳
}

View File

@ -1,5 +1,21 @@
package model
import "github.com/gogf/gf/v2/os/gtime"
type Tasks struct {
Id int64 `json:"id" orm:"id" description:"任务唯一标识符"` // 任务唯一标识符
QqNetbarTaskId string `json:"qqNetbarTaskId" orm:"qq_netbar_task_id" description:"QQ网吧任务ID"` // QQ网吧任务ID
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:"软删除时间戳"` // 软删除时间戳
QqNetbarTaskName string `json:"qqNetbarTaskName" orm:"qq_netbar_task_name" description:"QQ网吧任务名称"` // QQ网吧任务名称
QqNetbarTaskMemo string `json:"qqNetbarTaskMemo" orm:"qq_netbar_task_memo" description:"任务描述"` // 任务描述
QqNetbarTaskRules string `json:"qqNetbarTaskRules" orm:"qq_netbar_task_rules" description:"任务规则"` // 任务规则
GameId int64 `json:"gameId" orm:"game_id" description:"游戏唯一id"` // 游戏唯一id
StoreId int64 `json:"storeId" orm:"store_id" description:"门店 id"` // 门店 id
StoreTaskRewards []StoreTaskReward `json:"storeTaskRewards" orm:"with:task_id=id"`
}
type GetNonLoginTaskListIn struct {
NetBarAccount string `json:"netbar_account"` //网关账号
//Page int `json:"page"` // 分页索引
@ -37,3 +53,26 @@ type GetLoginTaskListOut struct {
// Total int `json:"total"`
Data interface{} `json:"data"`
}
// 定义一个与 JSON 结构匹配的结构体
type MyData struct {
TaskId string `json:"task_id"`
//GameId int `json:"game_id"`
QQNetBarTaskMemo string `json:"task_desc"`
QQNetBarTaskName string `json:"title"`
QQNetBarTaskRules string `json:"rule_desc"`
//StoreId int `json:"store_id"`
}
type TaskListIn struct {
Gid int `json:"gid" v:"required#游戏唯一id不能为空" dc:"游戏唯一id"`
NetBarAccount string `json:"netBarAccount"`
Page int `json:"page" dc:"页数"`
Size int `json:"size" dc:"条数"`
StoreId int `json:"store_id"`
}
type TaskListOut struct {
List interface{} `json:"list"`
Total int `json:"total"`
}