chore: 并入 iotlcm-onelink-mock 历史到 onelink-mock/(原提交 f398595)

This commit is contained in:
MiFaZhan
2026-11-02 13:28:02 +08:00
64 changed files with 10585 additions and 0 deletions
@@ -0,0 +1,85 @@
// ==========================================================================
// 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"
)
// MockCardGroupDao is the data access object for the table mock_card_group.
type MockCardGroupDao 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 MockCardGroupColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// MockCardGroupColumns defines and stores column names for the table mock_card_group.
type MockCardGroupColumns struct {
Id string //
Name string //
CreatedAt string //
UpdatedAt string //
}
// mockCardGroupColumns holds the columns for the table mock_card_group.
var mockCardGroupColumns = MockCardGroupColumns{
Id: "id",
Name: "name",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
}
// NewMockCardGroupDao creates and returns a new DAO object for table data access.
func NewMockCardGroupDao(handlers ...gdb.ModelHandler) *MockCardGroupDao {
return &MockCardGroupDao{
group: "default",
table: "mock_card_group",
columns: mockCardGroupColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *MockCardGroupDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *MockCardGroupDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *MockCardGroupDao) Columns() MockCardGroupColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *MockCardGroupDao) 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 *MockCardGroupDao) 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 *MockCardGroupDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,97 @@
// ==========================================================================
// 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"
)
// MockOrderDao is the data access object for the table mock_order.
type MockOrderDao 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 MockOrderColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// MockOrderColumns defines and stores column names for the table mock_order.
type MockOrderColumns struct {
Id string //
OrderNum string //
Msisdn string //
Iccid string //
Imsi string //
Type string //
OperType string //
ApnName string //
Status string //
CreatedAt string //
}
// mockOrderColumns holds the columns for the table mock_order.
var mockOrderColumns = MockOrderColumns{
Id: "id",
OrderNum: "order_num",
Msisdn: "msisdn",
Iccid: "iccid",
Imsi: "imsi",
Type: "type",
OperType: "oper_type",
ApnName: "apn_name",
Status: "status",
CreatedAt: "created_at",
}
// NewMockOrderDao creates and returns a new DAO object for table data access.
func NewMockOrderDao(handlers ...gdb.ModelHandler) *MockOrderDao {
return &MockOrderDao{
group: "default",
table: "mock_order",
columns: mockOrderColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *MockOrderDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *MockOrderDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *MockOrderDao) Columns() MockOrderColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *MockOrderDao) 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 *MockOrderDao) 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 *MockOrderDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,187 @@
// ==========================================================================
// 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"
)
// MockTSimCardDao is the data access object for the table mock_t_sim_card.
type MockTSimCardDao 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 MockTSimCardColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// MockTSimCardColumns defines and stores column names for the table mock_t_sim_card.
type MockTSimCardColumns struct {
Id string //
GroupId string //
Msisdn string //
Iccid string //
Imsi string //
Imei string //
Remark string //
Carrier string //
PackageCode string //
PackageName string //
PackageStatus string //
PackageTotalFlowMb string //
IsFlowPool string //
CardStatus string //
LastChangeDate string //
StopReason string //
FrozenStatus string //
FrozenReason string //
FrozenOperTime string //
OpenDate string //
ActiveDate string //
OnOffStatus string //
SessionStatus string //
ApnId string //
SessionIpv4 string //
SessionIpv6Prefix string //
SessionIpv6 string //
SessionCreateDate string //
Rat string //
ApnListJson string //
ApnUsageJson string //
PrimaryApnName string //
PrimaryApnStatus string //
PrimaryApnUsageKb string //
PrimaryApnUsageBytes string //
PccCode string //
PccUsageKb string //
CurrentMonthUsageKb string //
PoolUsageBytes string //
DailyUsageKb string //
MonthlyUsageKb string //
DailyQueryDate string //
MonthlyQueryMonth string //
MonthlyDeadline string //
GrowthPerMinuteKb string //
AutoGrowthEnabled string //
LastUsageUpdateTime string //
CardBindStatus string //
RegionLimitStatus string //
AreaRestrictType string //
RestrictedArea string //
Exported string //
ExportCheckedAt string //
CreatedAt string //
UpdatedAt string //
}
// mockTSimCardColumns holds the columns for the table mock_t_sim_card.
var mockTSimCardColumns = MockTSimCardColumns{
Id: "id",
GroupId: "group_id",
Msisdn: "msisdn",
Iccid: "iccid",
Imsi: "imsi",
Imei: "imei",
Remark: "remark",
Carrier: "carrier",
PackageCode: "package_code",
PackageName: "package_name",
PackageStatus: "package_status",
PackageTotalFlowMb: "package_total_flow_mb",
IsFlowPool: "is_flow_pool",
CardStatus: "card_status",
LastChangeDate: "last_change_date",
StopReason: "stop_reason",
FrozenStatus: "frozen_status",
FrozenReason: "frozen_reason",
FrozenOperTime: "frozen_oper_time",
OpenDate: "open_date",
ActiveDate: "active_date",
OnOffStatus: "on_off_status",
SessionStatus: "session_status",
ApnId: "apn_id",
SessionIpv4: "session_ipv4",
SessionIpv6Prefix: "session_ipv6_prefix",
SessionIpv6: "session_ipv6",
SessionCreateDate: "session_create_date",
Rat: "rat",
ApnListJson: "apn_list_json",
ApnUsageJson: "apn_usage_json",
PrimaryApnName: "primary_apn_name",
PrimaryApnStatus: "primary_apn_status",
PrimaryApnUsageKb: "primary_apn_usage_kb",
PrimaryApnUsageBytes: "primary_apn_usage_bytes",
PccCode: "pcc_code",
PccUsageKb: "pcc_usage_kb",
CurrentMonthUsageKb: "current_month_usage_kb",
PoolUsageBytes: "pool_usage_bytes",
DailyUsageKb: "daily_usage_kb",
MonthlyUsageKb: "monthly_usage_kb",
DailyQueryDate: "daily_query_date",
MonthlyQueryMonth: "monthly_query_month",
MonthlyDeadline: "monthly_deadline",
GrowthPerMinuteKb: "growth_per_minute_kb",
AutoGrowthEnabled: "auto_growth_enabled",
LastUsageUpdateTime: "last_usage_update_time",
CardBindStatus: "card_bind_status",
RegionLimitStatus: "region_limit_status",
AreaRestrictType: "area_restrict_type",
RestrictedArea: "restricted_area",
Exported: "exported",
ExportCheckedAt: "export_checked_at",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
}
// NewMockTSimCardDao creates and returns a new DAO object for table data access.
func NewMockTSimCardDao(handlers ...gdb.ModelHandler) *MockTSimCardDao {
return &MockTSimCardDao{
group: "default",
table: "mock_t_sim_card",
columns: mockTSimCardColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *MockTSimCardDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *MockTSimCardDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *MockTSimCardDao) Columns() MockTSimCardColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *MockTSimCardDao) 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 *MockTSimCardDao) 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 *MockTSimCardDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,22 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"git.5iot.com/iotlcm-public/iotlcm-onelink-mock/internal/dao/internal"
)
// mockCardGroupDao is the data access object for the table mock_card_group.
// You can define custom methods on it to extend its functionality as needed.
type mockCardGroupDao struct {
*internal.MockCardGroupDao
}
var (
// MockCardGroup is a globally accessible object for table mock_card_group operations.
MockCardGroup = mockCardGroupDao{internal.NewMockCardGroupDao()}
)
// Add your custom methods and functionality below.
+22
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 (
"git.5iot.com/iotlcm-public/iotlcm-onelink-mock/internal/dao/internal"
)
// mockOrderDao is the data access object for the table mock_order.
// You can define custom methods on it to extend its functionality as needed.
type mockOrderDao struct {
*internal.MockOrderDao
}
var (
// MockOrder is a globally accessible object for table mock_order operations.
MockOrder = mockOrderDao{internal.NewMockOrderDao()}
)
// Add your custom methods and functionality below.
@@ -0,0 +1,22 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"git.5iot.com/iotlcm-public/iotlcm-onelink-mock/internal/dao/internal"
)
// mockTSimCardDao is the data access object for the table mock_t_sim_card.
// You can define custom methods on it to extend its functionality as needed.
type mockTSimCardDao struct {
*internal.MockTSimCardDao
}
var (
// MockTSimCard is a globally accessible object for table mock_t_sim_card operations.
MockTSimCard = mockTSimCardDao{internal.NewMockTSimCardDao()}
)
// Add your custom methods and functionality below.