mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-11 03:33:53 +08:00
This commit is contained in:
27
server/internal/dao/admin_cash.go
Normal file
27
server/internal/dao/admin_cash.go
Normal file
@@ -0,0 +1,27 @@
|
||||
// =================================================================================
|
||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
||||
// =================================================================================
|
||||
|
||||
package dao
|
||||
|
||||
import (
|
||||
"hotgo/internal/dao/internal"
|
||||
)
|
||||
|
||||
// internalAdminCashDao is internal type for wrapping internal DAO implements.
|
||||
type internalAdminCashDao = *internal.AdminCashDao
|
||||
|
||||
// adminCashDao is the data access object for table hg_admin_cash.
|
||||
// You can define custom methods on it to extend its functionality as you wish.
|
||||
type adminCashDao struct {
|
||||
internalAdminCashDao
|
||||
}
|
||||
|
||||
var (
|
||||
// AdminCash is globally public accessible object for table hg_admin_cash operations.
|
||||
AdminCash = adminCashDao{
|
||||
internal.NewAdminCashDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Fill with you ideas below.
|
||||
27
server/internal/dao/admin_credits_log.go
Normal file
27
server/internal/dao/admin_credits_log.go
Normal file
@@ -0,0 +1,27 @@
|
||||
// =================================================================================
|
||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
||||
// =================================================================================
|
||||
|
||||
package dao
|
||||
|
||||
import (
|
||||
"hotgo/internal/dao/internal"
|
||||
)
|
||||
|
||||
// internalAdminCreditsLogDao is internal type for wrapping internal DAO implements.
|
||||
type internalAdminCreditsLogDao = *internal.AdminCreditsLogDao
|
||||
|
||||
// adminCreditsLogDao is the data access object for table hg_admin_credits_log.
|
||||
// You can define custom methods on it to extend its functionality as you wish.
|
||||
type adminCreditsLogDao struct {
|
||||
internalAdminCreditsLogDao
|
||||
}
|
||||
|
||||
var (
|
||||
// AdminCreditsLog is globally public accessible object for table hg_admin_credits_log operations.
|
||||
AdminCreditsLog = adminCreditsLogDao{
|
||||
internal.NewAdminCreditsLogDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Fill with you ideas below.
|
||||
@@ -48,18 +48,3 @@ func (dao *adminDeptDao) IsUniqueName(ctx context.Context, id int64, name string
|
||||
|
||||
return false, nil
|
||||
}
|
||||
|
||||
// TopPid 获取最上级pid
|
||||
func (dao *adminDeptDao) TopPid(ctx context.Context, data *entity.AdminDept) (int64, error) {
|
||||
var pidData *entity.AdminDept
|
||||
if data.Pid == 0 {
|
||||
return data.Id, nil
|
||||
}
|
||||
err := dao.Ctx(ctx).Where("id", data.Pid).Scan(&pidData)
|
||||
if err != nil {
|
||||
err = gerror.Wrap(err, consts.ErrorORM)
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return dao.TopPid(ctx, pidData)
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/dao/internal"
|
||||
"hotgo/internal/model/entity"
|
||||
)
|
||||
@@ -54,22 +53,3 @@ func (dao *adminMemberPostDao) UpdatePostIds(ctx context.Context, memberId int64
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetMemberByIds 获取指定关联员的岗位ids
|
||||
func (dao *adminMemberPostDao) GetMemberByIds(ctx context.Context, memberId int64) (postIds []int64, err error) {
|
||||
var list []*entity.AdminMemberPost
|
||||
err = dao.Ctx(ctx).
|
||||
Fields("post_id").
|
||||
Where("member_id", memberId).
|
||||
Scan(&list)
|
||||
if err != nil {
|
||||
err = gerror.Wrap(err, consts.ErrorORM)
|
||||
return postIds, err
|
||||
}
|
||||
|
||||
for i := 0; i < len(list); i++ {
|
||||
postIds = append(postIds, list[i].PostId)
|
||||
}
|
||||
|
||||
return postIds, nil
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ import (
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/dao/internal"
|
||||
"hotgo/internal/model"
|
||||
"hotgo/internal/model/entity"
|
||||
)
|
||||
|
||||
@@ -70,68 +69,3 @@ func (dao *adminMenuDao) IsUniqueName(ctx context.Context, id int64, name string
|
||||
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func (dao *adminMenuDao) GenLabelTreeList(ctx context.Context, pid int64) ([]*model.LabelTreeMenu, error) {
|
||||
|
||||
var (
|
||||
newLst []*model.LabelTreeMenu
|
||||
)
|
||||
if err := dao.Ctx(ctx).Where("pid", pid).Order("sort asc,id desc").Scan(&newLst); err != nil {
|
||||
err = gerror.Wrap(err, consts.ErrorORM)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for i := 0; i < len(newLst); i++ {
|
||||
newLst[i].Key = newLst[i].Id
|
||||
newLst[i].Label = newLst[i].Name
|
||||
err := dao.Ctx(ctx).Where("pid", newLst[i].Id).Order("sort asc,id desc").Scan(&newLst[i].Children)
|
||||
if err != nil {
|
||||
err = gerror.Wrap(err, consts.ErrorORM)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for i2 := 0; i2 < len(newLst[i].Children); i2++ {
|
||||
newLst[i].Children[i2].Key = newLst[i].Children[i2].Id
|
||||
newLst[i].Children[i2].Label = newLst[i].Children[i2].Name
|
||||
}
|
||||
}
|
||||
|
||||
return newLst, nil
|
||||
}
|
||||
|
||||
// GenTreeList 生成树列表
|
||||
func (dao *adminMenuDao) GenTreeList(ctx context.Context, pid int64, ids []int64) ([]*model.TreeMenu, error) {
|
||||
|
||||
var (
|
||||
newLst []*model.TreeMenu
|
||||
)
|
||||
if err := dao.Ctx(ctx).Where("id", ids).Where("pid", pid).Order("sort asc,id desc").Scan(&newLst); err != nil {
|
||||
err = gerror.Wrap(err, consts.ErrorORM)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for i := 0; i < len(newLst); i++ {
|
||||
err := dao.Ctx(ctx).Where("pid", newLst[i].Id).Order("sort asc,id desc").Scan(&newLst[i].Children)
|
||||
if err != nil {
|
||||
err = gerror.Wrap(err, consts.ErrorORM)
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
return newLst, nil
|
||||
}
|
||||
|
||||
// TopPid 获取最上级pid
|
||||
func (dao *adminMenuDao) TopPid(ctx context.Context, data *entity.AdminMenu) (int64, error) {
|
||||
var pidData *entity.AdminMenu
|
||||
if data.Pid == 0 {
|
||||
return data.Id, nil
|
||||
}
|
||||
err := dao.Ctx(ctx).Where("id", data.Pid).Scan(&pidData)
|
||||
if err != nil {
|
||||
err = gerror.Wrap(err, consts.ErrorORM)
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return dao.TopPid(ctx, pidData)
|
||||
}
|
||||
|
||||
27
server/internal/dao/admin_oauth.go
Normal file
27
server/internal/dao/admin_oauth.go
Normal file
@@ -0,0 +1,27 @@
|
||||
// =================================================================================
|
||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
||||
// =================================================================================
|
||||
|
||||
package dao
|
||||
|
||||
import (
|
||||
"hotgo/internal/dao/internal"
|
||||
)
|
||||
|
||||
// internalAdminOauthDao is internal type for wrapping internal DAO implements.
|
||||
type internalAdminOauthDao = *internal.AdminOauthDao
|
||||
|
||||
// adminOauthDao is the data access object for table hg_admin_oauth.
|
||||
// You can define custom methods on it to extend its functionality as you wish.
|
||||
type adminOauthDao struct {
|
||||
internalAdminOauthDao
|
||||
}
|
||||
|
||||
var (
|
||||
// AdminOauth is globally public accessible object for table hg_admin_oauth operations.
|
||||
AdminOauth = adminOauthDao{
|
||||
internal.NewAdminOauthDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Fill with you ideas below.
|
||||
27
server/internal/dao/admin_order.go
Normal file
27
server/internal/dao/admin_order.go
Normal file
@@ -0,0 +1,27 @@
|
||||
// =================================================================================
|
||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
||||
// =================================================================================
|
||||
|
||||
package dao
|
||||
|
||||
import (
|
||||
"hotgo/internal/dao/internal"
|
||||
)
|
||||
|
||||
// internalAdminOrderDao is internal type for wrapping internal DAO implements.
|
||||
type internalAdminOrderDao = *internal.AdminOrderDao
|
||||
|
||||
// adminOrderDao is the data access object for table hg_admin_order.
|
||||
// You can define custom methods on it to extend its functionality as you wish.
|
||||
type adminOrderDao struct {
|
||||
internalAdminOrderDao
|
||||
}
|
||||
|
||||
var (
|
||||
// AdminOrder is globally public accessible object for table hg_admin_order operations.
|
||||
AdminOrder = adminOrderDao{
|
||||
internal.NewAdminOrderDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Fill with you ideas below.
|
||||
91
server/internal/dao/internal/admin_cash.go
Normal file
91
server/internal/dao/internal/admin_cash.go
Normal file
@@ -0,0 +1,91 @@
|
||||
// ==========================================================================
|
||||
// Code generated 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"
|
||||
)
|
||||
|
||||
// AdminCashDao is the data access object for table hg_admin_cash.
|
||||
type AdminCashDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns AdminCashColumns // columns contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// AdminCashColumns defines and stores column names for table hg_admin_cash.
|
||||
type AdminCashColumns struct {
|
||||
Id string // ID
|
||||
MemberId string // 管理员ID
|
||||
Money string // 提现金额
|
||||
Fee string // 手续费
|
||||
LastMoney string // 最终到账金额
|
||||
Ip string // 申请人IP
|
||||
Status string // 状态码
|
||||
Msg string // 处理结果
|
||||
HandleAt string // 处理时间
|
||||
CreatedAt string // 申请时间
|
||||
}
|
||||
|
||||
// adminCashColumns holds the columns for table hg_admin_cash.
|
||||
var adminCashColumns = AdminCashColumns{
|
||||
Id: "id",
|
||||
MemberId: "member_id",
|
||||
Money: "money",
|
||||
Fee: "fee",
|
||||
LastMoney: "last_money",
|
||||
Ip: "ip",
|
||||
Status: "status",
|
||||
Msg: "msg",
|
||||
HandleAt: "handle_at",
|
||||
CreatedAt: "created_at",
|
||||
}
|
||||
|
||||
// NewAdminCashDao creates and returns a new DAO object for table data access.
|
||||
func NewAdminCashDao() *AdminCashDao {
|
||||
return &AdminCashDao{
|
||||
group: "default",
|
||||
table: "hg_admin_cash",
|
||||
columns: adminCashColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
func (dao *AdminCashDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
func (dao *AdminCashDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
func (dao *AdminCashDao) Columns() AdminCashColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
func (dao *AdminCashDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
func (dao *AdminCashDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *AdminCashDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
101
server/internal/dao/internal/admin_credits_log.go
Normal file
101
server/internal/dao/internal/admin_credits_log.go
Normal file
@@ -0,0 +1,101 @@
|
||||
// ==========================================================================
|
||||
// Code generated 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"
|
||||
)
|
||||
|
||||
// AdminCreditsLogDao is the data access object for table hg_admin_credits_log.
|
||||
type AdminCreditsLogDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns AdminCreditsLogColumns // columns contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// AdminCreditsLogColumns defines and stores column names for table hg_admin_credits_log.
|
||||
type AdminCreditsLogColumns struct {
|
||||
Id string // 变动ID
|
||||
MemberId string // 管理员ID
|
||||
AppId string // 应用id
|
||||
AddonsName string // 插件名称
|
||||
CreditType string // 变动类型
|
||||
CreditGroup string // 变动组别
|
||||
BeforeNum string // 变动前
|
||||
Num string // 变动数据
|
||||
AfterNum string // 变动后
|
||||
Remark string // 备注
|
||||
Ip string // 操作人IP
|
||||
MapId string // 关联ID
|
||||
Status string // 状态
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 修改时间
|
||||
}
|
||||
|
||||
// adminCreditsLogColumns holds the columns for table hg_admin_credits_log.
|
||||
var adminCreditsLogColumns = AdminCreditsLogColumns{
|
||||
Id: "id",
|
||||
MemberId: "member_id",
|
||||
AppId: "app_id",
|
||||
AddonsName: "addons_name",
|
||||
CreditType: "credit_type",
|
||||
CreditGroup: "credit_group",
|
||||
BeforeNum: "before_num",
|
||||
Num: "num",
|
||||
AfterNum: "after_num",
|
||||
Remark: "remark",
|
||||
Ip: "ip",
|
||||
MapId: "map_id",
|
||||
Status: "status",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
}
|
||||
|
||||
// NewAdminCreditsLogDao creates and returns a new DAO object for table data access.
|
||||
func NewAdminCreditsLogDao() *AdminCreditsLogDao {
|
||||
return &AdminCreditsLogDao{
|
||||
group: "default",
|
||||
table: "hg_admin_credits_log",
|
||||
columns: adminCreditsLogColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
func (dao *AdminCreditsLogDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
func (dao *AdminCreditsLogDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
func (dao *AdminCreditsLogDao) Columns() AdminCreditsLogColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
func (dao *AdminCreditsLogDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
func (dao *AdminCreditsLogDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *AdminCreditsLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -29,6 +29,7 @@ type AdminMemberColumns struct {
|
||||
Salt string // 密码盐
|
||||
AuthKey string // 授权令牌
|
||||
PasswordResetToken string // 密码重置令牌
|
||||
Integral string // 积分
|
||||
Balance string // 余额
|
||||
Avatar string // 头像
|
||||
Sex string // 性别
|
||||
@@ -60,6 +61,7 @@ var adminMemberColumns = AdminMemberColumns{
|
||||
Salt: "salt",
|
||||
AuthKey: "auth_key",
|
||||
PasswordResetToken: "password_reset_token",
|
||||
Integral: "integral",
|
||||
Balance: "balance",
|
||||
Avatar: "avatar",
|
||||
Sex: "sex",
|
||||
|
||||
101
server/internal/dao/internal/admin_oauth.go
Normal file
101
server/internal/dao/internal/admin_oauth.go
Normal file
@@ -0,0 +1,101 @@
|
||||
// ==========================================================================
|
||||
// Code generated 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"
|
||||
)
|
||||
|
||||
// AdminOauthDao is the data access object for table hg_admin_oauth.
|
||||
type AdminOauthDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns AdminOauthColumns // columns contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// AdminOauthColumns defines and stores column names for table hg_admin_oauth.
|
||||
type AdminOauthColumns struct {
|
||||
Id string // 主键
|
||||
MemberId string // 用户ID
|
||||
Unionid string // 唯一ID
|
||||
OauthClient string // 授权组别
|
||||
OauthOpenid string // 授权开放ID
|
||||
Sex string // 性别
|
||||
Nickname string // 昵称
|
||||
HeadPortrait string // 头像
|
||||
Birthday string // 生日
|
||||
Country string // 国家
|
||||
Province string // 省
|
||||
City string // 市
|
||||
Status string // 状态
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 修改时间
|
||||
}
|
||||
|
||||
// adminOauthColumns holds the columns for table hg_admin_oauth.
|
||||
var adminOauthColumns = AdminOauthColumns{
|
||||
Id: "id",
|
||||
MemberId: "member_id",
|
||||
Unionid: "unionid",
|
||||
OauthClient: "oauth_client",
|
||||
OauthOpenid: "oauth_openid",
|
||||
Sex: "sex",
|
||||
Nickname: "nickname",
|
||||
HeadPortrait: "head_portrait",
|
||||
Birthday: "birthday",
|
||||
Country: "country",
|
||||
Province: "province",
|
||||
City: "city",
|
||||
Status: "status",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
}
|
||||
|
||||
// NewAdminOauthDao creates and returns a new DAO object for table data access.
|
||||
func NewAdminOauthDao() *AdminOauthDao {
|
||||
return &AdminOauthDao{
|
||||
group: "default",
|
||||
table: "hg_admin_oauth",
|
||||
columns: adminOauthColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
func (dao *AdminOauthDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
func (dao *AdminOauthDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
func (dao *AdminOauthDao) Columns() AdminOauthColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
func (dao *AdminOauthDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
func (dao *AdminOauthDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *AdminOauthDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
95
server/internal/dao/internal/admin_order.go
Normal file
95
server/internal/dao/internal/admin_order.go
Normal file
@@ -0,0 +1,95 @@
|
||||
// ==========================================================================
|
||||
// Code generated 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"
|
||||
)
|
||||
|
||||
// AdminOrderDao is the data access object for table hg_admin_order.
|
||||
type AdminOrderDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns AdminOrderColumns // columns contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// AdminOrderColumns defines and stores column names for table hg_admin_order.
|
||||
type AdminOrderColumns struct {
|
||||
Id string // 主键
|
||||
MemberId string // 管理员id
|
||||
OrderType string // 订单类型
|
||||
ProductId string // 产品id
|
||||
OrderSn string // 关联订单号
|
||||
Money string // 充值金额
|
||||
Remark string // 备注
|
||||
RefundReason string // 退款原因
|
||||
RejectRefundReason string // 拒绝退款原因
|
||||
Status string // 状态
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 修改时间
|
||||
}
|
||||
|
||||
// adminOrderColumns holds the columns for table hg_admin_order.
|
||||
var adminOrderColumns = AdminOrderColumns{
|
||||
Id: "id",
|
||||
MemberId: "member_id",
|
||||
OrderType: "order_type",
|
||||
ProductId: "product_id",
|
||||
OrderSn: "order_sn",
|
||||
Money: "money",
|
||||
Remark: "remark",
|
||||
RefundReason: "refund_reason",
|
||||
RejectRefundReason: "reject_refund_reason",
|
||||
Status: "status",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
}
|
||||
|
||||
// NewAdminOrderDao creates and returns a new DAO object for table data access.
|
||||
func NewAdminOrderDao() *AdminOrderDao {
|
||||
return &AdminOrderDao{
|
||||
group: "default",
|
||||
table: "hg_admin_order",
|
||||
columns: adminOrderColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
func (dao *AdminOrderDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
func (dao *AdminOrderDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
func (dao *AdminOrderDao) Columns() AdminOrderColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
func (dao *AdminOrderDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
func (dao *AdminOrderDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *AdminOrderDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
131
server/internal/dao/internal/pay_log.go
Normal file
131
server/internal/dao/internal/pay_log.go
Normal file
@@ -0,0 +1,131 @@
|
||||
// ==========================================================================
|
||||
// Code generated 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"
|
||||
)
|
||||
|
||||
// PayLogDao is the data access object for table hg_pay_log.
|
||||
type PayLogDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns PayLogColumns // columns contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// PayLogColumns defines and stores column names for table hg_pay_log.
|
||||
type PayLogColumns struct {
|
||||
Id string // 主键
|
||||
MemberId string // 会员ID
|
||||
AppId string // 应用ID
|
||||
AddonsName string // 插件名称
|
||||
OrderSn string // 关联订单号
|
||||
OrderGroup string // 组别[默认统一支付类型]
|
||||
Openid string // openid
|
||||
MchId string // 商户支付账户
|
||||
Subject string // 订单标题
|
||||
Detail string // 支付商品详情
|
||||
AuthCode string // 刷卡码
|
||||
OutTradeNo string // 商户订单号
|
||||
TransactionId string // 交易号
|
||||
PayType string // 支付类型
|
||||
PayAmount string // 支付金额
|
||||
ActualAmount string // 实付金额
|
||||
PayStatus string // 支付状态
|
||||
PayAt string // 支付时间
|
||||
TradeType string // 交易类型
|
||||
RefundSn string // 退款单号
|
||||
IsRefund string // 是否退款
|
||||
Custom string // 自定义参数
|
||||
CreateIp string // 创建者IP
|
||||
PayIp string // 支付者IP
|
||||
NotifyUrl string // 支付通知回调地址
|
||||
ReturnUrl string // 买家付款成功跳转地址
|
||||
TraceIds string // 链路ID集合
|
||||
Status string // 状态
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 修改时间
|
||||
}
|
||||
|
||||
// payLogColumns holds the columns for table hg_pay_log.
|
||||
var payLogColumns = PayLogColumns{
|
||||
Id: "id",
|
||||
MemberId: "member_id",
|
||||
AppId: "app_id",
|
||||
AddonsName: "addons_name",
|
||||
OrderSn: "order_sn",
|
||||
OrderGroup: "order_group",
|
||||
Openid: "openid",
|
||||
MchId: "mch_id",
|
||||
Subject: "subject",
|
||||
Detail: "detail",
|
||||
AuthCode: "auth_code",
|
||||
OutTradeNo: "out_trade_no",
|
||||
TransactionId: "transaction_id",
|
||||
PayType: "pay_type",
|
||||
PayAmount: "pay_amount",
|
||||
ActualAmount: "actual_amount",
|
||||
PayStatus: "pay_status",
|
||||
PayAt: "pay_at",
|
||||
TradeType: "trade_type",
|
||||
RefundSn: "refund_sn",
|
||||
IsRefund: "is_refund",
|
||||
Custom: "custom",
|
||||
CreateIp: "create_ip",
|
||||
PayIp: "pay_ip",
|
||||
NotifyUrl: "notify_url",
|
||||
ReturnUrl: "return_url",
|
||||
TraceIds: "trace_ids",
|
||||
Status: "status",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
}
|
||||
|
||||
// NewPayLogDao creates and returns a new DAO object for table data access.
|
||||
func NewPayLogDao() *PayLogDao {
|
||||
return &PayLogDao{
|
||||
group: "default",
|
||||
table: "hg_pay_log",
|
||||
columns: payLogColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
func (dao *PayLogDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
func (dao *PayLogDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
func (dao *PayLogDao) Columns() PayLogColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
func (dao *PayLogDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
func (dao *PayLogDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *PayLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
97
server/internal/dao/internal/pay_refund.go
Normal file
97
server/internal/dao/internal/pay_refund.go
Normal file
@@ -0,0 +1,97 @@
|
||||
// ==========================================================================
|
||||
// Code generated 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"
|
||||
)
|
||||
|
||||
// PayRefundDao is the data access object for table hg_pay_refund.
|
||||
type PayRefundDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns PayRefundColumns // columns contains all the column names of Table for convenient usage.
|
||||
}
|
||||
|
||||
// PayRefundColumns defines and stores column names for table hg_pay_refund.
|
||||
type PayRefundColumns struct {
|
||||
Id string // 主键ID
|
||||
MemberId string // 会员ID
|
||||
AppId string // 应用ID
|
||||
OrderSn string // 业务订单号
|
||||
RefundTradeNo string // 退款交易号
|
||||
RefundMoney string // 退款金额
|
||||
RefundWay string // 退款方式
|
||||
Ip string // 申请者IP
|
||||
Reason string // 申请退款原因
|
||||
Remark string // 退款备注
|
||||
Status string // 退款状态
|
||||
CreatedAt string // 申请时间
|
||||
UpdatedAt string // 更新时间
|
||||
}
|
||||
|
||||
// payRefundColumns holds the columns for table hg_pay_refund.
|
||||
var payRefundColumns = PayRefundColumns{
|
||||
Id: "id",
|
||||
MemberId: "member_id",
|
||||
AppId: "app_id",
|
||||
OrderSn: "order_sn",
|
||||
RefundTradeNo: "refund_trade_no",
|
||||
RefundMoney: "refund_money",
|
||||
RefundWay: "refund_way",
|
||||
Ip: "ip",
|
||||
Reason: "reason",
|
||||
Remark: "remark",
|
||||
Status: "status",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
}
|
||||
|
||||
// NewPayRefundDao creates and returns a new DAO object for table data access.
|
||||
func NewPayRefundDao() *PayRefundDao {
|
||||
return &PayRefundDao{
|
||||
group: "default",
|
||||
table: "hg_pay_refund",
|
||||
columns: payRefundColumns,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
func (dao *PayRefundDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
func (dao *PayRefundDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
func (dao *PayRefundDao) Columns() PayRefundColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
func (dao *PayRefundDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
func (dao *PayRefundDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note that, you should not Commit or Rollback the transaction in function f
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *PayRefundDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
27
server/internal/dao/pay_log.go
Normal file
27
server/internal/dao/pay_log.go
Normal file
@@ -0,0 +1,27 @@
|
||||
// =================================================================================
|
||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
||||
// =================================================================================
|
||||
|
||||
package dao
|
||||
|
||||
import (
|
||||
"hotgo/internal/dao/internal"
|
||||
)
|
||||
|
||||
// internalPayLogDao is internal type for wrapping internal DAO implements.
|
||||
type internalPayLogDao = *internal.PayLogDao
|
||||
|
||||
// payLogDao is the data access object for table hg_pay_log.
|
||||
// You can define custom methods on it to extend its functionality as you wish.
|
||||
type payLogDao struct {
|
||||
internalPayLogDao
|
||||
}
|
||||
|
||||
var (
|
||||
// PayLog is globally public accessible object for table hg_pay_log operations.
|
||||
PayLog = payLogDao{
|
||||
internal.NewPayLogDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Fill with you ideas below.
|
||||
27
server/internal/dao/pay_refund.go
Normal file
27
server/internal/dao/pay_refund.go
Normal file
@@ -0,0 +1,27 @@
|
||||
// =================================================================================
|
||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
||||
// =================================================================================
|
||||
|
||||
package dao
|
||||
|
||||
import (
|
||||
"hotgo/internal/dao/internal"
|
||||
)
|
||||
|
||||
// internalPayRefundDao is internal type for wrapping internal DAO implements.
|
||||
type internalPayRefundDao = *internal.PayRefundDao
|
||||
|
||||
// payRefundDao is the data access object for table hg_pay_refund.
|
||||
// You can define custom methods on it to extend its functionality as you wish.
|
||||
type payRefundDao struct {
|
||||
internalPayRefundDao
|
||||
}
|
||||
|
||||
var (
|
||||
// PayRefund is globally public accessible object for table hg_pay_refund operations.
|
||||
PayRefund = payRefundDao{
|
||||
internal.NewPayRefundDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// Fill with you ideas below.
|
||||
Reference in New Issue
Block a user