调整微信扫码登录相关接口,拆分门店奖励:奖励类型、奖励详情

This commit is contained in:
2025-06-03 11:06:00 +08:00
parent ea87bc829e
commit fdc9cc3463
37 changed files with 698 additions and 189 deletions

View File

@ -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",

View 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)
}

View File

@ -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.

View File

@ -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=Web2=iOS3=Android4=微信小程序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",

View 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.