使用gorm 实现 php现在的逻辑
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraAdAppModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraAdLaunchModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraAdPcModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraAdPopupModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraAdXcxModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCatalogAndroidModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCatalogBankModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCatalogCountryModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCatalogCurrencyModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCatalogExportModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCatalogFileModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCatalogHolidayModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCatalogInviteModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCatalogLanguageModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCatalogMerchantModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCatalogNoticeModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCatalogServicefeeModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCommissionModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCustomerAccountModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCustomerBalanceModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCustomerCommissionModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCustomerCommissionWithdrawModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCustomerDepositModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCustomerDeviceLogModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCustomerDeviceModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCustomerDistributorModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCustomerExchangeModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCustomerFavouriteModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCustomerFeedbackModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCustomerFundModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCustomerHoldModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCustomerInternationalModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCustomerIpoModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,49 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/jmoiron/sqlx"
|
||||
)
|
||||
|
||||
const (
|
||||
/**
|
||||
* 禁止A仓交易,1:是;2:否
|
||||
*/
|
||||
Disable_A_No = 2
|
||||
Type_2 = 2
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCustomerModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
func (m *KillaraCustomerModel) Find(ctx context.Context) (result []*KillaraCustomer, err error) {
|
||||
var customer []*KillaraCustomer
|
||||
err = m.db.SelectContext(ctx, customer, fmt.Sprintf("select * from %s", m.TableName))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return customer, nil
|
||||
}
|
||||
|
||||
func (m *KillaraCustomerModel) InsertCustomer(data *KillaraCustomer) (int64, error) {
|
||||
result, err := m.db.NamedExec(`INSERT INTO customer (type, realname, code, telephone, email, nickname, name, status, disable_a, parent_id)
|
||||
VALUES (:type, :realname, :code, :telephone, :email, :nickname, :name, :status, :disable_a, :parent_id)`, data)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
id, err := result.LastInsertId()
|
||||
return id, err
|
||||
}
|
||||
|
||||
func (m *KillaraCustomerModel) UpdateCustomer(id int64, data *KillaraCustomer) error {
|
||||
_, err := m.db.NamedExec(
|
||||
`UPDATE customer SET type=:type, realname=:realname, code=:code, telephone=:telephone, email=:email, nickname=:nickname, name=:name, status=:status, disable_a=:disable_a, parent_id=:parent_id WHERE customer_id=:customer_id`,
|
||||
data,
|
||||
)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCustomerNewsModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCustomerPointModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCustomerTokenModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCustomerTransactionModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraCustomerWithdrawModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraFundAchievementModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraFundCategoryModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraFundModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraFundNetModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraHelpCategoryModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraHelpModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraHostingDayModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraHostingMagnificationModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraHostingStocksModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraHundsunFundModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraInfoCategoryModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraInfoModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraInformationTermModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraInternationalModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraIpoModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraIpoQtyModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraIpoRatioModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraSettingModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraStockModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraUserGroupModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraUserModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraUserLoginHistoryModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/jmoiron/sqlx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type KillaraUserTokenModel struct {
|
||||
// fields ...
|
||||
db *sqlx.DB
|
||||
db *gorm.DB
|
||||
TableName string // 表名
|
||||
}
|
||||
|
||||
2107
model/types_gen.go
2107
model/types_gen.go
File diff suppressed because it is too large
Load Diff
13
model/var.go
13
model/var.go
@@ -1 +1,14 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"gorm.io/driver/mysql"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
func ModelInit(mysqlDNS string) {
|
||||
db, err := gorm.Open(mysql.Open(mysqlDNS))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
Models.SetGormDriver(db)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user