奖励类型新增门店相关 id

This commit is contained in:
chy
2025-06-13 09:48:18 +08:00
parent fac2bd41b3
commit d7987a02f2
35 changed files with 561 additions and 129 deletions

View File

@ -16,10 +16,10 @@ type ListRes struct {
type CreateReq struct { type CreateReq struct {
g.Meta `path:"/rewardType" method:"post" tags:"奖励类型" summary:"(系统)创建奖励类型"` g.Meta `path:"/rewardType" method:"post" tags:"奖励类型" summary:"(系统)创建奖励类型"`
Name string `json:"name" v:"required#名称不能为空" dc:"名称"` Name string `json:"name" v:"required#名称不能为空" dc:"名称"`
//Sort int `json:"sort" v:"required#排序不能为空" dc:"排序"`
Code string `json:"code" v:"required#代号不能为空" dc:"代号"` Code string `json:"code" v:"required#代号不能为空" dc:"代号"`
Description string `json:"description" v:"required#描述不能为空" dc:"描述"` Description string `json:"description" v:"required#描述不能为空" dc:"描述"`
//Status int `json:"status" v:"required#状态不能为空" dc:"状态"` //Status int `json:"status" v:"required#状态不能为空" dc:"状态"`
StoreId int `json:"store_id" dc:"门店ID"`
} }
type CreateRes struct { type CreateRes struct {
@ -33,6 +33,7 @@ type UpdateReq struct {
Code string `json:"code" v:"required#代号不能为空" dc:"代号"` Code string `json:"code" v:"required#代号不能为空" dc:"代号"`
Description string `json:"description" v:"required#描述不能为空" dc:"描述"` Description string `json:"description" v:"required#描述不能为空" dc:"描述"`
Status int `json:"status" v:"required#状态不能为空" dc:"状态"` Status int `json:"status" v:"required#状态不能为空" dc:"状态"`
StoreId int `json:"store_id" dc:"门店ID"`
} }
type UpdateRes struct { type UpdateRes struct {

View File

@ -13,6 +13,7 @@ func (c *ControllerV1) Create(ctx context.Context, req *v1.CreateReq) (res *v1.C
Code: req.Code, Code: req.Code,
Description: req.Description, Description: req.Description,
Name: req.Name, Name: req.Name,
StoreId: req.StoreId,
}) })
if err != nil { if err != nil {
return nil, err return nil, err

View File

@ -2,6 +2,7 @@ package rewardType
import ( import (
"context" "context"
"github.com/gogf/gf/v2/frame/g"
"server/internal/model" "server/internal/model"
"server/internal/service" "server/internal/service"
@ -9,7 +10,10 @@ import (
) )
func (c *ControllerV1) List(ctx context.Context, req *v1.ListReq) (res *v1.ListRes, err error) { func (c *ControllerV1) List(ctx context.Context, req *v1.ListReq) (res *v1.ListRes, err error) {
out, err := service.RewardType().List(ctx, &model.RewardTypeIn{Page: req.Page, Size: req.Size})
roleName := g.RequestFromCtx(ctx).GetCtxVar("role").String()
operatorId := g.RequestFromCtx(ctx).GetCtxVar("id").Int()
out, err := service.RewardType().List(ctx, &model.RewardTypeIn{Page: req.Page, Size: req.Size, RoleName: roleName, OperatorId: operatorId})
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@ -15,6 +15,7 @@ func (c *ControllerV1) Update(ctx context.Context, req *v1.UpdateReq) (res *v1.U
Code: req.Code, Code: req.Code,
Status: req.Status, Status: req.Status,
Description: req.Description, Description: req.Description,
StoreId: req.StoreId,
}) })
if err != nil { if err != nil {

View File

@ -16,6 +16,7 @@ type AdminsDao struct {
table string // table is the underlying table name of the DAO. table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current 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. 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. // 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. // NewAdminsDao creates and returns a new DAO object for table data access.
func NewAdminsDao() *AdminsDao { func NewAdminsDao(handlers ...gdb.ModelHandler) *AdminsDao {
return &AdminsDao{ return &AdminsDao{
group: "default", group: "default",
table: "admins", table: "admins",
columns: adminsColumns, 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. // 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 { 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. // Transaction wraps the transaction logic using function f.

View File

@ -16,6 +16,7 @@ type FeedbacksDao struct {
table string // table is the underlying table name of the DAO. table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current 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. 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. // 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. // NewFeedbacksDao creates and returns a new DAO object for table data access.
func NewFeedbacksDao() *FeedbacksDao { func NewFeedbacksDao(handlers ...gdb.ModelHandler) *FeedbacksDao {
return &FeedbacksDao{ return &FeedbacksDao{
group: "default", group: "default",
table: "feedbacks", table: "feedbacks",
columns: feedbacksColumns, 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. // 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 { 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. // Transaction wraps the transaction logic using function f.

View File

@ -16,6 +16,7 @@ type GamesDao struct {
table string // table is the underlying table name of the DAO. table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current 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. 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. // GamesColumns defines and stores column names for the table games.
@ -43,11 +44,12 @@ var gamesColumns = GamesColumns{
} }
// NewGamesDao creates and returns a new DAO object for table data access. // NewGamesDao creates and returns a new DAO object for table data access.
func NewGamesDao() *GamesDao { func NewGamesDao(handlers ...gdb.ModelHandler) *GamesDao {
return &GamesDao{ return &GamesDao{
group: "default", group: "default",
table: "games", table: "games",
columns: gamesColumns, columns: gamesColumns,
handlers: handlers,
} }
} }
@ -73,7 +75,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. // 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 { 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. // Transaction wraps the transaction logic using function f.

View File

@ -16,6 +16,7 @@ type MerchantAdminsDao struct {
table string // table is the underlying table name of the DAO. table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current 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. 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. // 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. // NewMerchantAdminsDao creates and returns a new DAO object for table data access.
func NewMerchantAdminsDao() *MerchantAdminsDao { func NewMerchantAdminsDao(handlers ...gdb.ModelHandler) *MerchantAdminsDao {
return &MerchantAdminsDao{ return &MerchantAdminsDao{
group: "default", group: "default",
table: "merchant_admins", table: "merchant_admins",
columns: merchantAdminsColumns, 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. // 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 { 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. // Transaction wraps the transaction logic using function f.

View File

@ -16,6 +16,7 @@ type MerchantsDao struct {
table string // table is the underlying table name of the DAO. table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current 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. 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. // 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. // NewMerchantsDao creates and returns a new DAO object for table data access.
func NewMerchantsDao() *MerchantsDao { func NewMerchantsDao(handlers ...gdb.ModelHandler) *MerchantsDao {
return &MerchantsDao{ return &MerchantsDao{
group: "default", group: "default",
table: "merchants", table: "merchants",
columns: merchantsColumns, 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. // 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 { 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. // Transaction wraps the transaction logic using function f.

View File

@ -16,6 +16,7 @@ type RewardTypesDao struct {
table string // table is the underlying table name of the DAO. table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current 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. 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. // RewardTypesColumns defines and stores column names for the table reward_types.
@ -28,6 +29,7 @@ type RewardTypesColumns struct {
CreatedAt string // 创建时间 CreatedAt string // 创建时间
UpdatedAt string // 更新时间 UpdatedAt string // 更新时间
DeletedAt string // 软删除时间 DeletedAt string // 软删除时间
StoreId string // 门店 id
} }
// rewardTypesColumns holds the columns for the table reward_types. // rewardTypesColumns holds the columns for the table reward_types.
@ -40,14 +42,16 @@ var rewardTypesColumns = RewardTypesColumns{
CreatedAt: "created_at", CreatedAt: "created_at",
UpdatedAt: "updated_at", UpdatedAt: "updated_at",
DeletedAt: "deleted_at", DeletedAt: "deleted_at",
StoreId: "store_id",
} }
// NewRewardTypesDao creates and returns a new DAO object for table data access. // NewRewardTypesDao creates and returns a new DAO object for table data access.
func NewRewardTypesDao() *RewardTypesDao { func NewRewardTypesDao(handlers ...gdb.ModelHandler) *RewardTypesDao {
return &RewardTypesDao{ return &RewardTypesDao{
group: "default", group: "default",
table: "reward_types", table: "reward_types",
columns: rewardTypesColumns, columns: rewardTypesColumns,
handlers: handlers,
} }
} }
@ -73,7 +77,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. // 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 { 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. // Transaction wraps the transaction logic using function f.

View File

@ -16,6 +16,7 @@ type RewardsDao struct {
table string // table is the underlying table name of the DAO. table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current 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. 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. // RewardsColumns defines and stores column names for the table rewards.
@ -53,11 +54,12 @@ var rewardsColumns = RewardsColumns{
} }
// NewRewardsDao creates and returns a new DAO object for table data access. // NewRewardsDao creates and returns a new DAO object for table data access.
func NewRewardsDao() *RewardsDao { func NewRewardsDao(handlers ...gdb.ModelHandler) *RewardsDao {
return &RewardsDao{ return &RewardsDao{
group: "default", group: "default",
table: "rewards", table: "rewards",
columns: rewardsColumns, columns: rewardsColumns,
handlers: handlers,
} }
} }
@ -83,7 +85,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. // 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 { 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. // Transaction wraps the transaction logic using function f.

View File

@ -16,6 +16,7 @@ type RolesDao struct {
table string // table is the underlying table name of the DAO. table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current 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. 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. // RolesColumns defines and stores column names for the table roles.
@ -29,6 +30,7 @@ type RolesColumns struct {
UpdatedAt string // 更新时间 UpdatedAt string // 更新时间
DeletedAt string // 软删除时间戳 DeletedAt string // 软删除时间戳
IsDeletable string // 是否可删除0=不可删除1=可删除 IsDeletable string // 是否可删除0=不可删除1=可删除
StoreId string // 门店ID
} }
// rolesColumns holds the columns for the table roles. // rolesColumns holds the columns for the table roles.
@ -42,14 +44,16 @@ var rolesColumns = RolesColumns{
UpdatedAt: "updated_at", UpdatedAt: "updated_at",
DeletedAt: "deleted_at", DeletedAt: "deleted_at",
IsDeletable: "is_deletable", IsDeletable: "is_deletable",
StoreId: "store_id",
} }
// NewRolesDao creates and returns a new DAO object for table data access. // NewRolesDao creates and returns a new DAO object for table data access.
func NewRolesDao() *RolesDao { func NewRolesDao(handlers ...gdb.ModelHandler) *RolesDao {
return &RolesDao{ return &RolesDao{
group: "default", group: "default",
table: "roles", table: "roles",
columns: rolesColumns, columns: rolesColumns,
handlers: handlers,
} }
} }
@ -75,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. // 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 { 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. // Transaction wraps the transaction logic using function f.

View File

@ -16,6 +16,7 @@ type StoreAdminsDao struct {
table string // table is the underlying table name of the DAO. table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current 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. 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. // StoreAdminsColumns defines and stores column names for the table store_admins.
@ -34,6 +35,7 @@ type StoreAdminsColumns struct {
UpdatedAt string // 更新时间 UpdatedAt string // 更新时间
DeletedAt string // 软删除时间戳 DeletedAt string // 软删除时间戳
RoleId string // 角色ID RoleId string // 角色ID
StoreRoleId string // 门店角色ID
} }
// storeAdminsColumns holds the columns for the table store_admins. // storeAdminsColumns holds the columns for the table store_admins.
@ -52,14 +54,16 @@ var storeAdminsColumns = StoreAdminsColumns{
UpdatedAt: "updated_at", UpdatedAt: "updated_at",
DeletedAt: "deleted_at", DeletedAt: "deleted_at",
RoleId: "role_id", RoleId: "role_id",
StoreRoleId: "store_role_id",
} }
// NewStoreAdminsDao creates and returns a new DAO object for table data access. // NewStoreAdminsDao creates and returns a new DAO object for table data access.
func NewStoreAdminsDao() *StoreAdminsDao { func NewStoreAdminsDao(handlers ...gdb.ModelHandler) *StoreAdminsDao {
return &StoreAdminsDao{ return &StoreAdminsDao{
group: "default", group: "default",
table: "store_admins", table: "store_admins",
columns: storeAdminsColumns, columns: storeAdminsColumns,
handlers: handlers,
} }
} }
@ -85,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. // 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 { 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. // Transaction wraps the transaction logic using function f.

View 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"
)
// StoreDesktopSettingsDao is the data access object for the table store_desktop_settings.
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.
type StoreDesktopSettingsColumns struct {
Id string // 主键ID
StoreId string // 门店ID
BackgroundUrl string // 桌面背景图片URL
Resolution string // 分辨率例如1920x1080
IsTopWidgetVisible string // 顶部组件是否显示FALSE=隐藏TRUE=显示
IsRightWidgetVisible string // 右侧组件是否显示FALSE=隐藏TRUE=显示
CreatedAt string // 创建时间
UpdatedAt string // 更新时间
DeletedAt string // 软删除时间戳
}
// storeDesktopSettingsColumns holds the columns for the table store_desktop_settings.
var storeDesktopSettingsColumns = StoreDesktopSettingsColumns{
Id: "id",
StoreId: "store_id",
BackgroundUrl: "background_url",
Resolution: "resolution",
IsTopWidgetVisible: "is_top_widget_visible",
IsRightWidgetVisible: "is_right_widget_visible",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
DeletedAt: "deleted_at",
}
// NewStoreDesktopSettingsDao creates and returns a new DAO object for table data access.
func NewStoreDesktopSettingsDao(handlers ...gdb.ModelHandler) *StoreDesktopSettingsDao {
return &StoreDesktopSettingsDao{
group: "default",
table: "store_desktop_settings",
columns: storeDesktopSettingsColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *StoreDesktopSettingsDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *StoreDesktopSettingsDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *StoreDesktopSettingsDao) Columns() StoreDesktopSettingsColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *StoreDesktopSettingsDao) 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 *StoreDesktopSettingsDao) 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 *StoreDesktopSettingsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}

View File

@ -16,6 +16,7 @@ type StoreRewardsDao struct {
table string // table is the underlying table name of the DAO. table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO. group string // group is the database configuration group name of the current DAO.
columns StoreRewardsColumns // columns contains all the column names of Table for convenient usage. columns StoreRewardsColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
} }
// StoreRewardsColumns defines and stores column names for the table store_rewards. // StoreRewardsColumns defines and stores column names for the table store_rewards.
@ -33,11 +34,12 @@ var storeRewardsColumns = StoreRewardsColumns{
} }
// NewStoreRewardsDao creates and returns a new DAO object for table data access. // NewStoreRewardsDao creates and returns a new DAO object for table data access.
func NewStoreRewardsDao() *StoreRewardsDao { func NewStoreRewardsDao(handlers ...gdb.ModelHandler) *StoreRewardsDao {
return &StoreRewardsDao{ return &StoreRewardsDao{
group: "default", group: "default",
table: "store_rewards", table: "store_rewards",
columns: storeRewardsColumns, columns: storeRewardsColumns,
handlers: handlers,
} }
} }
@ -63,7 +65,11 @@ func (dao *StoreRewardsDao) Group() string {
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation. // Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *StoreRewardsDao) Ctx(ctx context.Context) *gdb.Model { func (dao *StoreRewardsDao) 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. // Transaction wraps the transaction logic using function f.

View File

@ -0,0 +1,89 @@
// ==========================================================================
// 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"
)
// StoreRolesDao is the data access object for the table store_roles.
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.
type StoreRolesColumns struct {
Id string // 门店角色ID
StoreId string // 所属门店ID
Name string // 门店角色名称
CreatedAt string // 创建时间
UpdatedAt string // 更新时间
DeletedAt string // 软删除时间戳
}
// storeRolesColumns holds the columns for the table store_roles.
var storeRolesColumns = StoreRolesColumns{
Id: "id",
StoreId: "store_id",
Name: "name",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
DeletedAt: "deleted_at",
}
// NewStoreRolesDao creates and returns a new DAO object for table data access.
func NewStoreRolesDao(handlers ...gdb.ModelHandler) *StoreRolesDao {
return &StoreRolesDao{
group: "default",
table: "store_roles",
columns: storeRolesColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *StoreRolesDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *StoreRolesDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *StoreRolesDao) Columns() StoreRolesColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *StoreRolesDao) 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 *StoreRolesDao) 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 *StoreRolesDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}

View File

@ -16,6 +16,7 @@ type StoresDao struct {
table string // table is the underlying table name of the DAO. table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current 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. 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. // StoresColumns defines and stores column names for the table stores.
@ -49,11 +50,12 @@ var storesColumns = StoresColumns{
} }
// NewStoresDao creates and returns a new DAO object for table data access. // NewStoresDao creates and returns a new DAO object for table data access.
func NewStoresDao() *StoresDao { func NewStoresDao(handlers ...gdb.ModelHandler) *StoresDao {
return &StoresDao{ return &StoresDao{
group: "default", group: "default",
table: "stores", table: "stores",
columns: storesColumns, columns: storesColumns,
handlers: handlers,
} }
} }
@ -79,7 +81,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. // 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 { 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. // Transaction wraps the transaction logic using function f.

View File

@ -16,6 +16,7 @@ type TasksDao struct {
table string // table is the underlying table name of the DAO. table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current 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. 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. // TasksColumns defines and stores column names for the table tasks.
@ -37,11 +38,12 @@ var tasksColumns = TasksColumns{
} }
// NewTasksDao creates and returns a new DAO object for table data access. // NewTasksDao creates and returns a new DAO object for table data access.
func NewTasksDao() *TasksDao { func NewTasksDao(handlers ...gdb.ModelHandler) *TasksDao {
return &TasksDao{ return &TasksDao{
group: "default", group: "default",
table: "tasks", table: "tasks",
columns: tasksColumns, columns: tasksColumns,
handlers: handlers,
} }
} }
@ -67,7 +69,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. // 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 { 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. // Transaction wraps the transaction logic using function f.

View File

@ -16,6 +16,7 @@ type UserTasksDao struct {
table string // table is the underlying table name of the DAO. table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current 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. 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. // UserTasksColumns defines and stores column names for the table user_tasks.
@ -47,11 +48,12 @@ var userTasksColumns = UserTasksColumns{
} }
// NewUserTasksDao creates and returns a new DAO object for table data access. // NewUserTasksDao creates and returns a new DAO object for table data access.
func NewUserTasksDao() *UserTasksDao { func NewUserTasksDao(handlers ...gdb.ModelHandler) *UserTasksDao {
return &UserTasksDao{ return &UserTasksDao{
group: "default", group: "default",
table: "user_tasks", table: "user_tasks",
columns: userTasksColumns, columns: userTasksColumns,
handlers: handlers,
} }
} }
@ -77,7 +79,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. // 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 { 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. // Transaction wraps the transaction logic using function f.

View File

@ -16,6 +16,7 @@ type UsersDao struct {
table string // table is the underlying table name of the DAO. table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current 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. 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. // UsersColumns defines and stores column names for the table users.
@ -61,11 +62,12 @@ var usersColumns = UsersColumns{
} }
// NewUsersDao creates and returns a new DAO object for table data access. // NewUsersDao creates and returns a new DAO object for table data access.
func NewUsersDao() *UsersDao { func NewUsersDao(handlers ...gdb.ModelHandler) *UsersDao {
return &UsersDao{ return &UsersDao{
group: "default", group: "default",
table: "users", table: "users",
columns: usersColumns, columns: usersColumns,
handlers: handlers,
} }
} }
@ -91,7 +93,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. // 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 { 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. // Transaction wraps the transaction logic using function f.

View 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"
)
// storeDesktopSettingsDao is the data access object for the table store_desktop_settings.
// You can define custom methods on it to extend its functionality as needed.
type storeDesktopSettingsDao struct {
*internal.StoreDesktopSettingsDao
}
var (
// StoreDesktopSettings is a globally accessible object for table store_desktop_settings operations.
StoreDesktopSettings = storeDesktopSettingsDao{internal.NewStoreDesktopSettingsDao()}
)
// Add your custom methods and functionality below.

View 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"
)
// storeRolesDao is the data access object for the table store_roles.
// You can define custom methods on it to extend its functionality as needed.
type storeRolesDao struct {
*internal.StoreRolesDao
}
var (
// StoreRoles is a globally accessible object for table store_roles operations.
StoreRoles = storeRolesDao{internal.NewStoreRolesDao()}
)
// Add your custom methods and functionality below.

View File

@ -45,7 +45,7 @@ func (s *sReward) CreateSystemReward(ctx context.Context, in *model.RewardCreate
RewardTypeId: in.RewardTypeID, RewardTypeId: in.RewardTypeID,
RewardScope: consts.SystemReward, // 系统奖励 RewardScope: consts.SystemReward, // 系统奖励
Name: in.Name, Name: in.Name,
Code: "xmax", Code: "xmaxa",
Description: in.Description, Description: in.Description,
Status: in.Status, Status: in.Status,
Stock: in.Stock, Stock: in.Stock,

View File

@ -2,6 +2,8 @@ package rewardType
import ( import (
"context" "context"
"fmt"
"server/internal/consts"
"server/internal/dao" "server/internal/dao"
"server/internal/model" "server/internal/model"
"server/internal/model/do" "server/internal/model/do"
@ -20,6 +22,7 @@ func init() {
service.RegisterRewardType(New()) service.RegisterRewardType(New())
} }
func (s *sRewardType) List(ctx context.Context, in *model.RewardTypeIn) (out *model.RewardTypeOut, err error) { func (s *sRewardType) List(ctx context.Context, in *model.RewardTypeIn) (out *model.RewardTypeOut, err error) {
m := dao.RewardTypes.Ctx(ctx) m := dao.RewardTypes.Ctx(ctx)
// 默认分页 // 默认分页
@ -30,9 +33,14 @@ func (s *sRewardType) List(ctx context.Context, in *model.RewardTypeIn) (out *mo
in.Size = 10 in.Size = 10
} }
// 判断角色
if in.RoleName == consts.StoreRoleCode {
m = m.Where(do.RewardTypes{StoreId: in.OperatorId})
}
list := make([]model.RewardType, 0) list := make([]model.RewardType, 0)
var total int var total int
err = m.Page(in.Page, in.Size).OrderDesc(dao.RewardTypes.Columns().CreatedAt).ScanAndCount(&list, &total, false) err = m.Fields(fmt.Sprintf("%s.*, %s.%s %s", dao.RewardTypes.Table(), dao.Stores.Table(), dao.Stores.Columns().Name, "store_name")).LeftJoin(dao.Stores.Table(), fmt.Sprintf("`%s`.`id` = `%s`.`store_id`", dao.Stores.Table(), dao.RewardTypes.Table())).Page(in.Page, in.Size).OrderDesc(dao.RewardTypes.Columns().CreatedAt).ScanAndCount(&list, &total, false)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -45,17 +53,17 @@ func (s *sRewardType) List(ctx context.Context, in *model.RewardTypeIn) (out *mo
func (s *sRewardType) CreateRewardType(ctx context.Context, in *model.CreateRewardTypeIn) (out *model.CreateRewardTypeOut, err error) { func (s *sRewardType) CreateRewardType(ctx context.Context, in *model.CreateRewardTypeIn) (out *model.CreateRewardTypeOut, err error) {
// 检查类型名称是否存在 // 检查类型名称是否存在
exist, err := dao.RewardTypes.Ctx(ctx).Where(do.RewardTypes{Name: in.Name}).Exist() exist, err := dao.RewardTypes.Ctx(ctx).Where(do.RewardTypes{Name: in.Name, StoreId: in.StoreId}).Exist()
if err != nil { if err != nil {
return nil, err return nil, ecode.Fail.Sub("查询该奖励类型失败")
} }
if exist { if exist {
return nil, ecode.Params.Sub("类型名称已存在") return nil, ecode.Params.Sub("类型名称已存在")
} }
exist, err = dao.RewardTypes.Ctx(ctx).Where(do.RewardTypes{Code: in.Code}).Exist() exist, err = dao.RewardTypes.Ctx(ctx).Where(do.RewardTypes{Code: in.Code, StoreId: in.StoreId}).Exist()
if err != nil { if err != nil {
return nil, err return nil, ecode.Fail.Sub("查询该奖励类型失败")
} }
if exist { if exist {
return nil, ecode.Params.Sub("类型代号已存在") return nil, ecode.Params.Sub("类型代号已存在")
@ -65,6 +73,7 @@ func (s *sRewardType) CreateRewardType(ctx context.Context, in *model.CreateRewa
Name: in.Name, Name: in.Name,
Code: in.Code, Code: in.Code,
Description: in.Description, Description: in.Description,
StoreId: in.StoreId,
}) })
if err != nil { if err != nil {
return nil, err return nil, err
@ -75,17 +84,17 @@ func (s *sRewardType) CreateRewardType(ctx context.Context, in *model.CreateRewa
func (s *sRewardType) UpdateRewardType(ctx context.Context, in *model.UpdateRewardTypeIn) (out *model.UpdateRewardTypeOut, err error) { func (s *sRewardType) UpdateRewardType(ctx context.Context, in *model.UpdateRewardTypeIn) (out *model.UpdateRewardTypeOut, err error) {
// 检查更新的是否存在 // 检查更新的是否存在
exist, err := dao.RewardTypes.Ctx(ctx).WherePri(in.Id).Exist() exist, err := dao.RewardTypes.Ctx(ctx).WherePri(in.Id).Where(do.RewardTypes{StoreId: in.StoreId}).Exist()
if err != nil { if err != nil {
return nil, ecode.Params.Sub("查询奖励失败") return nil, ecode.Fail.Sub("查询奖励类型失败")
} }
if !exist { if !exist {
return nil, ecode.Params.Sub("更新的奖励不存在") return nil, ecode.Params.Sub("更新的奖励类型不存在")
} }
exist, err = dao.RewardTypes.Ctx(ctx).Where(do.RewardTypes{Name: in.Name}).Exist() exist, err = dao.RewardTypes.Ctx(ctx).Where(do.RewardTypes{Name: in.Name, StoreId: in.StoreId}).Exist()
if err != nil { if err != nil {
return nil, ecode.Params.Sub("查询奖励类型失败") return nil, ecode.Fail.Sub("查询奖励类型失败")
} }
if exist { if exist {
return nil, ecode.Params.Sub("奖励类型名称已存在") return nil, ecode.Params.Sub("奖励类型名称已存在")

View File

@ -20,4 +20,5 @@ type RewardTypes struct {
CreatedAt *gtime.Time // 创建时间 CreatedAt *gtime.Time // 创建时间
UpdatedAt *gtime.Time // 更新时间 UpdatedAt *gtime.Time // 更新时间
DeletedAt *gtime.Time // 软删除时间 DeletedAt *gtime.Time // 软删除时间
StoreId interface{} // 门店 id
} }

View File

@ -21,4 +21,5 @@ type Roles struct {
UpdatedAt *gtime.Time // 更新时间 UpdatedAt *gtime.Time // 更新时间
DeletedAt *gtime.Time // 软删除时间戳 DeletedAt *gtime.Time // 软删除时间戳
IsDeletable interface{} // 是否可删除0=不可删除1=可删除 IsDeletable interface{} // 是否可删除0=不可删除1=可删除
StoreId interface{} // 门店ID
} }

View File

@ -26,4 +26,5 @@ type StoreAdmins struct {
UpdatedAt *gtime.Time // 更新时间 UpdatedAt *gtime.Time // 更新时间
DeletedAt *gtime.Time // 软删除时间戳 DeletedAt *gtime.Time // 软删除时间戳
RoleId interface{} // 角色ID RoleId interface{} // 角色ID
StoreRoleId interface{} // 门店角色ID
} }

View File

@ -0,0 +1,24 @@
// =================================================================================
// 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"
)
// StoreDesktopSettings is the golang structure of table store_desktop_settings for DAO operations like Where/Data.
type StoreDesktopSettings struct {
g.Meta `orm:"table:store_desktop_settings, do:true"`
Id interface{} // 主键ID
StoreId interface{} // 门店ID
BackgroundUrl interface{} // 桌面背景图片URL
Resolution interface{} // 分辨率例如1920x1080
IsTopWidgetVisible interface{} // 顶部组件是否显示FALSE=隐藏TRUE=显示
IsRightWidgetVisible interface{} // 右侧组件是否显示FALSE=隐藏TRUE=显示
CreatedAt *gtime.Time // 创建时间
UpdatedAt *gtime.Time // 更新时间
DeletedAt *gtime.Time // 软删除时间戳
}

View File

@ -0,0 +1,21 @@
// =================================================================================
// 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"
)
// StoreRoles is the golang structure of table store_roles for DAO operations like Where/Data.
type StoreRoles struct {
g.Meta `orm:"table:store_roles, do:true"`
Id interface{} // 门店角色ID
StoreId interface{} // 所属门店ID
Name interface{} // 门店角色名称
CreatedAt *gtime.Time // 创建时间
UpdatedAt *gtime.Time // 更新时间
DeletedAt *gtime.Time // 软删除时间戳
}

View File

@ -18,4 +18,5 @@ type RewardTypes struct {
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"` // 创建时间 CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"` // 创建时间
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"` // 更新时间 UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"` // 更新时间
DeletedAt *gtime.Time `json:"deletedAt" orm:"deleted_at" description:"软删除时间"` // 软删除时间 DeletedAt *gtime.Time `json:"deletedAt" orm:"deleted_at" description:"软删除时间"` // 软删除时间
StoreId int64 `json:"storeId" orm:"store_id" description:"门店 id"` // 门店 id
} }

View File

@ -19,4 +19,5 @@ type Roles struct {
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"` // 更新时间 UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"` // 更新时间
DeletedAt *gtime.Time `json:"deletedAt" orm:"deleted_at" description:"软删除时间戳"` // 软删除时间戳 DeletedAt *gtime.Time `json:"deletedAt" orm:"deleted_at" description:"软删除时间戳"` // 软删除时间戳
IsDeletable bool `json:"isDeletable" orm:"is_deletable" description:"是否可删除0=不可删除1=可删除"` // 是否可删除0=不可删除1=可删除 IsDeletable bool `json:"isDeletable" orm:"is_deletable" description:"是否可删除0=不可删除1=可删除"` // 是否可删除0=不可删除1=可删除
StoreId int64 `json:"storeId" orm:"store_id" description:"门店ID"` // 门店ID
} }

View File

@ -24,4 +24,5 @@ type StoreAdmins struct {
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"` // 更新时间 UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"` // 更新时间
DeletedAt *gtime.Time `json:"deletedAt" orm:"deleted_at" description:"软删除时间戳"` // 软删除时间戳 DeletedAt *gtime.Time `json:"deletedAt" orm:"deleted_at" description:"软删除时间戳"` // 软删除时间戳
RoleId int64 `json:"roleId" orm:"role_id" description:"角色ID"` // 角色ID RoleId int64 `json:"roleId" orm:"role_id" description:"角色ID"` // 角色ID
StoreRoleId int64 `json:"storeRoleId" orm:"store_role_id" description:"门店角色ID"` // 门店角色ID
} }

View File

@ -0,0 +1,22 @@
// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package entity
import (
"github.com/gogf/gf/v2/os/gtime"
)
// StoreDesktopSettings is the golang structure for table store_desktop_settings.
type StoreDesktopSettings struct {
Id int64 `json:"id" orm:"id" description:"主键ID"` // 主键ID
StoreId int64 `json:"storeId" orm:"store_id" description:"门店ID"` // 门店ID
BackgroundUrl string `json:"backgroundUrl" orm:"background_url" description:"桌面背景图片URL"` // 桌面背景图片URL
Resolution string `json:"resolution" orm:"resolution" description:"分辨率例如1920x1080"` // 分辨率例如1920x1080
IsTopWidgetVisible int `json:"isTopWidgetVisible" orm:"is_top_widget_visible" description:"顶部组件是否显示FALSE=隐藏TRUE=显示"` // 顶部组件是否显示FALSE=隐藏TRUE=显示
IsRightWidgetVisible int `json:"isRightWidgetVisible" orm:"is_right_widget_visible" description:"右侧组件是否显示FALSE=隐藏TRUE=显示"` // 右侧组件是否显示FALSE=隐藏TRUE=显示
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

@ -0,0 +1,19 @@
// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package entity
import (
"github.com/gogf/gf/v2/os/gtime"
)
// StoreRoles is the golang structure for table store_roles.
type StoreRoles struct {
Id int64 `json:"id" orm:"id" description:"门店角色ID"` // 门店角色ID
StoreId int64 `json:"storeId" orm:"store_id" description:"所属门店ID"` // 所属门店ID
Name string `json:"name" orm:"name" description:"门店角色名称"` // 门店角色名称
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

@ -15,10 +15,14 @@ type RewardType struct {
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"` CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"`
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"` UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"`
DeletedAt *gtime.Time `json:"deletedAt" orm:"deleted_at" description:"删除时间"` DeletedAt *gtime.Time `json:"deletedAt" orm:"deleted_at" description:"删除时间"`
//StoreId int `json:"storeId" dc:"门店ID" orm:"store_id"`
StoreName string `json:"storeName" dc:"门店名称" orm:"store_name"`
} }
type RewardTypeIn struct { type RewardTypeIn struct {
Page int Page int
Size int Size int
RoleName string
OperatorId int
} }
type RewardTypeOut struct { type RewardTypeOut struct {
@ -31,6 +35,7 @@ type CreateRewardTypeIn struct {
Code string Code string
Description string Description string
Status int Status int
StoreId int
} }
type CreateRewardTypeOut struct { type CreateRewardTypeOut struct {
@ -44,6 +49,7 @@ type UpdateRewardTypeIn struct {
Code string Code string
Description string Description string
Status int Status int
StoreId int
} }
// UpdateRewardTypeOut 更新奖励类型返回参数 // UpdateRewardTypeOut 更新奖励类型返回参数