新增奖励回调接口,调整奖励领取接口
This commit is contained in:
@ -206,7 +206,8 @@ type CallbackRes struct {
|
||||
Errmsg string `json:"errmsg"`
|
||||
AppId string `json:"appid"`
|
||||
OrderId string `json:"order_id"`
|
||||
Datas []CallbackData `json:"data"`
|
||||
//Datas []CallbackData `json:"data"`
|
||||
Datas interface{} `json:"data"`
|
||||
}
|
||||
|
||||
type GetLiftReq struct {
|
||||
@ -215,8 +216,9 @@ type GetLiftReq struct {
|
||||
AreaId int64 `json:"areaId" dc:"大区Id"`
|
||||
GameId int64 `json:"gameId" v:"required#游戏id不能为空" dc:"游戏Id"`
|
||||
RoleIdx string `json:"roleIdx" dc:"角色索引"`
|
||||
RewradType []int64 `json:"rewardType" dc:"奖励类型"`
|
||||
RewradType int64 `json:"rewardType" v:"required#奖励类型不能为空" dc:"奖励类型"`
|
||||
PopenId string `json:"popenid" dc:""`
|
||||
Source int `json:"source" v:"required#来源不能为空" dc:"来源" d:"1:系统 2:门店"`
|
||||
}
|
||||
|
||||
type GetLiftRes struct {
|
||||
|
||||
@ -8,6 +8,8 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/glog"
|
||||
"server/api/reward/v1"
|
||||
"server/internal/model"
|
||||
"server/internal/service"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@ -30,5 +32,29 @@ func (c *ControllerV1) Callback(ctx context.Context, req *v1.CallbackReq) (res *
|
||||
return &v1.CallbackRes{Errcode: 252151000, OrderId: req.OrderId, Datas: []v1.CallbackData{{PrizeCode: req.OrderId}}}, err
|
||||
}
|
||||
glog.Infof(ctx, fmt.Sprintf("%s,%s,%s,%s,%d,%d,%d,%s,%s,%s,#%s", req.Uid, req.OrderId, req.PrizeChannelId, req.PrizeId, req.PrizeType, req.PrizeSubType, req.Num, appid, timestamp, nonce, auth))
|
||||
return &v1.CallbackRes{Errcode: 0, OrderId: req.OrderId, Datas: []v1.CallbackData{{PrizeCode: req.OrderId}}}, err
|
||||
|
||||
out, err := service.Reward().CallBack(ctx, &model.RewardCallbackIn{
|
||||
Uid: req.Uid,
|
||||
CustomInfo: req.CustomInfo,
|
||||
OrderId: req.OrderId,
|
||||
PrizeChannelId: req.PrizeChannelId,
|
||||
PrizeId: req.PrizeId,
|
||||
PrizeType: int(req.PrizeType),
|
||||
PrizeSubType: int(req.PrizeSubType),
|
||||
Num: int(req.Num),
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &v1.CallbackRes{
|
||||
AppId: appid,
|
||||
Datas: out.Datas,
|
||||
Errcode: out.Errcode,
|
||||
Errmsg: out.Errmsg,
|
||||
OrderId: out.OrderId,
|
||||
}, nil
|
||||
|
||||
//return &v1.CallbackRes{Errcode: 0, OrderId: req.OrderId, Datas: []v1.CallbackData{{PrizeCode: req.OrderId}}}, err
|
||||
}
|
||||
|
||||
@ -12,6 +12,10 @@ func (c *ControllerV1) GetLift(ctx context.Context, req *v1.GetLiftReq) (res *v1
|
||||
GameId: int(req.GameId),
|
||||
TaskId: req.TaskId,
|
||||
PopenId: req.PopenId,
|
||||
RewradTypeId: int(req.RewradType),
|
||||
RoleIdx: req.RoleIdx,
|
||||
AreaId: int(req.AreaId),
|
||||
Source: req.Source,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
|
||||
@ -16,6 +16,7 @@ type AdminsDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of the current DAO.
|
||||
columns AdminsColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// AdminsColumns defines and stores column names for the table admins.
|
||||
@ -49,11 +50,12 @@ var adminsColumns = AdminsColumns{
|
||||
}
|
||||
|
||||
// NewAdminsDao creates and returns a new DAO object for table data access.
|
||||
func NewAdminsDao() *AdminsDao {
|
||||
func NewAdminsDao(handlers ...gdb.ModelHandler) *AdminsDao {
|
||||
return &AdminsDao{
|
||||
group: "default",
|
||||
table: "admins",
|
||||
columns: adminsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,7 +81,11 @@ func (dao *AdminsDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *AdminsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
|
||||
@ -16,6 +16,7 @@ type FeedbacksDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of the current DAO.
|
||||
columns FeedbacksColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// FeedbacksColumns defines and stores column names for the table feedbacks.
|
||||
@ -51,11 +52,12 @@ var feedbacksColumns = FeedbacksColumns{
|
||||
}
|
||||
|
||||
// NewFeedbacksDao creates and returns a new DAO object for table data access.
|
||||
func NewFeedbacksDao() *FeedbacksDao {
|
||||
func NewFeedbacksDao(handlers ...gdb.ModelHandler) *FeedbacksDao {
|
||||
return &FeedbacksDao{
|
||||
group: "default",
|
||||
table: "feedbacks",
|
||||
columns: feedbacksColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -81,7 +83,11 @@ func (dao *FeedbacksDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *FeedbacksDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
|
||||
@ -16,6 +16,7 @@ type GamesDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of the current DAO.
|
||||
columns GamesColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// GamesColumns defines and stores column names for the table games.
|
||||
@ -45,11 +46,12 @@ var gamesColumns = GamesColumns{
|
||||
}
|
||||
|
||||
// NewGamesDao creates and returns a new DAO object for table data access.
|
||||
func NewGamesDao() *GamesDao {
|
||||
func NewGamesDao(handlers ...gdb.ModelHandler) *GamesDao {
|
||||
return &GamesDao{
|
||||
group: "default",
|
||||
table: "games",
|
||||
columns: gamesColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,7 +77,11 @@ func (dao *GamesDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *GamesDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
|
||||
@ -16,6 +16,7 @@ type MerchantAdminsDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of the current DAO.
|
||||
columns MerchantAdminsColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// MerchantAdminsColumns defines and stores column names for the table merchant_admins.
|
||||
@ -57,11 +58,12 @@ var merchantAdminsColumns = MerchantAdminsColumns{
|
||||
}
|
||||
|
||||
// NewMerchantAdminsDao creates and returns a new DAO object for table data access.
|
||||
func NewMerchantAdminsDao() *MerchantAdminsDao {
|
||||
func NewMerchantAdminsDao(handlers ...gdb.ModelHandler) *MerchantAdminsDao {
|
||||
return &MerchantAdminsDao{
|
||||
group: "default",
|
||||
table: "merchant_admins",
|
||||
columns: merchantAdminsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -87,7 +89,11 @@ func (dao *MerchantAdminsDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *MerchantAdminsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
|
||||
@ -16,6 +16,7 @@ type MerchantsDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of the current DAO.
|
||||
columns MerchantsColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// MerchantsColumns defines and stores column names for the table merchants.
|
||||
@ -71,11 +72,12 @@ var merchantsColumns = MerchantsColumns{
|
||||
}
|
||||
|
||||
// NewMerchantsDao creates and returns a new DAO object for table data access.
|
||||
func NewMerchantsDao() *MerchantsDao {
|
||||
func NewMerchantsDao(handlers ...gdb.ModelHandler) *MerchantsDao {
|
||||
return &MerchantsDao{
|
||||
group: "default",
|
||||
table: "merchants",
|
||||
columns: merchantsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -101,7 +103,11 @@ func (dao *MerchantsDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *MerchantsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
|
||||
99
internal/dao/internal/notices.go
Normal file
99
internal/dao/internal/notices.go
Normal file
@ -0,0 +1,99 @@
|
||||
// ==========================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// ==========================================================================
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// NoticesDao is the data access object for the table notices.
|
||||
type NoticesDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of the current DAO.
|
||||
columns NoticesColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// NoticesColumns defines and stores column names for the table notices.
|
||||
type NoticesColumns struct {
|
||||
Id string // 通知ID
|
||||
Title string // 通知标题
|
||||
Content string // 通知内容
|
||||
Type string // 通知类型:1=系统公告,2=活动通知,3=维护通知
|
||||
Status string // 状态:0=关闭,1=发布
|
||||
VisibleTo string // 可见范围:1=所有人,2=仅门店,3=仅用户
|
||||
MerchantId string // 所属商户ID
|
||||
StoreId string // 所属门店ID
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间戳
|
||||
}
|
||||
|
||||
// noticesColumns holds the columns for the table notices.
|
||||
var noticesColumns = NoticesColumns{
|
||||
Id: "id",
|
||||
Title: "title",
|
||||
Content: "content",
|
||||
Type: "type",
|
||||
Status: "status",
|
||||
VisibleTo: "visible_to",
|
||||
MerchantId: "merchant_id",
|
||||
StoreId: "store_id",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewNoticesDao creates and returns a new DAO object for table data access.
|
||||
func NewNoticesDao(handlers ...gdb.ModelHandler) *NoticesDao {
|
||||
return &NoticesDao{
|
||||
group: "default",
|
||||
table: "notices",
|
||||
columns: noticesColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *NoticesDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *NoticesDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *NoticesDao) Columns() NoticesColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *NoticesDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *NoticesDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *NoticesDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
95
internal/dao/internal/reward_callback.go
Normal file
95
internal/dao/internal/reward_callback.go
Normal file
@ -0,0 +1,95 @@
|
||||
// ==========================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// ==========================================================================
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// RewardCallbackDao is the data access object for the table reward_callback.
|
||||
type RewardCallbackDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of the current DAO.
|
||||
columns RewardCallbackColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// RewardCallbackColumns defines and stores column names for the table reward_callback.
|
||||
type RewardCallbackColumns struct {
|
||||
Id string //
|
||||
Uid string // 用户账号
|
||||
OrderId string // 订单号必须保证全局唯一(保证接口幂等)
|
||||
PrizeChannelId string // 券渠道 ID
|
||||
PrizeId string // 券 ID
|
||||
PrizeType string // 奖励类型,1 网鱼积分,2 网鱼经验值,3 网鱼兑换码
|
||||
PrizeSubType string // 奖励子类型,默认为 0,有多种子类型时可用,如 1,5 元网费充值券,2、满 30-5 满减券等
|
||||
Num string // 奖励个数,默认 1,比如经验值 10
|
||||
CustomInfo string // 透传字段 (json串)
|
||||
}
|
||||
|
||||
// rewardCallbackColumns holds the columns for the table reward_callback.
|
||||
var rewardCallbackColumns = RewardCallbackColumns{
|
||||
Id: "id",
|
||||
Uid: "uid",
|
||||
OrderId: "order_id",
|
||||
PrizeChannelId: "prize_channel_id",
|
||||
PrizeId: "prize_id",
|
||||
PrizeType: "prize_type",
|
||||
PrizeSubType: "prize_sub_type",
|
||||
Num: "num",
|
||||
CustomInfo: "custom_info",
|
||||
}
|
||||
|
||||
// NewRewardCallbackDao creates and returns a new DAO object for table data access.
|
||||
func NewRewardCallbackDao(handlers ...gdb.ModelHandler) *RewardCallbackDao {
|
||||
return &RewardCallbackDao{
|
||||
group: "default",
|
||||
table: "reward_callback",
|
||||
columns: rewardCallbackColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *RewardCallbackDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *RewardCallbackDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *RewardCallbackDao) Columns() RewardCallbackColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *RewardCallbackDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *RewardCallbackDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *RewardCallbackDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@ -16,6 +16,7 @@ type RewardTypesDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of the current DAO.
|
||||
columns RewardTypesColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// RewardTypesColumns defines and stores column names for the table reward_types.
|
||||
@ -43,11 +44,12 @@ var rewardTypesColumns = RewardTypesColumns{
|
||||
}
|
||||
|
||||
// NewRewardTypesDao creates and returns a new DAO object for table data access.
|
||||
func NewRewardTypesDao() *RewardTypesDao {
|
||||
func NewRewardTypesDao(handlers ...gdb.ModelHandler) *RewardTypesDao {
|
||||
return &RewardTypesDao{
|
||||
group: "default",
|
||||
table: "reward_types",
|
||||
columns: rewardTypesColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -73,7 +75,11 @@ func (dao *RewardTypesDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *RewardTypesDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
|
||||
@ -16,6 +16,7 @@ type RewardsDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of the current DAO.
|
||||
columns RewardsColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// RewardsColumns defines and stores column names for the table rewards.
|
||||
@ -71,11 +72,12 @@ var rewardsColumns = RewardsColumns{
|
||||
}
|
||||
|
||||
// NewRewardsDao creates and returns a new DAO object for table data access.
|
||||
func NewRewardsDao() *RewardsDao {
|
||||
func NewRewardsDao(handlers ...gdb.ModelHandler) *RewardsDao {
|
||||
return &RewardsDao{
|
||||
group: "default",
|
||||
table: "rewards",
|
||||
columns: rewardsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -101,7 +103,11 @@ func (dao *RewardsDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *RewardsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
|
||||
@ -16,6 +16,7 @@ type RolesDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of the current DAO.
|
||||
columns RolesColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// RolesColumns defines and stores column names for the table roles.
|
||||
@ -47,11 +48,12 @@ var rolesColumns = RolesColumns{
|
||||
}
|
||||
|
||||
// NewRolesDao creates and returns a new DAO object for table data access.
|
||||
func NewRolesDao() *RolesDao {
|
||||
func NewRolesDao(handlers ...gdb.ModelHandler) *RolesDao {
|
||||
return &RolesDao{
|
||||
group: "default",
|
||||
table: "roles",
|
||||
columns: rolesColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -77,7 +79,11 @@ func (dao *RolesDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *RolesDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
|
||||
@ -16,6 +16,7 @@ type StoreAdminsDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of the current DAO.
|
||||
columns StoreAdminsColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// StoreAdminsColumns defines and stores column names for the table store_admins.
|
||||
@ -57,11 +58,12 @@ var storeAdminsColumns = StoreAdminsColumns{
|
||||
}
|
||||
|
||||
// NewStoreAdminsDao creates and returns a new DAO object for table data access.
|
||||
func NewStoreAdminsDao() *StoreAdminsDao {
|
||||
func NewStoreAdminsDao(handlers ...gdb.ModelHandler) *StoreAdminsDao {
|
||||
return &StoreAdminsDao{
|
||||
group: "default",
|
||||
table: "store_admins",
|
||||
columns: storeAdminsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -87,7 +89,11 @@ func (dao *StoreAdminsDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *StoreAdminsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
|
||||
@ -16,6 +16,7 @@ type StoreDesktopSettingsDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of the current DAO.
|
||||
columns StoreDesktopSettingsColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// StoreDesktopSettingsColumns defines and stores column names for the table store_desktop_settings.
|
||||
@ -33,11 +34,12 @@ var storeDesktopSettingsColumns = StoreDesktopSettingsColumns{
|
||||
}
|
||||
|
||||
// NewStoreDesktopSettingsDao creates and returns a new DAO object for table data access.
|
||||
func NewStoreDesktopSettingsDao() *StoreDesktopSettingsDao {
|
||||
func NewStoreDesktopSettingsDao(handlers ...gdb.ModelHandler) *StoreDesktopSettingsDao {
|
||||
return &StoreDesktopSettingsDao{
|
||||
group: "default",
|
||||
table: "store_desktop_settings",
|
||||
columns: storeDesktopSettingsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,7 +65,11 @@ func (dao *StoreDesktopSettingsDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *StoreDesktopSettingsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
|
||||
@ -16,6 +16,7 @@ type StoreIpsDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of the current DAO.
|
||||
columns StoreIpsColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// StoreIpsColumns defines and stores column names for the table store_ips.
|
||||
@ -41,11 +42,12 @@ var storeIpsColumns = StoreIpsColumns{
|
||||
}
|
||||
|
||||
// NewStoreIpsDao creates and returns a new DAO object for table data access.
|
||||
func NewStoreIpsDao() *StoreIpsDao {
|
||||
func NewStoreIpsDao(handlers ...gdb.ModelHandler) *StoreIpsDao {
|
||||
return &StoreIpsDao{
|
||||
group: "default",
|
||||
table: "store_ips",
|
||||
columns: storeIpsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -71,7 +73,11 @@ func (dao *StoreIpsDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *StoreIpsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
|
||||
@ -16,6 +16,7 @@ type StoreNetfeeAreaLevelDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of the current DAO.
|
||||
columns StoreNetfeeAreaLevelColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// StoreNetfeeAreaLevelColumns defines and stores column names for the table store_netfee_area_level.
|
||||
@ -49,11 +50,12 @@ var storeNetfeeAreaLevelColumns = StoreNetfeeAreaLevelColumns{
|
||||
}
|
||||
|
||||
// NewStoreNetfeeAreaLevelDao creates and returns a new DAO object for table data access.
|
||||
func NewStoreNetfeeAreaLevelDao() *StoreNetfeeAreaLevelDao {
|
||||
func NewStoreNetfeeAreaLevelDao(handlers ...gdb.ModelHandler) *StoreNetfeeAreaLevelDao {
|
||||
return &StoreNetfeeAreaLevelDao{
|
||||
group: "default",
|
||||
table: "store_netfee_area_level",
|
||||
columns: storeNetfeeAreaLevelColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,7 +81,11 @@ func (dao *StoreNetfeeAreaLevelDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *StoreNetfeeAreaLevelDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
|
||||
@ -16,6 +16,7 @@ type StoreRolesDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of the current DAO.
|
||||
columns StoreRolesColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// StoreRolesColumns defines and stores column names for the table store_roles.
|
||||
@ -39,11 +40,12 @@ var storeRolesColumns = StoreRolesColumns{
|
||||
}
|
||||
|
||||
// NewStoreRolesDao creates and returns a new DAO object for table data access.
|
||||
func NewStoreRolesDao() *StoreRolesDao {
|
||||
func NewStoreRolesDao(handlers ...gdb.ModelHandler) *StoreRolesDao {
|
||||
return &StoreRolesDao{
|
||||
group: "default",
|
||||
table: "store_roles",
|
||||
columns: storeRolesColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,7 +71,11 @@ func (dao *StoreRolesDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *StoreRolesDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
|
||||
@ -16,6 +16,7 @@ type StoresDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of the current DAO.
|
||||
columns StoresColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// StoresColumns defines and stores column names for the table stores.
|
||||
@ -51,11 +52,12 @@ var storesColumns = StoresColumns{
|
||||
}
|
||||
|
||||
// NewStoresDao creates and returns a new DAO object for table data access.
|
||||
func NewStoresDao() *StoresDao {
|
||||
func NewStoresDao(handlers ...gdb.ModelHandler) *StoresDao {
|
||||
return &StoresDao{
|
||||
group: "default",
|
||||
table: "stores",
|
||||
columns: storesColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -81,7 +83,11 @@ func (dao *StoresDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *StoresDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
|
||||
@ -16,6 +16,7 @@ type TaskRewardsDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of the current DAO.
|
||||
columns TaskRewardsColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// TaskRewardsColumns defines and stores column names for the table task_rewards.
|
||||
@ -31,11 +32,12 @@ var taskRewardsColumns = TaskRewardsColumns{
|
||||
}
|
||||
|
||||
// NewTaskRewardsDao creates and returns a new DAO object for table data access.
|
||||
func NewTaskRewardsDao() *TaskRewardsDao {
|
||||
func NewTaskRewardsDao(handlers ...gdb.ModelHandler) *TaskRewardsDao {
|
||||
return &TaskRewardsDao{
|
||||
group: "default",
|
||||
table: "task_rewards",
|
||||
columns: taskRewardsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,7 +63,11 @@ func (dao *TaskRewardsDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *TaskRewardsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
|
||||
@ -16,6 +16,7 @@ type TasksDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of the current DAO.
|
||||
columns TasksColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// TasksColumns defines and stores column names for the table tasks.
|
||||
@ -57,11 +58,12 @@ var tasksColumns = TasksColumns{
|
||||
}
|
||||
|
||||
// NewTasksDao creates and returns a new DAO object for table data access.
|
||||
func NewTasksDao() *TasksDao {
|
||||
func NewTasksDao(handlers ...gdb.ModelHandler) *TasksDao {
|
||||
return &TasksDao{
|
||||
group: "default",
|
||||
table: "tasks",
|
||||
columns: tasksColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -87,7 +89,11 @@ func (dao *TasksDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *TasksDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
|
||||
@ -16,6 +16,7 @@ type UserTasksDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of the current DAO.
|
||||
columns UserTasksColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// UserTasksColumns defines and stores column names for the table user_tasks.
|
||||
@ -51,11 +52,12 @@ var userTasksColumns = UserTasksColumns{
|
||||
}
|
||||
|
||||
// NewUserTasksDao creates and returns a new DAO object for table data access.
|
||||
func NewUserTasksDao() *UserTasksDao {
|
||||
func NewUserTasksDao(handlers ...gdb.ModelHandler) *UserTasksDao {
|
||||
return &UserTasksDao{
|
||||
group: "default",
|
||||
table: "user_tasks",
|
||||
columns: userTasksColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -81,7 +83,11 @@ func (dao *UserTasksDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *UserTasksDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
|
||||
@ -16,6 +16,7 @@ type UsersDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of the current DAO.
|
||||
columns UsersColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// UsersColumns defines and stores column names for the table users.
|
||||
@ -59,11 +60,12 @@ var usersColumns = UsersColumns{
|
||||
}
|
||||
|
||||
// NewUsersDao creates and returns a new DAO object for table data access.
|
||||
func NewUsersDao() *UsersDao {
|
||||
func NewUsersDao(handlers ...gdb.ModelHandler) *UsersDao {
|
||||
return &UsersDao{
|
||||
group: "default",
|
||||
table: "users",
|
||||
columns: usersColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -89,7 +91,11 @@ func (dao *UsersDao) Group() string {
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *UsersDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
|
||||
22
internal/dao/notices.go
Normal file
22
internal/dao/notices.go
Normal file
@ -0,0 +1,22 @@
|
||||
// =================================================================================
|
||||
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
|
||||
// =================================================================================
|
||||
|
||||
package dao
|
||||
|
||||
import (
|
||||
"server/internal/dao/internal"
|
||||
)
|
||||
|
||||
// noticesDao is the data access object for the table notices.
|
||||
// You can define custom methods on it to extend its functionality as needed.
|
||||
type noticesDao struct {
|
||||
*internal.NoticesDao
|
||||
}
|
||||
|
||||
var (
|
||||
// Notices is a globally accessible object for table notices operations.
|
||||
Notices = noticesDao{internal.NewNoticesDao()}
|
||||
)
|
||||
|
||||
// Add your custom methods and functionality below.
|
||||
22
internal/dao/reward_callback.go
Normal file
22
internal/dao/reward_callback.go
Normal file
@ -0,0 +1,22 @@
|
||||
// =================================================================================
|
||||
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
|
||||
// =================================================================================
|
||||
|
||||
package dao
|
||||
|
||||
import (
|
||||
"server/internal/dao/internal"
|
||||
)
|
||||
|
||||
// rewardCallbackDao is the data access object for the table reward_callback.
|
||||
// You can define custom methods on it to extend its functionality as needed.
|
||||
type rewardCallbackDao struct {
|
||||
*internal.RewardCallbackDao
|
||||
}
|
||||
|
||||
var (
|
||||
// RewardCallback is a globally accessible object for table reward_callback operations.
|
||||
RewardCallback = rewardCallbackDao{internal.NewRewardCallbackDao()}
|
||||
)
|
||||
|
||||
// Add your custom methods and functionality below.
|
||||
@ -359,16 +359,20 @@ func (s *sReward) List(ctx context.Context, in *model.RewardListIn) (out *model.
|
||||
// GetLift 领取奖励
|
||||
func (s *sReward) GetLift(ctx context.Context, in *model.GetRewardIn) (out *model.GetRewardOut, err error) {
|
||||
|
||||
// 遍历奖励类型列表
|
||||
//for _, v := range in.RewradTypeId {
|
||||
// if v > 0 {
|
||||
// // 发背包+兑换
|
||||
//
|
||||
// }
|
||||
// if v > 0 {
|
||||
// // 直接发背包
|
||||
// }
|
||||
//}
|
||||
// 判断奖励类型
|
||||
if in.Source == 1 {
|
||||
// 系统奖励处理
|
||||
if in.RewradTypeId != 16 {
|
||||
// 需要大区角色
|
||||
|
||||
} else {
|
||||
// 不需要
|
||||
|
||||
}
|
||||
} else {
|
||||
// 门店奖励处理
|
||||
|
||||
}
|
||||
|
||||
activity, err := gamelife.GetGamelifeClient(ctx).RequestActivity(ctx, &model.QQNetbarActivityIn{PopenId: in.PopenId, ServiceName: consts.GetGift, GiftParam: model.GiftParam{
|
||||
TaskId: in.TaskId,
|
||||
@ -496,3 +500,18 @@ func (s *sReward) OperateTaskReward(ctx context.Context, in *model.OperateTaskRe
|
||||
return &model.OperateTaskRewardOut{Success: true}, err
|
||||
}
|
||||
}
|
||||
|
||||
// CallBack 奖励回调
|
||||
func (s *sReward) CallBack(ctx context.Context, in *model.RewardCallbackIn) (out *model.RewardCallbackOut, err error) {
|
||||
|
||||
dao.RewardCallback.Ctx(ctx).Insert(do.RewardCallback{
|
||||
OrderId: in.OrderId,
|
||||
PrizeId: in.PrizeId,
|
||||
PrizeType: in.PrizeType,
|
||||
PrizeSubType: in.PrizeSubType,
|
||||
Uid: in.Uid,
|
||||
Num: in.Num,
|
||||
CustomInfo: in.CustomInfo,
|
||||
})
|
||||
return nil, err
|
||||
}
|
||||
|
||||
26
internal/model/do/notices.go
Normal file
26
internal/model/do/notices.go
Normal file
@ -0,0 +1,26 @@
|
||||
// =================================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// Notices is the golang structure of table notices for DAO operations like Where/Data.
|
||||
type Notices struct {
|
||||
g.Meta `orm:"table:notices, do:true"`
|
||||
Id interface{} // 通知ID
|
||||
Title interface{} // 通知标题
|
||||
Content interface{} // 通知内容
|
||||
Type interface{} // 通知类型:1=系统公告,2=活动通知,3=维护通知
|
||||
Status interface{} // 状态:0=关闭,1=发布
|
||||
VisibleTo interface{} // 可见范围:1=所有人,2=仅门店,3=仅用户
|
||||
MerchantId interface{} // 所属商户ID
|
||||
StoreId interface{} // 所属门店ID
|
||||
CreatedAt *gtime.Time // 创建时间
|
||||
UpdatedAt *gtime.Time // 更新时间
|
||||
DeletedAt *gtime.Time // 软删除时间戳
|
||||
}
|
||||
23
internal/model/do/reward_callback.go
Normal file
23
internal/model/do/reward_callback.go
Normal file
@ -0,0 +1,23 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package do
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// RewardCallback is the golang structure of table reward_callback for DAO operations like Where/Data.
|
||||
type RewardCallback struct {
|
||||
g.Meta `orm:"table:reward_callback, do:true"`
|
||||
Id interface{} //
|
||||
Uid interface{} // 用户账号
|
||||
OrderId interface{} // 订单号必须保证全局唯一(保证接口幂等)
|
||||
PrizeChannelId interface{} // 券渠道 ID
|
||||
PrizeId interface{} // 券 ID
|
||||
PrizeType interface{} // 奖励类型,1 网鱼积分,2 网鱼经验值,3 网鱼兑换码
|
||||
PrizeSubType interface{} // 奖励子类型,默认为 0,有多种子类型时可用,如 1,5 元网费充值券,2、满 30-5 满减券等
|
||||
Num interface{} // 奖励个数,默认 1,比如经验值 10
|
||||
CustomInfo interface{} // 透传字段 (json串)
|
||||
}
|
||||
24
internal/model/entity/notices.go
Normal file
24
internal/model/entity/notices.go
Normal file
@ -0,0 +1,24 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// Notices is the golang structure for table notices.
|
||||
type Notices struct {
|
||||
Id int64 `json:"id" orm:"id" description:"通知ID"` // 通知ID
|
||||
Title string `json:"title" orm:"title" description:"通知标题"` // 通知标题
|
||||
Content string `json:"content" orm:"content" description:"通知内容"` // 通知内容
|
||||
Type int `json:"type" orm:"type" description:"通知类型:1=系统公告,2=活动通知,3=维护通知"` // 通知类型:1=系统公告,2=活动通知,3=维护通知
|
||||
Status int `json:"status" orm:"status" description:"状态:0=关闭,1=发布"` // 状态:0=关闭,1=发布
|
||||
VisibleTo int `json:"visibleTo" orm:"visible_to" description:"可见范围:1=所有人,2=仅门店,3=仅用户"` // 可见范围:1=所有人,2=仅门店,3=仅用户
|
||||
MerchantId int64 `json:"merchantId" orm:"merchant_id" description:"所属商户ID"` // 所属商户ID
|
||||
StoreId int64 `json:"storeId" orm:"store_id" description:"所属门店ID"` // 所属门店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:"软删除时间戳"` // 软删除时间戳
|
||||
}
|
||||
18
internal/model/entity/reward_callback.go
Normal file
18
internal/model/entity/reward_callback.go
Normal file
@ -0,0 +1,18 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package entity
|
||||
|
||||
// RewardCallback is the golang structure for table reward_callback.
|
||||
type RewardCallback struct {
|
||||
Id int64 `json:"id" orm:"id" description:""` //
|
||||
Uid string `json:"uid" orm:"uid" description:"用户账号"` // 用户账号
|
||||
OrderId string `json:"orderId" orm:"order_id" description:"订单号必须保证全局唯一(保证接口幂等)"` // 订单号必须保证全局唯一(保证接口幂等)
|
||||
PrizeChannelId string `json:"prizeChannelId" orm:"prize_channel_id" description:"券渠道 ID"` // 券渠道 ID
|
||||
PrizeId string `json:"prizeId" orm:"prize_id" description:"券 ID"` // 券 ID
|
||||
PrizeType int `json:"prizeType" orm:"prize_type" description:"奖励类型,1 网鱼积分,2 网鱼经验值,3 网鱼兑换码"` // 奖励类型,1 网鱼积分,2 网鱼经验值,3 网鱼兑换码
|
||||
PrizeSubType int `json:"prizeSubType" orm:"prize_sub_type" description:"奖励子类型,默认为 0,有多种子类型时可用,如 1,5 元网费充值券,2、满 30-5 满减券等"` // 奖励子类型,默认为 0,有多种子类型时可用,如 1,5 元网费充值券,2、满 30-5 满减券等
|
||||
Num int `json:"num" orm:"num" description:"奖励个数,默认 1,比如经验值 10"` // 奖励个数,默认 1,比如经验值 10
|
||||
CustomInfo string `json:"customInfo" orm:"custom_info" description:"透传字段 (json串)"` // 透传字段 (json串)
|
||||
}
|
||||
@ -123,26 +123,37 @@ type RewardListOut struct {
|
||||
|
||||
// RewardCallbackIn 任务奖励领取回调入参
|
||||
type RewardCallbackIn struct {
|
||||
AreaId int
|
||||
GameId int
|
||||
RewradTypeId []int
|
||||
RoleIdx string
|
||||
TaskId string
|
||||
Uid string `json:"uid" ` // 用户账号
|
||||
OrderId string `json:"orderId"` // 订单号必须保证全局唯一(保证接口幂等)
|
||||
PrizeChannelId string `json:"prizeChannelId"` // 券渠道 ID
|
||||
PrizeId string `json:"prizeId"` // 券 ID
|
||||
PrizeType int `json:"prizeType"` // 奖励类型,1 网鱼积分,2 网鱼经验值,3 网鱼兑换码
|
||||
PrizeSubType int `json:"prizeSubType"` // 奖励子类型,默认为 0,有多种子类型时可用,如 1,5 元网费充值券,2、满 30-5 满减券等
|
||||
Num int `json:"num"` // 奖励个数,默认 1,比如经验值 10
|
||||
CustomInfo string `json:"customInfo"` // 透传字段 (json串)
|
||||
}
|
||||
|
||||
type RewardCallbackOut struct {
|
||||
List interface{} `json:"list"`
|
||||
Result int64 `json:"result"`
|
||||
Water Water `json:"water"`
|
||||
Errcode int32 `json:"errcode"`
|
||||
Errmsg string `json:"errmsg"`
|
||||
AppId string `json:"appid"`
|
||||
OrderId string `json:"order_id"`
|
||||
Datas []CallbackData `json:"data"`
|
||||
}
|
||||
|
||||
type CallbackData struct {
|
||||
PrizeCode string `json:"prize_code"`
|
||||
Comment string `json:"comment"`
|
||||
}
|
||||
|
||||
type GetRewardIn struct {
|
||||
AreaId int
|
||||
GameId int
|
||||
RewradTypeId []int
|
||||
RewradTypeId int
|
||||
RoleIdx string
|
||||
TaskId string
|
||||
PopenId string
|
||||
Source int
|
||||
}
|
||||
type GetRewardOut struct {
|
||||
List interface{} `json:"list"`
|
||||
|
||||
@ -4,7 +4,7 @@ import (
|
||||
_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
|
||||
_ "github.com/gogf/gf/contrib/nosql/redis/v2"
|
||||
_ "server/utility/gamelife"
|
||||
_ "server/utility/mqtt/emqx"
|
||||
//_ "server/utility/mqtt/emqx"
|
||||
_ "server/utility/myCasbin"
|
||||
_ "server/utility/oss/aliyun"
|
||||
_ "server/utility/rsa"
|
||||
|
||||
@ -29,6 +29,7 @@ type (
|
||||
// GetGoodsDetails 物品详情
|
||||
GetGoodsDetails(ctx context.Context, in *model.GetGoodsDetailsIn) (out *model.QueryUserGoodsDetailResponse, err error)
|
||||
OperateTaskReward(ctx context.Context, in *model.OperateTaskRewardIn) (out *model.OperateTaskRewardOut, err error)
|
||||
CallBack(ctx context.Context, in *model.RewardCallbackIn) (out *model.RewardCallbackOut, err error)
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user