调整微信扫码登录相关接口,拆分门店奖励:奖励类型、奖励详情
This commit is contained in:
@ -26,10 +26,7 @@ type AdminsColumns struct {
|
||||
RealName string // 真实姓名
|
||||
Phone string // 手机号
|
||||
Email string // 邮箱
|
||||
Role string // 角色:1=超级管理员,2=运营管理员,3=客服管理员,4=财务管理员
|
||||
Status string // 状态:1=正常,2=禁用
|
||||
LastLoginAt string // 最后登录时间
|
||||
LastLoginIp string // 最后登录IP
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间戳
|
||||
@ -43,10 +40,7 @@ var adminsColumns = AdminsColumns{
|
||||
RealName: "real_name",
|
||||
Phone: "phone",
|
||||
Email: "email",
|
||||
Role: "role",
|
||||
Status: "status",
|
||||
LastLoginAt: "last_login_at",
|
||||
LastLoginIp: "last_login_ip",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
|
||||
87
internal/dao/internal/reward_types.go
Normal file
87
internal/dao/internal/reward_types.go
Normal file
@ -0,0 +1,87 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// RewardTypesDao is the data access object for the table reward_types.
|
||||
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.
|
||||
}
|
||||
|
||||
// RewardTypesColumns defines and stores column names for the table reward_types.
|
||||
type RewardTypesColumns struct {
|
||||
Id string // 类型ID
|
||||
Name string // 类型名称
|
||||
Code string // 类型编码
|
||||
Description string // 类型描述
|
||||
Status string // 状态:1=启用,2=禁用
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间
|
||||
}
|
||||
|
||||
// rewardTypesColumns holds the columns for the table reward_types.
|
||||
var rewardTypesColumns = RewardTypesColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
Code: "code",
|
||||
Description: "description",
|
||||
Status: "status",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewRewardTypesDao creates and returns a new DAO object for table data access.
|
||||
func NewRewardTypesDao() *RewardTypesDao {
|
||||
return &RewardTypesDao{
|
||||
group: "default",
|
||||
table: "reward_types",
|
||||
columns: rewardTypesColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *RewardTypesDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *RewardTypesDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *RewardTypesDao) Columns() RewardTypesColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *RewardTypesDao) 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 *RewardTypesDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).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 *RewardTypesDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@ -20,30 +20,30 @@ type StoreRewardsDao struct {
|
||||
|
||||
// StoreRewardsColumns defines and stores column names for the table store_rewards.
|
||||
type StoreRewardsColumns struct {
|
||||
Id string // 门店奖励ID
|
||||
StoreId string // 所属门店ID
|
||||
RewardType string // 奖励类型:1=积分,2=优惠券,3=商品,4=抽奖券
|
||||
RewardName string // 奖励名称
|
||||
Amount string // 奖励数量
|
||||
Total string // 该奖励总库存(NULL 表示无限)
|
||||
MerchantId string // 所属商户ID
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间戳
|
||||
Id string // 门店奖励ID
|
||||
StoreId string // 所属门店ID
|
||||
RewardTypeId string // 奖励类型ID
|
||||
RewardName string // 奖励名称
|
||||
Amount string // 奖励数量
|
||||
Total string // 该奖励总库存(NULL 表示无限)
|
||||
MerchantId string // 所属商户ID
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
DeletedAt string // 软删除时间戳
|
||||
}
|
||||
|
||||
// storeRewardsColumns holds the columns for the table store_rewards.
|
||||
var storeRewardsColumns = StoreRewardsColumns{
|
||||
Id: "id",
|
||||
StoreId: "store_id",
|
||||
RewardType: "reward_type",
|
||||
RewardName: "reward_name",
|
||||
Amount: "amount",
|
||||
Total: "total",
|
||||
MerchantId: "merchant_id",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
Id: "id",
|
||||
StoreId: "store_id",
|
||||
RewardTypeId: "reward_type_id",
|
||||
RewardName: "reward_name",
|
||||
Amount: "amount",
|
||||
Total: "total",
|
||||
MerchantId: "merchant_id",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
DeletedAt: "deleted_at",
|
||||
}
|
||||
|
||||
// NewStoreRewardsDao creates and returns a new DAO object for table data access.
|
||||
|
||||
@ -23,10 +23,8 @@ type UserLoginRecordsColumns struct {
|
||||
Id string // 记录ID
|
||||
UserId string // 用户ID
|
||||
StoreId string // 登录门店ID
|
||||
MerchantId string // 所属商户ID
|
||||
LoginIp string // 登录IP地址
|
||||
LoginDevice string // 登录设备信息
|
||||
LoginPlatform string // 登录平台:1=Web,2=iOS,3=Android,4=微信小程序,5=支付宝小程序,6=其他
|
||||
LoginPlatform string // 登录平台:1=PC
|
||||
LoginType string // 登录方式:1=微信,2=手机号,3=账号密码,4=其他
|
||||
LoginStatus string // 登录状态:1=成功,2=失败
|
||||
FailReason string // 失败原因
|
||||
@ -40,9 +38,7 @@ var userLoginRecordsColumns = UserLoginRecordsColumns{
|
||||
Id: "id",
|
||||
UserId: "user_id",
|
||||
StoreId: "store_id",
|
||||
MerchantId: "merchant_id",
|
||||
LoginIp: "login_ip",
|
||||
LoginDevice: "login_device",
|
||||
LoginPlatform: "login_platform",
|
||||
LoginType: "login_type",
|
||||
LoginStatus: "login_status",
|
||||
|
||||
27
internal/dao/reward_types.go
Normal file
27
internal/dao/reward_types.go
Normal file
@ -0,0 +1,27 @@
|
||||
// =================================================================================
|
||||
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
|
||||
// =================================================================================
|
||||
|
||||
package dao
|
||||
|
||||
import (
|
||||
"server/internal/dao/internal"
|
||||
)
|
||||
|
||||
// internalRewardTypesDao is an internal type for wrapping the internal DAO implementation.
|
||||
type internalRewardTypesDao = *internal.RewardTypesDao
|
||||
|
||||
// rewardTypesDao is the data access object for the table reward_types.
|
||||
// You can define custom methods on it to extend its functionality as needed.
|
||||
type rewardTypesDao struct {
|
||||
internalRewardTypesDao
|
||||
}
|
||||
|
||||
var (
|
||||
// RewardTypes is a globally accessible object for table reward_types operations.
|
||||
RewardTypes = rewardTypesDao{
|
||||
internal.NewRewardTypesDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Add your custom methods and functionality below.
|
||||
Reference in New Issue
Block a user