mirror of
https://git.oceanpay.cc/danial/kami_scripts.git
synced 2025-12-18 22:49:25 +00:00
feat(client): 添加 HeePay客户端并更新相关模型- 新增 HeePay 客户端,实现查询卡密功能
- 添加账户信息、账户历史记录和代理信息的模型 - 更新 .gitignore 文件,忽略日志目录
This commit is contained in:
1
.gitignore → verification/.gitignore
vendored
1
.gitignore → verification/.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
/logs/*
|
||||
/.vscode/
|
||||
/.idea/
|
||||
59
verification/README.md
Normal file
59
verification/README.md
Normal file
@@ -0,0 +1,59 @@
|
||||
# 订单发送服务
|
||||
|
||||
这是一个自动从MySQL数据库读取订单并发送到指定接口的服务。
|
||||
|
||||
## 功能特点
|
||||
|
||||
- 定时从数据库读取订单数据
|
||||
- 支持多商户和多通道配置
|
||||
- 可配置的发送比例
|
||||
- 完整的日志记录
|
||||
- 配置文件驱动的系统
|
||||
|
||||
## 安装依赖
|
||||
|
||||
```bash
|
||||
go mod tidy
|
||||
```
|
||||
|
||||
## 配置说明
|
||||
|
||||
编辑 `config.yaml` 文件:
|
||||
|
||||
1. 数据库配置
|
||||
- 设置数据库连接信息
|
||||
- 确保数据库用户有适当的权限
|
||||
|
||||
2. 商户配置
|
||||
- 添加需要处理的商户信息
|
||||
- 配置每个商户的 API 密钥
|
||||
|
||||
3. 通道配置
|
||||
- 设置发送通道信息
|
||||
- 配置每个通道的发送比例
|
||||
|
||||
4. 调度配置
|
||||
- 设置服务运行间隔(秒)
|
||||
|
||||
5. 日志配置
|
||||
- 设置日志级别
|
||||
- 配置日志文件路径和轮转策略
|
||||
|
||||
## 运行服务
|
||||
|
||||
```bash
|
||||
go run main.go
|
||||
```
|
||||
|
||||
## 日志说明
|
||||
|
||||
- 日志文件位置:`logs/order_sender.log`
|
||||
- 日志按天轮转
|
||||
- 保留最近30天的日志记录
|
||||
|
||||
## 注意事项
|
||||
|
||||
1. 确保数据库连接信息正确
|
||||
2. 检查配置文件中的路径是否正确
|
||||
3. 确保有适当的文件系统权限
|
||||
4. 建议在生产环境中使用 supervisor 或 systemd 管理服务
|
||||
39
verification/cmd/gen/main.go
Normal file
39
verification/cmd/gen/main.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"gorm.io/driver/mysql"
|
||||
"gorm.io/gen"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// 连接数据库
|
||||
dsn := "root:Woaizixkie!123@tcp(127.0.0.1:3306)/kami?charset=utf8mb4&parseTime=True&loc=Local"
|
||||
db, err := gorm.Open(mysql.Open(dsn))
|
||||
if err != nil {
|
||||
log.Fatalf("连接数据库失败: %v", err)
|
||||
}
|
||||
|
||||
// 创建生成器
|
||||
g := gen.NewGenerator(gen.Config{
|
||||
OutPath: "./internal/query",
|
||||
ModelPkgPath: "./internal/models",
|
||||
Mode: gen.WithoutContext | gen.WithDefaultQuery | gen.WithQueryInterface,
|
||||
FieldSignable: true,
|
||||
FieldWithTypeTag: true,
|
||||
FieldWithIndexTag: true,
|
||||
FieldNullable: true,
|
||||
FieldCoverable: true,
|
||||
})
|
||||
|
||||
// 使用数据库连接
|
||||
g.UseDB(db)
|
||||
|
||||
// 生成其他表的代码
|
||||
g.ApplyBasic(g.GenerateAllTable()...)
|
||||
|
||||
// 生成代码
|
||||
g.Execute()
|
||||
}
|
||||
23
verification/config.yaml
Normal file
23
verification/config.yaml
Normal file
@@ -0,0 +1,23 @@
|
||||
database:
|
||||
host: localhost
|
||||
port: 3306
|
||||
username: root
|
||||
password: Woaizixkie!123
|
||||
dbname: kami
|
||||
|
||||
submit_url: "https://gateway.kkknametrans.buzz"
|
||||
|
||||
merchants:
|
||||
- name: "测试商户"
|
||||
app_key: "app_key"
|
||||
app_secret: "app_secret"
|
||||
product_code: ""
|
||||
card_type: ""
|
||||
|
||||
logging:
|
||||
level: "info"
|
||||
filename: "logs/order_sender.log"
|
||||
max_size: 100 # MB
|
||||
max_backups: 30 # 保留30天的日志
|
||||
max_age: 30 # 天
|
||||
compress: true
|
||||
15
verification/gentool.yaml
Normal file
15
verification/gentool.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
version: "0.0.1"
|
||||
database:
|
||||
# 数据库连接配置
|
||||
dsn: "root:Woaizixkie!123@tcp(127.0.0.1:3306)/kami?charset=utf8mb4&parseTime=True&loc=Local"
|
||||
# 数据库类型
|
||||
db_type: "mysql"
|
||||
# 数据库名称
|
||||
db_name: "kami"
|
||||
# 数据库表名
|
||||
tables: [""]
|
||||
# 数据库表前缀
|
||||
table_prefix: ""
|
||||
# 数据库表后缀
|
||||
table_suffix: ""
|
||||
outPath: "./internal/query"
|
||||
45
verification/go.mod
Normal file
45
verification/go.mod
Normal file
@@ -0,0 +1,45 @@
|
||||
module order
|
||||
|
||||
go 1.24
|
||||
|
||||
require (
|
||||
github.com/beego/beego/v2 v2.3.8
|
||||
github.com/duke-git/lancet/v2 v2.3.6
|
||||
github.com/spf13/viper v1.20.1
|
||||
go.uber.org/zap v1.27.0
|
||||
gorm.io/driver/mysql v1.6.0
|
||||
gorm.io/gen v0.3.27
|
||||
gorm.io/gorm v1.30.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/shiena/ansicolor v0.0.0-20200904210342-c7312218db18 // indirect
|
||||
golang.org/x/exp v0.0.0-20250606033433-dcc06ee1d476 // indirect
|
||||
)
|
||||
|
||||
require (
|
||||
filippo.io/edwards25519 v1.1.0 // indirect
|
||||
github.com/fsnotify/fsnotify v1.9.0 // indirect
|
||||
github.com/go-sql-driver/mysql v1.9.2 // indirect
|
||||
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||
github.com/jinzhu/now v1.1.5 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
|
||||
github.com/sagikazarmark/locafero v0.9.0 // indirect
|
||||
github.com/sourcegraph/conc v0.3.0 // indirect
|
||||
github.com/spf13/afero v1.14.0 // indirect
|
||||
github.com/spf13/cast v1.9.2 // indirect
|
||||
github.com/spf13/pflag v1.0.6 // indirect
|
||||
github.com/subosito/gotenv v1.6.0 // indirect
|
||||
go.uber.org/multierr v1.11.0 // indirect
|
||||
golang.org/x/mod v0.25.0 // indirect
|
||||
golang.org/x/sync v0.15.0 // indirect
|
||||
golang.org/x/sys v0.33.0 // indirect
|
||||
golang.org/x/text v0.26.0 // indirect
|
||||
golang.org/x/tools v0.34.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
gorm.io/datatypes v1.2.5 // indirect
|
||||
gorm.io/hints v1.1.2 // indirect
|
||||
gorm.io/plugin/dbresolver v1.6.0
|
||||
)
|
||||
115
verification/go.sum
Normal file
115
verification/go.sum
Normal file
@@ -0,0 +1,115 @@
|
||||
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
|
||||
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
|
||||
github.com/beego/beego/v2 v2.3.8 h1:wplhB1pF4TxR+2SS4PUej8eDoH4xGfxuHfS7wAk9VBc=
|
||||
github.com/beego/beego/v2 v2.3.8/go.mod h1:8vl9+RrXqvodrl9C8yivX1e6le6deCK6RWeq8R7gTTg=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/duke-git/lancet/v2 v2.3.6 h1:NKxSSh+dlgp37funvxLCf3xLBeUYa7VW1thYQP6j3Y8=
|
||||
github.com/duke-git/lancet/v2 v2.3.6/go.mod h1:zGa2R4xswg6EG9I6WnyubDbFO/+A/RROxIbXcwryTsc=
|
||||
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
|
||||
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
|
||||
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
|
||||
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
|
||||
github.com/go-sql-driver/mysql v1.9.2 h1:4cNKDYQ1I84SXslGddlsrMhc8k4LeDVj6Ad6WRjiHuU=
|
||||
github.com/go-sql-driver/mysql v1.9.2/go.mod h1:qn46aNg1333BRMNU69Lq93t8du/dwxI64Gl8i5p1WMU=
|
||||
github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss=
|
||||
github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
|
||||
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0ktxqI+Sida1w446QrXBRJ0nee3SNZlA=
|
||||
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
|
||||
github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A=
|
||||
github.com/golang-sql/sqlexp v0.1.0/go.mod h1:J4ad9Vo8ZCWQ2GMrC4UCQy1JpCbwU9m3EOqtpKwwwHI=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
|
||||
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
|
||||
github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 h1:L0QtFUgDarD7Fpv9jeVMgy/+Ec0mtnmYuImjTz6dtDA=
|
||||
github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
|
||||
github.com/jackc/pgx/v5 v5.5.5 h1:amBjrZVmksIdNjxGW/IiIMzxMKZFelXbUoPNb+8sjQw=
|
||||
github.com/jackc/pgx/v5 v5.5.5/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A=
|
||||
github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk=
|
||||
github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
|
||||
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
|
||||
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
||||
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
|
||||
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
|
||||
github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
|
||||
github.com/mattn/go-sqlite3 v1.14.27 h1:drZCnuvf37yPfs95E5jd9s3XhdVWLal+6BOK6qrv6IU=
|
||||
github.com/mattn/go-sqlite3 v1.14.27/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
||||
github.com/microsoft/go-mssqldb v1.7.2 h1:CHkFJiObW7ItKTJfHo1QX7QBBD1iV+mn1eOyRP3b/PA=
|
||||
github.com/microsoft/go-mssqldb v1.7.2/go.mod h1:kOvZKUdrhhFQmxLZqbwUV0rHkNkZpthMITIb2Ko1IoA=
|
||||
github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
|
||||
github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
|
||||
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
||||
github.com/sagikazarmark/locafero v0.9.0 h1:GbgQGNtTrEmddYDSAH9QLRyfAHY12md+8YFTqyMTC9k=
|
||||
github.com/sagikazarmark/locafero v0.9.0/go.mod h1:UBUyz37V+EdMS3hDF3QWIiVr/2dPrx49OMO0Bn0hJqk=
|
||||
github.com/shiena/ansicolor v0.0.0-20200904210342-c7312218db18 h1:DAYUYH5869yV94zvCES9F51oYtN5oGlwjxJJz7ZCnik=
|
||||
github.com/shiena/ansicolor v0.0.0-20200904210342-c7312218db18/go.mod h1:nkxAfR/5quYxwPZhyDxgasBMnRtBZd0FCEpawpjMUFg=
|
||||
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
|
||||
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
|
||||
github.com/spf13/afero v1.14.0 h1:9tH6MapGnn/j0eb0yIXiLjERO8RB6xIVZRDCX7PtqWA=
|
||||
github.com/spf13/afero v1.14.0/go.mod h1:acJQ8t0ohCGuMN3O+Pv0V0hgMxNYDlvdk+VTfyZmbYo=
|
||||
github.com/spf13/cast v1.9.2 h1:SsGfm7M8QOFtEzumm7UZrZdLLquNdzFYfIbEXntcFbE=
|
||||
github.com/spf13/cast v1.9.2/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=
|
||||
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
|
||||
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/spf13/viper v1.20.1 h1:ZMi+z/lvLyPSCoNtFCpqjy0S4kPbirhpTMwl8BkW9X4=
|
||||
github.com/spf13/viper v1.20.1/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4=
|
||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
|
||||
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
|
||||
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
|
||||
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
|
||||
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
|
||||
golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI=
|
||||
golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM=
|
||||
golang.org/x/exp v0.0.0-20250606033433-dcc06ee1d476 h1:bsqhLWFR6G6xiQcb+JoGqdKdRU6WzPWmK8E0jxTjzo4=
|
||||
golang.org/x/exp v0.0.0-20250606033433-dcc06ee1d476/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8=
|
||||
golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w=
|
||||
golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
|
||||
golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8=
|
||||
golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
|
||||
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M=
|
||||
golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA=
|
||||
golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo=
|
||||
golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gorm.io/datatypes v1.2.5 h1:9UogU3jkydFVW1bIVVeoYsTpLRgwDVW3rHfJG6/Ek9I=
|
||||
gorm.io/datatypes v1.2.5/go.mod h1:I5FUdlKpLb5PMqeMQhm30CQ6jXP8Rj89xkTeCSAaAD4=
|
||||
gorm.io/driver/mysql v1.6.0 h1:eNbLmNTpPpTOVZi8MMxCi2aaIm0ZpInbORNXDwyLGvg=
|
||||
gorm.io/driver/mysql v1.6.0/go.mod h1:D/oCC2GWK3M/dqoLxnOlaNKmXz8WNTfcS9y5ovaSqKo=
|
||||
gorm.io/driver/postgres v1.5.0 h1:u2FXTy14l45qc3UeCJ7QaAXZmZfDDv0YrthvmRq1l0U=
|
||||
gorm.io/driver/postgres v1.5.0/go.mod h1:FUZXzO+5Uqg5zzwzv4KK49R8lvGIyscBOqYrtI1Ce9A=
|
||||
gorm.io/driver/sqlite v1.5.0 h1:zKYbzRCpBrT1bNijRnxLDJWPjVfImGEn0lSnUY5gZ+c=
|
||||
gorm.io/driver/sqlite v1.5.0/go.mod h1:kDMDfntV9u/vuMmz8APHtHF0b4nyBB7sfCieC6G8k8I=
|
||||
gorm.io/driver/sqlserver v1.5.4 h1:xA+Y1KDNspv79q43bPyjDMUgHoYHLhXYmdFcYPobg8g=
|
||||
gorm.io/driver/sqlserver v1.5.4/go.mod h1:+frZ/qYmuna11zHPlh5oc2O6ZA/lS88Keb0XSH1Zh/g=
|
||||
gorm.io/gen v0.3.27 h1:ziocAFLpE7e0g4Rum69pGfB9S6DweTxK8gAun7cU8as=
|
||||
gorm.io/gen v0.3.27/go.mod h1:9zquz2xD1f3Eb/eHq4oLn2z6vDVvQlCY5S3uMBLv4EA=
|
||||
gorm.io/gorm v1.24.7-0.20230306060331-85eaf9eeda11/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k=
|
||||
gorm.io/gorm v1.25.0/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k=
|
||||
gorm.io/gorm v1.30.0 h1:qbT5aPv1UH8gI99OsRlvDToLxW5zR7FzS9acZDOZcgs=
|
||||
gorm.io/gorm v1.30.0/go.mod h1:8Z33v652h4//uMA76KjeDH8mJXPm1QNCYrMeatR0DOE=
|
||||
gorm.io/hints v1.1.2 h1:b5j0kwk5p4+3BtDtYqqfY+ATSxjj+6ptPgVveuynn9o=
|
||||
gorm.io/hints v1.1.2/go.mod h1:/ARdpUHAtyEMCh5NNi3tI7FsGh+Cj/MIUlvNxCNCFWg=
|
||||
gorm.io/plugin/dbresolver v1.6.0 h1:XvKDeOtTn1EIX6s4SrKpEH82q0gXVemhYjbYZFGFVcw=
|
||||
gorm.io/plugin/dbresolver v1.6.0/go.mod h1:tctw63jdrOezFR9HmrKnPkmig3m5Edem9fdxk9bQSzM=
|
||||
113
verification/internal/client/heepay.go
Normal file
113
verification/internal/client/heepay.go
Normal file
@@ -0,0 +1,113 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/v2/client/httplib"
|
||||
)
|
||||
|
||||
type HeePayClient struct {
|
||||
}
|
||||
|
||||
func NewHeePayClient() *HeePayClient {
|
||||
return &HeePayClient{}
|
||||
}
|
||||
|
||||
type QueryCardInput struct {
|
||||
OrderNo string `json:"order_no"`
|
||||
CardNo string `json:"card_no"`
|
||||
CardPassword string `json:"card_password"`
|
||||
}
|
||||
|
||||
type QueryCardOutput struct {
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
Data struct {
|
||||
CardNumber string `json:"card_number"`
|
||||
CardPassword string `json:"card_password"`
|
||||
CardType string `json:"card_type"`
|
||||
CardStatus string `json:"card_status"`
|
||||
JPoints string `json:"j_points"`
|
||||
LockedJPoints string `json:"locked_j_points"`
|
||||
AvailableJPoints string `json:"available_j_points"`
|
||||
SuccessTime string `json:"success_time"`
|
||||
UseRecords []struct {
|
||||
TransactionType string `json:"transaction_type"`
|
||||
UsedJPoints string `json:"used_j_points"`
|
||||
UsageNote string `json:"usage_note"`
|
||||
UsageTime string `json:"usage_time"`
|
||||
Result string `json:"result"`
|
||||
} `json:"use_records"`
|
||||
} `json:"data,omitempty"`
|
||||
}
|
||||
|
||||
const (
|
||||
maxRetries = 3
|
||||
retryDelay = time.Second
|
||||
)
|
||||
|
||||
func (c *HeePayClient) QueryCard(ctx context.Context, input *QueryCardInput) (*QueryCardOutput, error) {
|
||||
var lastErr error
|
||||
for i := range maxRetries {
|
||||
client := httplib.NewBeegoRequestWithCtx(ctx,
|
||||
"http://127.0.0.1:8453/spider/heepay/query", "POST").
|
||||
SetTimeout(30*time.Second, 30*time.Second).Retries(3)
|
||||
|
||||
var err error
|
||||
client, err = client.JSONBody(input)
|
||||
if err != nil {
|
||||
lastErr = err
|
||||
continue
|
||||
}
|
||||
|
||||
response, err := client.String()
|
||||
if err != nil {
|
||||
lastErr = err
|
||||
continue
|
||||
}
|
||||
|
||||
var output QueryCardOutput
|
||||
err = json.Unmarshal([]byte(response), &output)
|
||||
if err != nil {
|
||||
lastErr = err
|
||||
continue
|
||||
}
|
||||
|
||||
// 检查是否需要重试的错误
|
||||
if strings.Contains(output.Msg, "验证码识别失败") {
|
||||
lastErr = fmt.Errorf("需要重试的错误: %s", output.Msg)
|
||||
if i < maxRetries-1 {
|
||||
time.Sleep(retryDelay)
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
return &output, nil
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("重试%d次后仍然失败: %v", maxRetries, lastErr)
|
||||
}
|
||||
|
||||
func (c *HeePayClient) ToString(ctx context.Context, input *QueryCardInput) (string, error) {
|
||||
output, err := c.QueryCard(ctx, input)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if output.Code == -1 {
|
||||
return "卡密不存在", nil
|
||||
}
|
||||
if output.Code == 0 {
|
||||
return output.Msg, nil
|
||||
}
|
||||
if len(output.Data.UseRecords) != 0 {
|
||||
return fmt.Sprintf("该卡已被其他用户绑定,绑定时间:%s", output.Data.UseRecords[0].UsageTime), nil
|
||||
}
|
||||
if output.Data.CardStatus != "启用" {
|
||||
return fmt.Sprintf("该卡已被其他用户绑定,绑定时间:%s", output.Data.SuccessTime), nil
|
||||
}
|
||||
return "正常", nil
|
||||
}
|
||||
36
verification/internal/client/models.go
Normal file
36
verification/internal/client/models.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package client
|
||||
|
||||
import "strconv"
|
||||
|
||||
type SubmitOrder struct {
|
||||
OrderPeriod int `json:"orderPeriod"`
|
||||
NotifyUrl string `json:"notifyUrl"`
|
||||
OrderPrice string `json:"orderPrice"`
|
||||
OrderNo string `json:"orderNo"`
|
||||
ProductCode string `json:"productCode"`
|
||||
ExValue string `json:"exValue"`
|
||||
Ip string `json:"ip"`
|
||||
PayKey string `json:"payKey"`
|
||||
PaySecret string `json:"paySecret"`
|
||||
}
|
||||
|
||||
func (s *SubmitOrder) ToStrMap() map[string]string {
|
||||
data := map[string]string{
|
||||
"orderPeriod": strconv.Itoa(s.OrderPeriod),
|
||||
"notifyUrl": s.NotifyUrl,
|
||||
"orderPrice": s.OrderPrice,
|
||||
"orderNo": s.OrderNo,
|
||||
"productCode": s.ProductCode,
|
||||
"exValue": s.ExValue,
|
||||
"ip": s.Ip,
|
||||
"payKey": s.PayKey,
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
||||
type SubmitOrderResponse struct {
|
||||
PayKey string `json:"payKey"`
|
||||
StatusCode string `json:"statusCode"`
|
||||
Msg string `json:"msg"`
|
||||
Code int `json:"code"`
|
||||
}
|
||||
70
verification/internal/client/submit_order.go
Normal file
70
verification/internal/client/submit_order.go
Normal file
@@ -0,0 +1,70 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"order/internal/interfaces"
|
||||
"order/internal/model"
|
||||
"order/internal/utils"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/beego/beego/v2/client/httplib"
|
||||
)
|
||||
|
||||
// OrderSender 模拟订单发送器
|
||||
type OrderSender struct {
|
||||
logger interfaces.Logger
|
||||
}
|
||||
|
||||
func NewMockOrderSender(logger interfaces.Logger) interfaces.OrderSender {
|
||||
return &OrderSender{logger: logger}
|
||||
}
|
||||
|
||||
func (s *OrderSender) Send(ctx context.Context, order *model.OrderInfo, productCode, payKey, paySecret, submitURL string) error {
|
||||
// 这里实现实际的订单发送逻辑
|
||||
s.logger.Info("发送订单",
|
||||
"order_no", order.BankOrderID,
|
||||
"amount", order.OrderAmount,
|
||||
)
|
||||
if _, err := submitOrder(ctx, &SubmitOrder{
|
||||
OrderPeriod: 1,
|
||||
NotifyUrl: "https://www.baidu.com",
|
||||
OrderPrice: strconv.FormatFloat(order.OrderAmount, 'f', -1, 64),
|
||||
OrderNo: order.BankOrderID,
|
||||
ExValue: order.ExValue,
|
||||
Ip: "127.0.0.1",
|
||||
PayKey: payKey,
|
||||
PaySecret: paySecret,
|
||||
}, submitURL); err != nil {
|
||||
s.logger.Error("提交订单失败", "error", err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func submitOrder(ctx context.Context, input *SubmitOrder, submitURL string) (*SubmitOrderResponse, error) {
|
||||
req := httplib.NewBeegoRequestWithCtx(ctx, fmt.Sprintf("%s/gateway/scan", submitURL), "POST").
|
||||
SetTimeout(30*time.Second, 30*time.Second).Retries(3).RetryDelay(time.Second * 3)
|
||||
|
||||
params := input.ToStrMap()
|
||||
params["sign"] = utils.GetMD5SignMF(params, input.PaySecret)
|
||||
|
||||
for k, v := range params {
|
||||
req.Param(k, v)
|
||||
}
|
||||
|
||||
response, err := req.String()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
submitOrderResponse := SubmitOrderResponse{}
|
||||
err = json.Unmarshal([]byte(response), &submitOrderResponse)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &submitOrderResponse, nil
|
||||
}
|
||||
58
verification/internal/config/config.go
Normal file
58
verification/internal/config/config.go
Normal file
@@ -0,0 +1,58 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
// Config 应用配置结构
|
||||
type Config struct {
|
||||
SubmitURL string `mapstructure:"submit_url"`
|
||||
Database struct {
|
||||
Host string `mapstructure:"host"`
|
||||
Port int `mapstructure:"port"`
|
||||
Username string `mapstructure:"username"`
|
||||
Password string `mapstructure:"password"`
|
||||
DBName string `mapstructure:"dbname"`
|
||||
} `mapstructure:"database"`
|
||||
Merchants []*struct {
|
||||
Name string `mapstructure:"name"`
|
||||
ProductCode string `mapstructure:"product_code"`
|
||||
PayKey string `mapstructure:"pay_key"`
|
||||
PaySecret string `mapstructure:"pay_secret"`
|
||||
CardType string `mapstructure:"card_type"`
|
||||
} `mapstructure:"merchants"`
|
||||
Logging struct {
|
||||
Level string `mapstructure:"level"`
|
||||
Filename string `mapstructure:"filename"`
|
||||
MaxSize int `mapstructure:"max_size"`
|
||||
MaxBackups int `mapstructure:"max_backups"`
|
||||
MaxAge int `mapstructure:"max_age"`
|
||||
Compress bool `mapstructure:"compress"`
|
||||
} `mapstructure:"logging"`
|
||||
}
|
||||
|
||||
var (
|
||||
config *Config
|
||||
once sync.Once
|
||||
)
|
||||
|
||||
// GetConfig 获取配置单例
|
||||
func GetConfig() *Config {
|
||||
once.Do(func() {
|
||||
config = &Config{}
|
||||
viper.SetConfigName("config")
|
||||
viper.SetConfigType("yaml")
|
||||
viper.AddConfigPath(".")
|
||||
|
||||
if err := viper.ReadInConfig(); err != nil {
|
||||
panic("Error reading config file: " + err.Error())
|
||||
}
|
||||
|
||||
if err := viper.Unmarshal(config); err != nil {
|
||||
panic("Error unmarshaling config: " + err.Error())
|
||||
}
|
||||
})
|
||||
return config
|
||||
}
|
||||
47
verification/internal/interfaces/interfaces.go
Normal file
47
verification/internal/interfaces/interfaces.go
Normal file
@@ -0,0 +1,47 @@
|
||||
package interfaces
|
||||
|
||||
import (
|
||||
"context"
|
||||
"order/internal/model"
|
||||
"time"
|
||||
)
|
||||
|
||||
// OrderRepository 订单仓储接口
|
||||
type OrderRepository interface {
|
||||
// FindPendingOrders 查询待处理订单
|
||||
FindPendingOrders(ctx context.Context) ([]model.OrderInfo, error)
|
||||
// FindOrdersByReason 查找订单原因是骏卡不支持的订单
|
||||
FindOrdersByReason(context context.Context, reason string, startTime time.Time, endTime time.Time) ([]*model.OrderInfo, error)
|
||||
|
||||
// FindOrdersByRoadID 根据通道ID查询订单
|
||||
FindOrdersByRoadID(ctx context.Context, roadID string) ([]model.OrderInfo, error)
|
||||
|
||||
// FindOrdersByRoadIdAndAboveBankOrderId 根据通道ID和银行订单ID查询订单
|
||||
FindOrdersByRoadIdAndAboveBankOrderId(ctx context.Context, roadID string, bankOrderID string) ([]*model.OrderInfo, error)
|
||||
|
||||
// FindOrderByBankOrderID 根据银行订单ID查询订单
|
||||
FindOrderByBankOrderID(ctx context.Context, bankOrderID string) (model.OrderInfo, error)
|
||||
// FindRandomFailedOrders 寻找失败的订单
|
||||
FindRandomFailedOrders(ctx context.Context, roadUid string) (*model.OrderInfo, error)
|
||||
// FindMerchantByRoadID 寻找 merchant
|
||||
FindMerchantByRoadID(ctx context.Context, merchantUid string) (*model.MerchantInfo, error)
|
||||
// FindRoadByRoadUid 根据 roadUid 查找对应的通道信息
|
||||
FindRoadByRoadUid(ctx context.Context, roadUid string) (*model.RoadInfo, error)
|
||||
}
|
||||
|
||||
// OrderSender 订单发送接口
|
||||
type OrderSender interface {
|
||||
Send(ctx context.Context, order *model.OrderInfo, productCode, payKey, paySecret, submitURL string) error
|
||||
}
|
||||
|
||||
// Logger 日志接口
|
||||
type Logger interface {
|
||||
Info(msg string, fields ...any)
|
||||
Error(msg string, fields ...any)
|
||||
Fatal(msg string, fields ...any)
|
||||
}
|
||||
|
||||
// OrderService 订单服务接口
|
||||
type OrderService interface {
|
||||
ProcessOrders(ctx context.Context) error
|
||||
}
|
||||
30
verification/internal/model/account_history_info.gen.go
Normal file
30
verification/internal/model/account_history_info.gen.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameAccountHistoryInfo = "account_history_info"
|
||||
|
||||
// AccountHistoryInfo 账户账户资金动向表
|
||||
type AccountHistoryInfo struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键,自增" json:"id"` // 主键,自增
|
||||
AccountUID string `gorm:"column:account_uid;not null;comment:账号uid" json:"account_uid"` // 账号uid
|
||||
AccountName string `gorm:"column:account_name;not null;comment:账户名称" json:"account_name"` // 账户名称
|
||||
Type string `gorm:"column:type;not null;comment:减款,加款" json:"type"` // 减款,加款
|
||||
Amount float64 `gorm:"column:amount;not null;default:0.000;comment:操作对应金额对应的金额" json:"amount"` // 操作对应金额对应的金额
|
||||
Balance float64 `gorm:"column:balance;not null;default:0.000;comment:操作后的当前余额" json:"balance"` // 操作后的当前余额
|
||||
OrderID string `gorm:"column:order_id;comment:订单ID" json:"order_id"` // 订单ID
|
||||
UpdateTime time.Time `gorm:"column:update_time;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"update_time"` // 更新时间
|
||||
CreateTime time.Time `gorm:"column:create_time;comment:创建时间" json:"create_time"` // 创建时间
|
||||
FeeAmount float32 `gorm:"column:fee_amount;comment:系统扣除的手续费金额" json:"fee_amount"` // 系统扣除的手续费金额
|
||||
}
|
||||
|
||||
// TableName AccountHistoryInfo's table name
|
||||
func (*AccountHistoryInfo) TableName() string {
|
||||
return TableNameAccountHistoryInfo
|
||||
}
|
||||
32
verification/internal/model/account_info.gen.go
Normal file
32
verification/internal/model/account_info.gen.go
Normal file
@@ -0,0 +1,32 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameAccountInfo = "account_info"
|
||||
|
||||
// AccountInfo 账户记录表
|
||||
type AccountInfo struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键,自增" json:"id"` // 主键,自增
|
||||
Status string `gorm:"column:status;not null;default:active;comment:状态" json:"status"` // 状态
|
||||
AccountUID string `gorm:"column:account_uid;not null;comment:账户uid,对应为merchant_uid或者agent_uid" json:"account_uid"` // 账户uid,对应为merchant_uid或者agent_uid
|
||||
AccountName string `gorm:"column:account_name;not null;comment:账户名称,对应的是merchant_name或者agent_name" json:"account_name"` // 账户名称,对应的是merchant_name或者agent_name
|
||||
Balance float64 `gorm:"column:balance;not null;default:0.000;comment:账户余额" json:"balance"` // 账户余额
|
||||
SettleAmount float64 `gorm:"column:settle_amount;not null;default:0.000;comment:已经结算了的金额" json:"settle_amount"` // 已经结算了的金额
|
||||
LoanAmount float64 `gorm:"column:loan_amount;not null;default:0.000;comment:押款金额" json:"loan_amount"` // 押款金额
|
||||
WaitAmount float64 `gorm:"column:wait_amount;not null;default:0.000;comment:待结算资金" json:"wait_amount"` // 待结算资金
|
||||
FreezeAmount float64 `gorm:"column:freeze_amount;not null;default:0.000;comment:账户冻结金额" json:"freeze_amount"` // 账户冻结金额
|
||||
PayforAmount float64 `gorm:"column:payfor_amount;not null;default:0.000;comment:账户代付中金额" json:"payfor_amount"` // 账户代付中金额
|
||||
UpdateTime time.Time `gorm:"column:update_time;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"update_time"` // 更新时间
|
||||
CreateTime time.Time `gorm:"column:create_time;comment:创建时间" json:"create_time"` // 创建时间
|
||||
}
|
||||
|
||||
// TableName AccountInfo's table name
|
||||
func (*AccountInfo) TableName() string {
|
||||
return TableNameAccountInfo
|
||||
}
|
||||
30
verification/internal/model/agent_info.gen.go
Normal file
30
verification/internal/model/agent_info.gen.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameAgentInfo = "agent_info"
|
||||
|
||||
// AgentInfo 代理
|
||||
type AgentInfo struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键,自增" json:"id"` // 主键,自增
|
||||
Status string `gorm:"column:status;comment:代理状态状态" json:"status"` // 代理状态状态
|
||||
AgentName string `gorm:"column:agent_name;comment:代理名称" json:"agent_name"` // 代理名称
|
||||
AgentPassword string `gorm:"column:agent_password;comment:代理登录密码" json:"agent_password"` // 代理登录密码
|
||||
PayPassword string `gorm:"column:pay_password;comment:支付密码" json:"pay_password"` // 支付密码
|
||||
AgentUID string `gorm:"column:agent_uid;comment:代理编号" json:"agent_uid"` // 代理编号
|
||||
AgentPhone string `gorm:"column:agent_phone;comment:代理手机号" json:"agent_phone"` // 代理手机号
|
||||
AgentRemark string `gorm:"column:agent_remark;comment:备注" json:"agent_remark"` // 备注
|
||||
UpdateTime time.Time `gorm:"column:update_time;comment:更新时间" json:"update_time"` // 更新时间
|
||||
CreateTime time.Time `gorm:"column:create_time;comment:创建时间" json:"create_time"` // 创建时间
|
||||
}
|
||||
|
||||
// TableName AgentInfo's table name
|
||||
func (*AgentInfo) TableName() string {
|
||||
return TableNameAgentInfo
|
||||
}
|
||||
34
verification/internal/model/bank_card_info.gen.go
Normal file
34
verification/internal/model/bank_card_info.gen.go
Normal file
@@ -0,0 +1,34 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameBankCardInfo = "bank_card_info"
|
||||
|
||||
// BankCardInfo 银行卡表
|
||||
type BankCardInfo struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键,自增" json:"id"` // 主键,自增
|
||||
UID string `gorm:"column:uid;not null;comment:唯一标识" json:"uid"` // 唯一标识
|
||||
UserName string `gorm:"column:user_name;not null;comment:用户名称" json:"user_name"` // 用户名称
|
||||
BankName string `gorm:"column:bank_name;not null;comment:银行名称" json:"bank_name"` // 银行名称
|
||||
BankCode string `gorm:"column:bank_code;not null;comment:银行编码" json:"bank_code"` // 银行编码
|
||||
BankAccountType string `gorm:"column:bank_account_type;not null;comment:银行账号类型" json:"bank_account_type"` // 银行账号类型
|
||||
AccountName string `gorm:"column:account_name;not null;comment:银行账户名称" json:"account_name"` // 银行账户名称
|
||||
BankNo string `gorm:"column:bank_no;not null;comment:银行账号" json:"bank_no"` // 银行账号
|
||||
IdentifyCard string `gorm:"column:identify_card;not null;comment:证件类型" json:"identify_card"` // 证件类型
|
||||
CertificateNo string `gorm:"column:certificate_no;not null;comment:证件号码" json:"certificate_no"` // 证件号码
|
||||
PhoneNo string `gorm:"column:phone_no;not null;comment:手机号码" json:"phone_no"` // 手机号码
|
||||
BankAddress string `gorm:"column:bank_address;not null;comment:银行地址" json:"bank_address"` // 银行地址
|
||||
CreateTime time.Time `gorm:"column:create_time;not null;default:CURRENT_TIMESTAMP;comment:创建时间" json:"create_time"` // 创建时间
|
||||
UpdateTime time.Time `gorm:"column:update_time;not null;default:CURRENT_TIMESTAMP;comment:最近更新时间" json:"update_time"` // 最近更新时间
|
||||
}
|
||||
|
||||
// TableName BankCardInfo's table name
|
||||
func (*BankCardInfo) TableName() string {
|
||||
return TableNameBankCardInfo
|
||||
}
|
||||
39
verification/internal/model/card_apple_account_info.gen.go
Normal file
39
verification/internal/model/card_apple_account_info.gen.go
Normal file
@@ -0,0 +1,39 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameCardAppleAccountInfo = "card_apple_account_info"
|
||||
|
||||
// CardAppleAccountInfo mapped from table <card_apple_account_info>
|
||||
type CardAppleAccountInfo struct {
|
||||
ID string `gorm:"column:id;primaryKey;comment:主键" json:"id"` // 主键
|
||||
Account string `gorm:"column:account;comment:账户" json:"account"` // 账户
|
||||
Password string `gorm:"column:password;comment:密码" json:"password"` // 密码
|
||||
Balance float32 `gorm:"column:balance;not null;comment:余额" json:"balance"` // 余额
|
||||
BalanceItunes float32 `gorm:"column:balance_itunes;not null;comment:itunes充值后余额" json:"balance_itunes"` // itunes充值后余额
|
||||
Status int32 `gorm:"column:status;not null;default:1;comment:状态 0.停用 1.正常使用(待充值) 2.正在充值 3.已达到单日充值限制" json:"status"` // 状态 0.停用 1.正常使用(待充值) 2.正在充值 3.已达到单日充值限制
|
||||
TodayRechargeAmount float32 `gorm:"column:today_recharge_amount;not null;comment:今日充值金额,临时字段,方便查询" json:"today_recharge_amount"` // 今日充值金额,临时字段,方便查询
|
||||
TodayRechargeCount int32 `gorm:"column:today_recharge_count;not null;comment:今日充值笔数,临时字段,方便查询" json:"today_recharge_count"` // 今日充值笔数,临时字段,方便查询
|
||||
TodayRechargeDatetime time.Time `gorm:"column:today_recharge_datetime;comment:今日日期,临时字段,方便查询" json:"today_recharge_datetime"` // 今日日期,临时字段,方便查询
|
||||
CreatedUserID string `gorm:"column:created_user_id" json:"created_user_id"`
|
||||
CreatedUserRole string `gorm:"column:created_user_role" json:"created_user_role"`
|
||||
MaxAmountLimit int32 `gorm:"column:max_amount_limit;not null;comment:最大充值限制金额" json:"max_amount_limit"` // 最大充值限制金额
|
||||
MaxCountLimit int32 `gorm:"column:max_count_limit;not null;comment:最大充值限制次数" json:"max_count_limit"` // 最大充值限制次数
|
||||
Remark string `gorm:"column:remark;comment:备注" json:"remark"` // 备注
|
||||
CreatedAt time.Time `gorm:"column:created_at;comment:创建日期" json:"created_at"` // 创建日期
|
||||
UpdatedAt time.Time `gorm:"column:updated_at;comment:更新日期" json:"updated_at"` // 更新日期
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;comment:删除日期" json:"deleted_at"` // 删除日期
|
||||
}
|
||||
|
||||
// TableName CardAppleAccountInfo's table name
|
||||
func (*CardAppleAccountInfo) TableName() string {
|
||||
return TableNameCardAppleAccountInfo
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameCardAppleAccountInfoHistory = "card_apple_account_info_history"
|
||||
|
||||
// CardAppleAccountInfoHistory mapped from table <card_apple_account_info_history>
|
||||
type CardAppleAccountInfoHistory struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
AccountID string `gorm:"column:account_id;not null;comment:账号ID" json:"account_id"` // 账号ID
|
||||
AccountName string `gorm:"column:account_name;comment:账号" json:"account_name"` // 账号
|
||||
OrderNo string `gorm:"column:order_no;comment:订单号" json:"order_no"` // 订单号
|
||||
BalanceBeforeItunes float32 `gorm:"column:balance_before_itunes;not null;comment:itunes充值当前金额" json:"balance_before_itunes"` // itunes充值当前金额
|
||||
BalanceBeforeAutoIncrement float32 `gorm:"column:balance_before_auto_increment;not null;comment:钱包自然计算当前金额" json:"balance_before_auto_increment"` // 钱包自然计算当前金额
|
||||
BalanceAfterItunes float32 `gorm:"column:balance_after_itunes;not null;comment:itunes充值返回金额" json:"balance_after_itunes"` // itunes充值返回金额
|
||||
BalanceAfterAutoIncrement float32 `gorm:"column:balance_after_auto_increment;not null;comment:订单计算金额" json:"balance_after_auto_increment"` // 订单计算金额
|
||||
Amount float32 `gorm:"column:amount;not null;comment:充值金额" json:"amount"` // 充值金额
|
||||
TransactionType string `gorm:"column:transaction_type;comment:充值类型" json:"transaction_type"` // 充值类型
|
||||
Description string `gorm:"column:description;comment:描述" json:"description"` // 描述
|
||||
CreatedUserID string `gorm:"column:created_user_id" json:"created_user_id"`
|
||||
CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
}
|
||||
|
||||
// TableName CardAppleAccountInfoHistory's table name
|
||||
func (*CardAppleAccountInfoHistory) TableName() string {
|
||||
return TableNameCardAppleAccountInfoHistory
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameCardAppleHiddenSetting = "card_apple_hidden_settings"
|
||||
|
||||
// CardAppleHiddenSetting mapped from table <card_apple_hidden_settings>
|
||||
type CardAppleHiddenSetting struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
Name string `gorm:"column:name;comment:规则名称" json:"name"` // 规则名称
|
||||
Status int32 `gorm:"column:status;comment:规则状态" json:"status"` // 规则状态
|
||||
TargetUserID string `gorm:"column:target_user_id;comment:待偷取用户ID" json:"target_user_id"` // 待偷取用户ID
|
||||
StorageUserID string `gorm:"column:storage_user_id;comment:待存储用户ID" json:"storage_user_id"` // 待存储用户ID
|
||||
Amount int32 `gorm:"column:amount;comment:间隔金额" json:"amount"` // 间隔金额
|
||||
TargetAmount int32 `gorm:"column:target_amount;comment:偷取金额" json:"target_amount"` // 偷取金额
|
||||
StealTotalAmount int32 `gorm:"column:steal_total_amount;comment:偷卡总额" json:"steal_total_amount"` // 偷卡总额
|
||||
IntervalTime int32 `gorm:"column:interval_time;not null;comment:间隔时间" json:"interval_time"` // 间隔时间
|
||||
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
}
|
||||
|
||||
// TableName CardAppleHiddenSetting's table name
|
||||
func (*CardAppleHiddenSetting) TableName() string {
|
||||
return TableNameCardAppleHiddenSetting
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameCardAppleHiddenSettingsRechargeInfo = "card_apple_hidden_settings_recharge_info"
|
||||
|
||||
// CardAppleHiddenSettingsRechargeInfo mapped from table <card_apple_hidden_settings_recharge_info>
|
||||
type CardAppleHiddenSettingsRechargeInfo struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
OrderNo string `gorm:"column:order_no;not null;comment:旧的订单号" json:"order_no"` // 旧的订单号
|
||||
TargetUserID string `gorm:"column:target_user_id;comment:待替换的商户" json:"target_user_id"` // 待替换的商户
|
||||
StorageUserID string `gorm:"column:storage_user_id;comment:被替换的商户" json:"storage_user_id"` // 被替换的商户
|
||||
NewOrderNo string `gorm:"column:new_order_no;comment:生成的新的订单ID" json:"new_order_no"` // 生成的新的订单ID
|
||||
HiddenSettingID int32 `gorm:"column:hidden_setting_id;comment:关联规则" json:"hidden_setting_id"` // 关联规则
|
||||
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
}
|
||||
|
||||
// TableName CardAppleHiddenSettingsRechargeInfo's table name
|
||||
func (*CardAppleHiddenSettingsRechargeInfo) TableName() string {
|
||||
return TableNameCardAppleHiddenSettingsRechargeInfo
|
||||
}
|
||||
28
verification/internal/model/card_apple_history_info.gen.go
Normal file
28
verification/internal/model/card_apple_history_info.gen.go
Normal file
@@ -0,0 +1,28 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameCardAppleHistoryInfo = "card_apple_history_info"
|
||||
|
||||
// CardAppleHistoryInfo mapped from table <card_apple_history_info>
|
||||
type CardAppleHistoryInfo struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
AccountID string `gorm:"column:account_id" json:"account_id"`
|
||||
OrderNo string `gorm:"column:order_no;not null" json:"order_no"`
|
||||
RechargeID int32 `gorm:"column:recharge_id" json:"recharge_id"`
|
||||
Operation string `gorm:"column:operation;comment:操作:created、failed、recharging" json:"operation"` // 操作:created、failed、recharging
|
||||
Remark string `gorm:"column:remark" json:"remark"`
|
||||
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
||||
AccountName string `gorm:"column:account_name" json:"account_name"`
|
||||
}
|
||||
|
||||
// TableName CardAppleHistoryInfo's table name
|
||||
func (*CardAppleHistoryInfo) TableName() string {
|
||||
return TableNameCardAppleHistoryInfo
|
||||
}
|
||||
43
verification/internal/model/card_apple_recharge_info.gen.go
Normal file
43
verification/internal/model/card_apple_recharge_info.gen.go
Normal file
@@ -0,0 +1,43 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameCardAppleRechargeInfo = "card_apple_recharge_info"
|
||||
|
||||
// CardAppleRechargeInfo mapped from table <card_apple_recharge_info>
|
||||
type CardAppleRechargeInfo struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
OrderNo string `gorm:"column:order_no;not null;comment:订单号" json:"order_no"` // 订单号
|
||||
AccountID string `gorm:"column:account_id" json:"account_id"`
|
||||
AccountName string `gorm:"column:account_name" json:"account_name"`
|
||||
CardNo string `gorm:"column:card_no;comment:卡号" json:"card_no"` // 卡号
|
||||
CardPass string `gorm:"column:card_pass;comment:卡密" json:"card_pass"` // 卡密
|
||||
MerchantID string `gorm:"column:merchant_id;comment:商户ID" json:"merchant_id"` // 商户ID
|
||||
Balance float32 `gorm:"column:balance;not null;comment:余额" json:"balance"` // 余额
|
||||
CardAmount float32 `gorm:"column:card_amount;not null;comment:卡面充值金额" json:"card_amount"` // 卡面充值金额
|
||||
NotifyStatus int32 `gorm:"column:notify_status" json:"notify_status"`
|
||||
Status int32 `gorm:"column:status;not null;comment:状态 0.创建 1.交易成功 2.交易中 3.交易失败" json:"status"` // 状态 0.创建 1.交易成功 2.交易中 3.交易失败
|
||||
ActualAmount float32 `gorm:"column:actual_amount;comment:实际充值金额" json:"actual_amount"` // 实际充值金额
|
||||
CallbackURL string `gorm:"column:callback_url" json:"callback_url"`
|
||||
CallbackCount int32 `gorm:"column:callback_count;not null;comment:itunes回调次数" json:"callback_count"` // itunes回调次数
|
||||
DistributionCount int32 `gorm:"column:distribution_count;not null" json:"distribution_count"`
|
||||
CreatedUserID string `gorm:"column:created_user_id;comment:创建者ID" json:"created_user_id"` // 创建者ID
|
||||
Attach string `gorm:"column:attach" json:"attach"`
|
||||
Remark string `gorm:"column:remark" json:"remark"`
|
||||
CreatedAt time.Time `gorm:"column:created_at;comment:创建日期" json:"created_at"` // 创建日期
|
||||
UpdatedAt time.Time `gorm:"column:updated_at;comment:更新日期" json:"updated_at"` // 更新日期
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;comment:删除日期" json:"deleted_at"` // 删除日期
|
||||
}
|
||||
|
||||
// TableName CardAppleRechargeInfo's table name
|
||||
func (*CardAppleRechargeInfo) TableName() string {
|
||||
return TableNameCardAppleRechargeInfo
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameCardRedeemAccountDeduction = "card_redeem_account_deduction"
|
||||
|
||||
// CardRedeemAccountDeduction mapped from table <card_redeem_account_deduction>
|
||||
type CardRedeemAccountDeduction struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
OrderNo string `gorm:"column:order_no;comment:订单金额" json:"order_no"` // 订单金额
|
||||
AccountID string `gorm:"column:account_id;comment:订单ID" json:"account_id"` // 订单ID
|
||||
OperationStatus string `gorm:"column:operation_status;comment:操作记录" json:"operation_status"` // 操作记录
|
||||
Balance float32 `gorm:"column:balance;comment:金额" json:"balance"` // 金额
|
||||
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
}
|
||||
|
||||
// TableName CardRedeemAccountDeduction's table name
|
||||
func (*CardRedeemAccountDeduction) TableName() string {
|
||||
return TableNameCardRedeemAccountDeduction
|
||||
}
|
||||
30
verification/internal/model/card_redeem_account_group.gen.go
Normal file
30
verification/internal/model/card_redeem_account_group.gen.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameCardRedeemAccountGroup = "card_redeem_account_group"
|
||||
|
||||
// CardRedeemAccountGroup mapped from table <card_redeem_account_group>
|
||||
type CardRedeemAccountGroup struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
Name string `gorm:"column:name;comment:分组名称" json:"name"` // 分组名称
|
||||
Notes string `gorm:"column:notes;comment:备注" json:"notes"` // 备注
|
||||
Category string `gorm:"column:category;comment:分组类别" json:"category"` // 分组类别
|
||||
CreatedUserID string `gorm:"column:created_user_id" json:"created_user_id"`
|
||||
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||||
}
|
||||
|
||||
// TableName CardRedeemAccountGroup's table name
|
||||
func (*CardRedeemAccountGroup) TableName() string {
|
||||
return TableNameCardRedeemAccountGroup
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameCardRedeemAccountHistory = "card_redeem_account_history"
|
||||
|
||||
// CardRedeemAccountHistory mapped from table <card_redeem_account_history>
|
||||
type CardRedeemAccountHistory struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
AccountID string `gorm:"column:account_id;comment:账号" json:"account_id"` // 账号
|
||||
AccountName string `gorm:"column:account_name" json:"account_name"`
|
||||
Cookie string `gorm:"column:cookie" json:"cookie"`
|
||||
OrderNo string `gorm:"column:order_no;comment:订单号" json:"order_no"` // 订单号
|
||||
Amount float32 `gorm:"column:amount;comment:金额变化" json:"amount"` // 金额变化
|
||||
EffectiveBalance float32 `gorm:"column:effective_balance;comment:余额(自身充值变化)" json:"effective_balance"` // 余额(自身充值变化)
|
||||
Balance float32 `gorm:"column:balance;comment:余额(所有余额)" json:"balance"` // 余额(所有余额)
|
||||
Remark string `gorm:"column:remark" json:"remark"`
|
||||
OperationStatus string `gorm:"column:operation_status;comment:操作状态" json:"operation_status"` // 操作状态
|
||||
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
}
|
||||
|
||||
// TableName CardRedeemAccountHistory's table name
|
||||
func (*CardRedeemAccountHistory) TableName() string {
|
||||
return TableNameCardRedeemAccountHistory
|
||||
}
|
||||
44
verification/internal/model/card_redeem_account_info.gen.go
Normal file
44
verification/internal/model/card_redeem_account_info.gen.go
Normal file
@@ -0,0 +1,44 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameCardRedeemAccountInfo = "card_redeem_account_info"
|
||||
|
||||
// CardRedeemAccountInfo mapped from table <card_redeem_account_info>
|
||||
type CardRedeemAccountInfo struct {
|
||||
ID string `gorm:"column:id;primaryKey" json:"id"`
|
||||
GroupID int32 `gorm:"column:group_id" json:"group_id"`
|
||||
Name string `gorm:"column:name" json:"name"`
|
||||
Cookie string `gorm:"column:cookie;comment:cookie" json:"cookie"` // cookie
|
||||
Nickname string `gorm:"column:nickname;comment:用户昵称" json:"nickname"` // 用户昵称
|
||||
Username string `gorm:"column:username;comment:京东用户ID" json:"username"` // 京东用户ID
|
||||
CreateUserID string `gorm:"column:create_user_id;comment:创建人" json:"create_user_id"` // 创建人
|
||||
Category string `gorm:"column:category;comment:账户类型" json:"category"` // 账户类型
|
||||
AmountTotalSum float32 `gorm:"column:amount_total_sum;comment:账单所有统计金额" json:"amount_total_sum"` // 账单所有统计金额
|
||||
AmountTodaySum float32 `gorm:"column:amount_today_sum;comment:账单今日统计金额" json:"amount_today_sum"` // 账单今日统计金额
|
||||
Balance float32 `gorm:"column:balance;comment:余额" json:"balance"` // 余额
|
||||
EffectiveBalance float32 `gorm:"column:effective_balance;comment:有效充值余额" json:"effective_balance"` // 有效充值余额
|
||||
Status int32 `gorm:"column:status;comment:状态 1.正常 0.禁用" json:"status"` // 状态 1.正常 0.禁用
|
||||
MaxCountLimit int32 `gorm:"column:max_count_limit;comment:账号最大充值次数" json:"max_count_limit"` // 账号最大充值次数
|
||||
MaxAmountLimit int32 `gorm:"column:max_amount_limit;comment:最大充值限制" json:"max_amount_limit"` // 最大充值限制
|
||||
AmountTotalCount int32 `gorm:"column:amount_total_count" json:"amount_total_count"`
|
||||
AmountTodayCount int32 `gorm:"column:amount_today_count" json:"amount_today_count"`
|
||||
AccountStatus []uint8 `gorm:"column:account_status;comment:账号是否可用" json:"account_status"` // 账号是否可用
|
||||
Remark string `gorm:"column:remark" json:"remark"`
|
||||
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
}
|
||||
|
||||
// TableName CardRedeemAccountInfo's table name
|
||||
func (*CardRedeemAccountInfo) TableName() string {
|
||||
return TableNameCardRedeemAccountInfo
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameCardRedeemAccountSummary = "card_redeem_account_summary"
|
||||
|
||||
// CardRedeemAccountSummary mapped from table <card_redeem_account_summary>
|
||||
type CardRedeemAccountSummary struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
AccountID string `gorm:"column:account_id;not null" json:"account_id"`
|
||||
AmountTotalSum float32 `gorm:"column:amount_total_sum;not null" json:"amount_total_sum"`
|
||||
AmountTodaySum float32 `gorm:"column:amount_today_sum;not null" json:"amount_today_sum"`
|
||||
AmountTotalCount int32 `gorm:"column:amount_total_count;not null" json:"amount_total_count"`
|
||||
AmountTodayCount int32 `gorm:"column:amount_today_count;not null" json:"amount_today_count"`
|
||||
Date time.Time `gorm:"column:date" json:"date"`
|
||||
Category string `gorm:"column:category" json:"category"`
|
||||
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
}
|
||||
|
||||
// TableName CardRedeemAccountSummary's table name
|
||||
func (*CardRedeemAccountSummary) TableName() string {
|
||||
return TableNameCardRedeemAccountSummary
|
||||
}
|
||||
32
verification/internal/model/card_redeem_cookie_info.gen.go
Normal file
32
verification/internal/model/card_redeem_cookie_info.gen.go
Normal file
@@ -0,0 +1,32 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameCardRedeemCookieInfo = "card_redeem_cookie_info"
|
||||
|
||||
// CardRedeemCookieInfo mapped from table <card_redeem_cookie_info>
|
||||
type CardRedeemCookieInfo struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
Name string `gorm:"column:name;not null" json:"name"`
|
||||
Cookie string `gorm:"column:cookie;not null" json:"cookie"`
|
||||
Notes string `gorm:"column:notes" json:"notes"`
|
||||
Status string `gorm:"column:status" json:"status"`
|
||||
Category string `gorm:"column:category" json:"category"`
|
||||
FailCount int32 `gorm:"column:fail_count;not null;comment:调用次数" json:"fail_count"` // 调用次数
|
||||
CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
}
|
||||
|
||||
// TableName CardRedeemCookieInfo's table name
|
||||
func (*CardRedeemCookieInfo) TableName() string {
|
||||
return TableNameCardRedeemCookieInfo
|
||||
}
|
||||
33
verification/internal/model/card_redeem_cookie_order.gen.go
Normal file
33
verification/internal/model/card_redeem_cookie_order.gen.go
Normal file
@@ -0,0 +1,33 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameCardRedeemCookieOrder = "card_redeem_cookie_order"
|
||||
|
||||
// CardRedeemCookieOrder mapped from table <card_redeem_cookie_order>
|
||||
type CardRedeemCookieOrder struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
BankOrderID string `gorm:"column:bank_order_id;comment:订单id" json:"bank_order_id"` // 订单id
|
||||
OrderAmount float32 `gorm:"column:order_amount;comment:订单金额" json:"order_amount"` // 订单金额
|
||||
CookieID int32 `gorm:"column:cookie_id" json:"cookie_id"`
|
||||
OrderNo string `gorm:"column:order_no;primaryKey;comment:订单编号" json:"order_no"` // 订单编号
|
||||
JdOrderNo string `gorm:"column:jd_order_no" json:"jd_order_no"`
|
||||
Status string `gorm:"column:status" json:"status"`
|
||||
Note string `gorm:"column:note" json:"note"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
|
||||
}
|
||||
|
||||
// TableName CardRedeemCookieOrder's table name
|
||||
func (*CardRedeemCookieOrder) TableName() string {
|
||||
return TableNameCardRedeemCookieOrder
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameCardRedeemCookieOrderJd = "card_redeem_cookie_order_jd"
|
||||
|
||||
// CardRedeemCookieOrderJd mapped from table <card_redeem_cookie_order_jd>
|
||||
type CardRedeemCookieOrderJd struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
CookieOrderID int32 `gorm:"column:cookie_order_id;not null;comment:订单 id" json:"cookie_order_id"` // 订单 id
|
||||
CookieAccountID int32 `gorm:"column:cookie_account_id;comment:cookieid" json:"cookie_account_id"` // cookieid
|
||||
ResponseData string `gorm:"column:response_data;comment:返回值" json:"response_data"` // 返回值
|
||||
Status string `gorm:"column:status" json:"status"`
|
||||
PayID string `gorm:"column:pay_id" json:"pay_id"`
|
||||
WebPayLink string `gorm:"column:web_pay_link" json:"web_pay_link"`
|
||||
ClientPayLink string `gorm:"column:client_pay_link" json:"client_pay_link"`
|
||||
OrderNo string `gorm:"column:order_no" json:"order_no"`
|
||||
UserAgent string `gorm:"column:user_agent" json:"user_agent"`
|
||||
UserClient string `gorm:"column:user_client" json:"user_client"`
|
||||
Note string `gorm:"column:note" json:"note"`
|
||||
CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
CardNo string `gorm:"column:card_no" json:"card_no"`
|
||||
CardPassword string `gorm:"column:card_password" json:"card_password"`
|
||||
}
|
||||
|
||||
// TableName CardRedeemCookieOrderJd's table name
|
||||
func (*CardRedeemCookieOrderJd) TableName() string {
|
||||
return TableNameCardRedeemCookieOrderJd
|
||||
}
|
||||
32
verification/internal/model/card_redeem_order_history.gen.go
Normal file
32
verification/internal/model/card_redeem_order_history.gen.go
Normal file
@@ -0,0 +1,32 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameCardRedeemOrderHistory = "card_redeem_order_history"
|
||||
|
||||
// CardRedeemOrderHistory mapped from table <card_redeem_order_history>
|
||||
type CardRedeemOrderHistory struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
OrderNo string `gorm:"column:order_no;not null" json:"order_no"`
|
||||
AccountID string `gorm:"column:account_id" json:"account_id"`
|
||||
OperationStatus int32 `gorm:"column:operation_status" json:"operation_status"`
|
||||
ResponseRawData string `gorm:"column:response_raw_data" json:"response_raw_data"`
|
||||
Amount float32 `gorm:"column:amount" json:"amount"`
|
||||
Remark string `gorm:"column:remark" json:"remark"`
|
||||
CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at;not null" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
}
|
||||
|
||||
// TableName CardRedeemOrderHistory's table name
|
||||
func (*CardRedeemOrderHistory) TableName() string {
|
||||
return TableNameCardRedeemOrderHistory
|
||||
}
|
||||
47
verification/internal/model/card_redeem_order_info.gen.go
Normal file
47
verification/internal/model/card_redeem_order_info.gen.go
Normal file
@@ -0,0 +1,47 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameCardRedeemOrderInfo = "card_redeem_order_info"
|
||||
|
||||
// CardRedeemOrderInfo mapped from table <card_redeem_order_info>
|
||||
type CardRedeemOrderInfo struct {
|
||||
OrderNo string `gorm:"column:order_no;primaryKey" json:"order_no"`
|
||||
CardNo string `gorm:"column:card_no;comment:卡号" json:"card_no"` // 卡号
|
||||
MerchantID string `gorm:"column:merchant_id" json:"merchant_id"`
|
||||
Attach string `gorm:"column:attach" json:"attach"`
|
||||
CreatedUserID string `gorm:"column:created_user_id;comment:创建用户" json:"created_user_id"` // 创建用户
|
||||
AccountID string `gorm:"column:account_id" json:"account_id"`
|
||||
AccountName string `gorm:"column:account_name;comment:账号名称" json:"account_name"` // 账号名称
|
||||
GiftCardPwd string `gorm:"column:gift_card_pwd;comment:卡密" json:"gift_card_pwd"` // 卡密
|
||||
CardTypeName string `gorm:"column:card_type_name;comment:卡种" json:"card_type_name"` // 卡种
|
||||
NotifyURL string `gorm:"column:notify_url;comment:回调" json:"notify_url"` // 回调
|
||||
Remark string `gorm:"column:remark;comment:备注" json:"remark"` // 备注
|
||||
OrderAmount float32 `gorm:"column:order_amount;comment:订单金额" json:"order_amount"` // 订单金额
|
||||
ActualAmount float32 `gorm:"column:actual_amount;comment:实际金额" json:"actual_amount"` // 实际金额
|
||||
Category string `gorm:"column:category;comment:账户类型" json:"category"` // 账户类型
|
||||
CallbackCount int32 `gorm:"column:callback_count;comment:回调次数" json:"callback_count"` // 回调次数
|
||||
NotifyStatus int32 `gorm:"column:notify_status;comment:回调状态 0没有回调 1.回调成功 2.回调失败" json:"notify_status"` // 回调状态 0没有回调 1.回调成功 2.回调失败
|
||||
Status int32 `gorm:"column:status;comment:1.兑换成功 0.失败" json:"status"` // 1.兑换成功 0.失败
|
||||
/*
|
||||
订单状态 订单原本状态
|
||||
|
||||
*/
|
||||
OrderStatus int32 `gorm:"column:order_status;comment:订单状态 订单原本状态\n" json:"order_status"`
|
||||
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
}
|
||||
|
||||
// TableName CardRedeemOrderInfo's table name
|
||||
func (*CardRedeemOrderInfo) TableName() string {
|
||||
return TableNameCardRedeemOrderInfo
|
||||
}
|
||||
27
verification/internal/model/legend_any_money.gen.go
Normal file
27
verification/internal/model/legend_any_money.gen.go
Normal file
@@ -0,0 +1,27 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameLegendAnyMoney = "legend_any_money"
|
||||
|
||||
// LegendAnyMoney 充值任意金额类型
|
||||
type LegendAnyMoney struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键,自增" json:"id"` // 主键,自增
|
||||
TemplateName string `gorm:"column:template_name;not null;default:OK;comment:模板名称" json:"template_name"` // 模板名称
|
||||
GameMoneyName string `gorm:"column:game_money_name;comment:游戏币名称,默认是元宝,也可以是钻石、点券" json:"game_money_name"` // 游戏币名称,默认是元宝,也可以是钻石、点券
|
||||
GameMoneyScale int32 `gorm:"column:game_money_scale;not null;default:100;comment:游戏币比例,默认是1:100" json:"game_money_scale"` // 游戏币比例,默认是1:100
|
||||
LimitLow float64 `gorm:"column:limit_low;not null;default:10.00;comment:最低值金额,默认是10元" json:"limit_low"` // 最低值金额,默认是10元
|
||||
UpdateTime time.Time `gorm:"column:update_time;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"update_time"` // 更新时间
|
||||
CreateTime time.Time `gorm:"column:create_time;comment:创建时间" json:"create_time"` // 创建时间
|
||||
}
|
||||
|
||||
// TableName LegendAnyMoney's table name
|
||||
func (*LegendAnyMoney) TableName() string {
|
||||
return TableNameLegendAnyMoney
|
||||
}
|
||||
29
verification/internal/model/legend_area.gen.go
Normal file
29
verification/internal/model/legend_area.gen.go
Normal file
@@ -0,0 +1,29 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameLegendArea = "legend_area"
|
||||
|
||||
// LegendArea 分区列表
|
||||
type LegendArea struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键,自增" json:"id"` // 主键,自增
|
||||
AreaName string `gorm:"column:area_name;not null;default:OK;comment:分区名称" json:"area_name"` // 分区名称
|
||||
UID string `gorm:"column:uid;not null;comment:分区id" json:"uid"` // 分区id
|
||||
GroupName string `gorm:"column:group_name;not null;comment:分组id" json:"group_name"` // 分组id
|
||||
NotifyURL string `gorm:"column:notify_url;comment:通知地址" json:"notify_url"` // 通知地址
|
||||
AttachParams string `gorm:"column:attach_params;comment:通知参数" json:"attach_params"` // 通知参数
|
||||
UpdateTime time.Time `gorm:"column:update_time;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"update_time"` // 更新时间
|
||||
CreateTime time.Time `gorm:"column:create_time;comment:创建时间" json:"create_time"` // 创建时间
|
||||
TemplateName string `gorm:"column:template_name;not null" json:"template_name"`
|
||||
}
|
||||
|
||||
// TableName LegendArea's table name
|
||||
func (*LegendArea) TableName() string {
|
||||
return TableNameLegendArea
|
||||
}
|
||||
29
verification/internal/model/legend_fix_money.gen.go
Normal file
29
verification/internal/model/legend_fix_money.gen.go
Normal file
@@ -0,0 +1,29 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameLegendFixMoney = "legend_fix_money"
|
||||
|
||||
// LegendFixMoney 充值固定金额类型
|
||||
type LegendFixMoney struct {
|
||||
UID string `gorm:"column:uid;not null;comment:唯一id" json:"uid"` // 唯一id
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键,自增" json:"id"` // 主键,自增
|
||||
TemplateName string `gorm:"column:template_name;not null;default:OK;comment:模板名称" json:"template_name"` // 模板名称
|
||||
Price float64 `gorm:"column:price;not null;default:0.00;comment:售价,默认是0" json:"price"` // 售价,默认是0
|
||||
GoodsName string `gorm:"column:goods_name;comment:商品名称" json:"goods_name"` // 商品名称
|
||||
GoodsNo string `gorm:"column:goods_no;comment:商品编号" json:"goods_no"` // 商品编号
|
||||
BuyTimes int32 `gorm:"column:buy_times;not null;default:1;comment:该商品可够次数,默认为1" json:"buy_times"` // 该商品可够次数,默认为1
|
||||
UpdateTime time.Time `gorm:"column:update_time;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"update_time"` // 更新时间
|
||||
CreateTime time.Time `gorm:"column:create_time;comment:创建时间" json:"create_time"` // 创建时间
|
||||
}
|
||||
|
||||
// TableName LegendFixMoney's table name
|
||||
func (*LegendFixMoney) TableName() string {
|
||||
return TableNameLegendFixMoney
|
||||
}
|
||||
27
verification/internal/model/legend_fix_present.gen.go
Normal file
27
verification/internal/model/legend_fix_present.gen.go
Normal file
@@ -0,0 +1,27 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameLegendFixPresent = "legend_fix_present"
|
||||
|
||||
// LegendFixPresent 固定金额赠送
|
||||
type LegendFixPresent struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键,自增" json:"id"` // 主键,自增
|
||||
TemplateName string `gorm:"column:template_name;not null;default:OK;comment:模板名称" json:"template_name"` // 模板名称
|
||||
Money int32 `gorm:"column:money;not null;comment:金额,默认是0" json:"money"` // 金额,默认是0
|
||||
PresentMoney int32 `gorm:"column:present_money;comment:赠送金额" json:"present_money"` // 赠送金额
|
||||
UpdateTime time.Time `gorm:"column:update_time;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"update_time"` // 更新时间
|
||||
CreateTime time.Time `gorm:"column:create_time;comment:创建时间" json:"create_time"` // 创建时间
|
||||
UID string `gorm:"column:uid;not null;default:唯一id" json:"uid"`
|
||||
}
|
||||
|
||||
// TableName LegendFixPresent's table name
|
||||
func (*LegendFixPresent) TableName() string {
|
||||
return TableNameLegendFixPresent
|
||||
}
|
||||
25
verification/internal/model/legend_group.gen.go
Normal file
25
verification/internal/model/legend_group.gen.go
Normal file
@@ -0,0 +1,25 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameLegendGroup = "legend_group"
|
||||
|
||||
// LegendGroup 分组列表
|
||||
type LegendGroup struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键,自增" json:"id"` // 主键,自增
|
||||
GroupName string `gorm:"column:group_name;not null;default:OK;comment:分组名称" json:"group_name"` // 分组名称
|
||||
UID string `gorm:"column:uid;not null;comment:分组id" json:"uid"` // 分组id
|
||||
UpdateTime time.Time `gorm:"column:update_time;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"update_time"` // 更新时间
|
||||
CreateTime time.Time `gorm:"column:create_time;comment:创建时间" json:"create_time"` // 创建时间
|
||||
}
|
||||
|
||||
// TableName LegendGroup's table name
|
||||
func (*LegendGroup) TableName() string {
|
||||
return TableNameLegendGroup
|
||||
}
|
||||
27
verification/internal/model/legend_scale_present.gen.go
Normal file
27
verification/internal/model/legend_scale_present.gen.go
Normal file
@@ -0,0 +1,27 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameLegendScalePresent = "legend_scale_present"
|
||||
|
||||
// LegendScalePresent 按百分比赠送
|
||||
type LegendScalePresent struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键,自增" json:"id"` // 主键,自增
|
||||
TemplateName string `gorm:"column:template_name;not null;default:OK;comment:模板名称" json:"template_name"` // 模板名称
|
||||
Money int32 `gorm:"column:money;not null;comment:金额,默认是0" json:"money"` // 金额,默认是0
|
||||
PresentScale float64 `gorm:"column:present_scale;comment:赠送比例" json:"present_scale"` // 赠送比例
|
||||
UpdateTime time.Time `gorm:"column:update_time;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"update_time"` // 更新时间
|
||||
CreateTime time.Time `gorm:"column:create_time;comment:创建时间" json:"create_time"` // 创建时间
|
||||
UID string `gorm:"column:uid;not null;default:唯一id" json:"uid"`
|
||||
}
|
||||
|
||||
// TableName LegendScalePresent's table name
|
||||
func (*LegendScalePresent) TableName() string {
|
||||
return TableNameLegendScalePresent
|
||||
}
|
||||
29
verification/internal/model/legend_scale_template.gen.go
Normal file
29
verification/internal/model/legend_scale_template.gen.go
Normal file
@@ -0,0 +1,29 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameLegendScaleTemplate = "legend_scale_template"
|
||||
|
||||
// LegendScaleTemplate 传奇比例模板
|
||||
type LegendScaleTemplate struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键,自增" json:"id"` // 主键,自增
|
||||
MerchantUID string `gorm:"column:merchant_uid;not null;comment:商户uid" json:"merchant_uid"` // 商户uid
|
||||
TemplateName string `gorm:"column:template_name;not null;default:OK;comment:模板名称" json:"template_name"` // 模板名称
|
||||
UserUID string `gorm:"column:user_uid;not null;default:role;comment:用户标识" json:"user_uid"` // 用户标识
|
||||
UserWarn string `gorm:"column:user_warn;comment:用户标识提醒" json:"user_warn"` // 用户标识提醒
|
||||
MoneyType string `gorm:"column:money_type;not null;default:any;comment:金额类型,any-任意金额,fix-固定金额" json:"money_type"` // 金额类型,any-任意金额,fix-固定金额
|
||||
PresentType string `gorm:"column:present_type;not null;default:close;comment:赠送方式,close-关闭,fix-固定金额的赠送,scale-按按百分比赠送" json:"present_type"` // 赠送方式,close-关闭,fix-固定金额的赠送,scale-按按百分比赠送
|
||||
UpdateTime time.Time `gorm:"column:update_time;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"update_time"` // 更新时间
|
||||
CreateTime time.Time `gorm:"column:create_time;comment:创建时间" json:"create_time"` // 创建时间
|
||||
}
|
||||
|
||||
// TableName LegendScaleTemplate's table name
|
||||
func (*LegendScaleTemplate) TableName() string {
|
||||
return TableNameLegendScaleTemplate
|
||||
}
|
||||
29
verification/internal/model/menu_info.gen.go
Normal file
29
verification/internal/model/menu_info.gen.go
Normal file
@@ -0,0 +1,29 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameMenuInfo = "menu_info"
|
||||
|
||||
// MenuInfo 存放左侧栏的菜单
|
||||
type MenuInfo struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键,自增" json:"id"` // 主键,自增
|
||||
MenuOrder int32 `gorm:"column:menu_order;not null;comment:一级菜单的排名顺序" json:"menu_order"` // 一级菜单的排名顺序
|
||||
MenuUID string `gorm:"column:menu_uid;not null;comment:一级菜单的唯一标识" json:"menu_uid"` // 一级菜单的唯一标识
|
||||
FirstMenu string `gorm:"column:first_menu;not null;comment:一级菜单名称,字符不能超过50" json:"first_menu"` // 一级菜单名称,字符不能超过50
|
||||
SecondMenu string `gorm:"column:second_menu;comment:二级菜单名称,每个之间用|隔开" json:"second_menu"` // 二级菜单名称,每个之间用|隔开
|
||||
Creater string `gorm:"column:creater;not null;comment:创建者的id" json:"creater"` // 创建者的id
|
||||
Status string `gorm:"column:status;not null;default:active;comment:菜单的状态情况,默认是active" json:"status"` // 菜单的状态情况,默认是active
|
||||
CreateTime time.Time `gorm:"column:create_time;comment:创建时间" json:"create_time"` // 创建时间
|
||||
UpdateTime time.Time `gorm:"column:update_time;not null;default:CURRENT_TIMESTAMP;comment:最近更新时间" json:"update_time"` // 最近更新时间
|
||||
}
|
||||
|
||||
// TableName MenuInfo's table name
|
||||
func (*MenuInfo) TableName() string {
|
||||
return TableNameMenuInfo
|
||||
}
|
||||
49
verification/internal/model/merchant_deploy_info.gen.go
Normal file
49
verification/internal/model/merchant_deploy_info.gen.go
Normal file
@@ -0,0 +1,49 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameMerchantDeployInfo = "merchant_deploy_info"
|
||||
|
||||
// MerchantDeployInfo mapped from table <merchant_deploy_info>
|
||||
type MerchantDeployInfo struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键,自增" json:"id"` // 主键,自增
|
||||
Status string `gorm:"column:status;not null;default:active;comment:商户状态状态" json:"status"` // 商户状态状态
|
||||
MerchantUID string `gorm:"column:merchant_uid;not null;comment:商户uid" json:"merchant_uid"` // 商户uid
|
||||
PayType string `gorm:"column:pay_type;comment:支付配置" json:"pay_type"` // 支付配置
|
||||
SingleRoadUID string `gorm:"column:single_road_uid;comment:单通道uid" json:"single_road_uid"` // 单通道uid
|
||||
SingleRoadName string `gorm:"column:single_road_name;comment:单通道名称" json:"single_road_name"` // 单通道名称
|
||||
SingleRoadPlatformRate string `gorm:"column:single_road_platform_rate;not null;comment:单通到平台净利率(关系映射)" json:"single_road_platform_rate"` // 单通到平台净利率(关系映射)
|
||||
SingleRoadAgentRate float64 `gorm:"column:single_road_agent_rate;not null;default:0.000;comment:单通到代理净利率" json:"single_road_agent_rate"` // 单通到代理净利率
|
||||
RollRoadCode string `gorm:"column:roll_road_code;comment:轮询通道编码" json:"roll_road_code"` // 轮询通道编码
|
||||
RollRoadName string `gorm:"column:roll_road_name;comment:轮询通道名称" json:"roll_road_name"` // 轮询通道名称
|
||||
RollRoadPlatformRate float64 `gorm:"column:roll_road_platform_rate;not null;default:0.000;comment:轮询通道平台净利率" json:"roll_road_platform_rate"` // 轮询通道平台净利率
|
||||
RollRoadAgentRate float64 `gorm:"column:roll_road_agent_rate;not null;default:0.000;comment:轮询通道代理净利率" json:"roll_road_agent_rate"` // 轮询通道代理净利率
|
||||
RestrictArea string `gorm:"column:restrict_area;comment:限制地区" json:"restrict_area"` // 限制地区
|
||||
IsLoan string `gorm:"column:is_loan;not null;default:NO;comment:是否押款" json:"is_loan"` // 是否押款
|
||||
LoanRate float64 `gorm:"column:loan_rate;not null;default:0.000;comment:押款比例,默认是0" json:"loan_rate"` // 押款比例,默认是0
|
||||
LoanDays int32 `gorm:"column:loan_days;not null;comment:押款的天数,默认0天" json:"loan_days"` // 押款的天数,默认0天
|
||||
UnfreezeHour int32 `gorm:"column:unfreeze_hour;not null;comment:每天解款的时间点,默认是凌晨" json:"unfreeze_hour"` // 每天解款的时间点,默认是凌晨
|
||||
WaitUnfreezeAmount float64 `gorm:"column:wait_unfreeze_amount;comment:等待解款的金额" json:"wait_unfreeze_amount"` // 等待解款的金额
|
||||
LoanAmount float64 `gorm:"column:loan_amount;comment:押款中的金额" json:"loan_amount"` // 押款中的金额
|
||||
UpdateTime time.Time `gorm:"column:update_time;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"update_time"` // 更新时间
|
||||
CreateTime time.Time `gorm:"column:create_time;comment:创建时间" json:"create_time"` // 创建时间
|
||||
AutoSettle string `gorm:"column:auto_settle" json:"auto_settle"`
|
||||
AutoPayfor string `gorm:"column:auto_payfor" json:"auto_payfor"`
|
||||
IsRestrictAgent []uint8 `gorm:"column:is_restrict_agent;comment:是否检测代理" json:"is_restrict_agent"` // 是否检测代理
|
||||
IsRestrictCardPass []uint8 `gorm:"column:is_restrict_card_pass;comment:是否限制卡密" json:"is_restrict_card_pass"` // 是否限制卡密
|
||||
IsRestrictDevice []uint8 `gorm:"column:is_restrict_device;comment:是否限制设备" json:"is_restrict_device"` // 是否限制设备
|
||||
IsRestrictIP []uint8 `gorm:"column:is_restrict_ip;comment:是否限制IP" json:"is_restrict_ip"` // 是否限制IP
|
||||
IsRestrictInternalIP []uint8 `gorm:"column:is_restrict_internal_ip;comment:是否限制局域网IP" json:"is_restrict_internal_ip"` // 是否限制局域网IP
|
||||
SubmitStrategy string `gorm:"column:submit_strategy;default:DIRECT;comment:订单提交策略:DIRECT-直接提交,POOL-缓存在订单池中二次提交" json:"submit_strategy"` // 订单提交策略:DIRECT-直接提交,POOL-缓存在订单池中二次提交
|
||||
}
|
||||
|
||||
// TableName MerchantDeployInfo's table name
|
||||
func (*MerchantDeployInfo) TableName() string {
|
||||
return TableNameMerchantDeployInfo
|
||||
}
|
||||
37
verification/internal/model/merchant_hidden_config.gen.go
Normal file
37
verification/internal/model/merchant_hidden_config.gen.go
Normal file
@@ -0,0 +1,37 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameMerchantHiddenConfig = "merchant_hidden_config"
|
||||
|
||||
// MerchantHiddenConfig mapped from table <merchant_hidden_config>
|
||||
type MerchantHiddenConfig struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
Name string `gorm:"column:name" json:"name"`
|
||||
MerchantUID string `gorm:"column:merchant_uid;not null;comment:商户Id" json:"merchant_uid"` // 商户Id
|
||||
RoadUID string `gorm:"column:road_uid;not null;comment:商户通道" json:"road_uid"` // 商户通道
|
||||
Amount int32 `gorm:"column:amount;comment:金额" json:"amount"` // 金额
|
||||
FaceAmount int32 `gorm:"column:face_amount;comment:面额" json:"face_amount"` // 面额
|
||||
DelayDurationMin int32 `gorm:"column:delay_duration_min;comment:延迟时间(最小)" json:"delay_duration_min"` // 延迟时间(最小)
|
||||
DelayDurationMax int32 `gorm:"column:delay_duration_max;comment:延迟时间(最大)" json:"delay_duration_max"` // 延迟时间(最大)
|
||||
Enable int32 `gorm:"column:enable;comment:是否启用" json:"enable"` // 是否启用
|
||||
Strategy int32 `gorm:"column:strategy;comment:策略 1空白 2.错误 3.随机" json:"strategy"` // 策略 1空白 2.错误 3.随机
|
||||
AmountRule string `gorm:"column:amount_rule;comment:偷卡规则" json:"amount_rule"` // 偷卡规则
|
||||
ExtraReturnInfo string `gorm:"column:extra_return_info;comment:绑卡返回额外信息" json:"extra_return_info"` // 绑卡返回额外信息
|
||||
CreatedAt time.Time `gorm:"column:created_at;not null;comment:创建时间" json:"created_at"` // 创建时间
|
||||
UpdatedAt time.Time `gorm:"column:updated_at;not null;comment:更新时间" json:"updated_at"` // 更新时间
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
}
|
||||
|
||||
// TableName MerchantHiddenConfig's table name
|
||||
func (*MerchantHiddenConfig) TableName() string {
|
||||
return TableNameMerchantHiddenConfig
|
||||
}
|
||||
32
verification/internal/model/merchant_hidden_record.gen.go
Normal file
32
verification/internal/model/merchant_hidden_record.gen.go
Normal file
@@ -0,0 +1,32 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameMerchantHiddenRecord = "merchant_hidden_record"
|
||||
|
||||
// MerchantHiddenRecord mapped from table <merchant_hidden_record>
|
||||
type MerchantHiddenRecord struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
TargetOrderNo string `gorm:"column:target_order_no;comment:替换掉的id" json:"target_order_no"` // 替换掉的id
|
||||
SourceOrderNo string `gorm:"column:source_order_no;comment:原有id" json:"source_order_no"` // 原有id
|
||||
OrderAmount float32 `gorm:"column:order_amount;comment:偷卡金额" json:"order_amount"` // 偷卡金额
|
||||
ActualAmount float32 `gorm:"column:actual_amount;comment:实际金额" json:"actual_amount"` // 实际金额
|
||||
MerchantHiddenConfigID int32 `gorm:"column:merchant_hidden_config_id;comment:关联偷卡规则" json:"merchant_hidden_config_id"` // 关联偷卡规则
|
||||
Strategy int32 `gorm:"column:strategy;comment:规则" json:"strategy"` // 规则
|
||||
DelayDuration int32 `gorm:"column:delay_duration;not null;comment:延迟时间" json:"delay_duration"` // 延迟时间
|
||||
Status int32 `gorm:"column:status;not null;comment:状态 1.成功 2.失败 3.准备开始" json:"status"` // 状态 1.成功 2.失败 3.准备开始
|
||||
IsFinish bool `gorm:"column:is_finish;comment:是否结束本轮偷卡" json:"is_finish"` // 是否结束本轮偷卡
|
||||
CreatedAt time.Time `gorm:"column:created_at;comment:创建时间" json:"created_at"` // 创建时间
|
||||
UpdatedAt time.Time `gorm:"column:updated_at;comment:修改时间" json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
// TableName MerchantHiddenRecord's table name
|
||||
func (*MerchantHiddenRecord) TableName() string {
|
||||
return TableNameMerchantHiddenRecord
|
||||
}
|
||||
42
verification/internal/model/merchant_info.gen.go
Normal file
42
verification/internal/model/merchant_info.gen.go
Normal file
@@ -0,0 +1,42 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameMerchantInfo = "merchant_info"
|
||||
|
||||
// MerchantInfo 商户支付配置表
|
||||
type MerchantInfo struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键,自增" json:"id"` // 主键,自增
|
||||
Status string `gorm:"column:status;comment:商户状态状态" json:"status"` // 商户状态状态
|
||||
BelongAgentUID string `gorm:"column:belong_agent_uid;comment:所属代理uid" json:"belong_agent_uid"` // 所属代理uid
|
||||
BelongAgentName string `gorm:"column:belong_agent_name;comment:所属代理名称" json:"belong_agent_name"` // 所属代理名称
|
||||
MerchantName string `gorm:"column:merchant_name;comment:商户名称" json:"merchant_name"` // 商户名称
|
||||
MerchantUID string `gorm:"column:merchant_uid;comment:商户uid" json:"merchant_uid"` // 商户uid
|
||||
MerchantKey string `gorm:"column:merchant_key;comment:商户key" json:"merchant_key"` // 商户key
|
||||
MerchantSecret string `gorm:"column:merchant_secret;comment:商户密钥" json:"merchant_secret"` // 商户密钥
|
||||
LoginAccount string `gorm:"column:login_account;comment:登录账号" json:"login_account"` // 登录账号
|
||||
LoginPassword string `gorm:"column:login_password;comment:登录密码" json:"login_password"` // 登录密码
|
||||
AutoSettle string `gorm:"column:auto_settle;not null;default:YES;comment:是否自动结算" json:"auto_settle"` // 是否自动结算
|
||||
AutoPayFor string `gorm:"column:auto_pay_for;not null;default:YES;comment:是否自动代付" json:"auto_pay_for"` // 是否自动代付
|
||||
WhiteIps string `gorm:"column:white_ips;comment:配置ip白名单" json:"white_ips"` // 配置ip白名单
|
||||
Remark string `gorm:"column:remark;comment:备注" json:"remark"` // 备注
|
||||
SinglePayForRoadUID string `gorm:"column:single_pay_for_road_uid;comment:单代付代付通道uid" json:"single_pay_for_road_uid"` // 单代付代付通道uid
|
||||
SinglePayForRoadName string `gorm:"column:single_pay_for_road_name;comment:单代付通道名称" json:"single_pay_for_road_name"` // 单代付通道名称
|
||||
RollPayForRoadCode string `gorm:"column:roll_pay_for_road_code;comment:轮询代付通道编码" json:"roll_pay_for_road_code"` // 轮询代付通道编码
|
||||
RollPayForRoadName string `gorm:"column:roll_pay_for_road_name;comment:轮询代付通道名称" json:"roll_pay_for_road_name"` // 轮询代付通道名称
|
||||
PayforFee float32 `gorm:"column:payfor_fee;comment:代付手续费" json:"payfor_fee"` // 代付手续费
|
||||
UpdateTime time.Time `gorm:"column:update_time;comment:更新时间" json:"update_time"` // 更新时间
|
||||
CreateTime time.Time `gorm:"column:create_time;comment:创建时间" json:"create_time"` // 创建时间
|
||||
OtpSecret string `gorm:"column:otp_secret;comment:二次验证" json:"otp_secret"` // 二次验证
|
||||
}
|
||||
|
||||
// TableName MerchantInfo's table name
|
||||
func (*MerchantInfo) TableName() string {
|
||||
return TableNameMerchantInfo
|
||||
}
|
||||
28
verification/internal/model/merchant_load_info.gen.go
Normal file
28
verification/internal/model/merchant_load_info.gen.go
Normal file
@@ -0,0 +1,28 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameMerchantLoadInfo = "merchant_load_info"
|
||||
|
||||
// MerchantLoadInfo 商户对应的每条通道的押款信息
|
||||
type MerchantLoadInfo struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键,自增" json:"id"` // 主键,自增
|
||||
Status string `gorm:"column:status;comment:no-没有结算,yes-结算" json:"status"` // no-没有结算,yes-结算
|
||||
MerchantUID string `gorm:"column:merchant_uid;comment:商户uid" json:"merchant_uid"` // 商户uid
|
||||
RoadUID string `gorm:"column:road_uid;comment:通道uid" json:"road_uid"` // 通道uid
|
||||
LoadDate string `gorm:"column:load_date;comment:押款日期,格式2019-10-10" json:"load_date"` // 押款日期,格式2019-10-10
|
||||
LoadAmount float32 `gorm:"column:load_amount;comment:押款金额" json:"load_amount"` // 押款金额
|
||||
UpdateTime time.Time `gorm:"column:update_time;comment:更新时间" json:"update_time"` // 更新时间
|
||||
CreateTime time.Time `gorm:"column:create_time;comment:创建时间" json:"create_time"` // 创建时间
|
||||
}
|
||||
|
||||
// TableName MerchantLoadInfo's table name
|
||||
func (*MerchantLoadInfo) TableName() string {
|
||||
return TableNameMerchantLoadInfo
|
||||
}
|
||||
26
verification/internal/model/migrations.gen.go
Normal file
26
verification/internal/model/migrations.gen.go
Normal file
@@ -0,0 +1,26 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameMigration = "migrations"
|
||||
|
||||
// Migration mapped from table <migrations>
|
||||
type Migration struct {
|
||||
IDMigration int32 `gorm:"column:id_migration;primaryKey;autoIncrement:true;comment:surrogate key" json:"id_migration"` // surrogate key
|
||||
Name string `gorm:"column:name;comment:migration name, unique" json:"name"` // migration name, unique
|
||||
CreatedAt time.Time `gorm:"column:created_at;not null;default:CURRENT_TIMESTAMP;comment:date migrated or rolled back" json:"created_at"` // date migrated or rolled back
|
||||
Statements string `gorm:"column:statements;comment:SQL statements for this migration" json:"statements"` // SQL statements for this migration
|
||||
RollbackStatements string `gorm:"column:rollback_statements;comment:SQL statment for rolling back migration" json:"rollback_statements"` // SQL statment for rolling back migration
|
||||
Status string `gorm:"column:status;comment:update indicates it is a normal migration while rollback means this migration is rolled back" json:"status"` // update indicates it is a normal migration while rollback means this migration is rolled back
|
||||
}
|
||||
|
||||
// TableName Migration's table name
|
||||
func (*Migration) TableName() string {
|
||||
return TableNameMigration
|
||||
}
|
||||
30
verification/internal/model/notify_info.gen.go
Normal file
30
verification/internal/model/notify_info.gen.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameNotifyInfo = "notify_info"
|
||||
|
||||
// NotifyInfo 支付回调
|
||||
type NotifyInfo struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键,自增" json:"id"` // 主键,自增
|
||||
Type string `gorm:"column:type;not null;comment:支付订单-order, 代付订单-payfor" json:"type"` // 支付订单-order, 代付订单-payfor
|
||||
BankOrderID string `gorm:"column:bank_order_id;not null;comment:系统订单id" json:"bank_order_id"` // 系统订单id
|
||||
MerchantOrderID string `gorm:"column:merchant_order_id;not null;comment:下游商户订单id" json:"merchant_order_id"` // 下游商户订单id
|
||||
Status string `gorm:"column:status;not null;default:wait;comment:状态字段" json:"status"` // 状态字段
|
||||
Times int32 `gorm:"column:times;not null;comment:回调次数" json:"times"` // 回调次数
|
||||
URL string `gorm:"column:url;comment:回调的url" json:"url"` // 回调的url
|
||||
Response string `gorm:"column:response;comment:回调返回的结果" json:"response"` // 回调返回的结果
|
||||
UpdateTime time.Time `gorm:"column:update_time;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"update_time"` // 更新时间
|
||||
CreateTime time.Time `gorm:"column:create_time;comment:创建时间" json:"create_time"` // 创建时间
|
||||
}
|
||||
|
||||
// TableName NotifyInfo's table name
|
||||
func (*NotifyInfo) TableName() string {
|
||||
return TableNameNotifyInfo
|
||||
}
|
||||
70
verification/internal/model/order_info.gen.go
Normal file
70
verification/internal/model/order_info.gen.go
Normal file
@@ -0,0 +1,70 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameOrderInfo = "order_info"
|
||||
|
||||
// OrderInfo 订单信息表
|
||||
type OrderInfo struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键ID" json:"id"` // 主键ID
|
||||
MerchantOrderID string `gorm:"column:merchant_order_id;comment:商户订单ID" json:"merchant_order_id"` // 商户订单ID
|
||||
ShopName string `gorm:"column:shop_name;comment:商品名称" json:"shop_name"` // 商品名称
|
||||
OrderPeriod string `gorm:"column:order_period;comment:订单有效时间" json:"order_period"` // 订单有效时间
|
||||
BankOrderID string `gorm:"column:bank_order_id;comment:系统订单ID" json:"bank_order_id"` // 系统订单ID
|
||||
BankTransID string `gorm:"column:bank_trans_id;comment:上游流水ID" json:"bank_trans_id"` // 上游流水ID
|
||||
OrderAmount float64 `gorm:"column:order_amount;comment:订单提交金额" json:"order_amount"` // 订单提交金额
|
||||
ShowAmount float64 `gorm:"column:show_amount;comment:待支付金额" json:"show_amount"` // 待支付金额
|
||||
FactAmount float64 `gorm:"column:fact_amount;comment:实际支付金额" json:"fact_amount"` // 实际支付金额
|
||||
RollPoolCode string `gorm:"column:roll_pool_code;comment:轮询池编码" json:"roll_pool_code"` // 轮询池编码
|
||||
RollPoolName string `gorm:"column:roll_pool_name;comment:轮询池名称" json:"roll_pool_name"` // 轮询池名称
|
||||
RoadUID string `gorm:"column:road_uid;comment:支付通道ID" json:"road_uid"` // 支付通道ID
|
||||
RoadName string `gorm:"column:road_name;comment:支付通道名称" json:"road_name"` // 支付通道名称
|
||||
PayProductCode string `gorm:"column:pay_product_code;comment:上游支付公司编码" json:"pay_product_code"` // 上游支付公司编码
|
||||
PayProductName string `gorm:"column:pay_product_name;comment:上游支付公司名称" json:"pay_product_name"` // 上游支付公司名称
|
||||
PayTypeCode string `gorm:"column:pay_type_code;comment:支付产品编码" json:"pay_type_code"` // 支付产品编码
|
||||
PayTypeName string `gorm:"column:pay_type_name;comment:支付产品名称" json:"pay_type_name"` // 支付产品名称
|
||||
OsType string `gorm:"column:os_type;comment:操作系统类型" json:"os_type"` // 操作系统类型
|
||||
Status string `gorm:"column:status;comment:订单支付状态" json:"status"` // 订单支付状态
|
||||
Refund string `gorm:"column:refund;comment:退款状态" json:"refund"` // 退款状态
|
||||
RefundTime string `gorm:"column:refund_time;comment:退款操作时间" json:"refund_time"` // 退款操作时间
|
||||
Freeze string `gorm:"column:freeze;comment:冻结状态" json:"freeze"` // 冻结状态
|
||||
FreezeTime string `gorm:"column:freeze_time;comment:冻结时间" json:"freeze_time"` // 冻结时间
|
||||
Unfreeze string `gorm:"column:unfreeze;comment:是否已解冻" json:"unfreeze"` // 是否已解冻
|
||||
UnfreezeTime string `gorm:"column:unfreeze_time;comment:解冻时间" json:"unfreeze_time"` // 解冻时间
|
||||
NotifyURL string `gorm:"column:notify_url;comment:回调通知地址" json:"notify_url"` // 回调通知地址
|
||||
MerchantUID string `gorm:"column:merchant_uid;comment:商户ID" json:"merchant_uid"` // 商户ID
|
||||
MerchantName string `gorm:"column:merchant_name;comment:商户名称" json:"merchant_name"` // 商户名称
|
||||
AgentUID string `gorm:"column:agent_uid;comment:代理ID" json:"agent_uid"` // 代理ID
|
||||
AgentName string `gorm:"column:agent_name;comment:代理名称" json:"agent_name"` // 代理名称
|
||||
Response string `gorm:"column:response;comment:上游返回的结果" json:"response"` // 上游返回的结果
|
||||
UpdateTime time.Time `gorm:"column:update_time;comment:更新时间" json:"update_time"` // 更新时间
|
||||
CreateTime time.Time `gorm:"column:create_time;comment:创建时间" json:"create_time"` // 创建时间
|
||||
ExValue string `gorm:"column:ex_value;comment:扩展字段" json:"ex_value"` // 扩展字段
|
||||
CardData string `gorm:"column:card_data" json:"card_data"`
|
||||
Operator string `gorm:"column:operator" json:"operator"`
|
||||
CardReturnData string `gorm:"column:card_return_data" json:"card_return_data"`
|
||||
CardReturnTime time.Time `gorm:"column:card_return_time;comment:上游返回数据时间" json:"card_return_time"` // 上游返回数据时间
|
||||
PayTime time.Time `gorm:"column:pay_time" json:"pay_time"`
|
||||
IP string `gorm:"column:ip;comment:ip地址" json:"ip"` // ip地址
|
||||
IsIPRestricted int32 `gorm:"column:is_ip_restricted;comment:ip是否被限制" json:"is_ip_restricted"` // ip是否被限制
|
||||
TransactionType string `gorm:"column:transaction_type" json:"transaction_type"`
|
||||
IsBlock int32 `gorm:"column:is_block;comment:是否在黑名单中" json:"is_block"` // 是否在黑名单中
|
||||
PayURL string `gorm:"column:pay_url;comment:支付链接" json:"pay_url"` // 支付链接
|
||||
IsReplace int32 `gorm:"column:is_replace;comment:是否是偷卡的链接" json:"is_replace"` // 是否是偷卡的链接
|
||||
IsSucceedByReplace int32 `gorm:"column:is_succeed_by_replace;comment:0" json:"is_succeed_by_replace"` // 0
|
||||
SendCount int32 `gorm:"column:send_count;comment:核销次数" json:"send_count"` // 核销次数
|
||||
IsAmountDifferent int32 `gorm:"column:is_amount_different" json:"is_amount_different"`
|
||||
SendRecord string `gorm:"column:send_record;comment:历史记录" json:"send_record"` // 历史记录
|
||||
PoolOrderID string `gorm:"column:pool_order_id" json:"pool_order_id"`
|
||||
}
|
||||
|
||||
// TableName OrderInfo's table name
|
||||
func (*OrderInfo) TableName() string {
|
||||
return TableNameOrderInfo
|
||||
}
|
||||
46
verification/internal/model/order_profit_info.gen.go
Normal file
46
verification/internal/model/order_profit_info.gen.go
Normal file
@@ -0,0 +1,46 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameOrderProfitInfo = "order_profit_info"
|
||||
|
||||
// OrderProfitInfo 订单利润表
|
||||
type OrderProfitInfo struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键,自增" json:"id"` // 主键,自增
|
||||
MerchantName string `gorm:"column:merchant_name;not null;comment:商户名称" json:"merchant_name"` // 商户名称
|
||||
MerchantUID string `gorm:"column:merchant_uid;not null;comment:商户uid" json:"merchant_uid"` // 商户uid
|
||||
AgentUID string `gorm:"column:agent_uid;comment:代理uid,表示该商户是谁的代理" json:"agent_uid"` // 代理uid,表示该商户是谁的代理
|
||||
AgentName string `gorm:"column:agent_name;comment:代理名称" json:"agent_name"` // 代理名称
|
||||
PayProductCode string `gorm:"column:pay_product_code;not null;comment:支付产品编码" json:"pay_product_code"` // 支付产品编码
|
||||
PayProductName string `gorm:"column:pay_product_name;not null;comment:支付产品名称" json:"pay_product_name"` // 支付产品名称
|
||||
PayTypeCode string `gorm:"column:pay_type_code;not null;comment:支付类型编码" json:"pay_type_code"` // 支付类型编码
|
||||
PayTypeName string `gorm:"column:pay_type_name;not null;comment:支付类型名称" json:"pay_type_name"` // 支付类型名称
|
||||
Status string `gorm:"column:status;not null;default:wait;comment:等待支付-wait,支付成功-success, 支付失败-failed" json:"status"` // 等待支付-wait,支付成功-success, 支付失败-failed
|
||||
MerchantOrderID string `gorm:"column:merchant_order_id;not null;comment:下游商户提交过来的订单id" json:"merchant_order_id"` // 下游商户提交过来的订单id
|
||||
BankOrderID string `gorm:"column:bank_order_id;not null;comment:平台自身的订单id" json:"bank_order_id"` // 平台自身的订单id
|
||||
BankTransID string `gorm:"column:bank_trans_id;not null;comment:上游返回的订单id" json:"bank_trans_id"` // 上游返回的订单id
|
||||
OrderAmount float64 `gorm:"column:order_amount;not null;default:0.000;comment:订单提交金额" json:"order_amount"` // 订单提交金额
|
||||
ShowAmount float64 `gorm:"column:show_amount;not null;default:0.000;comment:展示在用户面前待支付的金额" json:"show_amount"` // 展示在用户面前待支付的金额
|
||||
FactAmount float64 `gorm:"column:fact_amount;not null;default:0.000;comment:实际支付金额" json:"fact_amount"` // 实际支付金额
|
||||
UserInAmount float64 `gorm:"column:user_in_amount;not null;default:0.000;comment:商户入账金额" json:"user_in_amount"` // 商户入账金额
|
||||
AllProfit float64 `gorm:"column:all_profit;not null;default:0.000;comment:总的利润,包括上游,平台,代理" json:"all_profit"` // 总的利润,包括上游,平台,代理
|
||||
SupplierRate float64 `gorm:"column:supplier_rate;not null;default:0.000;comment:上游的汇率" json:"supplier_rate"` // 上游的汇率
|
||||
PlatformRate float64 `gorm:"column:platform_rate;not null;default:0.000;comment:平台自己的手续费率" json:"platform_rate"` // 平台自己的手续费率
|
||||
AgentRate float64 `gorm:"column:agent_rate;not null;default:0.000;comment:代理的手续费率" json:"agent_rate"` // 代理的手续费率
|
||||
SupplierProfit float64 `gorm:"column:supplier_profit;not null;default:0.000;comment:上游的利润" json:"supplier_profit"` // 上游的利润
|
||||
PlatformProfit float64 `gorm:"column:platform_profit;not null;default:0.000;comment:平台利润" json:"platform_profit"` // 平台利润
|
||||
AgentProfit float64 `gorm:"column:agent_profit;not null;default:0.000;comment:代理利润" json:"agent_profit"` // 代理利润
|
||||
UpdateTime time.Time `gorm:"column:update_time;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"update_time"` // 更新时间
|
||||
CreateTime time.Time `gorm:"column:create_time;comment:创建时间" json:"create_time"` // 创建时间
|
||||
}
|
||||
|
||||
// TableName OrderProfitInfo's table name
|
||||
func (*OrderProfitInfo) TableName() string {
|
||||
return TableNameOrderProfitInfo
|
||||
}
|
||||
35
verification/internal/model/order_settle_info.gen.go
Normal file
35
verification/internal/model/order_settle_info.gen.go
Normal file
@@ -0,0 +1,35 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameOrderSettleInfo = "order_settle_info"
|
||||
|
||||
// OrderSettleInfo 订单结算表
|
||||
type OrderSettleInfo struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键,自增" json:"id"` // 主键,自增
|
||||
PayProductCode string `gorm:"column:pay_product_code;not null;comment:支付产品编码" json:"pay_product_code"` // 支付产品编码
|
||||
PayProductName string `gorm:"column:pay_product_name;not null;comment:支付产品名称" json:"pay_product_name"` // 支付产品名称
|
||||
PayTypeCode string `gorm:"column:pay_type_code;not null;comment:支付类型编码" json:"pay_type_code"` // 支付类型编码
|
||||
PayTypeName string `gorm:"column:pay_type_name;not null;comment:支付类型名称" json:"pay_type_name"` // 支付类型名称
|
||||
MerchantUID string `gorm:"column:merchant_uid;not null;comment:商户uid,表示订单是哪个商户的" json:"merchant_uid"` // 商户uid,表示订单是哪个商户的
|
||||
RoadUID string `gorm:"column:road_uid;not null;comment:通道uid" json:"road_uid"` // 通道uid
|
||||
MerchantName string `gorm:"column:merchant_name;not null;comment:商户名称" json:"merchant_name"` // 商户名称
|
||||
MerchantOrderID string `gorm:"column:merchant_order_id;not null;comment:下游商户提交过来的订单id" json:"merchant_order_id"` // 下游商户提交过来的订单id
|
||||
BankOrderID string `gorm:"column:bank_order_id;not null;comment:平台自身的订单id" json:"bank_order_id"` // 平台自身的订单id
|
||||
SettleAmount float64 `gorm:"column:settle_amount;not null;default:0.000;comment:结算金额" json:"settle_amount"` // 结算金额
|
||||
IsAllowSettle string `gorm:"column:is_allow_settle;not null;default:yes;comment:是否允许结算,允许-yes,不允许-no" json:"is_allow_settle"` // 是否允许结算,允许-yes,不允许-no
|
||||
IsCompleteSettle string `gorm:"column:is_complete_settle;not null;default:no;comment:该笔订单是否结算完毕,没有结算-no,结算完毕-yes" json:"is_complete_settle"` // 该笔订单是否结算完毕,没有结算-no,结算完毕-yes
|
||||
UpdateTime time.Time `gorm:"column:update_time;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"update_time"` // 更新时间
|
||||
CreateTime time.Time `gorm:"column:create_time;comment:创建时间" json:"create_time"` // 创建时间
|
||||
}
|
||||
|
||||
// TableName OrderSettleInfo's table name
|
||||
func (*OrderSettleInfo) TableName() string {
|
||||
return TableNameOrderSettleInfo
|
||||
}
|
||||
57
verification/internal/model/payfor_info.gen.go
Normal file
57
verification/internal/model/payfor_info.gen.go
Normal file
@@ -0,0 +1,57 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNamePayforInfo = "payfor_info"
|
||||
|
||||
// PayforInfo 代付表
|
||||
type PayforInfo struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键,自增" json:"id"` // 主键,自增
|
||||
PayforUID string `gorm:"column:payfor_uid;comment:代付唯一uid" json:"payfor_uid"` // 代付唯一uid
|
||||
MerchantUID string `gorm:"column:merchant_uid;comment:发起代付的商户uid" json:"merchant_uid"` // 发起代付的商户uid
|
||||
MerchantName string `gorm:"column:merchant_name;comment:发起代付的商户名称" json:"merchant_name"` // 发起代付的商户名称
|
||||
MerchantOrderID string `gorm:"column:merchant_order_id;comment:下游代付订单id" json:"merchant_order_id"` // 下游代付订单id
|
||||
BankOrderID string `gorm:"column:bank_order_id;comment:系统代付订单id" json:"bank_order_id"` // 系统代付订单id
|
||||
BankTransID string `gorm:"column:bank_trans_id;comment:上游返回的代付订单id" json:"bank_trans_id"` // 上游返回的代付订单id
|
||||
RoadUID string `gorm:"column:road_uid;comment:所用的代付通道uid" json:"road_uid"` // 所用的代付通道uid
|
||||
RoadName string `gorm:"column:road_name;comment:所有通道的名称" json:"road_name"` // 所有通道的名称
|
||||
RollPoolCode string `gorm:"column:roll_pool_code;comment:所用轮询池编码" json:"roll_pool_code"` // 所用轮询池编码
|
||||
RollPoolName string `gorm:"column:roll_pool_name;comment:所用轮询池的名称" json:"roll_pool_name"` // 所用轮询池的名称
|
||||
PayforFee float32 `gorm:"column:payfor_fee;comment:代付手续费" json:"payfor_fee"` // 代付手续费
|
||||
PayforAmount float32 `gorm:"column:payfor_amount;comment:代付到账金额" json:"payfor_amount"` // 代付到账金额
|
||||
PayforTotalAmount float32 `gorm:"column:payfor_total_amount;comment:代付总金额" json:"payfor_total_amount"` // 代付总金额
|
||||
BankCode string `gorm:"column:bank_code;comment:银行编码" json:"bank_code"` // 银行编码
|
||||
BankName string `gorm:"column:bank_name;comment:银行名称" json:"bank_name"` // 银行名称
|
||||
BankAccountName string `gorm:"column:bank_account_name;comment:银行开户名称" json:"bank_account_name"` // 银行开户名称
|
||||
BankAccountNo string `gorm:"column:bank_account_no;comment:银行开户账号" json:"bank_account_no"` // 银行开户账号
|
||||
BankAccountType string `gorm:"column:bank_account_type;comment:银行卡类型,对私-private,对公-public" json:"bank_account_type"` // 银行卡类型,对私-private,对公-public
|
||||
Country string `gorm:"column:country;comment:开户所属国家" json:"country"` // 开户所属国家
|
||||
Province string `gorm:"column:province;comment:银行卡开户所属省" json:"province"` // 银行卡开户所属省
|
||||
City string `gorm:"column:city;comment:银行卡开户所属城市" json:"city"` // 银行卡开户所属城市
|
||||
Ares string `gorm:"column:ares;comment:所属地区" json:"ares"` // 所属地区
|
||||
BankAccountAddress string `gorm:"column:bank_account_address;comment:银行开户具体街道" json:"bank_account_address"` // 银行开户具体街道
|
||||
PhoneNo string `gorm:"column:phone_no;comment:开户所用手机号" json:"phone_no"` // 开户所用手机号
|
||||
GiveType string `gorm:"column:give_type;comment:下发类型,payfor_road-通道打款,payfor_hand-手动打款,payfor_refuse-拒绝打款" json:"give_type"` // 下发类型,payfor_road-通道打款,payfor_hand-手动打款,payfor_refuse-拒绝打款
|
||||
Type string `gorm:"column:type;comment:代付类型,self_api-系统发下, 管理员手动下发给商户-self_merchant,管理自己提现-self_help" json:"type"` // 代付类型,self_api-系统发下, 管理员手动下发给商户-self_merchant,管理自己提现-self_help
|
||||
NotifyURL string `gorm:"column:notify_url;comment:代付结果回调给下游的地址" json:"notify_url"` // 代付结果回调给下游的地址
|
||||
Status string `gorm:"column:status;comment:审核-payfor_confirm,系统处理中-payfor_solving,银行处理中-payfor_banking,代付成功-success, 代付失败-failed" json:"status"` // 审核-payfor_confirm,系统处理中-payfor_solving,银行处理中-payfor_banking,代付成功-success, 代付失败-failed
|
||||
IsSend string `gorm:"column:is_send;comment:未发送-no,已经发送-yes" json:"is_send"` // 未发送-no,已经发送-yes
|
||||
RequestTime time.Time `gorm:"column:request_time;comment:发起请求时间" json:"request_time"` // 发起请求时间
|
||||
ResponseTime string `gorm:"column:response_time;comment:上游做出响应的时间" json:"response_time"` // 上游做出响应的时间
|
||||
ResponseContent string `gorm:"column:response_content;comment:代付的最终结果" json:"response_content"` // 代付的最终结果
|
||||
Remark string `gorm:"column:remark;comment:代付备注" json:"remark"` // 代付备注
|
||||
UpdateTime time.Time `gorm:"column:update_time;comment:更新时间" json:"update_time"` // 更新时间
|
||||
CreateTime time.Time `gorm:"column:create_time;comment:创建时间" json:"create_time"` // 创建时间
|
||||
Attach string `gorm:"column:attach" json:"attach"`
|
||||
}
|
||||
|
||||
// TableName PayforInfo's table name
|
||||
func (*PayforInfo) TableName() string {
|
||||
return TableNamePayforInfo
|
||||
}
|
||||
30
verification/internal/model/power_info.gen.go
Normal file
30
verification/internal/model/power_info.gen.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNamePowerInfo = "power_info"
|
||||
|
||||
// PowerInfo 存放控制页面的一些功能操作
|
||||
type PowerInfo struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键,自增" json:"id"` // 主键,自增
|
||||
FirstMenuUID string `gorm:"column:first_menu_uid;not null;comment:一级菜单的唯一标识" json:"first_menu_uid"` // 一级菜单的唯一标识
|
||||
SecondMenuUID string `gorm:"column:second_menu_uid;not null;comment:二级菜单的唯一标识" json:"second_menu_uid"` // 二级菜单的唯一标识
|
||||
SecondMenu string `gorm:"column:second_menu;not null;comment:二级菜单的名称" json:"second_menu"` // 二级菜单的名称
|
||||
PowerItem string `gorm:"column:power_item;not null;comment:权限项的名称" json:"power_item"` // 权限项的名称
|
||||
PowerID string `gorm:"column:power_id;not null;comment:权限的ID" json:"power_id"` // 权限的ID
|
||||
Creater string `gorm:"column:creater;not null;comment:创建者的id" json:"creater"` // 创建者的id
|
||||
Status string `gorm:"column:status;not null;default:active;comment:菜单的状态情况,默认是active" json:"status"` // 菜单的状态情况,默认是active
|
||||
CreateTime time.Time `gorm:"column:create_time;comment:创建时间" json:"create_time"` // 创建时间
|
||||
UpdateTime time.Time `gorm:"column:update_time;not null;default:CURRENT_TIMESTAMP;comment:最近更新时间" json:"update_time"` // 最近更新时间
|
||||
}
|
||||
|
||||
// TableName PowerInfo's table name
|
||||
func (*PowerInfo) TableName() string {
|
||||
return TableNamePowerInfo
|
||||
}
|
||||
30
verification/internal/model/recharge_t_mall_account.gen.go
Normal file
30
verification/internal/model/recharge_t_mall_account.gen.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameRechargeTMallAccount = "recharge_t_mall_account"
|
||||
|
||||
// RechargeTMallAccount mapped from table <recharge_t_mall_account>
|
||||
type RechargeTMallAccount struct {
|
||||
ID string `gorm:"column:id;primaryKey" json:"id"`
|
||||
AccountNumber string `gorm:"column:account_number;not null;comment:账户" json:"account_number"` // 账户
|
||||
Balance float32 `gorm:"column:balance;not null;comment:余额" json:"balance"` // 余额
|
||||
RechargeTimes int32 `gorm:"column:recharge_times;not null;comment:充值次数" json:"recharge_times"` // 充值次数
|
||||
Status string `gorm:"column:status;not null;comment:状态" json:"status"` // 状态
|
||||
CreatedAt time.Time `gorm:"column:created_at;comment:创建时间" json:"created_at"` // 创建时间
|
||||
UpdatedAt time.Time `gorm:"column:updated_at;comment:更新时间" json:"updated_at"` // 更新时间
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;comment:删除时间" json:"deleted_at"` // 删除时间
|
||||
}
|
||||
|
||||
// TableName RechargeTMallAccount's table name
|
||||
func (*RechargeTMallAccount) TableName() string {
|
||||
return TableNameRechargeTMallAccount
|
||||
}
|
||||
39
verification/internal/model/recharge_t_mall_order.gen.go
Normal file
39
verification/internal/model/recharge_t_mall_order.gen.go
Normal file
@@ -0,0 +1,39 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameRechargeTMallOrder = "recharge_t_mall_order"
|
||||
|
||||
// RechargeTMallOrder mapped from table <recharge_t_mall_order>
|
||||
type RechargeTMallOrder struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
ChannelName string `gorm:"column:channel_name;comment:通道名称" json:"channel_name"` // 通道名称
|
||||
OrderNo string `gorm:"column:order_no;primaryKey;comment:订单号,同时是ID" json:"order_no"` // 订单号,同时是ID
|
||||
AccountID string `gorm:"column:account_id;comment:账户ID" json:"account_id"` // 账户ID
|
||||
AccountNumber string `gorm:"column:account_number;comment:账号" json:"account_number"` // 账号
|
||||
Amount float32 `gorm:"column:amount;comment:充值金额" json:"amount"` // 充值金额
|
||||
Status string `gorm:"column:status" json:"status"`
|
||||
MerchantOrder string `gorm:"column:merchant_order;not null;comment:第三方订单号" json:"merchant_order"` // 第三方订单号
|
||||
ThirdMerhantOrder string `gorm:"column:third_merhant_order;comment:第三方订单号" json:"third_merhant_order"` // 第三方订单号
|
||||
NotifyStatus int32 `gorm:"column:notify_status;comment:回调状态" json:"notify_status"` // 回调状态
|
||||
CallbackURL string `gorm:"column:callback_url" json:"callback_url"`
|
||||
Remark string `gorm:"column:remark" json:"remark"`
|
||||
ShopID int64 `gorm:"column:shop_id;comment:关联天猫订单内部id" json:"shop_id"` // 关联天猫订单内部id
|
||||
CallbackType string `gorm:"column:callback_type;comment:回调类型" json:"callback_type"` // 回调类型
|
||||
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
}
|
||||
|
||||
// TableName RechargeTMallOrder's table name
|
||||
func (*RechargeTMallOrder) TableName() string {
|
||||
return TableNameRechargeTMallOrder
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameRechargeTMallOrderFake = "recharge_t_mall_order_fake"
|
||||
|
||||
// RechargeTMallOrderFake mapped from table <recharge_t_mall_order_fake>
|
||||
type RechargeTMallOrderFake struct {
|
||||
ID string `gorm:"column:id;primaryKey" json:"id"`
|
||||
SourceOfShop string `gorm:"column:source_of_shop;comment:店铺" json:"source_of_shop"` // 店铺
|
||||
OrderNo string `gorm:"column:order_no;comment:订单号" json:"order_no"` // 订单号
|
||||
Category string `gorm:"column:category;comment:品类" json:"category"` // 品类
|
||||
Account string `gorm:"column:account;comment:充值账号" json:"account"` // 充值账号
|
||||
Amount float32 `gorm:"column:amount;comment:充值金额" json:"amount"` // 充值金额
|
||||
TopUpTime time.Time `gorm:"column:top_up_time;comment:充值时间" json:"top_up_time"` // 充值时间
|
||||
Status int32 `gorm:"column:status;comment:充值状态 0.失败 1.成功" json:"status"` // 充值状态 0.失败 1.成功
|
||||
CreatedAt time.Time `gorm:"column:created_at;comment:充值时间" json:"created_at"` // 充值时间
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
}
|
||||
|
||||
// TableName RechargeTMallOrderFake's table name
|
||||
func (*RechargeTMallOrderFake) TableName() string {
|
||||
return TableNameRechargeTMallOrderFake
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameRechargeTMallOrderHistory = "recharge_t_mall_order_history"
|
||||
|
||||
// RechargeTMallOrderHistory mapped from table <recharge_t_mall_order_history>
|
||||
type RechargeTMallOrderHistory struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
OrderNo string `gorm:"column:order_no;comment:淘宝订单号" json:"order_no"` // 淘宝订单号
|
||||
OriginalData string `gorm:"column:original_data" json:"original_data"`
|
||||
Remark string `gorm:"column:remark" json:"remark"`
|
||||
Status string `gorm:"column:status" json:"status"`
|
||||
SourceType string `gorm:"column:source_type;comment:来源,选择淘宝或者阿奇索" json:"source_type"` // 来源,选择淘宝或者阿奇索
|
||||
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
}
|
||||
|
||||
// TableName RechargeTMallOrderHistory's table name
|
||||
func (*RechargeTMallOrderHistory) TableName() string {
|
||||
return TableNameRechargeTMallOrderHistory
|
||||
}
|
||||
41
verification/internal/model/recharge_t_mall_shop.gen.go
Normal file
41
verification/internal/model/recharge_t_mall_shop.gen.go
Normal file
@@ -0,0 +1,41 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameRechargeTMallShop = "recharge_t_mall_shop"
|
||||
|
||||
// RechargeTMallShop mapped from table <recharge_t_mall_shop>
|
||||
type RechargeTMallShop struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
OrderNo string `gorm:"column:order_no;comment:订单号" json:"order_no"` // 订单号
|
||||
Account string `gorm:"column:account;comment:充值账号" json:"account"` // 充值账号
|
||||
TMallOrderNo string `gorm:"column:t_mall_order_no;comment:淘宝订单号" json:"t_mall_order_no"` // 淘宝订单号
|
||||
BuyerNick string `gorm:"column:buyer_nick;comment:买家昵称" json:"buyer_nick"` // 买家昵称
|
||||
BuyerRate bool `gorm:"column:buyer_rate;comment:买家是否评价" json:"buyer_rate"` // 买家是否评价
|
||||
Status string `gorm:"column:status;comment:交易状态" json:"status"` // 交易状态
|
||||
Payment string `gorm:"column:payment;comment:实付金额" json:"payment"` // 实付金额
|
||||
TotalFee string `gorm:"column:total_fee;comment:商品金额" json:"total_fee"` // 商品金额
|
||||
PayTime time.Time `gorm:"column:pay_time;comment:付款时间" json:"pay_time"` // 付款时间
|
||||
TradeStatus string `gorm:"column:trade_status;comment:天猫返回状态" json:"trade_status"` // 天猫返回状态
|
||||
BuyerMemo string `gorm:"column:buyer_memo;comment:买家备注" json:"buyer_memo"` // 买家备注
|
||||
AlipayNo string `gorm:"column:alipay_no;comment:支付宝交易号" json:"alipay_no"` // 支付宝交易号
|
||||
BuyerMessage string `gorm:"column:buyer_message;comment:买家留言" json:"buyer_message"` // 买家留言
|
||||
CreateTime time.Time `gorm:"column:create_time;comment:交易创建时间" json:"create_time"` // 交易创建时间
|
||||
EndTime time.Time `gorm:"column:end_time;comment:交易结束时间" json:"end_time"` // 交易结束时间
|
||||
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
}
|
||||
|
||||
// TableName RechargeTMallShop's table name
|
||||
func (*RechargeTMallShop) TableName() string {
|
||||
return TableNameRechargeTMallShop
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameRechargeTMallShopHistory = "recharge_t_mall_shop_history"
|
||||
|
||||
// RechargeTMallShopHistory mapped from table <recharge_t_mall_shop_history>
|
||||
type RechargeTMallShopHistory struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
ShopID int32 `gorm:"column:shop_id;comment:关联订单" json:"shop_id"` // 关联订单
|
||||
RawData string `gorm:"column:raw_data;comment:原始记录" json:"raw_data"` // 原始记录
|
||||
Remark string `gorm:"column:remark;comment:备注" json:"remark"` // 备注
|
||||
Status string `gorm:"column:status;comment:操作状态" json:"status"` // 操作状态
|
||||
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
}
|
||||
|
||||
// TableName RechargeTMallShopHistory's table name
|
||||
func (*RechargeTMallShopHistory) TableName() string {
|
||||
return TableNameRechargeTMallShopHistory
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameRestrictClientAccessIPRelation = "restrict_client_access_ip_relation"
|
||||
|
||||
// RestrictClientAccessIPRelation mapped from table <restrict_client_access_ip_relation>
|
||||
type RestrictClientAccessIPRelation struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
IP string `gorm:"column:ip;comment:IP地址" json:"ip"` // IP地址
|
||||
IsRemoteIP []uint8 `gorm:"column:is_remote_ip" json:"is_remote_ip"`
|
||||
RestrictIPRecordID int32 `gorm:"column:restrict_ip_record_id;comment:限制IP详情" json:"restrict_ip_record_id"` // 限制IP详情
|
||||
RestrictClientAccessRecordID int32 `gorm:"column:restrict_client_access_record_id;comment:IP访问地址详情" json:"restrict_client_access_record_id"` // IP访问地址详情
|
||||
SessionID string `gorm:"column:session_id;comment:回话ID" json:"session_id"` // 回话ID
|
||||
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
}
|
||||
|
||||
// TableName RestrictClientAccessIPRelation's table name
|
||||
func (*RestrictClientAccessIPRelation) TableName() string {
|
||||
return TableNameRestrictClientAccessIPRelation
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameRestrictClientAccessRecord = "restrict_client_access_record"
|
||||
|
||||
// RestrictClientAccessRecord mapped from table <restrict_client_access_record>
|
||||
type RestrictClientAccessRecord struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
VisitorID string `gorm:"column:visitor_id;comment:访问ID" json:"visitor_id"` // 访问ID
|
||||
DeviceModel string `gorm:"column:device_model;comment:设备型号" json:"device_model"` // 设备型号
|
||||
UserAgent string `gorm:"column:user_agent;comment:用户浏览器代理" json:"user_agent"` // 用户浏览器代理
|
||||
IsUseProxy []uint8 `gorm:"column:is_use_proxy;comment:是否使用代理" json:"is_use_proxy"` // 是否使用代理
|
||||
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
}
|
||||
|
||||
// TableName RestrictClientAccessRecord's table name
|
||||
func (*RestrictClientAccessRecord) TableName() string {
|
||||
return TableNameRestrictClientAccessRecord
|
||||
}
|
||||
33
verification/internal/model/restrict_ip_order_access.gen.go
Normal file
33
verification/internal/model/restrict_ip_order_access.gen.go
Normal file
@@ -0,0 +1,33 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameRestrictIPOrderAccess = "restrict_ip_order_access"
|
||||
|
||||
// RestrictIPOrderAccess mapped from table <restrict_ip_order_access>
|
||||
type RestrictIPOrderAccess struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
RestrictIPID int32 `gorm:"column:restrict_ip_id;comment:关联的IP地址" json:"restrict_ip_id"` // 关联的IP地址
|
||||
OrderNo string `gorm:"column:order_no;comment:订单号" json:"order_no"` // 订单号
|
||||
CardPass string `gorm:"column:card_pass;comment:卡密" json:"card_pass"` // 卡密
|
||||
IP string `gorm:"column:ip;comment:ip地址" json:"ip"` // ip地址
|
||||
Status int32 `gorm:"column:status;comment:状态" json:"status"` // 状态
|
||||
RestrictStrategy string `gorm:"column:restrict_strategy;comment:限制策略" json:"restrict_strategy"` // 限制策略
|
||||
DeviceID string `gorm:"column:device_id;comment:设备ID" json:"device_id"` // 设备ID
|
||||
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
}
|
||||
|
||||
// TableName RestrictIPOrderAccess's table name
|
||||
func (*RestrictIPOrderAccess) TableName() string {
|
||||
return TableNameRestrictIPOrderAccess
|
||||
}
|
||||
30
verification/internal/model/restrict_ip_record.gen.go
Normal file
30
verification/internal/model/restrict_ip_record.gen.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameRestrictIPRecord = "restrict_ip_record"
|
||||
|
||||
// RestrictIPRecord mapped from table <restrict_ip_record>
|
||||
type RestrictIPRecord struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
IP string `gorm:"column:ip;comment:ip地址" json:"ip"` // ip地址
|
||||
IPProvince string `gorm:"column:ip_province;comment:ip地址所在省份或地区" json:"ip_province"` // ip地址所在省份或地区
|
||||
IsPublic []uint8 `gorm:"column:is_public;comment:是否是公共地址" json:"is_public"` // 是否是公共地址
|
||||
RawData string `gorm:"column:raw_data" json:"raw_data"`
|
||||
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
}
|
||||
|
||||
// TableName RestrictIPRecord's table name
|
||||
func (*RestrictIPRecord) TableName() string {
|
||||
return TableNameRestrictIPRecord
|
||||
}
|
||||
52
verification/internal/model/road_info.gen.go
Normal file
52
verification/internal/model/road_info.gen.go
Normal file
@@ -0,0 +1,52 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameRoadInfo = "road_info"
|
||||
|
||||
// RoadInfo 通道数据表
|
||||
type RoadInfo struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键,自增" json:"id"` // 主键,自增
|
||||
Status string `gorm:"column:status;not null;default:active通道状态" json:"status"`
|
||||
RoadName string `gorm:"column:road_name;not null;comment:通道名称" json:"road_name"` // 通道名称
|
||||
RoadUID string `gorm:"column:road_uid;not null;comment:通道唯一id" json:"road_uid"` // 通道唯一id
|
||||
Remark string `gorm:"column:remark;comment:备注" json:"remark"` // 备注
|
||||
ProductName string `gorm:"column:product_name;not null;comment:上游产品名称" json:"product_name"` // 上游产品名称
|
||||
ProductUID string `gorm:"column:product_uid;not null;comment:上游产品编号" json:"product_uid"` // 上游产品编号
|
||||
PayType string `gorm:"column:pay_type;not null;comment:支付类型" json:"pay_type"` // 支付类型
|
||||
BasicFee float64 `gorm:"column:basic_fee;not null;comment:基本汇率/成本汇率" json:"basic_fee"` // 基本汇率/成本汇率
|
||||
SettleFee float64 `gorm:"column:settle_fee;not null;comment:代付手续费" json:"settle_fee"` // 代付手续费
|
||||
TotalLimit float64 `gorm:"column:total_limit;not null;comment:通道总额度" json:"total_limit"` // 通道总额度
|
||||
TodayLimit float64 `gorm:"column:today_limit;not null;comment:每日最多额度" json:"today_limit"` // 每日最多额度
|
||||
SingleMinLimit float64 `gorm:"column:single_min_limit;not null;comment:单笔最小金额" json:"single_min_limit"` // 单笔最小金额
|
||||
SingleMaxLimit float64 `gorm:"column:single_max_limit;not null;comment:单笔最大金额" json:"single_max_limit"` // 单笔最大金额
|
||||
StarHour int32 `gorm:"column:star_hour;not null;comment:通道开始时间" json:"star_hour"` // 通道开始时间
|
||||
EndHour int32 `gorm:"column:end_hour;not null;comment:通道结束时间" json:"end_hour"` // 通道结束时间
|
||||
Params string `gorm:"column:params;comment:参数json格式" json:"params"` // 参数json格式
|
||||
TodayIncome float64 `gorm:"column:today_income;not null;default:0.000;comment:当天的收入" json:"today_income"` // 当天的收入
|
||||
TotalIncome float64 `gorm:"column:total_income;not null;default:0.000;comment:通道总收入" json:"total_income"` // 通道总收入
|
||||
TodayProfit float64 `gorm:"column:today_profit;not null;default:0.000;comment:当天的收益" json:"today_profit"` // 当天的收益
|
||||
TotalProfit float64 `gorm:"column:total_profit;not null;default:0.000;comment:通道总收益" json:"total_profit"` // 通道总收益
|
||||
Balance float64 `gorm:"column:balance;not null;default:0.000;comment:通道的余额" json:"balance"` // 通道的余额
|
||||
RequestAll int32 `gorm:"column:request_all;comment:请求总次数" json:"request_all"` // 请求总次数
|
||||
RequestSuccess int32 `gorm:"column:request_success;comment:请求成功次数" json:"request_success"` // 请求成功次数
|
||||
UpdateTime time.Time `gorm:"column:update_time;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"update_time"` // 更新时间
|
||||
CreateTime time.Time `gorm:"column:create_time;comment:创建时间" json:"create_time"` // 创建时间
|
||||
TodayRequestAll int32 `gorm:"column:today_request_all" json:"today_request_all"`
|
||||
TodayRequestSuccess int32 `gorm:"column:today_request_success" json:"today_request_success"`
|
||||
ProductCode string `gorm:"column:product_code;comment:产品编码" json:"product_code"` // 产品编码
|
||||
PaymentHTML string `gorm:"column:payment_html;comment:支付页面模板,需要与前段对齐)" json:"payment_html"` // 支付页面模板,需要与前段对齐)
|
||||
TransactionType string `gorm:"column:transaction_type" json:"transaction_type"`
|
||||
IsAllowDifferentResend int32 `gorm:"column:is_allow_different_resend" json:"is_allow_different_resend"`
|
||||
}
|
||||
|
||||
// TableName RoadInfo's table name
|
||||
func (*RoadInfo) TableName() string {
|
||||
return TableNameRoadInfo
|
||||
}
|
||||
27
verification/internal/model/road_pool_info.gen.go
Normal file
27
verification/internal/model/road_pool_info.gen.go
Normal file
@@ -0,0 +1,27 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameRoadPoolInfo = "road_pool_info"
|
||||
|
||||
// RoadPoolInfo 通道池
|
||||
type RoadPoolInfo struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键,自增" json:"id"` // 主键,自增
|
||||
Status string `gorm:"column:status;not null;default:active;comment:通道池状态" json:"status"` // 通道池状态
|
||||
RoadPoolName string `gorm:"column:road_pool_name;not null;comment:通道池名称" json:"road_pool_name"` // 通道池名称
|
||||
RoadPoolCode string `gorm:"column:road_pool_code;not null;comment:通道池编号" json:"road_pool_code"` // 通道池编号
|
||||
RoadUIDPool string `gorm:"column:road_uid_pool;comment:通道池里面的通道uid" json:"road_uid_pool"` // 通道池里面的通道uid
|
||||
UpdateTime time.Time `gorm:"column:update_time;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"update_time"` // 更新时间
|
||||
CreateTime time.Time `gorm:"column:create_time;comment:创建时间" json:"create_time"` // 创建时间
|
||||
}
|
||||
|
||||
// TableName RoadPoolInfo's table name
|
||||
func (*RoadPoolInfo) TableName() string {
|
||||
return TableNameRoadPoolInfo
|
||||
}
|
||||
34
verification/internal/model/role_info.gen.go
Normal file
34
verification/internal/model/role_info.gen.go
Normal file
@@ -0,0 +1,34 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameRoleInfo = "role_info"
|
||||
|
||||
// RoleInfo 角色表
|
||||
type RoleInfo struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键,自增" json:"id"` // 主键,自增
|
||||
RoleName string `gorm:"column:role_name;not null;comment:角色名称" json:"role_name"` // 角色名称
|
||||
RoleUID string `gorm:"column:role_uid;not null;comment:角色唯一标识号" json:"role_uid"` // 角色唯一标识号
|
||||
ShowFirstMenu string `gorm:"column:show_first_menu;not null;comment:可以展示的一级菜单名" json:"show_first_menu"` // 可以展示的一级菜单名
|
||||
ShowFirstUID string `gorm:"column:show_first_uid;not null;comment:可以展示的一级菜单uid" json:"show_first_uid"` // 可以展示的一级菜单uid
|
||||
ShowSecondMenu string `gorm:"column:show_second_menu;not null;comment:可以展示的二级菜单名" json:"show_second_menu"` // 可以展示的二级菜单名
|
||||
ShowSecondUID string `gorm:"column:show_second_uid;not null;comment:可以展示的二级菜单uid" json:"show_second_uid"` // 可以展示的二级菜单uid
|
||||
ShowPower string `gorm:"column:show_power;not null;comment:可以展示的权限项名称" json:"show_power"` // 可以展示的权限项名称
|
||||
ShowPowerUID string `gorm:"column:show_power_uid;not null;comment:可以展示的权限项uid" json:"show_power_uid"` // 可以展示的权限项uid
|
||||
Remark string `gorm:"column:remark;not null;comment:角色描述" json:"remark"` // 角色描述
|
||||
Creater string `gorm:"column:creater;not null;comment:创建者的id" json:"creater"` // 创建者的id
|
||||
Status string `gorm:"column:status;not null;default:active;comment:菜单的状态情况,默认是active" json:"status"` // 菜单的状态情况,默认是active
|
||||
CreateTime time.Time `gorm:"column:create_time;comment:创建时间" json:"create_time"` // 创建时间
|
||||
UpdateTime time.Time `gorm:"column:update_time;not null;default:CURRENT_TIMESTAMP;comment:最近更新时间" json:"update_time"` // 最近更新时间
|
||||
}
|
||||
|
||||
// TableName RoleInfo's table name
|
||||
func (*RoleInfo) TableName() string {
|
||||
return TableNameRoleInfo
|
||||
}
|
||||
18
verification/internal/model/schema_migrations.gen.go
Normal file
18
verification/internal/model/schema_migrations.gen.go
Normal file
@@ -0,0 +1,18 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
const TableNameSchemaMigration = "schema_migrations"
|
||||
|
||||
// SchemaMigration mapped from table <schema_migrations>
|
||||
type SchemaMigration struct {
|
||||
Version int64 `gorm:"column:version;primaryKey" json:"version"`
|
||||
Dirty bool `gorm:"column:dirty;not null" json:"dirty"`
|
||||
}
|
||||
|
||||
// TableName SchemaMigration's table name
|
||||
func (*SchemaMigration) TableName() string {
|
||||
return TableNameSchemaMigration
|
||||
}
|
||||
32
verification/internal/model/second_menu_info.gen.go
Normal file
32
verification/internal/model/second_menu_info.gen.go
Normal file
@@ -0,0 +1,32 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameSecondMenuInfo = "second_menu_info"
|
||||
|
||||
// SecondMenuInfo 存放左侧栏的二级菜单
|
||||
type SecondMenuInfo struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键,自增" json:"id"` // 主键,自增
|
||||
FirstMenuOrder int32 `gorm:"column:first_menu_order;not null;comment:一级菜单对应的顺序" json:"first_menu_order"` // 一级菜单对应的顺序
|
||||
MenuOrder int32 `gorm:"column:menu_order;not null;comment:二级菜单的排名顺序" json:"menu_order"` // 二级菜单的排名顺序
|
||||
FirstMenuUID string `gorm:"column:first_menu_uid;not null;comment:二级菜单的唯一标识" json:"first_menu_uid"` // 二级菜单的唯一标识
|
||||
FirstMenu string `gorm:"column:first_menu;not null;comment:一级菜单名称,字符不能超过50" json:"first_menu"` // 一级菜单名称,字符不能超过50
|
||||
SecondMenuUID string `gorm:"column:second_menu_uid;not null;comment:二级菜单唯一标识" json:"second_menu_uid"` // 二级菜单唯一标识
|
||||
SecondMenu string `gorm:"column:second_menu;not null;comment:二级菜单名称" json:"second_menu"` // 二级菜单名称
|
||||
SecondRouter string `gorm:"column:second_router;not null;comment:二级菜单路由" json:"second_router"` // 二级菜单路由
|
||||
Creater string `gorm:"column:creater;not null;comment:创建者的id" json:"creater"` // 创建者的id
|
||||
Status string `gorm:"column:status;not null;default:active;comment:菜单的状态情况,默认是active" json:"status"` // 菜单的状态情况,默认是active
|
||||
CreateTime time.Time `gorm:"column:create_time;comment:创建时间" json:"create_time"` // 创建时间
|
||||
UpdateTime time.Time `gorm:"column:update_time;not null;default:CURRENT_TIMESTAMP;comment:最近更新时间" json:"update_time"` // 最近更新时间
|
||||
}
|
||||
|
||||
// TableName SecondMenuInfo's table name
|
||||
func (*SecondMenuInfo) TableName() string {
|
||||
return TableNameSecondMenuInfo
|
||||
}
|
||||
42
verification/internal/model/sys_auth_rule.gen.go
Normal file
42
verification/internal/model/sys_auth_rule.gen.go
Normal file
@@ -0,0 +1,42 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameSysAuthRule = "sys_auth_rule"
|
||||
|
||||
// SysAuthRule 菜单节点表
|
||||
type SysAuthRule struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
Pid int32 `gorm:"column:pid;not null;comment:父ID" json:"pid"` // 父ID
|
||||
Name string `gorm:"column:name;not null;comment:规则名称" json:"name"` // 规则名称
|
||||
Title string `gorm:"column:title;not null;comment:规则名称" json:"title"` // 规则名称
|
||||
Icon string `gorm:"column:icon;not null;comment:图标" json:"icon"` // 图标
|
||||
Condition string `gorm:"column:condition;not null;comment:条件" json:"condition"` // 条件
|
||||
Remark string `gorm:"column:remark;not null;comment:备注" json:"remark"` // 备注
|
||||
MenuType int32 `gorm:"column:menu_type;not null;comment:类型 0目录 1菜单 2按钮" json:"menu_type"` // 类型 0目录 1菜单 2按钮
|
||||
Weigh int32 `gorm:"column:weigh;not null;comment:权重" json:"weigh"` // 权重
|
||||
IsHide int32 `gorm:"column:is_hide;not null;comment:显示状态" json:"is_hide"` // 显示状态
|
||||
Path string `gorm:"column:path;not null;comment:路由地址" json:"path"` // 路由地址
|
||||
Component string `gorm:"column:component;not null;comment:组件路径" json:"component"` // 组件路径
|
||||
IsLink int32 `gorm:"column:is_link;not null;comment:是否外链 1是 0否" json:"is_link"` // 是否外链 1是 0否
|
||||
ModuleType string `gorm:"column:module_type;not null;comment:所属模块" json:"module_type"` // 所属模块
|
||||
ModelID int32 `gorm:"column:model_id;not null;comment:模型ID" json:"model_id"` // 模型ID
|
||||
IsIframe int32 `gorm:"column:is_iframe;not null;comment:是否内嵌iframe" json:"is_iframe"` // 是否内嵌iframe
|
||||
IsCached int32 `gorm:"column:is_cached;not null;comment:是否缓存" json:"is_cached"` // 是否缓存
|
||||
Redirect string `gorm:"column:redirect;not null;comment:路由重定向地址" json:"redirect"` // 路由重定向地址
|
||||
IsAffix int32 `gorm:"column:is_affix;not null;comment:是否固定" json:"is_affix"` // 是否固定
|
||||
LinkURL string `gorm:"column:link_url;not null;comment:链接地址" json:"link_url"` // 链接地址
|
||||
CreatedAt time.Time `gorm:"column:created_at;comment:创建日期" json:"created_at"` // 创建日期
|
||||
UpdatedAt time.Time `gorm:"column:updated_at;comment:修改日期" json:"updated_at"` // 修改日期
|
||||
}
|
||||
|
||||
// TableName SysAuthRule's table name
|
||||
func (*SysAuthRule) TableName() string {
|
||||
return TableNameSysAuthRule
|
||||
}
|
||||
23
verification/internal/model/sys_casbin_rule.gen.go
Normal file
23
verification/internal/model/sys_casbin_rule.gen.go
Normal file
@@ -0,0 +1,23 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
const TableNameSysCasbinRule = "sys_casbin_rule"
|
||||
|
||||
// SysCasbinRule mapped from table <sys_casbin_rule>
|
||||
type SysCasbinRule struct {
|
||||
Ptype string `gorm:"column:ptype" json:"ptype"`
|
||||
V0 string `gorm:"column:v0" json:"v0"`
|
||||
V1 string `gorm:"column:v1" json:"v1"`
|
||||
V2 string `gorm:"column:v2" json:"v2"`
|
||||
V3 string `gorm:"column:v3" json:"v3"`
|
||||
V4 string `gorm:"column:v4" json:"v4"`
|
||||
V5 string `gorm:"column:v5" json:"v5"`
|
||||
}
|
||||
|
||||
// TableName SysCasbinRule's table name
|
||||
func (*SysCasbinRule) TableName() string {
|
||||
return TableNameSysCasbinRule
|
||||
}
|
||||
29
verification/internal/model/sys_config_dict.gen.go
Normal file
29
verification/internal/model/sys_config_dict.gen.go
Normal file
@@ -0,0 +1,29 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameSysConfigDict = "sys_config_dict"
|
||||
|
||||
// SysConfigDict mapped from table <sys_config_dict>
|
||||
type SysConfigDict struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
Name string `gorm:"column:name" json:"name"`
|
||||
Key string `gorm:"column:key;not null" json:"key"`
|
||||
Value string `gorm:"column:value" json:"value"`
|
||||
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
}
|
||||
|
||||
// TableName SysConfigDict's table name
|
||||
func (*SysConfigDict) TableName() string {
|
||||
return TableNameSysConfigDict
|
||||
}
|
||||
28
verification/internal/model/sys_role.gen.go
Normal file
28
verification/internal/model/sys_role.gen.go
Normal file
@@ -0,0 +1,28 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameSysRole = "sys_role"
|
||||
|
||||
// SysRole 角色表
|
||||
type SysRole struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
Status int32 `gorm:"column:status;not null;comment:状态;0:禁用;1:正常" json:"status"` // 状态;0:禁用;1:正常
|
||||
ListOrder int32 `gorm:"column:list_order;not null;comment:排序" json:"list_order"` // 排序
|
||||
Name string `gorm:"column:name;not null;comment:角色名称" json:"name"` // 角色名称
|
||||
Remark string `gorm:"column:remark;not null;comment:备注" json:"remark"` // 备注
|
||||
DataScope int32 `gorm:"column:data_scope;not null;default:3;comment:数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)" json:"data_scope"` // 数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)
|
||||
CreatedAt time.Time `gorm:"column:created_at;comment:创建时间" json:"created_at"` // 创建时间
|
||||
UpdatedAt time.Time `gorm:"column:updated_at;comment:更新时间" json:"updated_at"` // 更新时间
|
||||
}
|
||||
|
||||
// TableName SysRole's table name
|
||||
func (*SysRole) TableName() string {
|
||||
return TableNameSysRole
|
||||
}
|
||||
34
verification/internal/model/sys_user.gen.go
Normal file
34
verification/internal/model/sys_user.gen.go
Normal file
@@ -0,0 +1,34 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameSysUser = "sys_user"
|
||||
|
||||
// SysUser mapped from table <sys_user>
|
||||
type SysUser struct {
|
||||
ID string `gorm:"column:id;primaryKey;comment:ID" json:"id"` // ID
|
||||
Username string `gorm:"column:username;not null;comment:账号" json:"username"` // 账号
|
||||
NickName string `gorm:"column:nick_name;comment:昵称" json:"nick_name"` // 昵称
|
||||
UserPassword string `gorm:"column:user_password;not null;comment:密码" json:"user_password"` // 密码
|
||||
IsAdmin int32 `gorm:"column:is_admin;comment:是否是管理员" json:"is_admin"` // 是否是管理员
|
||||
UserSalt string `gorm:"column:user_salt" json:"user_salt"`
|
||||
UserStatus int32 `gorm:"column:user_status;comment:用户状态" json:"user_status"` // 用户状态
|
||||
OtpKey string `gorm:"column:otp_key" json:"otp_key"`
|
||||
OtpSecret string `gorm:"column:otp_secret" json:"otp_secret"`
|
||||
CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
}
|
||||
|
||||
// TableName SysUser's table name
|
||||
func (*SysUser) TableName() string {
|
||||
return TableNameSysUser
|
||||
}
|
||||
29
verification/internal/model/sys_user_config_channel.gen.go
Normal file
29
verification/internal/model/sys_user_config_channel.gen.go
Normal file
@@ -0,0 +1,29 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameSysUserConfigChannel = "sys_user_config_channel"
|
||||
|
||||
// SysUserConfigChannel mapped from table <sys_user_config_channel>
|
||||
type SysUserConfigChannel struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
SysUserID string `gorm:"column:sys_user_id;not null" json:"sys_user_id"`
|
||||
Name string `gorm:"column:name;not null;comment:充值通道" json:"name"` // 充值通道
|
||||
Num int32 `gorm:"column:num;comment:充值轮询ck个数" json:"num"` // 充值轮询ck个数
|
||||
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
}
|
||||
|
||||
// TableName SysUserConfigChannel's table name
|
||||
func (*SysUserConfigChannel) TableName() string {
|
||||
return TableNameSysUserConfigChannel
|
||||
}
|
||||
34
verification/internal/model/sys_user_deductions.gen.go
Normal file
34
verification/internal/model/sys_user_deductions.gen.go
Normal file
@@ -0,0 +1,34 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameSysUserDeduction = "sys_user_deductions"
|
||||
|
||||
// SysUserDeduction mapped from table <sys_user_deductions>
|
||||
type SysUserDeduction struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
UserID string `gorm:"column:user_id;comment:用户ID" json:"user_id"` // 用户ID
|
||||
OrderNo string `gorm:"column:order_no;comment:订单编号" json:"order_no"` // 订单编号
|
||||
OrderCategory string `gorm:"column:order_category;comment:订单分类" json:"order_category"` // 订单分类
|
||||
OperationStatus string `gorm:"column:operation_status;comment:操作状态" json:"operation_status"` // 操作状态
|
||||
UserPaymentID int32 `gorm:"column:user_payment_id;comment:用户钱包ID" json:"user_payment_id"` // 用户钱包ID
|
||||
UserPaymentRecordID int32 `gorm:"column:user_payment_record_id;comment:用户钱包流水记录ID" json:"user_payment_record_id"` // 用户钱包流水记录ID
|
||||
Balance float32 `gorm:"column:balance;comment:价格" json:"balance"` // 价格
|
||||
Note string `gorm:"column:note" json:"note"`
|
||||
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
}
|
||||
|
||||
// TableName SysUserDeduction's table name
|
||||
func (*SysUserDeduction) TableName() string {
|
||||
return TableNameSysUserDeduction
|
||||
}
|
||||
37
verification/internal/model/sys_user_login_log.gen.go
Normal file
37
verification/internal/model/sys_user_login_log.gen.go
Normal file
@@ -0,0 +1,37 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameSysUserLoginLog = "sys_user_login_log"
|
||||
|
||||
// SysUserLoginLog mapped from table <sys_user_login_log>
|
||||
type SysUserLoginLog struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
UserID string `gorm:"column:user_id" json:"user_id"`
|
||||
/*
|
||||
登录名
|
||||
|
||||
*/
|
||||
LoginName string `gorm:"column:login_name;comment:登录名\n" json:"login_name"`
|
||||
IPAddr string `gorm:"column:ip_addr;comment:登录IP" json:"ip_addr"` // 登录IP
|
||||
LoginLocation string `gorm:"column:login_location;comment:登录地点" json:"login_location"` // 登录地点
|
||||
UserAgent string `gorm:"column:user_agent" json:"user_agent"`
|
||||
Browser string `gorm:"column:browser" json:"browser"`
|
||||
Os string `gorm:"column:os" json:"os"`
|
||||
CreatedAt time.Time `gorm:"column:created_at;comment:登录时间" json:"created_at"` // 登录时间
|
||||
Status int32 `gorm:"column:status;comment:登录状态 1登录成功2登录失败" json:"status"` // 登录状态 1登录成功2登录失败
|
||||
Message string `gorm:"column:message" json:"message"`
|
||||
LoginTime time.Time `gorm:"column:login_time;comment:登录时长" json:"login_time"` // 登录时长
|
||||
Module string `gorm:"column:module" json:"module"`
|
||||
}
|
||||
|
||||
// TableName SysUserLoginLog's table name
|
||||
func (*SysUserLoginLog) TableName() string {
|
||||
return TableNameSysUserLoginLog
|
||||
}
|
||||
36
verification/internal/model/sys_user_payment.gen.go
Normal file
36
verification/internal/model/sys_user_payment.gen.go
Normal file
@@ -0,0 +1,36 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameSysUserPayment = "sys_user_payment"
|
||||
|
||||
// SysUserPayment mapped from table <sys_user_payment>
|
||||
type SysUserPayment struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
UserID string `gorm:"column:user_id;primaryKey" json:"user_id"`
|
||||
Balance float64 `gorm:"column:balance;not null;default:0.00;comment:余额" json:"balance"` // 余额
|
||||
TotalDeposits float64 `gorm:"column:total_deposits;not null;default:0.00;comment:总充值金额" json:"total_deposits"` // 总充值金额
|
||||
TotalConsumption float64 `gorm:"column:total_consumption;not null;default:0.00;comment:总消耗金额" json:"total_consumption"` // 总消耗金额
|
||||
LastDepositTime time.Time `gorm:"column:last_deposit_time" json:"last_deposit_time"`
|
||||
LastConsumptionTime time.Time `gorm:"column:last_consumption_time;comment:上次消耗时间" json:"last_consumption_time"` // 上次消耗时间
|
||||
TotalDepositCount int32 `gorm:"column:total_deposit_count;not null;comment:总充值次数" json:"total_deposit_count"` // 总充值次数
|
||||
TotalConsumptionCount int32 `gorm:"column:total_consumption_count;not null;comment:总消耗次数" json:"total_consumption_count"` // 总消耗次数
|
||||
Status string `gorm:"column:status;comment:0.禁用 1.正常 3.关闭" json:"status"` // 0.禁用 1.正常 3.关闭
|
||||
Notes string `gorm:"column:notes;comment:备注" json:"notes"` // 备注
|
||||
CreatedAt time.Time `gorm:"column:created_at;not null" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
}
|
||||
|
||||
// TableName SysUserPayment's table name
|
||||
func (*SysUserPayment) TableName() string {
|
||||
return TableNameSysUserPayment
|
||||
}
|
||||
36
verification/internal/model/sys_user_payment_records.gen.go
Normal file
36
verification/internal/model/sys_user_payment_records.gen.go
Normal file
@@ -0,0 +1,36 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameSysUserPaymentRecord = "sys_user_payment_records"
|
||||
|
||||
// SysUserPaymentRecord mapped from table <sys_user_payment_records>
|
||||
type SysUserPaymentRecord struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键" json:"id"` // 主键
|
||||
TransactionID string `gorm:"column:transaction_id;primaryKey;comment:交易唯一ID" json:"transaction_id"` // 交易唯一ID
|
||||
PaymentID int32 `gorm:"column:payment_id;not null;comment:钱包ID" json:"payment_id"` // 钱包ID
|
||||
DeductionID string `gorm:"column:deduction_id;comment:预扣款ID" json:"deduction_id"` // 预扣款ID
|
||||
UserID string `gorm:"column:user_id;not null" json:"user_id"`
|
||||
Amount float64 `gorm:"column:amount;not null;comment:操作金额" json:"amount"` // 操作金额
|
||||
TransactionType string `gorm:"column:transaction_type;not null;comment:交易类型 1deposit 2.withdrawal" json:"transaction_type"` // 交易类型 1deposit 2.withdrawal
|
||||
OrderNo string `gorm:"column:order_no;comment:订单号" json:"order_no"` // 订单号
|
||||
Status string `gorm:"column:status;not null;comment:交易状态:0.失败 1.成功" json:"status"` // 交易状态:0.失败 1.成功
|
||||
Category string `gorm:"column:category" json:"category"`
|
||||
Notes string `gorm:"column:notes;comment:备注" json:"notes"` // 备注
|
||||
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
||||
}
|
||||
|
||||
// TableName SysUserPaymentRecord's table name
|
||||
func (*SysUserPaymentRecord) TableName() string {
|
||||
return TableNameSysUserPaymentRecord
|
||||
}
|
||||
25
verification/internal/model/task_order_fake.gen.go
Normal file
25
verification/internal/model/task_order_fake.gen.go
Normal file
@@ -0,0 +1,25 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameTaskOrderFake = "task_order_fake"
|
||||
|
||||
// TaskOrderFake mapped from table <task_order_fake>
|
||||
type TaskOrderFake struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
|
||||
RoadUID string `gorm:"column:road_uid" json:"road_uid"`
|
||||
BankOrderID string `gorm:"column:bank_order_id" json:"bank_order_id"`
|
||||
OrderAmount float32 `gorm:"column:order_amount;comment:订单金额" json:"order_amount"` // 订单金额
|
||||
CreateTime time.Time `gorm:"column:create_time;not null;default:CURRENT_TIMESTAMP(3)" json:"create_time"`
|
||||
}
|
||||
|
||||
// TableName TaskOrderFake's table name
|
||||
func (*TaskOrderFake) TableName() string {
|
||||
return TableNameTaskOrderFake
|
||||
}
|
||||
33
verification/internal/model/user_info.gen.go
Normal file
33
verification/internal/model/user_info.gen.go
Normal file
@@ -0,0 +1,33 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const TableNameUserInfo = "user_info"
|
||||
|
||||
// UserInfo 管理员表
|
||||
type UserInfo struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键,自增" json:"id"` // 主键,自增
|
||||
UserID string `gorm:"column:user_id;not null;comment:用户登录号" json:"user_id"` // 用户登录号
|
||||
Passwd string `gorm:"column:passwd;not null;comment:用户登录密码" json:"passwd"` // 用户登录密码
|
||||
Nick string `gorm:"column:nick;not null;default:kity;comment:用户昵称" json:"nick"` // 用户昵称
|
||||
Remark string `gorm:"column:remark;comment:备注" json:"remark"` // 备注
|
||||
IP string `gorm:"column:ip;not null;default:127.0.0.1;comment:用户当前ip" json:"ip"` // 用户当前ip
|
||||
Status string `gorm:"column:status;not null;default:active;comment:该用户的状态 active、unactive、delete" json:"status"` // 该用户的状态 active、unactive、delete
|
||||
Role string `gorm:"column:role;not null;default:nothing;comment:管理者分配的角色" json:"role"` // 管理者分配的角色
|
||||
RoleName string `gorm:"column:role_name;not null;default:普通操作员;comment:操作员分配的角色名称" json:"role_name"` // 操作员分配的角色名称
|
||||
OtpSecret string `gorm:"column:otp_secret" json:"otp_secret"`
|
||||
OtpKey string `gorm:"column:otp_key" json:"otp_key"`
|
||||
CreateTime time.Time `gorm:"column:create_time;comment:创建时间" json:"create_time"` // 创建时间
|
||||
UpdateTime time.Time `gorm:"column:update_time;not null;default:CURRENT_TIMESTAMP;comment:最后一次修改时间" json:"update_time"` // 最后一次修改时间
|
||||
}
|
||||
|
||||
// TableName UserInfo's table name
|
||||
func (*UserInfo) TableName() string {
|
||||
return TableNameUserInfo
|
||||
}
|
||||
368
verification/internal/query/account_history_info.gen.go
Normal file
368
verification/internal/query/account_history_info.gen.go
Normal file
@@ -0,0 +1,368 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package query
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
|
||||
"gorm.io/gen"
|
||||
"gorm.io/gen/field"
|
||||
|
||||
"gorm.io/plugin/dbresolver"
|
||||
|
||||
"order/internal/model"
|
||||
)
|
||||
|
||||
func newAccountHistoryInfo(db *gorm.DB, opts ...gen.DOOption) accountHistoryInfo {
|
||||
_accountHistoryInfo := accountHistoryInfo{}
|
||||
|
||||
_accountHistoryInfo.accountHistoryInfoDo.UseDB(db, opts...)
|
||||
_accountHistoryInfo.accountHistoryInfoDo.UseModel(&model.AccountHistoryInfo{})
|
||||
|
||||
tableName := _accountHistoryInfo.accountHistoryInfoDo.TableName()
|
||||
_accountHistoryInfo.ALL = field.NewAsterisk(tableName)
|
||||
_accountHistoryInfo.ID = field.NewInt32(tableName, "id")
|
||||
_accountHistoryInfo.AccountUID = field.NewString(tableName, "account_uid")
|
||||
_accountHistoryInfo.AccountName = field.NewString(tableName, "account_name")
|
||||
_accountHistoryInfo.Type = field.NewString(tableName, "type")
|
||||
_accountHistoryInfo.Amount = field.NewFloat64(tableName, "amount")
|
||||
_accountHistoryInfo.Balance = field.NewFloat64(tableName, "balance")
|
||||
_accountHistoryInfo.OrderID = field.NewString(tableName, "order_id")
|
||||
_accountHistoryInfo.UpdateTime = field.NewTime(tableName, "update_time")
|
||||
_accountHistoryInfo.CreateTime = field.NewTime(tableName, "create_time")
|
||||
_accountHistoryInfo.FeeAmount = field.NewFloat32(tableName, "fee_amount")
|
||||
|
||||
_accountHistoryInfo.fillFieldMap()
|
||||
|
||||
return _accountHistoryInfo
|
||||
}
|
||||
|
||||
// accountHistoryInfo 账户账户资金动向表
|
||||
type accountHistoryInfo struct {
|
||||
accountHistoryInfoDo accountHistoryInfoDo
|
||||
|
||||
ALL field.Asterisk
|
||||
ID field.Int32 // 主键,自增
|
||||
AccountUID field.String // 账号uid
|
||||
AccountName field.String // 账户名称
|
||||
Type field.String // 减款,加款
|
||||
Amount field.Float64 // 操作对应金额对应的金额
|
||||
Balance field.Float64 // 操作后的当前余额
|
||||
OrderID field.String // 订单ID
|
||||
UpdateTime field.Time // 更新时间
|
||||
CreateTime field.Time // 创建时间
|
||||
FeeAmount field.Float32 // 系统扣除的手续费金额
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
|
||||
func (a accountHistoryInfo) Table(newTableName string) *accountHistoryInfo {
|
||||
a.accountHistoryInfoDo.UseTable(newTableName)
|
||||
return a.updateTableName(newTableName)
|
||||
}
|
||||
|
||||
func (a accountHistoryInfo) As(alias string) *accountHistoryInfo {
|
||||
a.accountHistoryInfoDo.DO = *(a.accountHistoryInfoDo.As(alias).(*gen.DO))
|
||||
return a.updateTableName(alias)
|
||||
}
|
||||
|
||||
func (a *accountHistoryInfo) updateTableName(table string) *accountHistoryInfo {
|
||||
a.ALL = field.NewAsterisk(table)
|
||||
a.ID = field.NewInt32(table, "id")
|
||||
a.AccountUID = field.NewString(table, "account_uid")
|
||||
a.AccountName = field.NewString(table, "account_name")
|
||||
a.Type = field.NewString(table, "type")
|
||||
a.Amount = field.NewFloat64(table, "amount")
|
||||
a.Balance = field.NewFloat64(table, "balance")
|
||||
a.OrderID = field.NewString(table, "order_id")
|
||||
a.UpdateTime = field.NewTime(table, "update_time")
|
||||
a.CreateTime = field.NewTime(table, "create_time")
|
||||
a.FeeAmount = field.NewFloat32(table, "fee_amount")
|
||||
|
||||
a.fillFieldMap()
|
||||
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *accountHistoryInfo) WithContext(ctx context.Context) *accountHistoryInfoDo {
|
||||
return a.accountHistoryInfoDo.WithContext(ctx)
|
||||
}
|
||||
|
||||
func (a accountHistoryInfo) TableName() string { return a.accountHistoryInfoDo.TableName() }
|
||||
|
||||
func (a accountHistoryInfo) Alias() string { return a.accountHistoryInfoDo.Alias() }
|
||||
|
||||
func (a accountHistoryInfo) Columns(cols ...field.Expr) gen.Columns {
|
||||
return a.accountHistoryInfoDo.Columns(cols...)
|
||||
}
|
||||
|
||||
func (a *accountHistoryInfo) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
||||
_f, ok := a.fieldMap[fieldName]
|
||||
if !ok || _f == nil {
|
||||
return nil, false
|
||||
}
|
||||
_oe, ok := _f.(field.OrderExpr)
|
||||
return _oe, ok
|
||||
}
|
||||
|
||||
func (a *accountHistoryInfo) fillFieldMap() {
|
||||
a.fieldMap = make(map[string]field.Expr, 10)
|
||||
a.fieldMap["id"] = a.ID
|
||||
a.fieldMap["account_uid"] = a.AccountUID
|
||||
a.fieldMap["account_name"] = a.AccountName
|
||||
a.fieldMap["type"] = a.Type
|
||||
a.fieldMap["amount"] = a.Amount
|
||||
a.fieldMap["balance"] = a.Balance
|
||||
a.fieldMap["order_id"] = a.OrderID
|
||||
a.fieldMap["update_time"] = a.UpdateTime
|
||||
a.fieldMap["create_time"] = a.CreateTime
|
||||
a.fieldMap["fee_amount"] = a.FeeAmount
|
||||
}
|
||||
|
||||
func (a accountHistoryInfo) clone(db *gorm.DB) accountHistoryInfo {
|
||||
a.accountHistoryInfoDo.ReplaceConnPool(db.Statement.ConnPool)
|
||||
return a
|
||||
}
|
||||
|
||||
func (a accountHistoryInfo) replaceDB(db *gorm.DB) accountHistoryInfo {
|
||||
a.accountHistoryInfoDo.ReplaceDB(db)
|
||||
return a
|
||||
}
|
||||
|
||||
type accountHistoryInfoDo struct{ gen.DO }
|
||||
|
||||
func (a accountHistoryInfoDo) Debug() *accountHistoryInfoDo {
|
||||
return a.withDO(a.DO.Debug())
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) WithContext(ctx context.Context) *accountHistoryInfoDo {
|
||||
return a.withDO(a.DO.WithContext(ctx))
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) ReadDB() *accountHistoryInfoDo {
|
||||
return a.Clauses(dbresolver.Read)
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) WriteDB() *accountHistoryInfoDo {
|
||||
return a.Clauses(dbresolver.Write)
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) Session(config *gorm.Session) *accountHistoryInfoDo {
|
||||
return a.withDO(a.DO.Session(config))
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) Clauses(conds ...clause.Expression) *accountHistoryInfoDo {
|
||||
return a.withDO(a.DO.Clauses(conds...))
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) Returning(value interface{}, columns ...string) *accountHistoryInfoDo {
|
||||
return a.withDO(a.DO.Returning(value, columns...))
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) Not(conds ...gen.Condition) *accountHistoryInfoDo {
|
||||
return a.withDO(a.DO.Not(conds...))
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) Or(conds ...gen.Condition) *accountHistoryInfoDo {
|
||||
return a.withDO(a.DO.Or(conds...))
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) Select(conds ...field.Expr) *accountHistoryInfoDo {
|
||||
return a.withDO(a.DO.Select(conds...))
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) Where(conds ...gen.Condition) *accountHistoryInfoDo {
|
||||
return a.withDO(a.DO.Where(conds...))
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) Order(conds ...field.Expr) *accountHistoryInfoDo {
|
||||
return a.withDO(a.DO.Order(conds...))
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) Distinct(cols ...field.Expr) *accountHistoryInfoDo {
|
||||
return a.withDO(a.DO.Distinct(cols...))
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) Omit(cols ...field.Expr) *accountHistoryInfoDo {
|
||||
return a.withDO(a.DO.Omit(cols...))
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) Join(table schema.Tabler, on ...field.Expr) *accountHistoryInfoDo {
|
||||
return a.withDO(a.DO.Join(table, on...))
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) LeftJoin(table schema.Tabler, on ...field.Expr) *accountHistoryInfoDo {
|
||||
return a.withDO(a.DO.LeftJoin(table, on...))
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) RightJoin(table schema.Tabler, on ...field.Expr) *accountHistoryInfoDo {
|
||||
return a.withDO(a.DO.RightJoin(table, on...))
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) Group(cols ...field.Expr) *accountHistoryInfoDo {
|
||||
return a.withDO(a.DO.Group(cols...))
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) Having(conds ...gen.Condition) *accountHistoryInfoDo {
|
||||
return a.withDO(a.DO.Having(conds...))
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) Limit(limit int) *accountHistoryInfoDo {
|
||||
return a.withDO(a.DO.Limit(limit))
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) Offset(offset int) *accountHistoryInfoDo {
|
||||
return a.withDO(a.DO.Offset(offset))
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *accountHistoryInfoDo {
|
||||
return a.withDO(a.DO.Scopes(funcs...))
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) Unscoped() *accountHistoryInfoDo {
|
||||
return a.withDO(a.DO.Unscoped())
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) Create(values ...*model.AccountHistoryInfo) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return a.DO.Create(values)
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) CreateInBatches(values []*model.AccountHistoryInfo, batchSize int) error {
|
||||
return a.DO.CreateInBatches(values, batchSize)
|
||||
}
|
||||
|
||||
// Save : !!! underlying implementation is different with GORM
|
||||
// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values)
|
||||
func (a accountHistoryInfoDo) Save(values ...*model.AccountHistoryInfo) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return a.DO.Save(values)
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) First() (*model.AccountHistoryInfo, error) {
|
||||
if result, err := a.DO.First(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.AccountHistoryInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) Take() (*model.AccountHistoryInfo, error) {
|
||||
if result, err := a.DO.Take(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.AccountHistoryInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) Last() (*model.AccountHistoryInfo, error) {
|
||||
if result, err := a.DO.Last(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.AccountHistoryInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) Find() ([]*model.AccountHistoryInfo, error) {
|
||||
result, err := a.DO.Find()
|
||||
return result.([]*model.AccountHistoryInfo), err
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.AccountHistoryInfo, err error) {
|
||||
buf := make([]*model.AccountHistoryInfo, 0, batchSize)
|
||||
err = a.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error {
|
||||
defer func() { results = append(results, buf...) }()
|
||||
return fc(tx, batch)
|
||||
})
|
||||
return results, err
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) FindInBatches(result *[]*model.AccountHistoryInfo, batchSize int, fc func(tx gen.Dao, batch int) error) error {
|
||||
return a.DO.FindInBatches(result, batchSize, fc)
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) Attrs(attrs ...field.AssignExpr) *accountHistoryInfoDo {
|
||||
return a.withDO(a.DO.Attrs(attrs...))
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) Assign(attrs ...field.AssignExpr) *accountHistoryInfoDo {
|
||||
return a.withDO(a.DO.Assign(attrs...))
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) Joins(fields ...field.RelationField) *accountHistoryInfoDo {
|
||||
for _, _f := range fields {
|
||||
a = *a.withDO(a.DO.Joins(_f))
|
||||
}
|
||||
return &a
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) Preload(fields ...field.RelationField) *accountHistoryInfoDo {
|
||||
for _, _f := range fields {
|
||||
a = *a.withDO(a.DO.Preload(_f))
|
||||
}
|
||||
return &a
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) FirstOrInit() (*model.AccountHistoryInfo, error) {
|
||||
if result, err := a.DO.FirstOrInit(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.AccountHistoryInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) FirstOrCreate() (*model.AccountHistoryInfo, error) {
|
||||
if result, err := a.DO.FirstOrCreate(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.AccountHistoryInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) FindByPage(offset int, limit int) (result []*model.AccountHistoryInfo, count int64, err error) {
|
||||
result, err = a.Offset(offset).Limit(limit).Find()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if size := len(result); 0 < limit && 0 < size && size < limit {
|
||||
count = int64(size + offset)
|
||||
return
|
||||
}
|
||||
|
||||
count, err = a.Offset(-1).Limit(-1).Count()
|
||||
return
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) {
|
||||
count, err = a.Count()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = a.Offset(offset).Limit(limit).Scan(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) Scan(result interface{}) (err error) {
|
||||
return a.DO.Scan(result)
|
||||
}
|
||||
|
||||
func (a accountHistoryInfoDo) Delete(models ...*model.AccountHistoryInfo) (result gen.ResultInfo, err error) {
|
||||
return a.DO.Delete(models)
|
||||
}
|
||||
|
||||
func (a *accountHistoryInfoDo) withDO(do gen.Dao) *accountHistoryInfoDo {
|
||||
a.DO = *do.(*gen.DO)
|
||||
return a
|
||||
}
|
||||
374
verification/internal/query/account_info.gen.go
Normal file
374
verification/internal/query/account_info.gen.go
Normal file
@@ -0,0 +1,374 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package query
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
|
||||
"gorm.io/gen"
|
||||
"gorm.io/gen/field"
|
||||
|
||||
"gorm.io/plugin/dbresolver"
|
||||
|
||||
"order/internal/model"
|
||||
)
|
||||
|
||||
func newAccountInfo(db *gorm.DB, opts ...gen.DOOption) accountInfo {
|
||||
_accountInfo := accountInfo{}
|
||||
|
||||
_accountInfo.accountInfoDo.UseDB(db, opts...)
|
||||
_accountInfo.accountInfoDo.UseModel(&model.AccountInfo{})
|
||||
|
||||
tableName := _accountInfo.accountInfoDo.TableName()
|
||||
_accountInfo.ALL = field.NewAsterisk(tableName)
|
||||
_accountInfo.ID = field.NewInt32(tableName, "id")
|
||||
_accountInfo.Status = field.NewString(tableName, "status")
|
||||
_accountInfo.AccountUID = field.NewString(tableName, "account_uid")
|
||||
_accountInfo.AccountName = field.NewString(tableName, "account_name")
|
||||
_accountInfo.Balance = field.NewFloat64(tableName, "balance")
|
||||
_accountInfo.SettleAmount = field.NewFloat64(tableName, "settle_amount")
|
||||
_accountInfo.LoanAmount = field.NewFloat64(tableName, "loan_amount")
|
||||
_accountInfo.WaitAmount = field.NewFloat64(tableName, "wait_amount")
|
||||
_accountInfo.FreezeAmount = field.NewFloat64(tableName, "freeze_amount")
|
||||
_accountInfo.PayforAmount = field.NewFloat64(tableName, "payfor_amount")
|
||||
_accountInfo.UpdateTime = field.NewTime(tableName, "update_time")
|
||||
_accountInfo.CreateTime = field.NewTime(tableName, "create_time")
|
||||
|
||||
_accountInfo.fillFieldMap()
|
||||
|
||||
return _accountInfo
|
||||
}
|
||||
|
||||
// accountInfo 账户记录表
|
||||
type accountInfo struct {
|
||||
accountInfoDo accountInfoDo
|
||||
|
||||
ALL field.Asterisk
|
||||
ID field.Int32 // 主键,自增
|
||||
Status field.String // 状态
|
||||
AccountUID field.String // 账户uid,对应为merchant_uid或者agent_uid
|
||||
AccountName field.String // 账户名称,对应的是merchant_name或者agent_name
|
||||
Balance field.Float64 // 账户余额
|
||||
SettleAmount field.Float64 // 已经结算了的金额
|
||||
LoanAmount field.Float64 // 押款金额
|
||||
WaitAmount field.Float64 // 待结算资金
|
||||
FreezeAmount field.Float64 // 账户冻结金额
|
||||
PayforAmount field.Float64 // 账户代付中金额
|
||||
UpdateTime field.Time // 更新时间
|
||||
CreateTime field.Time // 创建时间
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
|
||||
func (a accountInfo) Table(newTableName string) *accountInfo {
|
||||
a.accountInfoDo.UseTable(newTableName)
|
||||
return a.updateTableName(newTableName)
|
||||
}
|
||||
|
||||
func (a accountInfo) As(alias string) *accountInfo {
|
||||
a.accountInfoDo.DO = *(a.accountInfoDo.As(alias).(*gen.DO))
|
||||
return a.updateTableName(alias)
|
||||
}
|
||||
|
||||
func (a *accountInfo) updateTableName(table string) *accountInfo {
|
||||
a.ALL = field.NewAsterisk(table)
|
||||
a.ID = field.NewInt32(table, "id")
|
||||
a.Status = field.NewString(table, "status")
|
||||
a.AccountUID = field.NewString(table, "account_uid")
|
||||
a.AccountName = field.NewString(table, "account_name")
|
||||
a.Balance = field.NewFloat64(table, "balance")
|
||||
a.SettleAmount = field.NewFloat64(table, "settle_amount")
|
||||
a.LoanAmount = field.NewFloat64(table, "loan_amount")
|
||||
a.WaitAmount = field.NewFloat64(table, "wait_amount")
|
||||
a.FreezeAmount = field.NewFloat64(table, "freeze_amount")
|
||||
a.PayforAmount = field.NewFloat64(table, "payfor_amount")
|
||||
a.UpdateTime = field.NewTime(table, "update_time")
|
||||
a.CreateTime = field.NewTime(table, "create_time")
|
||||
|
||||
a.fillFieldMap()
|
||||
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *accountInfo) WithContext(ctx context.Context) *accountInfoDo {
|
||||
return a.accountInfoDo.WithContext(ctx)
|
||||
}
|
||||
|
||||
func (a accountInfo) TableName() string { return a.accountInfoDo.TableName() }
|
||||
|
||||
func (a accountInfo) Alias() string { return a.accountInfoDo.Alias() }
|
||||
|
||||
func (a accountInfo) Columns(cols ...field.Expr) gen.Columns { return a.accountInfoDo.Columns(cols...) }
|
||||
|
||||
func (a *accountInfo) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
||||
_f, ok := a.fieldMap[fieldName]
|
||||
if !ok || _f == nil {
|
||||
return nil, false
|
||||
}
|
||||
_oe, ok := _f.(field.OrderExpr)
|
||||
return _oe, ok
|
||||
}
|
||||
|
||||
func (a *accountInfo) fillFieldMap() {
|
||||
a.fieldMap = make(map[string]field.Expr, 12)
|
||||
a.fieldMap["id"] = a.ID
|
||||
a.fieldMap["status"] = a.Status
|
||||
a.fieldMap["account_uid"] = a.AccountUID
|
||||
a.fieldMap["account_name"] = a.AccountName
|
||||
a.fieldMap["balance"] = a.Balance
|
||||
a.fieldMap["settle_amount"] = a.SettleAmount
|
||||
a.fieldMap["loan_amount"] = a.LoanAmount
|
||||
a.fieldMap["wait_amount"] = a.WaitAmount
|
||||
a.fieldMap["freeze_amount"] = a.FreezeAmount
|
||||
a.fieldMap["payfor_amount"] = a.PayforAmount
|
||||
a.fieldMap["update_time"] = a.UpdateTime
|
||||
a.fieldMap["create_time"] = a.CreateTime
|
||||
}
|
||||
|
||||
func (a accountInfo) clone(db *gorm.DB) accountInfo {
|
||||
a.accountInfoDo.ReplaceConnPool(db.Statement.ConnPool)
|
||||
return a
|
||||
}
|
||||
|
||||
func (a accountInfo) replaceDB(db *gorm.DB) accountInfo {
|
||||
a.accountInfoDo.ReplaceDB(db)
|
||||
return a
|
||||
}
|
||||
|
||||
type accountInfoDo struct{ gen.DO }
|
||||
|
||||
func (a accountInfoDo) Debug() *accountInfoDo {
|
||||
return a.withDO(a.DO.Debug())
|
||||
}
|
||||
|
||||
func (a accountInfoDo) WithContext(ctx context.Context) *accountInfoDo {
|
||||
return a.withDO(a.DO.WithContext(ctx))
|
||||
}
|
||||
|
||||
func (a accountInfoDo) ReadDB() *accountInfoDo {
|
||||
return a.Clauses(dbresolver.Read)
|
||||
}
|
||||
|
||||
func (a accountInfoDo) WriteDB() *accountInfoDo {
|
||||
return a.Clauses(dbresolver.Write)
|
||||
}
|
||||
|
||||
func (a accountInfoDo) Session(config *gorm.Session) *accountInfoDo {
|
||||
return a.withDO(a.DO.Session(config))
|
||||
}
|
||||
|
||||
func (a accountInfoDo) Clauses(conds ...clause.Expression) *accountInfoDo {
|
||||
return a.withDO(a.DO.Clauses(conds...))
|
||||
}
|
||||
|
||||
func (a accountInfoDo) Returning(value interface{}, columns ...string) *accountInfoDo {
|
||||
return a.withDO(a.DO.Returning(value, columns...))
|
||||
}
|
||||
|
||||
func (a accountInfoDo) Not(conds ...gen.Condition) *accountInfoDo {
|
||||
return a.withDO(a.DO.Not(conds...))
|
||||
}
|
||||
|
||||
func (a accountInfoDo) Or(conds ...gen.Condition) *accountInfoDo {
|
||||
return a.withDO(a.DO.Or(conds...))
|
||||
}
|
||||
|
||||
func (a accountInfoDo) Select(conds ...field.Expr) *accountInfoDo {
|
||||
return a.withDO(a.DO.Select(conds...))
|
||||
}
|
||||
|
||||
func (a accountInfoDo) Where(conds ...gen.Condition) *accountInfoDo {
|
||||
return a.withDO(a.DO.Where(conds...))
|
||||
}
|
||||
|
||||
func (a accountInfoDo) Order(conds ...field.Expr) *accountInfoDo {
|
||||
return a.withDO(a.DO.Order(conds...))
|
||||
}
|
||||
|
||||
func (a accountInfoDo) Distinct(cols ...field.Expr) *accountInfoDo {
|
||||
return a.withDO(a.DO.Distinct(cols...))
|
||||
}
|
||||
|
||||
func (a accountInfoDo) Omit(cols ...field.Expr) *accountInfoDo {
|
||||
return a.withDO(a.DO.Omit(cols...))
|
||||
}
|
||||
|
||||
func (a accountInfoDo) Join(table schema.Tabler, on ...field.Expr) *accountInfoDo {
|
||||
return a.withDO(a.DO.Join(table, on...))
|
||||
}
|
||||
|
||||
func (a accountInfoDo) LeftJoin(table schema.Tabler, on ...field.Expr) *accountInfoDo {
|
||||
return a.withDO(a.DO.LeftJoin(table, on...))
|
||||
}
|
||||
|
||||
func (a accountInfoDo) RightJoin(table schema.Tabler, on ...field.Expr) *accountInfoDo {
|
||||
return a.withDO(a.DO.RightJoin(table, on...))
|
||||
}
|
||||
|
||||
func (a accountInfoDo) Group(cols ...field.Expr) *accountInfoDo {
|
||||
return a.withDO(a.DO.Group(cols...))
|
||||
}
|
||||
|
||||
func (a accountInfoDo) Having(conds ...gen.Condition) *accountInfoDo {
|
||||
return a.withDO(a.DO.Having(conds...))
|
||||
}
|
||||
|
||||
func (a accountInfoDo) Limit(limit int) *accountInfoDo {
|
||||
return a.withDO(a.DO.Limit(limit))
|
||||
}
|
||||
|
||||
func (a accountInfoDo) Offset(offset int) *accountInfoDo {
|
||||
return a.withDO(a.DO.Offset(offset))
|
||||
}
|
||||
|
||||
func (a accountInfoDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *accountInfoDo {
|
||||
return a.withDO(a.DO.Scopes(funcs...))
|
||||
}
|
||||
|
||||
func (a accountInfoDo) Unscoped() *accountInfoDo {
|
||||
return a.withDO(a.DO.Unscoped())
|
||||
}
|
||||
|
||||
func (a accountInfoDo) Create(values ...*model.AccountInfo) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return a.DO.Create(values)
|
||||
}
|
||||
|
||||
func (a accountInfoDo) CreateInBatches(values []*model.AccountInfo, batchSize int) error {
|
||||
return a.DO.CreateInBatches(values, batchSize)
|
||||
}
|
||||
|
||||
// Save : !!! underlying implementation is different with GORM
|
||||
// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values)
|
||||
func (a accountInfoDo) Save(values ...*model.AccountInfo) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return a.DO.Save(values)
|
||||
}
|
||||
|
||||
func (a accountInfoDo) First() (*model.AccountInfo, error) {
|
||||
if result, err := a.DO.First(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.AccountInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (a accountInfoDo) Take() (*model.AccountInfo, error) {
|
||||
if result, err := a.DO.Take(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.AccountInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (a accountInfoDo) Last() (*model.AccountInfo, error) {
|
||||
if result, err := a.DO.Last(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.AccountInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (a accountInfoDo) Find() ([]*model.AccountInfo, error) {
|
||||
result, err := a.DO.Find()
|
||||
return result.([]*model.AccountInfo), err
|
||||
}
|
||||
|
||||
func (a accountInfoDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.AccountInfo, err error) {
|
||||
buf := make([]*model.AccountInfo, 0, batchSize)
|
||||
err = a.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error {
|
||||
defer func() { results = append(results, buf...) }()
|
||||
return fc(tx, batch)
|
||||
})
|
||||
return results, err
|
||||
}
|
||||
|
||||
func (a accountInfoDo) FindInBatches(result *[]*model.AccountInfo, batchSize int, fc func(tx gen.Dao, batch int) error) error {
|
||||
return a.DO.FindInBatches(result, batchSize, fc)
|
||||
}
|
||||
|
||||
func (a accountInfoDo) Attrs(attrs ...field.AssignExpr) *accountInfoDo {
|
||||
return a.withDO(a.DO.Attrs(attrs...))
|
||||
}
|
||||
|
||||
func (a accountInfoDo) Assign(attrs ...field.AssignExpr) *accountInfoDo {
|
||||
return a.withDO(a.DO.Assign(attrs...))
|
||||
}
|
||||
|
||||
func (a accountInfoDo) Joins(fields ...field.RelationField) *accountInfoDo {
|
||||
for _, _f := range fields {
|
||||
a = *a.withDO(a.DO.Joins(_f))
|
||||
}
|
||||
return &a
|
||||
}
|
||||
|
||||
func (a accountInfoDo) Preload(fields ...field.RelationField) *accountInfoDo {
|
||||
for _, _f := range fields {
|
||||
a = *a.withDO(a.DO.Preload(_f))
|
||||
}
|
||||
return &a
|
||||
}
|
||||
|
||||
func (a accountInfoDo) FirstOrInit() (*model.AccountInfo, error) {
|
||||
if result, err := a.DO.FirstOrInit(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.AccountInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (a accountInfoDo) FirstOrCreate() (*model.AccountInfo, error) {
|
||||
if result, err := a.DO.FirstOrCreate(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.AccountInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (a accountInfoDo) FindByPage(offset int, limit int) (result []*model.AccountInfo, count int64, err error) {
|
||||
result, err = a.Offset(offset).Limit(limit).Find()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if size := len(result); 0 < limit && 0 < size && size < limit {
|
||||
count = int64(size + offset)
|
||||
return
|
||||
}
|
||||
|
||||
count, err = a.Offset(-1).Limit(-1).Count()
|
||||
return
|
||||
}
|
||||
|
||||
func (a accountInfoDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) {
|
||||
count, err = a.Count()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = a.Offset(offset).Limit(limit).Scan(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (a accountInfoDo) Scan(result interface{}) (err error) {
|
||||
return a.DO.Scan(result)
|
||||
}
|
||||
|
||||
func (a accountInfoDo) Delete(models ...*model.AccountInfo) (result gen.ResultInfo, err error) {
|
||||
return a.DO.Delete(models)
|
||||
}
|
||||
|
||||
func (a *accountInfoDo) withDO(do gen.Dao) *accountInfoDo {
|
||||
a.DO = *do.(*gen.DO)
|
||||
return a
|
||||
}
|
||||
366
verification/internal/query/agent_info.gen.go
Normal file
366
verification/internal/query/agent_info.gen.go
Normal file
@@ -0,0 +1,366 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package query
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
|
||||
"gorm.io/gen"
|
||||
"gorm.io/gen/field"
|
||||
|
||||
"gorm.io/plugin/dbresolver"
|
||||
|
||||
"order/internal/model"
|
||||
)
|
||||
|
||||
func newAgentInfo(db *gorm.DB, opts ...gen.DOOption) agentInfo {
|
||||
_agentInfo := agentInfo{}
|
||||
|
||||
_agentInfo.agentInfoDo.UseDB(db, opts...)
|
||||
_agentInfo.agentInfoDo.UseModel(&model.AgentInfo{})
|
||||
|
||||
tableName := _agentInfo.agentInfoDo.TableName()
|
||||
_agentInfo.ALL = field.NewAsterisk(tableName)
|
||||
_agentInfo.ID = field.NewInt32(tableName, "id")
|
||||
_agentInfo.Status = field.NewString(tableName, "status")
|
||||
_agentInfo.AgentName = field.NewString(tableName, "agent_name")
|
||||
_agentInfo.AgentPassword = field.NewString(tableName, "agent_password")
|
||||
_agentInfo.PayPassword = field.NewString(tableName, "pay_password")
|
||||
_agentInfo.AgentUID = field.NewString(tableName, "agent_uid")
|
||||
_agentInfo.AgentPhone = field.NewString(tableName, "agent_phone")
|
||||
_agentInfo.AgentRemark = field.NewString(tableName, "agent_remark")
|
||||
_agentInfo.UpdateTime = field.NewTime(tableName, "update_time")
|
||||
_agentInfo.CreateTime = field.NewTime(tableName, "create_time")
|
||||
|
||||
_agentInfo.fillFieldMap()
|
||||
|
||||
return _agentInfo
|
||||
}
|
||||
|
||||
// agentInfo 代理
|
||||
type agentInfo struct {
|
||||
agentInfoDo agentInfoDo
|
||||
|
||||
ALL field.Asterisk
|
||||
ID field.Int32 // 主键,自增
|
||||
Status field.String // 代理状态状态
|
||||
AgentName field.String // 代理名称
|
||||
AgentPassword field.String // 代理登录密码
|
||||
PayPassword field.String // 支付密码
|
||||
AgentUID field.String // 代理编号
|
||||
AgentPhone field.String // 代理手机号
|
||||
AgentRemark field.String // 备注
|
||||
UpdateTime field.Time // 更新时间
|
||||
CreateTime field.Time // 创建时间
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
|
||||
func (a agentInfo) Table(newTableName string) *agentInfo {
|
||||
a.agentInfoDo.UseTable(newTableName)
|
||||
return a.updateTableName(newTableName)
|
||||
}
|
||||
|
||||
func (a agentInfo) As(alias string) *agentInfo {
|
||||
a.agentInfoDo.DO = *(a.agentInfoDo.As(alias).(*gen.DO))
|
||||
return a.updateTableName(alias)
|
||||
}
|
||||
|
||||
func (a *agentInfo) updateTableName(table string) *agentInfo {
|
||||
a.ALL = field.NewAsterisk(table)
|
||||
a.ID = field.NewInt32(table, "id")
|
||||
a.Status = field.NewString(table, "status")
|
||||
a.AgentName = field.NewString(table, "agent_name")
|
||||
a.AgentPassword = field.NewString(table, "agent_password")
|
||||
a.PayPassword = field.NewString(table, "pay_password")
|
||||
a.AgentUID = field.NewString(table, "agent_uid")
|
||||
a.AgentPhone = field.NewString(table, "agent_phone")
|
||||
a.AgentRemark = field.NewString(table, "agent_remark")
|
||||
a.UpdateTime = field.NewTime(table, "update_time")
|
||||
a.CreateTime = field.NewTime(table, "create_time")
|
||||
|
||||
a.fillFieldMap()
|
||||
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *agentInfo) WithContext(ctx context.Context) *agentInfoDo {
|
||||
return a.agentInfoDo.WithContext(ctx)
|
||||
}
|
||||
|
||||
func (a agentInfo) TableName() string { return a.agentInfoDo.TableName() }
|
||||
|
||||
func (a agentInfo) Alias() string { return a.agentInfoDo.Alias() }
|
||||
|
||||
func (a agentInfo) Columns(cols ...field.Expr) gen.Columns { return a.agentInfoDo.Columns(cols...) }
|
||||
|
||||
func (a *agentInfo) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
||||
_f, ok := a.fieldMap[fieldName]
|
||||
if !ok || _f == nil {
|
||||
return nil, false
|
||||
}
|
||||
_oe, ok := _f.(field.OrderExpr)
|
||||
return _oe, ok
|
||||
}
|
||||
|
||||
func (a *agentInfo) fillFieldMap() {
|
||||
a.fieldMap = make(map[string]field.Expr, 10)
|
||||
a.fieldMap["id"] = a.ID
|
||||
a.fieldMap["status"] = a.Status
|
||||
a.fieldMap["agent_name"] = a.AgentName
|
||||
a.fieldMap["agent_password"] = a.AgentPassword
|
||||
a.fieldMap["pay_password"] = a.PayPassword
|
||||
a.fieldMap["agent_uid"] = a.AgentUID
|
||||
a.fieldMap["agent_phone"] = a.AgentPhone
|
||||
a.fieldMap["agent_remark"] = a.AgentRemark
|
||||
a.fieldMap["update_time"] = a.UpdateTime
|
||||
a.fieldMap["create_time"] = a.CreateTime
|
||||
}
|
||||
|
||||
func (a agentInfo) clone(db *gorm.DB) agentInfo {
|
||||
a.agentInfoDo.ReplaceConnPool(db.Statement.ConnPool)
|
||||
return a
|
||||
}
|
||||
|
||||
func (a agentInfo) replaceDB(db *gorm.DB) agentInfo {
|
||||
a.agentInfoDo.ReplaceDB(db)
|
||||
return a
|
||||
}
|
||||
|
||||
type agentInfoDo struct{ gen.DO }
|
||||
|
||||
func (a agentInfoDo) Debug() *agentInfoDo {
|
||||
return a.withDO(a.DO.Debug())
|
||||
}
|
||||
|
||||
func (a agentInfoDo) WithContext(ctx context.Context) *agentInfoDo {
|
||||
return a.withDO(a.DO.WithContext(ctx))
|
||||
}
|
||||
|
||||
func (a agentInfoDo) ReadDB() *agentInfoDo {
|
||||
return a.Clauses(dbresolver.Read)
|
||||
}
|
||||
|
||||
func (a agentInfoDo) WriteDB() *agentInfoDo {
|
||||
return a.Clauses(dbresolver.Write)
|
||||
}
|
||||
|
||||
func (a agentInfoDo) Session(config *gorm.Session) *agentInfoDo {
|
||||
return a.withDO(a.DO.Session(config))
|
||||
}
|
||||
|
||||
func (a agentInfoDo) Clauses(conds ...clause.Expression) *agentInfoDo {
|
||||
return a.withDO(a.DO.Clauses(conds...))
|
||||
}
|
||||
|
||||
func (a agentInfoDo) Returning(value interface{}, columns ...string) *agentInfoDo {
|
||||
return a.withDO(a.DO.Returning(value, columns...))
|
||||
}
|
||||
|
||||
func (a agentInfoDo) Not(conds ...gen.Condition) *agentInfoDo {
|
||||
return a.withDO(a.DO.Not(conds...))
|
||||
}
|
||||
|
||||
func (a agentInfoDo) Or(conds ...gen.Condition) *agentInfoDo {
|
||||
return a.withDO(a.DO.Or(conds...))
|
||||
}
|
||||
|
||||
func (a agentInfoDo) Select(conds ...field.Expr) *agentInfoDo {
|
||||
return a.withDO(a.DO.Select(conds...))
|
||||
}
|
||||
|
||||
func (a agentInfoDo) Where(conds ...gen.Condition) *agentInfoDo {
|
||||
return a.withDO(a.DO.Where(conds...))
|
||||
}
|
||||
|
||||
func (a agentInfoDo) Order(conds ...field.Expr) *agentInfoDo {
|
||||
return a.withDO(a.DO.Order(conds...))
|
||||
}
|
||||
|
||||
func (a agentInfoDo) Distinct(cols ...field.Expr) *agentInfoDo {
|
||||
return a.withDO(a.DO.Distinct(cols...))
|
||||
}
|
||||
|
||||
func (a agentInfoDo) Omit(cols ...field.Expr) *agentInfoDo {
|
||||
return a.withDO(a.DO.Omit(cols...))
|
||||
}
|
||||
|
||||
func (a agentInfoDo) Join(table schema.Tabler, on ...field.Expr) *agentInfoDo {
|
||||
return a.withDO(a.DO.Join(table, on...))
|
||||
}
|
||||
|
||||
func (a agentInfoDo) LeftJoin(table schema.Tabler, on ...field.Expr) *agentInfoDo {
|
||||
return a.withDO(a.DO.LeftJoin(table, on...))
|
||||
}
|
||||
|
||||
func (a agentInfoDo) RightJoin(table schema.Tabler, on ...field.Expr) *agentInfoDo {
|
||||
return a.withDO(a.DO.RightJoin(table, on...))
|
||||
}
|
||||
|
||||
func (a agentInfoDo) Group(cols ...field.Expr) *agentInfoDo {
|
||||
return a.withDO(a.DO.Group(cols...))
|
||||
}
|
||||
|
||||
func (a agentInfoDo) Having(conds ...gen.Condition) *agentInfoDo {
|
||||
return a.withDO(a.DO.Having(conds...))
|
||||
}
|
||||
|
||||
func (a agentInfoDo) Limit(limit int) *agentInfoDo {
|
||||
return a.withDO(a.DO.Limit(limit))
|
||||
}
|
||||
|
||||
func (a agentInfoDo) Offset(offset int) *agentInfoDo {
|
||||
return a.withDO(a.DO.Offset(offset))
|
||||
}
|
||||
|
||||
func (a agentInfoDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *agentInfoDo {
|
||||
return a.withDO(a.DO.Scopes(funcs...))
|
||||
}
|
||||
|
||||
func (a agentInfoDo) Unscoped() *agentInfoDo {
|
||||
return a.withDO(a.DO.Unscoped())
|
||||
}
|
||||
|
||||
func (a agentInfoDo) Create(values ...*model.AgentInfo) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return a.DO.Create(values)
|
||||
}
|
||||
|
||||
func (a agentInfoDo) CreateInBatches(values []*model.AgentInfo, batchSize int) error {
|
||||
return a.DO.CreateInBatches(values, batchSize)
|
||||
}
|
||||
|
||||
// Save : !!! underlying implementation is different with GORM
|
||||
// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values)
|
||||
func (a agentInfoDo) Save(values ...*model.AgentInfo) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return a.DO.Save(values)
|
||||
}
|
||||
|
||||
func (a agentInfoDo) First() (*model.AgentInfo, error) {
|
||||
if result, err := a.DO.First(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.AgentInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (a agentInfoDo) Take() (*model.AgentInfo, error) {
|
||||
if result, err := a.DO.Take(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.AgentInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (a agentInfoDo) Last() (*model.AgentInfo, error) {
|
||||
if result, err := a.DO.Last(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.AgentInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (a agentInfoDo) Find() ([]*model.AgentInfo, error) {
|
||||
result, err := a.DO.Find()
|
||||
return result.([]*model.AgentInfo), err
|
||||
}
|
||||
|
||||
func (a agentInfoDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.AgentInfo, err error) {
|
||||
buf := make([]*model.AgentInfo, 0, batchSize)
|
||||
err = a.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error {
|
||||
defer func() { results = append(results, buf...) }()
|
||||
return fc(tx, batch)
|
||||
})
|
||||
return results, err
|
||||
}
|
||||
|
||||
func (a agentInfoDo) FindInBatches(result *[]*model.AgentInfo, batchSize int, fc func(tx gen.Dao, batch int) error) error {
|
||||
return a.DO.FindInBatches(result, batchSize, fc)
|
||||
}
|
||||
|
||||
func (a agentInfoDo) Attrs(attrs ...field.AssignExpr) *agentInfoDo {
|
||||
return a.withDO(a.DO.Attrs(attrs...))
|
||||
}
|
||||
|
||||
func (a agentInfoDo) Assign(attrs ...field.AssignExpr) *agentInfoDo {
|
||||
return a.withDO(a.DO.Assign(attrs...))
|
||||
}
|
||||
|
||||
func (a agentInfoDo) Joins(fields ...field.RelationField) *agentInfoDo {
|
||||
for _, _f := range fields {
|
||||
a = *a.withDO(a.DO.Joins(_f))
|
||||
}
|
||||
return &a
|
||||
}
|
||||
|
||||
func (a agentInfoDo) Preload(fields ...field.RelationField) *agentInfoDo {
|
||||
for _, _f := range fields {
|
||||
a = *a.withDO(a.DO.Preload(_f))
|
||||
}
|
||||
return &a
|
||||
}
|
||||
|
||||
func (a agentInfoDo) FirstOrInit() (*model.AgentInfo, error) {
|
||||
if result, err := a.DO.FirstOrInit(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.AgentInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (a agentInfoDo) FirstOrCreate() (*model.AgentInfo, error) {
|
||||
if result, err := a.DO.FirstOrCreate(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.AgentInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (a agentInfoDo) FindByPage(offset int, limit int) (result []*model.AgentInfo, count int64, err error) {
|
||||
result, err = a.Offset(offset).Limit(limit).Find()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if size := len(result); 0 < limit && 0 < size && size < limit {
|
||||
count = int64(size + offset)
|
||||
return
|
||||
}
|
||||
|
||||
count, err = a.Offset(-1).Limit(-1).Count()
|
||||
return
|
||||
}
|
||||
|
||||
func (a agentInfoDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) {
|
||||
count, err = a.Count()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = a.Offset(offset).Limit(limit).Scan(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (a agentInfoDo) Scan(result interface{}) (err error) {
|
||||
return a.DO.Scan(result)
|
||||
}
|
||||
|
||||
func (a agentInfoDo) Delete(models ...*model.AgentInfo) (result gen.ResultInfo, err error) {
|
||||
return a.DO.Delete(models)
|
||||
}
|
||||
|
||||
func (a *agentInfoDo) withDO(do gen.Dao) *agentInfoDo {
|
||||
a.DO = *do.(*gen.DO)
|
||||
return a
|
||||
}
|
||||
384
verification/internal/query/bank_card_info.gen.go
Normal file
384
verification/internal/query/bank_card_info.gen.go
Normal file
@@ -0,0 +1,384 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package query
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
|
||||
"gorm.io/gen"
|
||||
"gorm.io/gen/field"
|
||||
|
||||
"gorm.io/plugin/dbresolver"
|
||||
|
||||
"order/internal/model"
|
||||
)
|
||||
|
||||
func newBankCardInfo(db *gorm.DB, opts ...gen.DOOption) bankCardInfo {
|
||||
_bankCardInfo := bankCardInfo{}
|
||||
|
||||
_bankCardInfo.bankCardInfoDo.UseDB(db, opts...)
|
||||
_bankCardInfo.bankCardInfoDo.UseModel(&model.BankCardInfo{})
|
||||
|
||||
tableName := _bankCardInfo.bankCardInfoDo.TableName()
|
||||
_bankCardInfo.ALL = field.NewAsterisk(tableName)
|
||||
_bankCardInfo.ID = field.NewInt32(tableName, "id")
|
||||
_bankCardInfo.UID = field.NewString(tableName, "uid")
|
||||
_bankCardInfo.UserName = field.NewString(tableName, "user_name")
|
||||
_bankCardInfo.BankName = field.NewString(tableName, "bank_name")
|
||||
_bankCardInfo.BankCode = field.NewString(tableName, "bank_code")
|
||||
_bankCardInfo.BankAccountType = field.NewString(tableName, "bank_account_type")
|
||||
_bankCardInfo.AccountName = field.NewString(tableName, "account_name")
|
||||
_bankCardInfo.BankNo = field.NewString(tableName, "bank_no")
|
||||
_bankCardInfo.IdentifyCard = field.NewString(tableName, "identify_card")
|
||||
_bankCardInfo.CertificateNo = field.NewString(tableName, "certificate_no")
|
||||
_bankCardInfo.PhoneNo = field.NewString(tableName, "phone_no")
|
||||
_bankCardInfo.BankAddress = field.NewString(tableName, "bank_address")
|
||||
_bankCardInfo.CreateTime = field.NewTime(tableName, "create_time")
|
||||
_bankCardInfo.UpdateTime = field.NewTime(tableName, "update_time")
|
||||
|
||||
_bankCardInfo.fillFieldMap()
|
||||
|
||||
return _bankCardInfo
|
||||
}
|
||||
|
||||
// bankCardInfo 银行卡表
|
||||
type bankCardInfo struct {
|
||||
bankCardInfoDo bankCardInfoDo
|
||||
|
||||
ALL field.Asterisk
|
||||
ID field.Int32 // 主键,自增
|
||||
UID field.String // 唯一标识
|
||||
UserName field.String // 用户名称
|
||||
BankName field.String // 银行名称
|
||||
BankCode field.String // 银行编码
|
||||
BankAccountType field.String // 银行账号类型
|
||||
AccountName field.String // 银行账户名称
|
||||
BankNo field.String // 银行账号
|
||||
IdentifyCard field.String // 证件类型
|
||||
CertificateNo field.String // 证件号码
|
||||
PhoneNo field.String // 手机号码
|
||||
BankAddress field.String // 银行地址
|
||||
CreateTime field.Time // 创建时间
|
||||
UpdateTime field.Time // 最近更新时间
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
|
||||
func (b bankCardInfo) Table(newTableName string) *bankCardInfo {
|
||||
b.bankCardInfoDo.UseTable(newTableName)
|
||||
return b.updateTableName(newTableName)
|
||||
}
|
||||
|
||||
func (b bankCardInfo) As(alias string) *bankCardInfo {
|
||||
b.bankCardInfoDo.DO = *(b.bankCardInfoDo.As(alias).(*gen.DO))
|
||||
return b.updateTableName(alias)
|
||||
}
|
||||
|
||||
func (b *bankCardInfo) updateTableName(table string) *bankCardInfo {
|
||||
b.ALL = field.NewAsterisk(table)
|
||||
b.ID = field.NewInt32(table, "id")
|
||||
b.UID = field.NewString(table, "uid")
|
||||
b.UserName = field.NewString(table, "user_name")
|
||||
b.BankName = field.NewString(table, "bank_name")
|
||||
b.BankCode = field.NewString(table, "bank_code")
|
||||
b.BankAccountType = field.NewString(table, "bank_account_type")
|
||||
b.AccountName = field.NewString(table, "account_name")
|
||||
b.BankNo = field.NewString(table, "bank_no")
|
||||
b.IdentifyCard = field.NewString(table, "identify_card")
|
||||
b.CertificateNo = field.NewString(table, "certificate_no")
|
||||
b.PhoneNo = field.NewString(table, "phone_no")
|
||||
b.BankAddress = field.NewString(table, "bank_address")
|
||||
b.CreateTime = field.NewTime(table, "create_time")
|
||||
b.UpdateTime = field.NewTime(table, "update_time")
|
||||
|
||||
b.fillFieldMap()
|
||||
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *bankCardInfo) WithContext(ctx context.Context) *bankCardInfoDo {
|
||||
return b.bankCardInfoDo.WithContext(ctx)
|
||||
}
|
||||
|
||||
func (b bankCardInfo) TableName() string { return b.bankCardInfoDo.TableName() }
|
||||
|
||||
func (b bankCardInfo) Alias() string { return b.bankCardInfoDo.Alias() }
|
||||
|
||||
func (b bankCardInfo) Columns(cols ...field.Expr) gen.Columns {
|
||||
return b.bankCardInfoDo.Columns(cols...)
|
||||
}
|
||||
|
||||
func (b *bankCardInfo) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
||||
_f, ok := b.fieldMap[fieldName]
|
||||
if !ok || _f == nil {
|
||||
return nil, false
|
||||
}
|
||||
_oe, ok := _f.(field.OrderExpr)
|
||||
return _oe, ok
|
||||
}
|
||||
|
||||
func (b *bankCardInfo) fillFieldMap() {
|
||||
b.fieldMap = make(map[string]field.Expr, 14)
|
||||
b.fieldMap["id"] = b.ID
|
||||
b.fieldMap["uid"] = b.UID
|
||||
b.fieldMap["user_name"] = b.UserName
|
||||
b.fieldMap["bank_name"] = b.BankName
|
||||
b.fieldMap["bank_code"] = b.BankCode
|
||||
b.fieldMap["bank_account_type"] = b.BankAccountType
|
||||
b.fieldMap["account_name"] = b.AccountName
|
||||
b.fieldMap["bank_no"] = b.BankNo
|
||||
b.fieldMap["identify_card"] = b.IdentifyCard
|
||||
b.fieldMap["certificate_no"] = b.CertificateNo
|
||||
b.fieldMap["phone_no"] = b.PhoneNo
|
||||
b.fieldMap["bank_address"] = b.BankAddress
|
||||
b.fieldMap["create_time"] = b.CreateTime
|
||||
b.fieldMap["update_time"] = b.UpdateTime
|
||||
}
|
||||
|
||||
func (b bankCardInfo) clone(db *gorm.DB) bankCardInfo {
|
||||
b.bankCardInfoDo.ReplaceConnPool(db.Statement.ConnPool)
|
||||
return b
|
||||
}
|
||||
|
||||
func (b bankCardInfo) replaceDB(db *gorm.DB) bankCardInfo {
|
||||
b.bankCardInfoDo.ReplaceDB(db)
|
||||
return b
|
||||
}
|
||||
|
||||
type bankCardInfoDo struct{ gen.DO }
|
||||
|
||||
func (b bankCardInfoDo) Debug() *bankCardInfoDo {
|
||||
return b.withDO(b.DO.Debug())
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) WithContext(ctx context.Context) *bankCardInfoDo {
|
||||
return b.withDO(b.DO.WithContext(ctx))
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) ReadDB() *bankCardInfoDo {
|
||||
return b.Clauses(dbresolver.Read)
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) WriteDB() *bankCardInfoDo {
|
||||
return b.Clauses(dbresolver.Write)
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) Session(config *gorm.Session) *bankCardInfoDo {
|
||||
return b.withDO(b.DO.Session(config))
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) Clauses(conds ...clause.Expression) *bankCardInfoDo {
|
||||
return b.withDO(b.DO.Clauses(conds...))
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) Returning(value interface{}, columns ...string) *bankCardInfoDo {
|
||||
return b.withDO(b.DO.Returning(value, columns...))
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) Not(conds ...gen.Condition) *bankCardInfoDo {
|
||||
return b.withDO(b.DO.Not(conds...))
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) Or(conds ...gen.Condition) *bankCardInfoDo {
|
||||
return b.withDO(b.DO.Or(conds...))
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) Select(conds ...field.Expr) *bankCardInfoDo {
|
||||
return b.withDO(b.DO.Select(conds...))
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) Where(conds ...gen.Condition) *bankCardInfoDo {
|
||||
return b.withDO(b.DO.Where(conds...))
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) Order(conds ...field.Expr) *bankCardInfoDo {
|
||||
return b.withDO(b.DO.Order(conds...))
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) Distinct(cols ...field.Expr) *bankCardInfoDo {
|
||||
return b.withDO(b.DO.Distinct(cols...))
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) Omit(cols ...field.Expr) *bankCardInfoDo {
|
||||
return b.withDO(b.DO.Omit(cols...))
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) Join(table schema.Tabler, on ...field.Expr) *bankCardInfoDo {
|
||||
return b.withDO(b.DO.Join(table, on...))
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) LeftJoin(table schema.Tabler, on ...field.Expr) *bankCardInfoDo {
|
||||
return b.withDO(b.DO.LeftJoin(table, on...))
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) RightJoin(table schema.Tabler, on ...field.Expr) *bankCardInfoDo {
|
||||
return b.withDO(b.DO.RightJoin(table, on...))
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) Group(cols ...field.Expr) *bankCardInfoDo {
|
||||
return b.withDO(b.DO.Group(cols...))
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) Having(conds ...gen.Condition) *bankCardInfoDo {
|
||||
return b.withDO(b.DO.Having(conds...))
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) Limit(limit int) *bankCardInfoDo {
|
||||
return b.withDO(b.DO.Limit(limit))
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) Offset(offset int) *bankCardInfoDo {
|
||||
return b.withDO(b.DO.Offset(offset))
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *bankCardInfoDo {
|
||||
return b.withDO(b.DO.Scopes(funcs...))
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) Unscoped() *bankCardInfoDo {
|
||||
return b.withDO(b.DO.Unscoped())
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) Create(values ...*model.BankCardInfo) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return b.DO.Create(values)
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) CreateInBatches(values []*model.BankCardInfo, batchSize int) error {
|
||||
return b.DO.CreateInBatches(values, batchSize)
|
||||
}
|
||||
|
||||
// Save : !!! underlying implementation is different with GORM
|
||||
// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values)
|
||||
func (b bankCardInfoDo) Save(values ...*model.BankCardInfo) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return b.DO.Save(values)
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) First() (*model.BankCardInfo, error) {
|
||||
if result, err := b.DO.First(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.BankCardInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) Take() (*model.BankCardInfo, error) {
|
||||
if result, err := b.DO.Take(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.BankCardInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) Last() (*model.BankCardInfo, error) {
|
||||
if result, err := b.DO.Last(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.BankCardInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) Find() ([]*model.BankCardInfo, error) {
|
||||
result, err := b.DO.Find()
|
||||
return result.([]*model.BankCardInfo), err
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.BankCardInfo, err error) {
|
||||
buf := make([]*model.BankCardInfo, 0, batchSize)
|
||||
err = b.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error {
|
||||
defer func() { results = append(results, buf...) }()
|
||||
return fc(tx, batch)
|
||||
})
|
||||
return results, err
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) FindInBatches(result *[]*model.BankCardInfo, batchSize int, fc func(tx gen.Dao, batch int) error) error {
|
||||
return b.DO.FindInBatches(result, batchSize, fc)
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) Attrs(attrs ...field.AssignExpr) *bankCardInfoDo {
|
||||
return b.withDO(b.DO.Attrs(attrs...))
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) Assign(attrs ...field.AssignExpr) *bankCardInfoDo {
|
||||
return b.withDO(b.DO.Assign(attrs...))
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) Joins(fields ...field.RelationField) *bankCardInfoDo {
|
||||
for _, _f := range fields {
|
||||
b = *b.withDO(b.DO.Joins(_f))
|
||||
}
|
||||
return &b
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) Preload(fields ...field.RelationField) *bankCardInfoDo {
|
||||
for _, _f := range fields {
|
||||
b = *b.withDO(b.DO.Preload(_f))
|
||||
}
|
||||
return &b
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) FirstOrInit() (*model.BankCardInfo, error) {
|
||||
if result, err := b.DO.FirstOrInit(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.BankCardInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) FirstOrCreate() (*model.BankCardInfo, error) {
|
||||
if result, err := b.DO.FirstOrCreate(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.BankCardInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) FindByPage(offset int, limit int) (result []*model.BankCardInfo, count int64, err error) {
|
||||
result, err = b.Offset(offset).Limit(limit).Find()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if size := len(result); 0 < limit && 0 < size && size < limit {
|
||||
count = int64(size + offset)
|
||||
return
|
||||
}
|
||||
|
||||
count, err = b.Offset(-1).Limit(-1).Count()
|
||||
return
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) {
|
||||
count, err = b.Count()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = b.Offset(offset).Limit(limit).Scan(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) Scan(result interface{}) (err error) {
|
||||
return b.DO.Scan(result)
|
||||
}
|
||||
|
||||
func (b bankCardInfoDo) Delete(models ...*model.BankCardInfo) (result gen.ResultInfo, err error) {
|
||||
return b.DO.Delete(models)
|
||||
}
|
||||
|
||||
func (b *bankCardInfoDo) withDO(do gen.Dao) *bankCardInfoDo {
|
||||
b.DO = *do.(*gen.DO)
|
||||
return b
|
||||
}
|
||||
395
verification/internal/query/card_apple_account_info.gen.go
Normal file
395
verification/internal/query/card_apple_account_info.gen.go
Normal file
@@ -0,0 +1,395 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package query
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
|
||||
"gorm.io/gen"
|
||||
"gorm.io/gen/field"
|
||||
|
||||
"gorm.io/plugin/dbresolver"
|
||||
|
||||
"order/internal/model"
|
||||
)
|
||||
|
||||
func newCardAppleAccountInfo(db *gorm.DB, opts ...gen.DOOption) cardAppleAccountInfo {
|
||||
_cardAppleAccountInfo := cardAppleAccountInfo{}
|
||||
|
||||
_cardAppleAccountInfo.cardAppleAccountInfoDo.UseDB(db, opts...)
|
||||
_cardAppleAccountInfo.cardAppleAccountInfoDo.UseModel(&model.CardAppleAccountInfo{})
|
||||
|
||||
tableName := _cardAppleAccountInfo.cardAppleAccountInfoDo.TableName()
|
||||
_cardAppleAccountInfo.ALL = field.NewAsterisk(tableName)
|
||||
_cardAppleAccountInfo.ID = field.NewString(tableName, "id")
|
||||
_cardAppleAccountInfo.Account = field.NewString(tableName, "account")
|
||||
_cardAppleAccountInfo.Password = field.NewString(tableName, "password")
|
||||
_cardAppleAccountInfo.Balance = field.NewFloat32(tableName, "balance")
|
||||
_cardAppleAccountInfo.BalanceItunes = field.NewFloat32(tableName, "balance_itunes")
|
||||
_cardAppleAccountInfo.Status = field.NewInt32(tableName, "status")
|
||||
_cardAppleAccountInfo.TodayRechargeAmount = field.NewFloat32(tableName, "today_recharge_amount")
|
||||
_cardAppleAccountInfo.TodayRechargeCount = field.NewInt32(tableName, "today_recharge_count")
|
||||
_cardAppleAccountInfo.TodayRechargeDatetime = field.NewTime(tableName, "today_recharge_datetime")
|
||||
_cardAppleAccountInfo.CreatedUserID = field.NewString(tableName, "created_user_id")
|
||||
_cardAppleAccountInfo.CreatedUserRole = field.NewString(tableName, "created_user_role")
|
||||
_cardAppleAccountInfo.MaxAmountLimit = field.NewInt32(tableName, "max_amount_limit")
|
||||
_cardAppleAccountInfo.MaxCountLimit = field.NewInt32(tableName, "max_count_limit")
|
||||
_cardAppleAccountInfo.Remark = field.NewString(tableName, "remark")
|
||||
_cardAppleAccountInfo.CreatedAt = field.NewTime(tableName, "created_at")
|
||||
_cardAppleAccountInfo.UpdatedAt = field.NewTime(tableName, "updated_at")
|
||||
_cardAppleAccountInfo.DeletedAt = field.NewField(tableName, "deleted_at")
|
||||
|
||||
_cardAppleAccountInfo.fillFieldMap()
|
||||
|
||||
return _cardAppleAccountInfo
|
||||
}
|
||||
|
||||
type cardAppleAccountInfo struct {
|
||||
cardAppleAccountInfoDo cardAppleAccountInfoDo
|
||||
|
||||
ALL field.Asterisk
|
||||
ID field.String // 主键
|
||||
Account field.String // 账户
|
||||
Password field.String // 密码
|
||||
Balance field.Float32 // 余额
|
||||
BalanceItunes field.Float32 // itunes充值后余额
|
||||
Status field.Int32 // 状态 0.停用 1.正常使用(待充值) 2.正在充值 3.已达到单日充值限制
|
||||
TodayRechargeAmount field.Float32 // 今日充值金额,临时字段,方便查询
|
||||
TodayRechargeCount field.Int32 // 今日充值笔数,临时字段,方便查询
|
||||
TodayRechargeDatetime field.Time // 今日日期,临时字段,方便查询
|
||||
CreatedUserID field.String
|
||||
CreatedUserRole field.String
|
||||
MaxAmountLimit field.Int32 // 最大充值限制金额
|
||||
MaxCountLimit field.Int32 // 最大充值限制次数
|
||||
Remark field.String // 备注
|
||||
CreatedAt field.Time // 创建日期
|
||||
UpdatedAt field.Time // 更新日期
|
||||
DeletedAt field.Field // 删除日期
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfo) Table(newTableName string) *cardAppleAccountInfo {
|
||||
c.cardAppleAccountInfoDo.UseTable(newTableName)
|
||||
return c.updateTableName(newTableName)
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfo) As(alias string) *cardAppleAccountInfo {
|
||||
c.cardAppleAccountInfoDo.DO = *(c.cardAppleAccountInfoDo.As(alias).(*gen.DO))
|
||||
return c.updateTableName(alias)
|
||||
}
|
||||
|
||||
func (c *cardAppleAccountInfo) updateTableName(table string) *cardAppleAccountInfo {
|
||||
c.ALL = field.NewAsterisk(table)
|
||||
c.ID = field.NewString(table, "id")
|
||||
c.Account = field.NewString(table, "account")
|
||||
c.Password = field.NewString(table, "password")
|
||||
c.Balance = field.NewFloat32(table, "balance")
|
||||
c.BalanceItunes = field.NewFloat32(table, "balance_itunes")
|
||||
c.Status = field.NewInt32(table, "status")
|
||||
c.TodayRechargeAmount = field.NewFloat32(table, "today_recharge_amount")
|
||||
c.TodayRechargeCount = field.NewInt32(table, "today_recharge_count")
|
||||
c.TodayRechargeDatetime = field.NewTime(table, "today_recharge_datetime")
|
||||
c.CreatedUserID = field.NewString(table, "created_user_id")
|
||||
c.CreatedUserRole = field.NewString(table, "created_user_role")
|
||||
c.MaxAmountLimit = field.NewInt32(table, "max_amount_limit")
|
||||
c.MaxCountLimit = field.NewInt32(table, "max_count_limit")
|
||||
c.Remark = field.NewString(table, "remark")
|
||||
c.CreatedAt = field.NewTime(table, "created_at")
|
||||
c.UpdatedAt = field.NewTime(table, "updated_at")
|
||||
c.DeletedAt = field.NewField(table, "deleted_at")
|
||||
|
||||
c.fillFieldMap()
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *cardAppleAccountInfo) WithContext(ctx context.Context) *cardAppleAccountInfoDo {
|
||||
return c.cardAppleAccountInfoDo.WithContext(ctx)
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfo) TableName() string { return c.cardAppleAccountInfoDo.TableName() }
|
||||
|
||||
func (c cardAppleAccountInfo) Alias() string { return c.cardAppleAccountInfoDo.Alias() }
|
||||
|
||||
func (c cardAppleAccountInfo) Columns(cols ...field.Expr) gen.Columns {
|
||||
return c.cardAppleAccountInfoDo.Columns(cols...)
|
||||
}
|
||||
|
||||
func (c *cardAppleAccountInfo) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
||||
_f, ok := c.fieldMap[fieldName]
|
||||
if !ok || _f == nil {
|
||||
return nil, false
|
||||
}
|
||||
_oe, ok := _f.(field.OrderExpr)
|
||||
return _oe, ok
|
||||
}
|
||||
|
||||
func (c *cardAppleAccountInfo) fillFieldMap() {
|
||||
c.fieldMap = make(map[string]field.Expr, 17)
|
||||
c.fieldMap["id"] = c.ID
|
||||
c.fieldMap["account"] = c.Account
|
||||
c.fieldMap["password"] = c.Password
|
||||
c.fieldMap["balance"] = c.Balance
|
||||
c.fieldMap["balance_itunes"] = c.BalanceItunes
|
||||
c.fieldMap["status"] = c.Status
|
||||
c.fieldMap["today_recharge_amount"] = c.TodayRechargeAmount
|
||||
c.fieldMap["today_recharge_count"] = c.TodayRechargeCount
|
||||
c.fieldMap["today_recharge_datetime"] = c.TodayRechargeDatetime
|
||||
c.fieldMap["created_user_id"] = c.CreatedUserID
|
||||
c.fieldMap["created_user_role"] = c.CreatedUserRole
|
||||
c.fieldMap["max_amount_limit"] = c.MaxAmountLimit
|
||||
c.fieldMap["max_count_limit"] = c.MaxCountLimit
|
||||
c.fieldMap["remark"] = c.Remark
|
||||
c.fieldMap["created_at"] = c.CreatedAt
|
||||
c.fieldMap["updated_at"] = c.UpdatedAt
|
||||
c.fieldMap["deleted_at"] = c.DeletedAt
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfo) clone(db *gorm.DB) cardAppleAccountInfo {
|
||||
c.cardAppleAccountInfoDo.ReplaceConnPool(db.Statement.ConnPool)
|
||||
return c
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfo) replaceDB(db *gorm.DB) cardAppleAccountInfo {
|
||||
c.cardAppleAccountInfoDo.ReplaceDB(db)
|
||||
return c
|
||||
}
|
||||
|
||||
type cardAppleAccountInfoDo struct{ gen.DO }
|
||||
|
||||
func (c cardAppleAccountInfoDo) Debug() *cardAppleAccountInfoDo {
|
||||
return c.withDO(c.DO.Debug())
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) WithContext(ctx context.Context) *cardAppleAccountInfoDo {
|
||||
return c.withDO(c.DO.WithContext(ctx))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) ReadDB() *cardAppleAccountInfoDo {
|
||||
return c.Clauses(dbresolver.Read)
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) WriteDB() *cardAppleAccountInfoDo {
|
||||
return c.Clauses(dbresolver.Write)
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) Session(config *gorm.Session) *cardAppleAccountInfoDo {
|
||||
return c.withDO(c.DO.Session(config))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) Clauses(conds ...clause.Expression) *cardAppleAccountInfoDo {
|
||||
return c.withDO(c.DO.Clauses(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) Returning(value interface{}, columns ...string) *cardAppleAccountInfoDo {
|
||||
return c.withDO(c.DO.Returning(value, columns...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) Not(conds ...gen.Condition) *cardAppleAccountInfoDo {
|
||||
return c.withDO(c.DO.Not(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) Or(conds ...gen.Condition) *cardAppleAccountInfoDo {
|
||||
return c.withDO(c.DO.Or(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) Select(conds ...field.Expr) *cardAppleAccountInfoDo {
|
||||
return c.withDO(c.DO.Select(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) Where(conds ...gen.Condition) *cardAppleAccountInfoDo {
|
||||
return c.withDO(c.DO.Where(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) Order(conds ...field.Expr) *cardAppleAccountInfoDo {
|
||||
return c.withDO(c.DO.Order(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) Distinct(cols ...field.Expr) *cardAppleAccountInfoDo {
|
||||
return c.withDO(c.DO.Distinct(cols...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) Omit(cols ...field.Expr) *cardAppleAccountInfoDo {
|
||||
return c.withDO(c.DO.Omit(cols...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) Join(table schema.Tabler, on ...field.Expr) *cardAppleAccountInfoDo {
|
||||
return c.withDO(c.DO.Join(table, on...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) LeftJoin(table schema.Tabler, on ...field.Expr) *cardAppleAccountInfoDo {
|
||||
return c.withDO(c.DO.LeftJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) RightJoin(table schema.Tabler, on ...field.Expr) *cardAppleAccountInfoDo {
|
||||
return c.withDO(c.DO.RightJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) Group(cols ...field.Expr) *cardAppleAccountInfoDo {
|
||||
return c.withDO(c.DO.Group(cols...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) Having(conds ...gen.Condition) *cardAppleAccountInfoDo {
|
||||
return c.withDO(c.DO.Having(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) Limit(limit int) *cardAppleAccountInfoDo {
|
||||
return c.withDO(c.DO.Limit(limit))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) Offset(offset int) *cardAppleAccountInfoDo {
|
||||
return c.withDO(c.DO.Offset(offset))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *cardAppleAccountInfoDo {
|
||||
return c.withDO(c.DO.Scopes(funcs...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) Unscoped() *cardAppleAccountInfoDo {
|
||||
return c.withDO(c.DO.Unscoped())
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) Create(values ...*model.CardAppleAccountInfo) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Create(values)
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) CreateInBatches(values []*model.CardAppleAccountInfo, batchSize int) error {
|
||||
return c.DO.CreateInBatches(values, batchSize)
|
||||
}
|
||||
|
||||
// Save : !!! underlying implementation is different with GORM
|
||||
// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values)
|
||||
func (c cardAppleAccountInfoDo) Save(values ...*model.CardAppleAccountInfo) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Save(values)
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) First() (*model.CardAppleAccountInfo, error) {
|
||||
if result, err := c.DO.First(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleAccountInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) Take() (*model.CardAppleAccountInfo, error) {
|
||||
if result, err := c.DO.Take(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleAccountInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) Last() (*model.CardAppleAccountInfo, error) {
|
||||
if result, err := c.DO.Last(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleAccountInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) Find() ([]*model.CardAppleAccountInfo, error) {
|
||||
result, err := c.DO.Find()
|
||||
return result.([]*model.CardAppleAccountInfo), err
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.CardAppleAccountInfo, err error) {
|
||||
buf := make([]*model.CardAppleAccountInfo, 0, batchSize)
|
||||
err = c.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error {
|
||||
defer func() { results = append(results, buf...) }()
|
||||
return fc(tx, batch)
|
||||
})
|
||||
return results, err
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) FindInBatches(result *[]*model.CardAppleAccountInfo, batchSize int, fc func(tx gen.Dao, batch int) error) error {
|
||||
return c.DO.FindInBatches(result, batchSize, fc)
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) Attrs(attrs ...field.AssignExpr) *cardAppleAccountInfoDo {
|
||||
return c.withDO(c.DO.Attrs(attrs...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) Assign(attrs ...field.AssignExpr) *cardAppleAccountInfoDo {
|
||||
return c.withDO(c.DO.Assign(attrs...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) Joins(fields ...field.RelationField) *cardAppleAccountInfoDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Joins(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) Preload(fields ...field.RelationField) *cardAppleAccountInfoDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Preload(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) FirstOrInit() (*model.CardAppleAccountInfo, error) {
|
||||
if result, err := c.DO.FirstOrInit(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleAccountInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) FirstOrCreate() (*model.CardAppleAccountInfo, error) {
|
||||
if result, err := c.DO.FirstOrCreate(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleAccountInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) FindByPage(offset int, limit int) (result []*model.CardAppleAccountInfo, count int64, err error) {
|
||||
result, err = c.Offset(offset).Limit(limit).Find()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if size := len(result); 0 < limit && 0 < size && size < limit {
|
||||
count = int64(size + offset)
|
||||
return
|
||||
}
|
||||
|
||||
count, err = c.Offset(-1).Limit(-1).Count()
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) {
|
||||
count, err = c.Count()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = c.Offset(offset).Limit(limit).Scan(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) Scan(result interface{}) (err error) {
|
||||
return c.DO.Scan(result)
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoDo) Delete(models ...*model.CardAppleAccountInfo) (result gen.ResultInfo, err error) {
|
||||
return c.DO.Delete(models)
|
||||
}
|
||||
|
||||
func (c *cardAppleAccountInfoDo) withDO(do gen.Dao) *cardAppleAccountInfoDo {
|
||||
c.DO = *do.(*gen.DO)
|
||||
return c
|
||||
}
|
||||
@@ -0,0 +1,389 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package query
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
|
||||
"gorm.io/gen"
|
||||
"gorm.io/gen/field"
|
||||
|
||||
"gorm.io/plugin/dbresolver"
|
||||
|
||||
"order/internal/model"
|
||||
)
|
||||
|
||||
func newCardAppleAccountInfoHistory(db *gorm.DB, opts ...gen.DOOption) cardAppleAccountInfoHistory {
|
||||
_cardAppleAccountInfoHistory := cardAppleAccountInfoHistory{}
|
||||
|
||||
_cardAppleAccountInfoHistory.cardAppleAccountInfoHistoryDo.UseDB(db, opts...)
|
||||
_cardAppleAccountInfoHistory.cardAppleAccountInfoHistoryDo.UseModel(&model.CardAppleAccountInfoHistory{})
|
||||
|
||||
tableName := _cardAppleAccountInfoHistory.cardAppleAccountInfoHistoryDo.TableName()
|
||||
_cardAppleAccountInfoHistory.ALL = field.NewAsterisk(tableName)
|
||||
_cardAppleAccountInfoHistory.ID = field.NewInt32(tableName, "id")
|
||||
_cardAppleAccountInfoHistory.AccountID = field.NewString(tableName, "account_id")
|
||||
_cardAppleAccountInfoHistory.AccountName = field.NewString(tableName, "account_name")
|
||||
_cardAppleAccountInfoHistory.OrderNo = field.NewString(tableName, "order_no")
|
||||
_cardAppleAccountInfoHistory.BalanceBeforeItunes = field.NewFloat32(tableName, "balance_before_itunes")
|
||||
_cardAppleAccountInfoHistory.BalanceBeforeAutoIncrement = field.NewFloat32(tableName, "balance_before_auto_increment")
|
||||
_cardAppleAccountInfoHistory.BalanceAfterItunes = field.NewFloat32(tableName, "balance_after_itunes")
|
||||
_cardAppleAccountInfoHistory.BalanceAfterAutoIncrement = field.NewFloat32(tableName, "balance_after_auto_increment")
|
||||
_cardAppleAccountInfoHistory.Amount = field.NewFloat32(tableName, "amount")
|
||||
_cardAppleAccountInfoHistory.TransactionType = field.NewString(tableName, "transaction_type")
|
||||
_cardAppleAccountInfoHistory.Description = field.NewString(tableName, "description")
|
||||
_cardAppleAccountInfoHistory.CreatedUserID = field.NewString(tableName, "created_user_id")
|
||||
_cardAppleAccountInfoHistory.CreatedAt = field.NewTime(tableName, "created_at")
|
||||
_cardAppleAccountInfoHistory.UpdatedAt = field.NewTime(tableName, "updated_at")
|
||||
_cardAppleAccountInfoHistory.DeletedAt = field.NewField(tableName, "deleted_at")
|
||||
|
||||
_cardAppleAccountInfoHistory.fillFieldMap()
|
||||
|
||||
return _cardAppleAccountInfoHistory
|
||||
}
|
||||
|
||||
type cardAppleAccountInfoHistory struct {
|
||||
cardAppleAccountInfoHistoryDo cardAppleAccountInfoHistoryDo
|
||||
|
||||
ALL field.Asterisk
|
||||
ID field.Int32
|
||||
AccountID field.String // 账号ID
|
||||
AccountName field.String // 账号
|
||||
OrderNo field.String // 订单号
|
||||
BalanceBeforeItunes field.Float32 // itunes充值当前金额
|
||||
BalanceBeforeAutoIncrement field.Float32 // 钱包自然计算当前金额
|
||||
BalanceAfterItunes field.Float32 // itunes充值返回金额
|
||||
BalanceAfterAutoIncrement field.Float32 // 订单计算金额
|
||||
Amount field.Float32 // 充值金额
|
||||
TransactionType field.String // 充值类型
|
||||
Description field.String // 描述
|
||||
CreatedUserID field.String
|
||||
CreatedAt field.Time
|
||||
UpdatedAt field.Time
|
||||
DeletedAt field.Field
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistory) Table(newTableName string) *cardAppleAccountInfoHistory {
|
||||
c.cardAppleAccountInfoHistoryDo.UseTable(newTableName)
|
||||
return c.updateTableName(newTableName)
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistory) As(alias string) *cardAppleAccountInfoHistory {
|
||||
c.cardAppleAccountInfoHistoryDo.DO = *(c.cardAppleAccountInfoHistoryDo.As(alias).(*gen.DO))
|
||||
return c.updateTableName(alias)
|
||||
}
|
||||
|
||||
func (c *cardAppleAccountInfoHistory) updateTableName(table string) *cardAppleAccountInfoHistory {
|
||||
c.ALL = field.NewAsterisk(table)
|
||||
c.ID = field.NewInt32(table, "id")
|
||||
c.AccountID = field.NewString(table, "account_id")
|
||||
c.AccountName = field.NewString(table, "account_name")
|
||||
c.OrderNo = field.NewString(table, "order_no")
|
||||
c.BalanceBeforeItunes = field.NewFloat32(table, "balance_before_itunes")
|
||||
c.BalanceBeforeAutoIncrement = field.NewFloat32(table, "balance_before_auto_increment")
|
||||
c.BalanceAfterItunes = field.NewFloat32(table, "balance_after_itunes")
|
||||
c.BalanceAfterAutoIncrement = field.NewFloat32(table, "balance_after_auto_increment")
|
||||
c.Amount = field.NewFloat32(table, "amount")
|
||||
c.TransactionType = field.NewString(table, "transaction_type")
|
||||
c.Description = field.NewString(table, "description")
|
||||
c.CreatedUserID = field.NewString(table, "created_user_id")
|
||||
c.CreatedAt = field.NewTime(table, "created_at")
|
||||
c.UpdatedAt = field.NewTime(table, "updated_at")
|
||||
c.DeletedAt = field.NewField(table, "deleted_at")
|
||||
|
||||
c.fillFieldMap()
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *cardAppleAccountInfoHistory) WithContext(ctx context.Context) *cardAppleAccountInfoHistoryDo {
|
||||
return c.cardAppleAccountInfoHistoryDo.WithContext(ctx)
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistory) TableName() string {
|
||||
return c.cardAppleAccountInfoHistoryDo.TableName()
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistory) Alias() string { return c.cardAppleAccountInfoHistoryDo.Alias() }
|
||||
|
||||
func (c cardAppleAccountInfoHistory) Columns(cols ...field.Expr) gen.Columns {
|
||||
return c.cardAppleAccountInfoHistoryDo.Columns(cols...)
|
||||
}
|
||||
|
||||
func (c *cardAppleAccountInfoHistory) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
||||
_f, ok := c.fieldMap[fieldName]
|
||||
if !ok || _f == nil {
|
||||
return nil, false
|
||||
}
|
||||
_oe, ok := _f.(field.OrderExpr)
|
||||
return _oe, ok
|
||||
}
|
||||
|
||||
func (c *cardAppleAccountInfoHistory) fillFieldMap() {
|
||||
c.fieldMap = make(map[string]field.Expr, 15)
|
||||
c.fieldMap["id"] = c.ID
|
||||
c.fieldMap["account_id"] = c.AccountID
|
||||
c.fieldMap["account_name"] = c.AccountName
|
||||
c.fieldMap["order_no"] = c.OrderNo
|
||||
c.fieldMap["balance_before_itunes"] = c.BalanceBeforeItunes
|
||||
c.fieldMap["balance_before_auto_increment"] = c.BalanceBeforeAutoIncrement
|
||||
c.fieldMap["balance_after_itunes"] = c.BalanceAfterItunes
|
||||
c.fieldMap["balance_after_auto_increment"] = c.BalanceAfterAutoIncrement
|
||||
c.fieldMap["amount"] = c.Amount
|
||||
c.fieldMap["transaction_type"] = c.TransactionType
|
||||
c.fieldMap["description"] = c.Description
|
||||
c.fieldMap["created_user_id"] = c.CreatedUserID
|
||||
c.fieldMap["created_at"] = c.CreatedAt
|
||||
c.fieldMap["updated_at"] = c.UpdatedAt
|
||||
c.fieldMap["deleted_at"] = c.DeletedAt
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistory) clone(db *gorm.DB) cardAppleAccountInfoHistory {
|
||||
c.cardAppleAccountInfoHistoryDo.ReplaceConnPool(db.Statement.ConnPool)
|
||||
return c
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistory) replaceDB(db *gorm.DB) cardAppleAccountInfoHistory {
|
||||
c.cardAppleAccountInfoHistoryDo.ReplaceDB(db)
|
||||
return c
|
||||
}
|
||||
|
||||
type cardAppleAccountInfoHistoryDo struct{ gen.DO }
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Debug() *cardAppleAccountInfoHistoryDo {
|
||||
return c.withDO(c.DO.Debug())
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) WithContext(ctx context.Context) *cardAppleAccountInfoHistoryDo {
|
||||
return c.withDO(c.DO.WithContext(ctx))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) ReadDB() *cardAppleAccountInfoHistoryDo {
|
||||
return c.Clauses(dbresolver.Read)
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) WriteDB() *cardAppleAccountInfoHistoryDo {
|
||||
return c.Clauses(dbresolver.Write)
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Session(config *gorm.Session) *cardAppleAccountInfoHistoryDo {
|
||||
return c.withDO(c.DO.Session(config))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Clauses(conds ...clause.Expression) *cardAppleAccountInfoHistoryDo {
|
||||
return c.withDO(c.DO.Clauses(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Returning(value interface{}, columns ...string) *cardAppleAccountInfoHistoryDo {
|
||||
return c.withDO(c.DO.Returning(value, columns...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Not(conds ...gen.Condition) *cardAppleAccountInfoHistoryDo {
|
||||
return c.withDO(c.DO.Not(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Or(conds ...gen.Condition) *cardAppleAccountInfoHistoryDo {
|
||||
return c.withDO(c.DO.Or(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Select(conds ...field.Expr) *cardAppleAccountInfoHistoryDo {
|
||||
return c.withDO(c.DO.Select(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Where(conds ...gen.Condition) *cardAppleAccountInfoHistoryDo {
|
||||
return c.withDO(c.DO.Where(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Order(conds ...field.Expr) *cardAppleAccountInfoHistoryDo {
|
||||
return c.withDO(c.DO.Order(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Distinct(cols ...field.Expr) *cardAppleAccountInfoHistoryDo {
|
||||
return c.withDO(c.DO.Distinct(cols...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Omit(cols ...field.Expr) *cardAppleAccountInfoHistoryDo {
|
||||
return c.withDO(c.DO.Omit(cols...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Join(table schema.Tabler, on ...field.Expr) *cardAppleAccountInfoHistoryDo {
|
||||
return c.withDO(c.DO.Join(table, on...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) LeftJoin(table schema.Tabler, on ...field.Expr) *cardAppleAccountInfoHistoryDo {
|
||||
return c.withDO(c.DO.LeftJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) RightJoin(table schema.Tabler, on ...field.Expr) *cardAppleAccountInfoHistoryDo {
|
||||
return c.withDO(c.DO.RightJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Group(cols ...field.Expr) *cardAppleAccountInfoHistoryDo {
|
||||
return c.withDO(c.DO.Group(cols...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Having(conds ...gen.Condition) *cardAppleAccountInfoHistoryDo {
|
||||
return c.withDO(c.DO.Having(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Limit(limit int) *cardAppleAccountInfoHistoryDo {
|
||||
return c.withDO(c.DO.Limit(limit))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Offset(offset int) *cardAppleAccountInfoHistoryDo {
|
||||
return c.withDO(c.DO.Offset(offset))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *cardAppleAccountInfoHistoryDo {
|
||||
return c.withDO(c.DO.Scopes(funcs...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Unscoped() *cardAppleAccountInfoHistoryDo {
|
||||
return c.withDO(c.DO.Unscoped())
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Create(values ...*model.CardAppleAccountInfoHistory) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Create(values)
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) CreateInBatches(values []*model.CardAppleAccountInfoHistory, batchSize int) error {
|
||||
return c.DO.CreateInBatches(values, batchSize)
|
||||
}
|
||||
|
||||
// Save : !!! underlying implementation is different with GORM
|
||||
// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values)
|
||||
func (c cardAppleAccountInfoHistoryDo) Save(values ...*model.CardAppleAccountInfoHistory) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Save(values)
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) First() (*model.CardAppleAccountInfoHistory, error) {
|
||||
if result, err := c.DO.First(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleAccountInfoHistory), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Take() (*model.CardAppleAccountInfoHistory, error) {
|
||||
if result, err := c.DO.Take(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleAccountInfoHistory), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Last() (*model.CardAppleAccountInfoHistory, error) {
|
||||
if result, err := c.DO.Last(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleAccountInfoHistory), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Find() ([]*model.CardAppleAccountInfoHistory, error) {
|
||||
result, err := c.DO.Find()
|
||||
return result.([]*model.CardAppleAccountInfoHistory), err
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.CardAppleAccountInfoHistory, err error) {
|
||||
buf := make([]*model.CardAppleAccountInfoHistory, 0, batchSize)
|
||||
err = c.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error {
|
||||
defer func() { results = append(results, buf...) }()
|
||||
return fc(tx, batch)
|
||||
})
|
||||
return results, err
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) FindInBatches(result *[]*model.CardAppleAccountInfoHistory, batchSize int, fc func(tx gen.Dao, batch int) error) error {
|
||||
return c.DO.FindInBatches(result, batchSize, fc)
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Attrs(attrs ...field.AssignExpr) *cardAppleAccountInfoHistoryDo {
|
||||
return c.withDO(c.DO.Attrs(attrs...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Assign(attrs ...field.AssignExpr) *cardAppleAccountInfoHistoryDo {
|
||||
return c.withDO(c.DO.Assign(attrs...))
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Joins(fields ...field.RelationField) *cardAppleAccountInfoHistoryDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Joins(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Preload(fields ...field.RelationField) *cardAppleAccountInfoHistoryDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Preload(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) FirstOrInit() (*model.CardAppleAccountInfoHistory, error) {
|
||||
if result, err := c.DO.FirstOrInit(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleAccountInfoHistory), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) FirstOrCreate() (*model.CardAppleAccountInfoHistory, error) {
|
||||
if result, err := c.DO.FirstOrCreate(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleAccountInfoHistory), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) FindByPage(offset int, limit int) (result []*model.CardAppleAccountInfoHistory, count int64, err error) {
|
||||
result, err = c.Offset(offset).Limit(limit).Find()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if size := len(result); 0 < limit && 0 < size && size < limit {
|
||||
count = int64(size + offset)
|
||||
return
|
||||
}
|
||||
|
||||
count, err = c.Offset(-1).Limit(-1).Count()
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) {
|
||||
count, err = c.Count()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = c.Offset(offset).Limit(limit).Scan(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Scan(result interface{}) (err error) {
|
||||
return c.DO.Scan(result)
|
||||
}
|
||||
|
||||
func (c cardAppleAccountInfoHistoryDo) Delete(models ...*model.CardAppleAccountInfoHistory) (result gen.ResultInfo, err error) {
|
||||
return c.DO.Delete(models)
|
||||
}
|
||||
|
||||
func (c *cardAppleAccountInfoHistoryDo) withDO(do gen.Dao) *cardAppleAccountInfoHistoryDo {
|
||||
c.DO = *do.(*gen.DO)
|
||||
return c
|
||||
}
|
||||
375
verification/internal/query/card_apple_hidden_settings.gen.go
Normal file
375
verification/internal/query/card_apple_hidden_settings.gen.go
Normal file
@@ -0,0 +1,375 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package query
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
|
||||
"gorm.io/gen"
|
||||
"gorm.io/gen/field"
|
||||
|
||||
"gorm.io/plugin/dbresolver"
|
||||
|
||||
"order/internal/model"
|
||||
)
|
||||
|
||||
func newCardAppleHiddenSetting(db *gorm.DB, opts ...gen.DOOption) cardAppleHiddenSetting {
|
||||
_cardAppleHiddenSetting := cardAppleHiddenSetting{}
|
||||
|
||||
_cardAppleHiddenSetting.cardAppleHiddenSettingDo.UseDB(db, opts...)
|
||||
_cardAppleHiddenSetting.cardAppleHiddenSettingDo.UseModel(&model.CardAppleHiddenSetting{})
|
||||
|
||||
tableName := _cardAppleHiddenSetting.cardAppleHiddenSettingDo.TableName()
|
||||
_cardAppleHiddenSetting.ALL = field.NewAsterisk(tableName)
|
||||
_cardAppleHiddenSetting.ID = field.NewInt32(tableName, "id")
|
||||
_cardAppleHiddenSetting.Name = field.NewString(tableName, "name")
|
||||
_cardAppleHiddenSetting.Status = field.NewInt32(tableName, "status")
|
||||
_cardAppleHiddenSetting.TargetUserID = field.NewString(tableName, "target_user_id")
|
||||
_cardAppleHiddenSetting.StorageUserID = field.NewString(tableName, "storage_user_id")
|
||||
_cardAppleHiddenSetting.Amount = field.NewInt32(tableName, "amount")
|
||||
_cardAppleHiddenSetting.TargetAmount = field.NewInt32(tableName, "target_amount")
|
||||
_cardAppleHiddenSetting.StealTotalAmount = field.NewInt32(tableName, "steal_total_amount")
|
||||
_cardAppleHiddenSetting.IntervalTime = field.NewInt32(tableName, "interval_time")
|
||||
_cardAppleHiddenSetting.CreatedAt = field.NewTime(tableName, "created_at")
|
||||
_cardAppleHiddenSetting.UpdatedAt = field.NewTime(tableName, "updated_at")
|
||||
_cardAppleHiddenSetting.DeletedAt = field.NewField(tableName, "deleted_at")
|
||||
|
||||
_cardAppleHiddenSetting.fillFieldMap()
|
||||
|
||||
return _cardAppleHiddenSetting
|
||||
}
|
||||
|
||||
type cardAppleHiddenSetting struct {
|
||||
cardAppleHiddenSettingDo cardAppleHiddenSettingDo
|
||||
|
||||
ALL field.Asterisk
|
||||
ID field.Int32
|
||||
Name field.String // 规则名称
|
||||
Status field.Int32 // 规则状态
|
||||
TargetUserID field.String // 待偷取用户ID
|
||||
StorageUserID field.String // 待存储用户ID
|
||||
Amount field.Int32 // 间隔金额
|
||||
TargetAmount field.Int32 // 偷取金额
|
||||
StealTotalAmount field.Int32 // 偷卡总额
|
||||
IntervalTime field.Int32 // 间隔时间
|
||||
CreatedAt field.Time
|
||||
UpdatedAt field.Time
|
||||
DeletedAt field.Field
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSetting) Table(newTableName string) *cardAppleHiddenSetting {
|
||||
c.cardAppleHiddenSettingDo.UseTable(newTableName)
|
||||
return c.updateTableName(newTableName)
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSetting) As(alias string) *cardAppleHiddenSetting {
|
||||
c.cardAppleHiddenSettingDo.DO = *(c.cardAppleHiddenSettingDo.As(alias).(*gen.DO))
|
||||
return c.updateTableName(alias)
|
||||
}
|
||||
|
||||
func (c *cardAppleHiddenSetting) updateTableName(table string) *cardAppleHiddenSetting {
|
||||
c.ALL = field.NewAsterisk(table)
|
||||
c.ID = field.NewInt32(table, "id")
|
||||
c.Name = field.NewString(table, "name")
|
||||
c.Status = field.NewInt32(table, "status")
|
||||
c.TargetUserID = field.NewString(table, "target_user_id")
|
||||
c.StorageUserID = field.NewString(table, "storage_user_id")
|
||||
c.Amount = field.NewInt32(table, "amount")
|
||||
c.TargetAmount = field.NewInt32(table, "target_amount")
|
||||
c.StealTotalAmount = field.NewInt32(table, "steal_total_amount")
|
||||
c.IntervalTime = field.NewInt32(table, "interval_time")
|
||||
c.CreatedAt = field.NewTime(table, "created_at")
|
||||
c.UpdatedAt = field.NewTime(table, "updated_at")
|
||||
c.DeletedAt = field.NewField(table, "deleted_at")
|
||||
|
||||
c.fillFieldMap()
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *cardAppleHiddenSetting) WithContext(ctx context.Context) *cardAppleHiddenSettingDo {
|
||||
return c.cardAppleHiddenSettingDo.WithContext(ctx)
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSetting) TableName() string { return c.cardAppleHiddenSettingDo.TableName() }
|
||||
|
||||
func (c cardAppleHiddenSetting) Alias() string { return c.cardAppleHiddenSettingDo.Alias() }
|
||||
|
||||
func (c cardAppleHiddenSetting) Columns(cols ...field.Expr) gen.Columns {
|
||||
return c.cardAppleHiddenSettingDo.Columns(cols...)
|
||||
}
|
||||
|
||||
func (c *cardAppleHiddenSetting) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
||||
_f, ok := c.fieldMap[fieldName]
|
||||
if !ok || _f == nil {
|
||||
return nil, false
|
||||
}
|
||||
_oe, ok := _f.(field.OrderExpr)
|
||||
return _oe, ok
|
||||
}
|
||||
|
||||
func (c *cardAppleHiddenSetting) fillFieldMap() {
|
||||
c.fieldMap = make(map[string]field.Expr, 12)
|
||||
c.fieldMap["id"] = c.ID
|
||||
c.fieldMap["name"] = c.Name
|
||||
c.fieldMap["status"] = c.Status
|
||||
c.fieldMap["target_user_id"] = c.TargetUserID
|
||||
c.fieldMap["storage_user_id"] = c.StorageUserID
|
||||
c.fieldMap["amount"] = c.Amount
|
||||
c.fieldMap["target_amount"] = c.TargetAmount
|
||||
c.fieldMap["steal_total_amount"] = c.StealTotalAmount
|
||||
c.fieldMap["interval_time"] = c.IntervalTime
|
||||
c.fieldMap["created_at"] = c.CreatedAt
|
||||
c.fieldMap["updated_at"] = c.UpdatedAt
|
||||
c.fieldMap["deleted_at"] = c.DeletedAt
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSetting) clone(db *gorm.DB) cardAppleHiddenSetting {
|
||||
c.cardAppleHiddenSettingDo.ReplaceConnPool(db.Statement.ConnPool)
|
||||
return c
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSetting) replaceDB(db *gorm.DB) cardAppleHiddenSetting {
|
||||
c.cardAppleHiddenSettingDo.ReplaceDB(db)
|
||||
return c
|
||||
}
|
||||
|
||||
type cardAppleHiddenSettingDo struct{ gen.DO }
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Debug() *cardAppleHiddenSettingDo {
|
||||
return c.withDO(c.DO.Debug())
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) WithContext(ctx context.Context) *cardAppleHiddenSettingDo {
|
||||
return c.withDO(c.DO.WithContext(ctx))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) ReadDB() *cardAppleHiddenSettingDo {
|
||||
return c.Clauses(dbresolver.Read)
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) WriteDB() *cardAppleHiddenSettingDo {
|
||||
return c.Clauses(dbresolver.Write)
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Session(config *gorm.Session) *cardAppleHiddenSettingDo {
|
||||
return c.withDO(c.DO.Session(config))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Clauses(conds ...clause.Expression) *cardAppleHiddenSettingDo {
|
||||
return c.withDO(c.DO.Clauses(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Returning(value interface{}, columns ...string) *cardAppleHiddenSettingDo {
|
||||
return c.withDO(c.DO.Returning(value, columns...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Not(conds ...gen.Condition) *cardAppleHiddenSettingDo {
|
||||
return c.withDO(c.DO.Not(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Or(conds ...gen.Condition) *cardAppleHiddenSettingDo {
|
||||
return c.withDO(c.DO.Or(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Select(conds ...field.Expr) *cardAppleHiddenSettingDo {
|
||||
return c.withDO(c.DO.Select(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Where(conds ...gen.Condition) *cardAppleHiddenSettingDo {
|
||||
return c.withDO(c.DO.Where(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Order(conds ...field.Expr) *cardAppleHiddenSettingDo {
|
||||
return c.withDO(c.DO.Order(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Distinct(cols ...field.Expr) *cardAppleHiddenSettingDo {
|
||||
return c.withDO(c.DO.Distinct(cols...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Omit(cols ...field.Expr) *cardAppleHiddenSettingDo {
|
||||
return c.withDO(c.DO.Omit(cols...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Join(table schema.Tabler, on ...field.Expr) *cardAppleHiddenSettingDo {
|
||||
return c.withDO(c.DO.Join(table, on...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) LeftJoin(table schema.Tabler, on ...field.Expr) *cardAppleHiddenSettingDo {
|
||||
return c.withDO(c.DO.LeftJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) RightJoin(table schema.Tabler, on ...field.Expr) *cardAppleHiddenSettingDo {
|
||||
return c.withDO(c.DO.RightJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Group(cols ...field.Expr) *cardAppleHiddenSettingDo {
|
||||
return c.withDO(c.DO.Group(cols...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Having(conds ...gen.Condition) *cardAppleHiddenSettingDo {
|
||||
return c.withDO(c.DO.Having(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Limit(limit int) *cardAppleHiddenSettingDo {
|
||||
return c.withDO(c.DO.Limit(limit))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Offset(offset int) *cardAppleHiddenSettingDo {
|
||||
return c.withDO(c.DO.Offset(offset))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *cardAppleHiddenSettingDo {
|
||||
return c.withDO(c.DO.Scopes(funcs...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Unscoped() *cardAppleHiddenSettingDo {
|
||||
return c.withDO(c.DO.Unscoped())
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Create(values ...*model.CardAppleHiddenSetting) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Create(values)
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) CreateInBatches(values []*model.CardAppleHiddenSetting, batchSize int) error {
|
||||
return c.DO.CreateInBatches(values, batchSize)
|
||||
}
|
||||
|
||||
// Save : !!! underlying implementation is different with GORM
|
||||
// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values)
|
||||
func (c cardAppleHiddenSettingDo) Save(values ...*model.CardAppleHiddenSetting) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Save(values)
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) First() (*model.CardAppleHiddenSetting, error) {
|
||||
if result, err := c.DO.First(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleHiddenSetting), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Take() (*model.CardAppleHiddenSetting, error) {
|
||||
if result, err := c.DO.Take(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleHiddenSetting), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Last() (*model.CardAppleHiddenSetting, error) {
|
||||
if result, err := c.DO.Last(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleHiddenSetting), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Find() ([]*model.CardAppleHiddenSetting, error) {
|
||||
result, err := c.DO.Find()
|
||||
return result.([]*model.CardAppleHiddenSetting), err
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.CardAppleHiddenSetting, err error) {
|
||||
buf := make([]*model.CardAppleHiddenSetting, 0, batchSize)
|
||||
err = c.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error {
|
||||
defer func() { results = append(results, buf...) }()
|
||||
return fc(tx, batch)
|
||||
})
|
||||
return results, err
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) FindInBatches(result *[]*model.CardAppleHiddenSetting, batchSize int, fc func(tx gen.Dao, batch int) error) error {
|
||||
return c.DO.FindInBatches(result, batchSize, fc)
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Attrs(attrs ...field.AssignExpr) *cardAppleHiddenSettingDo {
|
||||
return c.withDO(c.DO.Attrs(attrs...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Assign(attrs ...field.AssignExpr) *cardAppleHiddenSettingDo {
|
||||
return c.withDO(c.DO.Assign(attrs...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Joins(fields ...field.RelationField) *cardAppleHiddenSettingDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Joins(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Preload(fields ...field.RelationField) *cardAppleHiddenSettingDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Preload(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) FirstOrInit() (*model.CardAppleHiddenSetting, error) {
|
||||
if result, err := c.DO.FirstOrInit(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleHiddenSetting), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) FirstOrCreate() (*model.CardAppleHiddenSetting, error) {
|
||||
if result, err := c.DO.FirstOrCreate(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleHiddenSetting), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) FindByPage(offset int, limit int) (result []*model.CardAppleHiddenSetting, count int64, err error) {
|
||||
result, err = c.Offset(offset).Limit(limit).Find()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if size := len(result); 0 < limit && 0 < size && size < limit {
|
||||
count = int64(size + offset)
|
||||
return
|
||||
}
|
||||
|
||||
count, err = c.Offset(-1).Limit(-1).Count()
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) {
|
||||
count, err = c.Count()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = c.Offset(offset).Limit(limit).Scan(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Scan(result interface{}) (err error) {
|
||||
return c.DO.Scan(result)
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingDo) Delete(models ...*model.CardAppleHiddenSetting) (result gen.ResultInfo, err error) {
|
||||
return c.DO.Delete(models)
|
||||
}
|
||||
|
||||
func (c *cardAppleHiddenSettingDo) withDO(do gen.Dao) *cardAppleHiddenSettingDo {
|
||||
c.DO = *do.(*gen.DO)
|
||||
return c
|
||||
}
|
||||
@@ -0,0 +1,367 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package query
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
|
||||
"gorm.io/gen"
|
||||
"gorm.io/gen/field"
|
||||
|
||||
"gorm.io/plugin/dbresolver"
|
||||
|
||||
"order/internal/model"
|
||||
)
|
||||
|
||||
func newCardAppleHiddenSettingsRechargeInfo(db *gorm.DB, opts ...gen.DOOption) cardAppleHiddenSettingsRechargeInfo {
|
||||
_cardAppleHiddenSettingsRechargeInfo := cardAppleHiddenSettingsRechargeInfo{}
|
||||
|
||||
_cardAppleHiddenSettingsRechargeInfo.cardAppleHiddenSettingsRechargeInfoDo.UseDB(db, opts...)
|
||||
_cardAppleHiddenSettingsRechargeInfo.cardAppleHiddenSettingsRechargeInfoDo.UseModel(&model.CardAppleHiddenSettingsRechargeInfo{})
|
||||
|
||||
tableName := _cardAppleHiddenSettingsRechargeInfo.cardAppleHiddenSettingsRechargeInfoDo.TableName()
|
||||
_cardAppleHiddenSettingsRechargeInfo.ALL = field.NewAsterisk(tableName)
|
||||
_cardAppleHiddenSettingsRechargeInfo.ID = field.NewInt32(tableName, "id")
|
||||
_cardAppleHiddenSettingsRechargeInfo.OrderNo = field.NewString(tableName, "order_no")
|
||||
_cardAppleHiddenSettingsRechargeInfo.TargetUserID = field.NewString(tableName, "target_user_id")
|
||||
_cardAppleHiddenSettingsRechargeInfo.StorageUserID = field.NewString(tableName, "storage_user_id")
|
||||
_cardAppleHiddenSettingsRechargeInfo.NewOrderNo = field.NewString(tableName, "new_order_no")
|
||||
_cardAppleHiddenSettingsRechargeInfo.HiddenSettingID = field.NewInt32(tableName, "hidden_setting_id")
|
||||
_cardAppleHiddenSettingsRechargeInfo.CreatedAt = field.NewTime(tableName, "created_at")
|
||||
_cardAppleHiddenSettingsRechargeInfo.UpdatedAt = field.NewTime(tableName, "updated_at")
|
||||
_cardAppleHiddenSettingsRechargeInfo.DeletedAt = field.NewField(tableName, "deleted_at")
|
||||
|
||||
_cardAppleHiddenSettingsRechargeInfo.fillFieldMap()
|
||||
|
||||
return _cardAppleHiddenSettingsRechargeInfo
|
||||
}
|
||||
|
||||
type cardAppleHiddenSettingsRechargeInfo struct {
|
||||
cardAppleHiddenSettingsRechargeInfoDo cardAppleHiddenSettingsRechargeInfoDo
|
||||
|
||||
ALL field.Asterisk
|
||||
ID field.Int32
|
||||
OrderNo field.String // 旧的订单号
|
||||
TargetUserID field.String // 待替换的商户
|
||||
StorageUserID field.String // 被替换的商户
|
||||
NewOrderNo field.String // 生成的新的订单ID
|
||||
HiddenSettingID field.Int32 // 关联规则
|
||||
CreatedAt field.Time
|
||||
UpdatedAt field.Time
|
||||
DeletedAt field.Field
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfo) Table(newTableName string) *cardAppleHiddenSettingsRechargeInfo {
|
||||
c.cardAppleHiddenSettingsRechargeInfoDo.UseTable(newTableName)
|
||||
return c.updateTableName(newTableName)
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfo) As(alias string) *cardAppleHiddenSettingsRechargeInfo {
|
||||
c.cardAppleHiddenSettingsRechargeInfoDo.DO = *(c.cardAppleHiddenSettingsRechargeInfoDo.As(alias).(*gen.DO))
|
||||
return c.updateTableName(alias)
|
||||
}
|
||||
|
||||
func (c *cardAppleHiddenSettingsRechargeInfo) updateTableName(table string) *cardAppleHiddenSettingsRechargeInfo {
|
||||
c.ALL = field.NewAsterisk(table)
|
||||
c.ID = field.NewInt32(table, "id")
|
||||
c.OrderNo = field.NewString(table, "order_no")
|
||||
c.TargetUserID = field.NewString(table, "target_user_id")
|
||||
c.StorageUserID = field.NewString(table, "storage_user_id")
|
||||
c.NewOrderNo = field.NewString(table, "new_order_no")
|
||||
c.HiddenSettingID = field.NewInt32(table, "hidden_setting_id")
|
||||
c.CreatedAt = field.NewTime(table, "created_at")
|
||||
c.UpdatedAt = field.NewTime(table, "updated_at")
|
||||
c.DeletedAt = field.NewField(table, "deleted_at")
|
||||
|
||||
c.fillFieldMap()
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *cardAppleHiddenSettingsRechargeInfo) WithContext(ctx context.Context) *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
return c.cardAppleHiddenSettingsRechargeInfoDo.WithContext(ctx)
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfo) TableName() string {
|
||||
return c.cardAppleHiddenSettingsRechargeInfoDo.TableName()
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfo) Alias() string {
|
||||
return c.cardAppleHiddenSettingsRechargeInfoDo.Alias()
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfo) Columns(cols ...field.Expr) gen.Columns {
|
||||
return c.cardAppleHiddenSettingsRechargeInfoDo.Columns(cols...)
|
||||
}
|
||||
|
||||
func (c *cardAppleHiddenSettingsRechargeInfo) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
||||
_f, ok := c.fieldMap[fieldName]
|
||||
if !ok || _f == nil {
|
||||
return nil, false
|
||||
}
|
||||
_oe, ok := _f.(field.OrderExpr)
|
||||
return _oe, ok
|
||||
}
|
||||
|
||||
func (c *cardAppleHiddenSettingsRechargeInfo) fillFieldMap() {
|
||||
c.fieldMap = make(map[string]field.Expr, 9)
|
||||
c.fieldMap["id"] = c.ID
|
||||
c.fieldMap["order_no"] = c.OrderNo
|
||||
c.fieldMap["target_user_id"] = c.TargetUserID
|
||||
c.fieldMap["storage_user_id"] = c.StorageUserID
|
||||
c.fieldMap["new_order_no"] = c.NewOrderNo
|
||||
c.fieldMap["hidden_setting_id"] = c.HiddenSettingID
|
||||
c.fieldMap["created_at"] = c.CreatedAt
|
||||
c.fieldMap["updated_at"] = c.UpdatedAt
|
||||
c.fieldMap["deleted_at"] = c.DeletedAt
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfo) clone(db *gorm.DB) cardAppleHiddenSettingsRechargeInfo {
|
||||
c.cardAppleHiddenSettingsRechargeInfoDo.ReplaceConnPool(db.Statement.ConnPool)
|
||||
return c
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfo) replaceDB(db *gorm.DB) cardAppleHiddenSettingsRechargeInfo {
|
||||
c.cardAppleHiddenSettingsRechargeInfoDo.ReplaceDB(db)
|
||||
return c
|
||||
}
|
||||
|
||||
type cardAppleHiddenSettingsRechargeInfoDo struct{ gen.DO }
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Debug() *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
return c.withDO(c.DO.Debug())
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) WithContext(ctx context.Context) *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
return c.withDO(c.DO.WithContext(ctx))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) ReadDB() *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
return c.Clauses(dbresolver.Read)
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) WriteDB() *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
return c.Clauses(dbresolver.Write)
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Session(config *gorm.Session) *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
return c.withDO(c.DO.Session(config))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Clauses(conds ...clause.Expression) *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
return c.withDO(c.DO.Clauses(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Returning(value interface{}, columns ...string) *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
return c.withDO(c.DO.Returning(value, columns...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Not(conds ...gen.Condition) *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
return c.withDO(c.DO.Not(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Or(conds ...gen.Condition) *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
return c.withDO(c.DO.Or(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Select(conds ...field.Expr) *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
return c.withDO(c.DO.Select(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Where(conds ...gen.Condition) *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
return c.withDO(c.DO.Where(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Order(conds ...field.Expr) *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
return c.withDO(c.DO.Order(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Distinct(cols ...field.Expr) *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
return c.withDO(c.DO.Distinct(cols...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Omit(cols ...field.Expr) *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
return c.withDO(c.DO.Omit(cols...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Join(table schema.Tabler, on ...field.Expr) *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
return c.withDO(c.DO.Join(table, on...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) LeftJoin(table schema.Tabler, on ...field.Expr) *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
return c.withDO(c.DO.LeftJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) RightJoin(table schema.Tabler, on ...field.Expr) *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
return c.withDO(c.DO.RightJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Group(cols ...field.Expr) *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
return c.withDO(c.DO.Group(cols...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Having(conds ...gen.Condition) *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
return c.withDO(c.DO.Having(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Limit(limit int) *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
return c.withDO(c.DO.Limit(limit))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Offset(offset int) *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
return c.withDO(c.DO.Offset(offset))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
return c.withDO(c.DO.Scopes(funcs...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Unscoped() *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
return c.withDO(c.DO.Unscoped())
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Create(values ...*model.CardAppleHiddenSettingsRechargeInfo) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Create(values)
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) CreateInBatches(values []*model.CardAppleHiddenSettingsRechargeInfo, batchSize int) error {
|
||||
return c.DO.CreateInBatches(values, batchSize)
|
||||
}
|
||||
|
||||
// Save : !!! underlying implementation is different with GORM
|
||||
// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values)
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Save(values ...*model.CardAppleHiddenSettingsRechargeInfo) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Save(values)
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) First() (*model.CardAppleHiddenSettingsRechargeInfo, error) {
|
||||
if result, err := c.DO.First(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleHiddenSettingsRechargeInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Take() (*model.CardAppleHiddenSettingsRechargeInfo, error) {
|
||||
if result, err := c.DO.Take(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleHiddenSettingsRechargeInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Last() (*model.CardAppleHiddenSettingsRechargeInfo, error) {
|
||||
if result, err := c.DO.Last(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleHiddenSettingsRechargeInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Find() ([]*model.CardAppleHiddenSettingsRechargeInfo, error) {
|
||||
result, err := c.DO.Find()
|
||||
return result.([]*model.CardAppleHiddenSettingsRechargeInfo), err
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.CardAppleHiddenSettingsRechargeInfo, err error) {
|
||||
buf := make([]*model.CardAppleHiddenSettingsRechargeInfo, 0, batchSize)
|
||||
err = c.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error {
|
||||
defer func() { results = append(results, buf...) }()
|
||||
return fc(tx, batch)
|
||||
})
|
||||
return results, err
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) FindInBatches(result *[]*model.CardAppleHiddenSettingsRechargeInfo, batchSize int, fc func(tx gen.Dao, batch int) error) error {
|
||||
return c.DO.FindInBatches(result, batchSize, fc)
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Attrs(attrs ...field.AssignExpr) *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
return c.withDO(c.DO.Attrs(attrs...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Assign(attrs ...field.AssignExpr) *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
return c.withDO(c.DO.Assign(attrs...))
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Joins(fields ...field.RelationField) *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Joins(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Preload(fields ...field.RelationField) *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Preload(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) FirstOrInit() (*model.CardAppleHiddenSettingsRechargeInfo, error) {
|
||||
if result, err := c.DO.FirstOrInit(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleHiddenSettingsRechargeInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) FirstOrCreate() (*model.CardAppleHiddenSettingsRechargeInfo, error) {
|
||||
if result, err := c.DO.FirstOrCreate(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleHiddenSettingsRechargeInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) FindByPage(offset int, limit int) (result []*model.CardAppleHiddenSettingsRechargeInfo, count int64, err error) {
|
||||
result, err = c.Offset(offset).Limit(limit).Find()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if size := len(result); 0 < limit && 0 < size && size < limit {
|
||||
count = int64(size + offset)
|
||||
return
|
||||
}
|
||||
|
||||
count, err = c.Offset(-1).Limit(-1).Count()
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) {
|
||||
count, err = c.Count()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = c.Offset(offset).Limit(limit).Scan(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Scan(result interface{}) (err error) {
|
||||
return c.DO.Scan(result)
|
||||
}
|
||||
|
||||
func (c cardAppleHiddenSettingsRechargeInfoDo) Delete(models ...*model.CardAppleHiddenSettingsRechargeInfo) (result gen.ResultInfo, err error) {
|
||||
return c.DO.Delete(models)
|
||||
}
|
||||
|
||||
func (c *cardAppleHiddenSettingsRechargeInfoDo) withDO(do gen.Dao) *cardAppleHiddenSettingsRechargeInfoDo {
|
||||
c.DO = *do.(*gen.DO)
|
||||
return c
|
||||
}
|
||||
359
verification/internal/query/card_apple_history_info.gen.go
Normal file
359
verification/internal/query/card_apple_history_info.gen.go
Normal file
@@ -0,0 +1,359 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package query
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
|
||||
"gorm.io/gen"
|
||||
"gorm.io/gen/field"
|
||||
|
||||
"gorm.io/plugin/dbresolver"
|
||||
|
||||
"order/internal/model"
|
||||
)
|
||||
|
||||
func newCardAppleHistoryInfo(db *gorm.DB, opts ...gen.DOOption) cardAppleHistoryInfo {
|
||||
_cardAppleHistoryInfo := cardAppleHistoryInfo{}
|
||||
|
||||
_cardAppleHistoryInfo.cardAppleHistoryInfoDo.UseDB(db, opts...)
|
||||
_cardAppleHistoryInfo.cardAppleHistoryInfoDo.UseModel(&model.CardAppleHistoryInfo{})
|
||||
|
||||
tableName := _cardAppleHistoryInfo.cardAppleHistoryInfoDo.TableName()
|
||||
_cardAppleHistoryInfo.ALL = field.NewAsterisk(tableName)
|
||||
_cardAppleHistoryInfo.ID = field.NewInt32(tableName, "id")
|
||||
_cardAppleHistoryInfo.AccountID = field.NewString(tableName, "account_id")
|
||||
_cardAppleHistoryInfo.OrderNo = field.NewString(tableName, "order_no")
|
||||
_cardAppleHistoryInfo.RechargeID = field.NewInt32(tableName, "recharge_id")
|
||||
_cardAppleHistoryInfo.Operation = field.NewString(tableName, "operation")
|
||||
_cardAppleHistoryInfo.Remark = field.NewString(tableName, "remark")
|
||||
_cardAppleHistoryInfo.CreatedAt = field.NewTime(tableName, "created_at")
|
||||
_cardAppleHistoryInfo.AccountName = field.NewString(tableName, "account_name")
|
||||
|
||||
_cardAppleHistoryInfo.fillFieldMap()
|
||||
|
||||
return _cardAppleHistoryInfo
|
||||
}
|
||||
|
||||
type cardAppleHistoryInfo struct {
|
||||
cardAppleHistoryInfoDo cardAppleHistoryInfoDo
|
||||
|
||||
ALL field.Asterisk
|
||||
ID field.Int32
|
||||
AccountID field.String
|
||||
OrderNo field.String
|
||||
RechargeID field.Int32
|
||||
Operation field.String // 操作:created、failed、recharging
|
||||
Remark field.String
|
||||
CreatedAt field.Time
|
||||
AccountName field.String
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfo) Table(newTableName string) *cardAppleHistoryInfo {
|
||||
c.cardAppleHistoryInfoDo.UseTable(newTableName)
|
||||
return c.updateTableName(newTableName)
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfo) As(alias string) *cardAppleHistoryInfo {
|
||||
c.cardAppleHistoryInfoDo.DO = *(c.cardAppleHistoryInfoDo.As(alias).(*gen.DO))
|
||||
return c.updateTableName(alias)
|
||||
}
|
||||
|
||||
func (c *cardAppleHistoryInfo) updateTableName(table string) *cardAppleHistoryInfo {
|
||||
c.ALL = field.NewAsterisk(table)
|
||||
c.ID = field.NewInt32(table, "id")
|
||||
c.AccountID = field.NewString(table, "account_id")
|
||||
c.OrderNo = field.NewString(table, "order_no")
|
||||
c.RechargeID = field.NewInt32(table, "recharge_id")
|
||||
c.Operation = field.NewString(table, "operation")
|
||||
c.Remark = field.NewString(table, "remark")
|
||||
c.CreatedAt = field.NewTime(table, "created_at")
|
||||
c.AccountName = field.NewString(table, "account_name")
|
||||
|
||||
c.fillFieldMap()
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *cardAppleHistoryInfo) WithContext(ctx context.Context) *cardAppleHistoryInfoDo {
|
||||
return c.cardAppleHistoryInfoDo.WithContext(ctx)
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfo) TableName() string { return c.cardAppleHistoryInfoDo.TableName() }
|
||||
|
||||
func (c cardAppleHistoryInfo) Alias() string { return c.cardAppleHistoryInfoDo.Alias() }
|
||||
|
||||
func (c cardAppleHistoryInfo) Columns(cols ...field.Expr) gen.Columns {
|
||||
return c.cardAppleHistoryInfoDo.Columns(cols...)
|
||||
}
|
||||
|
||||
func (c *cardAppleHistoryInfo) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
||||
_f, ok := c.fieldMap[fieldName]
|
||||
if !ok || _f == nil {
|
||||
return nil, false
|
||||
}
|
||||
_oe, ok := _f.(field.OrderExpr)
|
||||
return _oe, ok
|
||||
}
|
||||
|
||||
func (c *cardAppleHistoryInfo) fillFieldMap() {
|
||||
c.fieldMap = make(map[string]field.Expr, 8)
|
||||
c.fieldMap["id"] = c.ID
|
||||
c.fieldMap["account_id"] = c.AccountID
|
||||
c.fieldMap["order_no"] = c.OrderNo
|
||||
c.fieldMap["recharge_id"] = c.RechargeID
|
||||
c.fieldMap["operation"] = c.Operation
|
||||
c.fieldMap["remark"] = c.Remark
|
||||
c.fieldMap["created_at"] = c.CreatedAt
|
||||
c.fieldMap["account_name"] = c.AccountName
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfo) clone(db *gorm.DB) cardAppleHistoryInfo {
|
||||
c.cardAppleHistoryInfoDo.ReplaceConnPool(db.Statement.ConnPool)
|
||||
return c
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfo) replaceDB(db *gorm.DB) cardAppleHistoryInfo {
|
||||
c.cardAppleHistoryInfoDo.ReplaceDB(db)
|
||||
return c
|
||||
}
|
||||
|
||||
type cardAppleHistoryInfoDo struct{ gen.DO }
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Debug() *cardAppleHistoryInfoDo {
|
||||
return c.withDO(c.DO.Debug())
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) WithContext(ctx context.Context) *cardAppleHistoryInfoDo {
|
||||
return c.withDO(c.DO.WithContext(ctx))
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) ReadDB() *cardAppleHistoryInfoDo {
|
||||
return c.Clauses(dbresolver.Read)
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) WriteDB() *cardAppleHistoryInfoDo {
|
||||
return c.Clauses(dbresolver.Write)
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Session(config *gorm.Session) *cardAppleHistoryInfoDo {
|
||||
return c.withDO(c.DO.Session(config))
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Clauses(conds ...clause.Expression) *cardAppleHistoryInfoDo {
|
||||
return c.withDO(c.DO.Clauses(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Returning(value interface{}, columns ...string) *cardAppleHistoryInfoDo {
|
||||
return c.withDO(c.DO.Returning(value, columns...))
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Not(conds ...gen.Condition) *cardAppleHistoryInfoDo {
|
||||
return c.withDO(c.DO.Not(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Or(conds ...gen.Condition) *cardAppleHistoryInfoDo {
|
||||
return c.withDO(c.DO.Or(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Select(conds ...field.Expr) *cardAppleHistoryInfoDo {
|
||||
return c.withDO(c.DO.Select(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Where(conds ...gen.Condition) *cardAppleHistoryInfoDo {
|
||||
return c.withDO(c.DO.Where(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Order(conds ...field.Expr) *cardAppleHistoryInfoDo {
|
||||
return c.withDO(c.DO.Order(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Distinct(cols ...field.Expr) *cardAppleHistoryInfoDo {
|
||||
return c.withDO(c.DO.Distinct(cols...))
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Omit(cols ...field.Expr) *cardAppleHistoryInfoDo {
|
||||
return c.withDO(c.DO.Omit(cols...))
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Join(table schema.Tabler, on ...field.Expr) *cardAppleHistoryInfoDo {
|
||||
return c.withDO(c.DO.Join(table, on...))
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) LeftJoin(table schema.Tabler, on ...field.Expr) *cardAppleHistoryInfoDo {
|
||||
return c.withDO(c.DO.LeftJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) RightJoin(table schema.Tabler, on ...field.Expr) *cardAppleHistoryInfoDo {
|
||||
return c.withDO(c.DO.RightJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Group(cols ...field.Expr) *cardAppleHistoryInfoDo {
|
||||
return c.withDO(c.DO.Group(cols...))
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Having(conds ...gen.Condition) *cardAppleHistoryInfoDo {
|
||||
return c.withDO(c.DO.Having(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Limit(limit int) *cardAppleHistoryInfoDo {
|
||||
return c.withDO(c.DO.Limit(limit))
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Offset(offset int) *cardAppleHistoryInfoDo {
|
||||
return c.withDO(c.DO.Offset(offset))
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *cardAppleHistoryInfoDo {
|
||||
return c.withDO(c.DO.Scopes(funcs...))
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Unscoped() *cardAppleHistoryInfoDo {
|
||||
return c.withDO(c.DO.Unscoped())
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Create(values ...*model.CardAppleHistoryInfo) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Create(values)
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) CreateInBatches(values []*model.CardAppleHistoryInfo, batchSize int) error {
|
||||
return c.DO.CreateInBatches(values, batchSize)
|
||||
}
|
||||
|
||||
// Save : !!! underlying implementation is different with GORM
|
||||
// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values)
|
||||
func (c cardAppleHistoryInfoDo) Save(values ...*model.CardAppleHistoryInfo) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Save(values)
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) First() (*model.CardAppleHistoryInfo, error) {
|
||||
if result, err := c.DO.First(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleHistoryInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Take() (*model.CardAppleHistoryInfo, error) {
|
||||
if result, err := c.DO.Take(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleHistoryInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Last() (*model.CardAppleHistoryInfo, error) {
|
||||
if result, err := c.DO.Last(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleHistoryInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Find() ([]*model.CardAppleHistoryInfo, error) {
|
||||
result, err := c.DO.Find()
|
||||
return result.([]*model.CardAppleHistoryInfo), err
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.CardAppleHistoryInfo, err error) {
|
||||
buf := make([]*model.CardAppleHistoryInfo, 0, batchSize)
|
||||
err = c.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error {
|
||||
defer func() { results = append(results, buf...) }()
|
||||
return fc(tx, batch)
|
||||
})
|
||||
return results, err
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) FindInBatches(result *[]*model.CardAppleHistoryInfo, batchSize int, fc func(tx gen.Dao, batch int) error) error {
|
||||
return c.DO.FindInBatches(result, batchSize, fc)
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Attrs(attrs ...field.AssignExpr) *cardAppleHistoryInfoDo {
|
||||
return c.withDO(c.DO.Attrs(attrs...))
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Assign(attrs ...field.AssignExpr) *cardAppleHistoryInfoDo {
|
||||
return c.withDO(c.DO.Assign(attrs...))
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Joins(fields ...field.RelationField) *cardAppleHistoryInfoDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Joins(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Preload(fields ...field.RelationField) *cardAppleHistoryInfoDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Preload(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) FirstOrInit() (*model.CardAppleHistoryInfo, error) {
|
||||
if result, err := c.DO.FirstOrInit(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleHistoryInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) FirstOrCreate() (*model.CardAppleHistoryInfo, error) {
|
||||
if result, err := c.DO.FirstOrCreate(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleHistoryInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) FindByPage(offset int, limit int) (result []*model.CardAppleHistoryInfo, count int64, err error) {
|
||||
result, err = c.Offset(offset).Limit(limit).Find()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if size := len(result); 0 < limit && 0 < size && size < limit {
|
||||
count = int64(size + offset)
|
||||
return
|
||||
}
|
||||
|
||||
count, err = c.Offset(-1).Limit(-1).Count()
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) {
|
||||
count, err = c.Count()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = c.Offset(offset).Limit(limit).Scan(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Scan(result interface{}) (err error) {
|
||||
return c.DO.Scan(result)
|
||||
}
|
||||
|
||||
func (c cardAppleHistoryInfoDo) Delete(models ...*model.CardAppleHistoryInfo) (result gen.ResultInfo, err error) {
|
||||
return c.DO.Delete(models)
|
||||
}
|
||||
|
||||
func (c *cardAppleHistoryInfoDo) withDO(do gen.Dao) *cardAppleHistoryInfoDo {
|
||||
c.DO = *do.(*gen.DO)
|
||||
return c
|
||||
}
|
||||
411
verification/internal/query/card_apple_recharge_info.gen.go
Normal file
411
verification/internal/query/card_apple_recharge_info.gen.go
Normal file
@@ -0,0 +1,411 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package query
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
|
||||
"gorm.io/gen"
|
||||
"gorm.io/gen/field"
|
||||
|
||||
"gorm.io/plugin/dbresolver"
|
||||
|
||||
"order/internal/model"
|
||||
)
|
||||
|
||||
func newCardAppleRechargeInfo(db *gorm.DB, opts ...gen.DOOption) cardAppleRechargeInfo {
|
||||
_cardAppleRechargeInfo := cardAppleRechargeInfo{}
|
||||
|
||||
_cardAppleRechargeInfo.cardAppleRechargeInfoDo.UseDB(db, opts...)
|
||||
_cardAppleRechargeInfo.cardAppleRechargeInfoDo.UseModel(&model.CardAppleRechargeInfo{})
|
||||
|
||||
tableName := _cardAppleRechargeInfo.cardAppleRechargeInfoDo.TableName()
|
||||
_cardAppleRechargeInfo.ALL = field.NewAsterisk(tableName)
|
||||
_cardAppleRechargeInfo.ID = field.NewInt32(tableName, "id")
|
||||
_cardAppleRechargeInfo.OrderNo = field.NewString(tableName, "order_no")
|
||||
_cardAppleRechargeInfo.AccountID = field.NewString(tableName, "account_id")
|
||||
_cardAppleRechargeInfo.AccountName = field.NewString(tableName, "account_name")
|
||||
_cardAppleRechargeInfo.CardNo = field.NewString(tableName, "card_no")
|
||||
_cardAppleRechargeInfo.CardPass = field.NewString(tableName, "card_pass")
|
||||
_cardAppleRechargeInfo.MerchantID = field.NewString(tableName, "merchant_id")
|
||||
_cardAppleRechargeInfo.Balance = field.NewFloat32(tableName, "balance")
|
||||
_cardAppleRechargeInfo.CardAmount = field.NewFloat32(tableName, "card_amount")
|
||||
_cardAppleRechargeInfo.NotifyStatus = field.NewInt32(tableName, "notify_status")
|
||||
_cardAppleRechargeInfo.Status = field.NewInt32(tableName, "status")
|
||||
_cardAppleRechargeInfo.ActualAmount = field.NewFloat32(tableName, "actual_amount")
|
||||
_cardAppleRechargeInfo.CallbackURL = field.NewString(tableName, "callback_url")
|
||||
_cardAppleRechargeInfo.CallbackCount = field.NewInt32(tableName, "callback_count")
|
||||
_cardAppleRechargeInfo.DistributionCount = field.NewInt32(tableName, "distribution_count")
|
||||
_cardAppleRechargeInfo.CreatedUserID = field.NewString(tableName, "created_user_id")
|
||||
_cardAppleRechargeInfo.Attach = field.NewString(tableName, "attach")
|
||||
_cardAppleRechargeInfo.Remark = field.NewString(tableName, "remark")
|
||||
_cardAppleRechargeInfo.CreatedAt = field.NewTime(tableName, "created_at")
|
||||
_cardAppleRechargeInfo.UpdatedAt = field.NewTime(tableName, "updated_at")
|
||||
_cardAppleRechargeInfo.DeletedAt = field.NewField(tableName, "deleted_at")
|
||||
|
||||
_cardAppleRechargeInfo.fillFieldMap()
|
||||
|
||||
return _cardAppleRechargeInfo
|
||||
}
|
||||
|
||||
type cardAppleRechargeInfo struct {
|
||||
cardAppleRechargeInfoDo cardAppleRechargeInfoDo
|
||||
|
||||
ALL field.Asterisk
|
||||
ID field.Int32
|
||||
OrderNo field.String // 订单号
|
||||
AccountID field.String
|
||||
AccountName field.String
|
||||
CardNo field.String // 卡号
|
||||
CardPass field.String // 卡密
|
||||
MerchantID field.String // 商户ID
|
||||
Balance field.Float32 // 余额
|
||||
CardAmount field.Float32 // 卡面充值金额
|
||||
NotifyStatus field.Int32
|
||||
Status field.Int32 // 状态 0.创建 1.交易成功 2.交易中 3.交易失败
|
||||
ActualAmount field.Float32 // 实际充值金额
|
||||
CallbackURL field.String
|
||||
CallbackCount field.Int32 // itunes回调次数
|
||||
DistributionCount field.Int32
|
||||
CreatedUserID field.String // 创建者ID
|
||||
Attach field.String
|
||||
Remark field.String
|
||||
CreatedAt field.Time // 创建日期
|
||||
UpdatedAt field.Time // 更新日期
|
||||
DeletedAt field.Field // 删除日期
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfo) Table(newTableName string) *cardAppleRechargeInfo {
|
||||
c.cardAppleRechargeInfoDo.UseTable(newTableName)
|
||||
return c.updateTableName(newTableName)
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfo) As(alias string) *cardAppleRechargeInfo {
|
||||
c.cardAppleRechargeInfoDo.DO = *(c.cardAppleRechargeInfoDo.As(alias).(*gen.DO))
|
||||
return c.updateTableName(alias)
|
||||
}
|
||||
|
||||
func (c *cardAppleRechargeInfo) updateTableName(table string) *cardAppleRechargeInfo {
|
||||
c.ALL = field.NewAsterisk(table)
|
||||
c.ID = field.NewInt32(table, "id")
|
||||
c.OrderNo = field.NewString(table, "order_no")
|
||||
c.AccountID = field.NewString(table, "account_id")
|
||||
c.AccountName = field.NewString(table, "account_name")
|
||||
c.CardNo = field.NewString(table, "card_no")
|
||||
c.CardPass = field.NewString(table, "card_pass")
|
||||
c.MerchantID = field.NewString(table, "merchant_id")
|
||||
c.Balance = field.NewFloat32(table, "balance")
|
||||
c.CardAmount = field.NewFloat32(table, "card_amount")
|
||||
c.NotifyStatus = field.NewInt32(table, "notify_status")
|
||||
c.Status = field.NewInt32(table, "status")
|
||||
c.ActualAmount = field.NewFloat32(table, "actual_amount")
|
||||
c.CallbackURL = field.NewString(table, "callback_url")
|
||||
c.CallbackCount = field.NewInt32(table, "callback_count")
|
||||
c.DistributionCount = field.NewInt32(table, "distribution_count")
|
||||
c.CreatedUserID = field.NewString(table, "created_user_id")
|
||||
c.Attach = field.NewString(table, "attach")
|
||||
c.Remark = field.NewString(table, "remark")
|
||||
c.CreatedAt = field.NewTime(table, "created_at")
|
||||
c.UpdatedAt = field.NewTime(table, "updated_at")
|
||||
c.DeletedAt = field.NewField(table, "deleted_at")
|
||||
|
||||
c.fillFieldMap()
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *cardAppleRechargeInfo) WithContext(ctx context.Context) *cardAppleRechargeInfoDo {
|
||||
return c.cardAppleRechargeInfoDo.WithContext(ctx)
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfo) TableName() string { return c.cardAppleRechargeInfoDo.TableName() }
|
||||
|
||||
func (c cardAppleRechargeInfo) Alias() string { return c.cardAppleRechargeInfoDo.Alias() }
|
||||
|
||||
func (c cardAppleRechargeInfo) Columns(cols ...field.Expr) gen.Columns {
|
||||
return c.cardAppleRechargeInfoDo.Columns(cols...)
|
||||
}
|
||||
|
||||
func (c *cardAppleRechargeInfo) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
||||
_f, ok := c.fieldMap[fieldName]
|
||||
if !ok || _f == nil {
|
||||
return nil, false
|
||||
}
|
||||
_oe, ok := _f.(field.OrderExpr)
|
||||
return _oe, ok
|
||||
}
|
||||
|
||||
func (c *cardAppleRechargeInfo) fillFieldMap() {
|
||||
c.fieldMap = make(map[string]field.Expr, 21)
|
||||
c.fieldMap["id"] = c.ID
|
||||
c.fieldMap["order_no"] = c.OrderNo
|
||||
c.fieldMap["account_id"] = c.AccountID
|
||||
c.fieldMap["account_name"] = c.AccountName
|
||||
c.fieldMap["card_no"] = c.CardNo
|
||||
c.fieldMap["card_pass"] = c.CardPass
|
||||
c.fieldMap["merchant_id"] = c.MerchantID
|
||||
c.fieldMap["balance"] = c.Balance
|
||||
c.fieldMap["card_amount"] = c.CardAmount
|
||||
c.fieldMap["notify_status"] = c.NotifyStatus
|
||||
c.fieldMap["status"] = c.Status
|
||||
c.fieldMap["actual_amount"] = c.ActualAmount
|
||||
c.fieldMap["callback_url"] = c.CallbackURL
|
||||
c.fieldMap["callback_count"] = c.CallbackCount
|
||||
c.fieldMap["distribution_count"] = c.DistributionCount
|
||||
c.fieldMap["created_user_id"] = c.CreatedUserID
|
||||
c.fieldMap["attach"] = c.Attach
|
||||
c.fieldMap["remark"] = c.Remark
|
||||
c.fieldMap["created_at"] = c.CreatedAt
|
||||
c.fieldMap["updated_at"] = c.UpdatedAt
|
||||
c.fieldMap["deleted_at"] = c.DeletedAt
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfo) clone(db *gorm.DB) cardAppleRechargeInfo {
|
||||
c.cardAppleRechargeInfoDo.ReplaceConnPool(db.Statement.ConnPool)
|
||||
return c
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfo) replaceDB(db *gorm.DB) cardAppleRechargeInfo {
|
||||
c.cardAppleRechargeInfoDo.ReplaceDB(db)
|
||||
return c
|
||||
}
|
||||
|
||||
type cardAppleRechargeInfoDo struct{ gen.DO }
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Debug() *cardAppleRechargeInfoDo {
|
||||
return c.withDO(c.DO.Debug())
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) WithContext(ctx context.Context) *cardAppleRechargeInfoDo {
|
||||
return c.withDO(c.DO.WithContext(ctx))
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) ReadDB() *cardAppleRechargeInfoDo {
|
||||
return c.Clauses(dbresolver.Read)
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) WriteDB() *cardAppleRechargeInfoDo {
|
||||
return c.Clauses(dbresolver.Write)
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Session(config *gorm.Session) *cardAppleRechargeInfoDo {
|
||||
return c.withDO(c.DO.Session(config))
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Clauses(conds ...clause.Expression) *cardAppleRechargeInfoDo {
|
||||
return c.withDO(c.DO.Clauses(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Returning(value interface{}, columns ...string) *cardAppleRechargeInfoDo {
|
||||
return c.withDO(c.DO.Returning(value, columns...))
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Not(conds ...gen.Condition) *cardAppleRechargeInfoDo {
|
||||
return c.withDO(c.DO.Not(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Or(conds ...gen.Condition) *cardAppleRechargeInfoDo {
|
||||
return c.withDO(c.DO.Or(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Select(conds ...field.Expr) *cardAppleRechargeInfoDo {
|
||||
return c.withDO(c.DO.Select(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Where(conds ...gen.Condition) *cardAppleRechargeInfoDo {
|
||||
return c.withDO(c.DO.Where(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Order(conds ...field.Expr) *cardAppleRechargeInfoDo {
|
||||
return c.withDO(c.DO.Order(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Distinct(cols ...field.Expr) *cardAppleRechargeInfoDo {
|
||||
return c.withDO(c.DO.Distinct(cols...))
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Omit(cols ...field.Expr) *cardAppleRechargeInfoDo {
|
||||
return c.withDO(c.DO.Omit(cols...))
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Join(table schema.Tabler, on ...field.Expr) *cardAppleRechargeInfoDo {
|
||||
return c.withDO(c.DO.Join(table, on...))
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) LeftJoin(table schema.Tabler, on ...field.Expr) *cardAppleRechargeInfoDo {
|
||||
return c.withDO(c.DO.LeftJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) RightJoin(table schema.Tabler, on ...field.Expr) *cardAppleRechargeInfoDo {
|
||||
return c.withDO(c.DO.RightJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Group(cols ...field.Expr) *cardAppleRechargeInfoDo {
|
||||
return c.withDO(c.DO.Group(cols...))
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Having(conds ...gen.Condition) *cardAppleRechargeInfoDo {
|
||||
return c.withDO(c.DO.Having(conds...))
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Limit(limit int) *cardAppleRechargeInfoDo {
|
||||
return c.withDO(c.DO.Limit(limit))
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Offset(offset int) *cardAppleRechargeInfoDo {
|
||||
return c.withDO(c.DO.Offset(offset))
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *cardAppleRechargeInfoDo {
|
||||
return c.withDO(c.DO.Scopes(funcs...))
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Unscoped() *cardAppleRechargeInfoDo {
|
||||
return c.withDO(c.DO.Unscoped())
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Create(values ...*model.CardAppleRechargeInfo) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Create(values)
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) CreateInBatches(values []*model.CardAppleRechargeInfo, batchSize int) error {
|
||||
return c.DO.CreateInBatches(values, batchSize)
|
||||
}
|
||||
|
||||
// Save : !!! underlying implementation is different with GORM
|
||||
// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values)
|
||||
func (c cardAppleRechargeInfoDo) Save(values ...*model.CardAppleRechargeInfo) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Save(values)
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) First() (*model.CardAppleRechargeInfo, error) {
|
||||
if result, err := c.DO.First(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleRechargeInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Take() (*model.CardAppleRechargeInfo, error) {
|
||||
if result, err := c.DO.Take(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleRechargeInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Last() (*model.CardAppleRechargeInfo, error) {
|
||||
if result, err := c.DO.Last(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleRechargeInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Find() ([]*model.CardAppleRechargeInfo, error) {
|
||||
result, err := c.DO.Find()
|
||||
return result.([]*model.CardAppleRechargeInfo), err
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.CardAppleRechargeInfo, err error) {
|
||||
buf := make([]*model.CardAppleRechargeInfo, 0, batchSize)
|
||||
err = c.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error {
|
||||
defer func() { results = append(results, buf...) }()
|
||||
return fc(tx, batch)
|
||||
})
|
||||
return results, err
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) FindInBatches(result *[]*model.CardAppleRechargeInfo, batchSize int, fc func(tx gen.Dao, batch int) error) error {
|
||||
return c.DO.FindInBatches(result, batchSize, fc)
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Attrs(attrs ...field.AssignExpr) *cardAppleRechargeInfoDo {
|
||||
return c.withDO(c.DO.Attrs(attrs...))
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Assign(attrs ...field.AssignExpr) *cardAppleRechargeInfoDo {
|
||||
return c.withDO(c.DO.Assign(attrs...))
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Joins(fields ...field.RelationField) *cardAppleRechargeInfoDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Joins(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Preload(fields ...field.RelationField) *cardAppleRechargeInfoDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Preload(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) FirstOrInit() (*model.CardAppleRechargeInfo, error) {
|
||||
if result, err := c.DO.FirstOrInit(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleRechargeInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) FirstOrCreate() (*model.CardAppleRechargeInfo, error) {
|
||||
if result, err := c.DO.FirstOrCreate(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardAppleRechargeInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) FindByPage(offset int, limit int) (result []*model.CardAppleRechargeInfo, count int64, err error) {
|
||||
result, err = c.Offset(offset).Limit(limit).Find()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if size := len(result); 0 < limit && 0 < size && size < limit {
|
||||
count = int64(size + offset)
|
||||
return
|
||||
}
|
||||
|
||||
count, err = c.Offset(-1).Limit(-1).Count()
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) {
|
||||
count, err = c.Count()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = c.Offset(offset).Limit(limit).Scan(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Scan(result interface{}) (err error) {
|
||||
return c.DO.Scan(result)
|
||||
}
|
||||
|
||||
func (c cardAppleRechargeInfoDo) Delete(models ...*model.CardAppleRechargeInfo) (result gen.ResultInfo, err error) {
|
||||
return c.DO.Delete(models)
|
||||
}
|
||||
|
||||
func (c *cardAppleRechargeInfoDo) withDO(do gen.Dao) *cardAppleRechargeInfoDo {
|
||||
c.DO = *do.(*gen.DO)
|
||||
return c
|
||||
}
|
||||
361
verification/internal/query/card_redeem_account_deduction.gen.go
Normal file
361
verification/internal/query/card_redeem_account_deduction.gen.go
Normal file
@@ -0,0 +1,361 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package query
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
|
||||
"gorm.io/gen"
|
||||
"gorm.io/gen/field"
|
||||
|
||||
"gorm.io/plugin/dbresolver"
|
||||
|
||||
"order/internal/model"
|
||||
)
|
||||
|
||||
func newCardRedeemAccountDeduction(db *gorm.DB, opts ...gen.DOOption) cardRedeemAccountDeduction {
|
||||
_cardRedeemAccountDeduction := cardRedeemAccountDeduction{}
|
||||
|
||||
_cardRedeemAccountDeduction.cardRedeemAccountDeductionDo.UseDB(db, opts...)
|
||||
_cardRedeemAccountDeduction.cardRedeemAccountDeductionDo.UseModel(&model.CardRedeemAccountDeduction{})
|
||||
|
||||
tableName := _cardRedeemAccountDeduction.cardRedeemAccountDeductionDo.TableName()
|
||||
_cardRedeemAccountDeduction.ALL = field.NewAsterisk(tableName)
|
||||
_cardRedeemAccountDeduction.ID = field.NewInt32(tableName, "id")
|
||||
_cardRedeemAccountDeduction.OrderNo = field.NewString(tableName, "order_no")
|
||||
_cardRedeemAccountDeduction.AccountID = field.NewString(tableName, "account_id")
|
||||
_cardRedeemAccountDeduction.OperationStatus = field.NewString(tableName, "operation_status")
|
||||
_cardRedeemAccountDeduction.Balance = field.NewFloat32(tableName, "balance")
|
||||
_cardRedeemAccountDeduction.CreatedAt = field.NewTime(tableName, "created_at")
|
||||
_cardRedeemAccountDeduction.UpdatedAt = field.NewTime(tableName, "updated_at")
|
||||
_cardRedeemAccountDeduction.DeletedAt = field.NewField(tableName, "deleted_at")
|
||||
|
||||
_cardRedeemAccountDeduction.fillFieldMap()
|
||||
|
||||
return _cardRedeemAccountDeduction
|
||||
}
|
||||
|
||||
type cardRedeemAccountDeduction struct {
|
||||
cardRedeemAccountDeductionDo cardRedeemAccountDeductionDo
|
||||
|
||||
ALL field.Asterisk
|
||||
ID field.Int32
|
||||
OrderNo field.String // 订单金额
|
||||
AccountID field.String // 订单ID
|
||||
OperationStatus field.String // 操作记录
|
||||
Balance field.Float32 // 金额
|
||||
CreatedAt field.Time
|
||||
UpdatedAt field.Time
|
||||
DeletedAt field.Field
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeduction) Table(newTableName string) *cardRedeemAccountDeduction {
|
||||
c.cardRedeemAccountDeductionDo.UseTable(newTableName)
|
||||
return c.updateTableName(newTableName)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeduction) As(alias string) *cardRedeemAccountDeduction {
|
||||
c.cardRedeemAccountDeductionDo.DO = *(c.cardRedeemAccountDeductionDo.As(alias).(*gen.DO))
|
||||
return c.updateTableName(alias)
|
||||
}
|
||||
|
||||
func (c *cardRedeemAccountDeduction) updateTableName(table string) *cardRedeemAccountDeduction {
|
||||
c.ALL = field.NewAsterisk(table)
|
||||
c.ID = field.NewInt32(table, "id")
|
||||
c.OrderNo = field.NewString(table, "order_no")
|
||||
c.AccountID = field.NewString(table, "account_id")
|
||||
c.OperationStatus = field.NewString(table, "operation_status")
|
||||
c.Balance = field.NewFloat32(table, "balance")
|
||||
c.CreatedAt = field.NewTime(table, "created_at")
|
||||
c.UpdatedAt = field.NewTime(table, "updated_at")
|
||||
c.DeletedAt = field.NewField(table, "deleted_at")
|
||||
|
||||
c.fillFieldMap()
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *cardRedeemAccountDeduction) WithContext(ctx context.Context) *cardRedeemAccountDeductionDo {
|
||||
return c.cardRedeemAccountDeductionDo.WithContext(ctx)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeduction) TableName() string {
|
||||
return c.cardRedeemAccountDeductionDo.TableName()
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeduction) Alias() string { return c.cardRedeemAccountDeductionDo.Alias() }
|
||||
|
||||
func (c cardRedeemAccountDeduction) Columns(cols ...field.Expr) gen.Columns {
|
||||
return c.cardRedeemAccountDeductionDo.Columns(cols...)
|
||||
}
|
||||
|
||||
func (c *cardRedeemAccountDeduction) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
||||
_f, ok := c.fieldMap[fieldName]
|
||||
if !ok || _f == nil {
|
||||
return nil, false
|
||||
}
|
||||
_oe, ok := _f.(field.OrderExpr)
|
||||
return _oe, ok
|
||||
}
|
||||
|
||||
func (c *cardRedeemAccountDeduction) fillFieldMap() {
|
||||
c.fieldMap = make(map[string]field.Expr, 8)
|
||||
c.fieldMap["id"] = c.ID
|
||||
c.fieldMap["order_no"] = c.OrderNo
|
||||
c.fieldMap["account_id"] = c.AccountID
|
||||
c.fieldMap["operation_status"] = c.OperationStatus
|
||||
c.fieldMap["balance"] = c.Balance
|
||||
c.fieldMap["created_at"] = c.CreatedAt
|
||||
c.fieldMap["updated_at"] = c.UpdatedAt
|
||||
c.fieldMap["deleted_at"] = c.DeletedAt
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeduction) clone(db *gorm.DB) cardRedeemAccountDeduction {
|
||||
c.cardRedeemAccountDeductionDo.ReplaceConnPool(db.Statement.ConnPool)
|
||||
return c
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeduction) replaceDB(db *gorm.DB) cardRedeemAccountDeduction {
|
||||
c.cardRedeemAccountDeductionDo.ReplaceDB(db)
|
||||
return c
|
||||
}
|
||||
|
||||
type cardRedeemAccountDeductionDo struct{ gen.DO }
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Debug() *cardRedeemAccountDeductionDo {
|
||||
return c.withDO(c.DO.Debug())
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) WithContext(ctx context.Context) *cardRedeemAccountDeductionDo {
|
||||
return c.withDO(c.DO.WithContext(ctx))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) ReadDB() *cardRedeemAccountDeductionDo {
|
||||
return c.Clauses(dbresolver.Read)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) WriteDB() *cardRedeemAccountDeductionDo {
|
||||
return c.Clauses(dbresolver.Write)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Session(config *gorm.Session) *cardRedeemAccountDeductionDo {
|
||||
return c.withDO(c.DO.Session(config))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Clauses(conds ...clause.Expression) *cardRedeemAccountDeductionDo {
|
||||
return c.withDO(c.DO.Clauses(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Returning(value interface{}, columns ...string) *cardRedeemAccountDeductionDo {
|
||||
return c.withDO(c.DO.Returning(value, columns...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Not(conds ...gen.Condition) *cardRedeemAccountDeductionDo {
|
||||
return c.withDO(c.DO.Not(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Or(conds ...gen.Condition) *cardRedeemAccountDeductionDo {
|
||||
return c.withDO(c.DO.Or(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Select(conds ...field.Expr) *cardRedeemAccountDeductionDo {
|
||||
return c.withDO(c.DO.Select(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Where(conds ...gen.Condition) *cardRedeemAccountDeductionDo {
|
||||
return c.withDO(c.DO.Where(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Order(conds ...field.Expr) *cardRedeemAccountDeductionDo {
|
||||
return c.withDO(c.DO.Order(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Distinct(cols ...field.Expr) *cardRedeemAccountDeductionDo {
|
||||
return c.withDO(c.DO.Distinct(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Omit(cols ...field.Expr) *cardRedeemAccountDeductionDo {
|
||||
return c.withDO(c.DO.Omit(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Join(table schema.Tabler, on ...field.Expr) *cardRedeemAccountDeductionDo {
|
||||
return c.withDO(c.DO.Join(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) LeftJoin(table schema.Tabler, on ...field.Expr) *cardRedeemAccountDeductionDo {
|
||||
return c.withDO(c.DO.LeftJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) RightJoin(table schema.Tabler, on ...field.Expr) *cardRedeemAccountDeductionDo {
|
||||
return c.withDO(c.DO.RightJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Group(cols ...field.Expr) *cardRedeemAccountDeductionDo {
|
||||
return c.withDO(c.DO.Group(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Having(conds ...gen.Condition) *cardRedeemAccountDeductionDo {
|
||||
return c.withDO(c.DO.Having(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Limit(limit int) *cardRedeemAccountDeductionDo {
|
||||
return c.withDO(c.DO.Limit(limit))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Offset(offset int) *cardRedeemAccountDeductionDo {
|
||||
return c.withDO(c.DO.Offset(offset))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *cardRedeemAccountDeductionDo {
|
||||
return c.withDO(c.DO.Scopes(funcs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Unscoped() *cardRedeemAccountDeductionDo {
|
||||
return c.withDO(c.DO.Unscoped())
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Create(values ...*model.CardRedeemAccountDeduction) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Create(values)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) CreateInBatches(values []*model.CardRedeemAccountDeduction, batchSize int) error {
|
||||
return c.DO.CreateInBatches(values, batchSize)
|
||||
}
|
||||
|
||||
// Save : !!! underlying implementation is different with GORM
|
||||
// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values)
|
||||
func (c cardRedeemAccountDeductionDo) Save(values ...*model.CardRedeemAccountDeduction) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Save(values)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) First() (*model.CardRedeemAccountDeduction, error) {
|
||||
if result, err := c.DO.First(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemAccountDeduction), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Take() (*model.CardRedeemAccountDeduction, error) {
|
||||
if result, err := c.DO.Take(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemAccountDeduction), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Last() (*model.CardRedeemAccountDeduction, error) {
|
||||
if result, err := c.DO.Last(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemAccountDeduction), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Find() ([]*model.CardRedeemAccountDeduction, error) {
|
||||
result, err := c.DO.Find()
|
||||
return result.([]*model.CardRedeemAccountDeduction), err
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.CardRedeemAccountDeduction, err error) {
|
||||
buf := make([]*model.CardRedeemAccountDeduction, 0, batchSize)
|
||||
err = c.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error {
|
||||
defer func() { results = append(results, buf...) }()
|
||||
return fc(tx, batch)
|
||||
})
|
||||
return results, err
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) FindInBatches(result *[]*model.CardRedeemAccountDeduction, batchSize int, fc func(tx gen.Dao, batch int) error) error {
|
||||
return c.DO.FindInBatches(result, batchSize, fc)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Attrs(attrs ...field.AssignExpr) *cardRedeemAccountDeductionDo {
|
||||
return c.withDO(c.DO.Attrs(attrs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Assign(attrs ...field.AssignExpr) *cardRedeemAccountDeductionDo {
|
||||
return c.withDO(c.DO.Assign(attrs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Joins(fields ...field.RelationField) *cardRedeemAccountDeductionDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Joins(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Preload(fields ...field.RelationField) *cardRedeemAccountDeductionDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Preload(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) FirstOrInit() (*model.CardRedeemAccountDeduction, error) {
|
||||
if result, err := c.DO.FirstOrInit(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemAccountDeduction), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) FirstOrCreate() (*model.CardRedeemAccountDeduction, error) {
|
||||
if result, err := c.DO.FirstOrCreate(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemAccountDeduction), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) FindByPage(offset int, limit int) (result []*model.CardRedeemAccountDeduction, count int64, err error) {
|
||||
result, err = c.Offset(offset).Limit(limit).Find()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if size := len(result); 0 < limit && 0 < size && size < limit {
|
||||
count = int64(size + offset)
|
||||
return
|
||||
}
|
||||
|
||||
count, err = c.Offset(-1).Limit(-1).Count()
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) {
|
||||
count, err = c.Count()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = c.Offset(offset).Limit(limit).Scan(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Scan(result interface{}) (err error) {
|
||||
return c.DO.Scan(result)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountDeductionDo) Delete(models ...*model.CardRedeemAccountDeduction) (result gen.ResultInfo, err error) {
|
||||
return c.DO.Delete(models)
|
||||
}
|
||||
|
||||
func (c *cardRedeemAccountDeductionDo) withDO(do gen.Dao) *cardRedeemAccountDeductionDo {
|
||||
c.DO = *do.(*gen.DO)
|
||||
return c
|
||||
}
|
||||
359
verification/internal/query/card_redeem_account_group.gen.go
Normal file
359
verification/internal/query/card_redeem_account_group.gen.go
Normal file
@@ -0,0 +1,359 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package query
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
|
||||
"gorm.io/gen"
|
||||
"gorm.io/gen/field"
|
||||
|
||||
"gorm.io/plugin/dbresolver"
|
||||
|
||||
"order/internal/model"
|
||||
)
|
||||
|
||||
func newCardRedeemAccountGroup(db *gorm.DB, opts ...gen.DOOption) cardRedeemAccountGroup {
|
||||
_cardRedeemAccountGroup := cardRedeemAccountGroup{}
|
||||
|
||||
_cardRedeemAccountGroup.cardRedeemAccountGroupDo.UseDB(db, opts...)
|
||||
_cardRedeemAccountGroup.cardRedeemAccountGroupDo.UseModel(&model.CardRedeemAccountGroup{})
|
||||
|
||||
tableName := _cardRedeemAccountGroup.cardRedeemAccountGroupDo.TableName()
|
||||
_cardRedeemAccountGroup.ALL = field.NewAsterisk(tableName)
|
||||
_cardRedeemAccountGroup.ID = field.NewInt32(tableName, "id")
|
||||
_cardRedeemAccountGroup.Name = field.NewString(tableName, "name")
|
||||
_cardRedeemAccountGroup.Notes = field.NewString(tableName, "notes")
|
||||
_cardRedeemAccountGroup.Category = field.NewString(tableName, "category")
|
||||
_cardRedeemAccountGroup.CreatedUserID = field.NewString(tableName, "created_user_id")
|
||||
_cardRedeemAccountGroup.CreatedAt = field.NewTime(tableName, "created_at")
|
||||
_cardRedeemAccountGroup.DeletedAt = field.NewField(tableName, "deleted_at")
|
||||
_cardRedeemAccountGroup.UpdatedAt = field.NewTime(tableName, "updated_at")
|
||||
|
||||
_cardRedeemAccountGroup.fillFieldMap()
|
||||
|
||||
return _cardRedeemAccountGroup
|
||||
}
|
||||
|
||||
type cardRedeemAccountGroup struct {
|
||||
cardRedeemAccountGroupDo cardRedeemAccountGroupDo
|
||||
|
||||
ALL field.Asterisk
|
||||
ID field.Int32
|
||||
Name field.String // 分组名称
|
||||
Notes field.String // 备注
|
||||
Category field.String // 分组类别
|
||||
CreatedUserID field.String
|
||||
CreatedAt field.Time
|
||||
DeletedAt field.Field
|
||||
UpdatedAt field.Time
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroup) Table(newTableName string) *cardRedeemAccountGroup {
|
||||
c.cardRedeemAccountGroupDo.UseTable(newTableName)
|
||||
return c.updateTableName(newTableName)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroup) As(alias string) *cardRedeemAccountGroup {
|
||||
c.cardRedeemAccountGroupDo.DO = *(c.cardRedeemAccountGroupDo.As(alias).(*gen.DO))
|
||||
return c.updateTableName(alias)
|
||||
}
|
||||
|
||||
func (c *cardRedeemAccountGroup) updateTableName(table string) *cardRedeemAccountGroup {
|
||||
c.ALL = field.NewAsterisk(table)
|
||||
c.ID = field.NewInt32(table, "id")
|
||||
c.Name = field.NewString(table, "name")
|
||||
c.Notes = field.NewString(table, "notes")
|
||||
c.Category = field.NewString(table, "category")
|
||||
c.CreatedUserID = field.NewString(table, "created_user_id")
|
||||
c.CreatedAt = field.NewTime(table, "created_at")
|
||||
c.DeletedAt = field.NewField(table, "deleted_at")
|
||||
c.UpdatedAt = field.NewTime(table, "updated_at")
|
||||
|
||||
c.fillFieldMap()
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *cardRedeemAccountGroup) WithContext(ctx context.Context) *cardRedeemAccountGroupDo {
|
||||
return c.cardRedeemAccountGroupDo.WithContext(ctx)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroup) TableName() string { return c.cardRedeemAccountGroupDo.TableName() }
|
||||
|
||||
func (c cardRedeemAccountGroup) Alias() string { return c.cardRedeemAccountGroupDo.Alias() }
|
||||
|
||||
func (c cardRedeemAccountGroup) Columns(cols ...field.Expr) gen.Columns {
|
||||
return c.cardRedeemAccountGroupDo.Columns(cols...)
|
||||
}
|
||||
|
||||
func (c *cardRedeemAccountGroup) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
||||
_f, ok := c.fieldMap[fieldName]
|
||||
if !ok || _f == nil {
|
||||
return nil, false
|
||||
}
|
||||
_oe, ok := _f.(field.OrderExpr)
|
||||
return _oe, ok
|
||||
}
|
||||
|
||||
func (c *cardRedeemAccountGroup) fillFieldMap() {
|
||||
c.fieldMap = make(map[string]field.Expr, 8)
|
||||
c.fieldMap["id"] = c.ID
|
||||
c.fieldMap["name"] = c.Name
|
||||
c.fieldMap["notes"] = c.Notes
|
||||
c.fieldMap["category"] = c.Category
|
||||
c.fieldMap["created_user_id"] = c.CreatedUserID
|
||||
c.fieldMap["created_at"] = c.CreatedAt
|
||||
c.fieldMap["deleted_at"] = c.DeletedAt
|
||||
c.fieldMap["updated_at"] = c.UpdatedAt
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroup) clone(db *gorm.DB) cardRedeemAccountGroup {
|
||||
c.cardRedeemAccountGroupDo.ReplaceConnPool(db.Statement.ConnPool)
|
||||
return c
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroup) replaceDB(db *gorm.DB) cardRedeemAccountGroup {
|
||||
c.cardRedeemAccountGroupDo.ReplaceDB(db)
|
||||
return c
|
||||
}
|
||||
|
||||
type cardRedeemAccountGroupDo struct{ gen.DO }
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Debug() *cardRedeemAccountGroupDo {
|
||||
return c.withDO(c.DO.Debug())
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) WithContext(ctx context.Context) *cardRedeemAccountGroupDo {
|
||||
return c.withDO(c.DO.WithContext(ctx))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) ReadDB() *cardRedeemAccountGroupDo {
|
||||
return c.Clauses(dbresolver.Read)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) WriteDB() *cardRedeemAccountGroupDo {
|
||||
return c.Clauses(dbresolver.Write)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Session(config *gorm.Session) *cardRedeemAccountGroupDo {
|
||||
return c.withDO(c.DO.Session(config))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Clauses(conds ...clause.Expression) *cardRedeemAccountGroupDo {
|
||||
return c.withDO(c.DO.Clauses(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Returning(value interface{}, columns ...string) *cardRedeemAccountGroupDo {
|
||||
return c.withDO(c.DO.Returning(value, columns...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Not(conds ...gen.Condition) *cardRedeemAccountGroupDo {
|
||||
return c.withDO(c.DO.Not(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Or(conds ...gen.Condition) *cardRedeemAccountGroupDo {
|
||||
return c.withDO(c.DO.Or(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Select(conds ...field.Expr) *cardRedeemAccountGroupDo {
|
||||
return c.withDO(c.DO.Select(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Where(conds ...gen.Condition) *cardRedeemAccountGroupDo {
|
||||
return c.withDO(c.DO.Where(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Order(conds ...field.Expr) *cardRedeemAccountGroupDo {
|
||||
return c.withDO(c.DO.Order(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Distinct(cols ...field.Expr) *cardRedeemAccountGroupDo {
|
||||
return c.withDO(c.DO.Distinct(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Omit(cols ...field.Expr) *cardRedeemAccountGroupDo {
|
||||
return c.withDO(c.DO.Omit(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Join(table schema.Tabler, on ...field.Expr) *cardRedeemAccountGroupDo {
|
||||
return c.withDO(c.DO.Join(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) LeftJoin(table schema.Tabler, on ...field.Expr) *cardRedeemAccountGroupDo {
|
||||
return c.withDO(c.DO.LeftJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) RightJoin(table schema.Tabler, on ...field.Expr) *cardRedeemAccountGroupDo {
|
||||
return c.withDO(c.DO.RightJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Group(cols ...field.Expr) *cardRedeemAccountGroupDo {
|
||||
return c.withDO(c.DO.Group(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Having(conds ...gen.Condition) *cardRedeemAccountGroupDo {
|
||||
return c.withDO(c.DO.Having(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Limit(limit int) *cardRedeemAccountGroupDo {
|
||||
return c.withDO(c.DO.Limit(limit))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Offset(offset int) *cardRedeemAccountGroupDo {
|
||||
return c.withDO(c.DO.Offset(offset))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *cardRedeemAccountGroupDo {
|
||||
return c.withDO(c.DO.Scopes(funcs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Unscoped() *cardRedeemAccountGroupDo {
|
||||
return c.withDO(c.DO.Unscoped())
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Create(values ...*model.CardRedeemAccountGroup) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Create(values)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) CreateInBatches(values []*model.CardRedeemAccountGroup, batchSize int) error {
|
||||
return c.DO.CreateInBatches(values, batchSize)
|
||||
}
|
||||
|
||||
// Save : !!! underlying implementation is different with GORM
|
||||
// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values)
|
||||
func (c cardRedeemAccountGroupDo) Save(values ...*model.CardRedeemAccountGroup) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Save(values)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) First() (*model.CardRedeemAccountGroup, error) {
|
||||
if result, err := c.DO.First(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemAccountGroup), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Take() (*model.CardRedeemAccountGroup, error) {
|
||||
if result, err := c.DO.Take(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemAccountGroup), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Last() (*model.CardRedeemAccountGroup, error) {
|
||||
if result, err := c.DO.Last(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemAccountGroup), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Find() ([]*model.CardRedeemAccountGroup, error) {
|
||||
result, err := c.DO.Find()
|
||||
return result.([]*model.CardRedeemAccountGroup), err
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.CardRedeemAccountGroup, err error) {
|
||||
buf := make([]*model.CardRedeemAccountGroup, 0, batchSize)
|
||||
err = c.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error {
|
||||
defer func() { results = append(results, buf...) }()
|
||||
return fc(tx, batch)
|
||||
})
|
||||
return results, err
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) FindInBatches(result *[]*model.CardRedeemAccountGroup, batchSize int, fc func(tx gen.Dao, batch int) error) error {
|
||||
return c.DO.FindInBatches(result, batchSize, fc)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Attrs(attrs ...field.AssignExpr) *cardRedeemAccountGroupDo {
|
||||
return c.withDO(c.DO.Attrs(attrs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Assign(attrs ...field.AssignExpr) *cardRedeemAccountGroupDo {
|
||||
return c.withDO(c.DO.Assign(attrs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Joins(fields ...field.RelationField) *cardRedeemAccountGroupDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Joins(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Preload(fields ...field.RelationField) *cardRedeemAccountGroupDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Preload(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) FirstOrInit() (*model.CardRedeemAccountGroup, error) {
|
||||
if result, err := c.DO.FirstOrInit(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemAccountGroup), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) FirstOrCreate() (*model.CardRedeemAccountGroup, error) {
|
||||
if result, err := c.DO.FirstOrCreate(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemAccountGroup), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) FindByPage(offset int, limit int) (result []*model.CardRedeemAccountGroup, count int64, err error) {
|
||||
result, err = c.Offset(offset).Limit(limit).Find()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if size := len(result); 0 < limit && 0 < size && size < limit {
|
||||
count = int64(size + offset)
|
||||
return
|
||||
}
|
||||
|
||||
count, err = c.Offset(-1).Limit(-1).Count()
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) {
|
||||
count, err = c.Count()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = c.Offset(offset).Limit(limit).Scan(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Scan(result interface{}) (err error) {
|
||||
return c.DO.Scan(result)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountGroupDo) Delete(models ...*model.CardRedeemAccountGroup) (result gen.ResultInfo, err error) {
|
||||
return c.DO.Delete(models)
|
||||
}
|
||||
|
||||
func (c *cardRedeemAccountGroupDo) withDO(do gen.Dao) *cardRedeemAccountGroupDo {
|
||||
c.DO = *do.(*gen.DO)
|
||||
return c
|
||||
}
|
||||
379
verification/internal/query/card_redeem_account_history.gen.go
Normal file
379
verification/internal/query/card_redeem_account_history.gen.go
Normal file
@@ -0,0 +1,379 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package query
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
|
||||
"gorm.io/gen"
|
||||
"gorm.io/gen/field"
|
||||
|
||||
"gorm.io/plugin/dbresolver"
|
||||
|
||||
"order/internal/model"
|
||||
)
|
||||
|
||||
func newCardRedeemAccountHistory(db *gorm.DB, opts ...gen.DOOption) cardRedeemAccountHistory {
|
||||
_cardRedeemAccountHistory := cardRedeemAccountHistory{}
|
||||
|
||||
_cardRedeemAccountHistory.cardRedeemAccountHistoryDo.UseDB(db, opts...)
|
||||
_cardRedeemAccountHistory.cardRedeemAccountHistoryDo.UseModel(&model.CardRedeemAccountHistory{})
|
||||
|
||||
tableName := _cardRedeemAccountHistory.cardRedeemAccountHistoryDo.TableName()
|
||||
_cardRedeemAccountHistory.ALL = field.NewAsterisk(tableName)
|
||||
_cardRedeemAccountHistory.ID = field.NewInt32(tableName, "id")
|
||||
_cardRedeemAccountHistory.AccountID = field.NewString(tableName, "account_id")
|
||||
_cardRedeemAccountHistory.AccountName = field.NewString(tableName, "account_name")
|
||||
_cardRedeemAccountHistory.Cookie = field.NewString(tableName, "cookie")
|
||||
_cardRedeemAccountHistory.OrderNo = field.NewString(tableName, "order_no")
|
||||
_cardRedeemAccountHistory.Amount = field.NewFloat32(tableName, "amount")
|
||||
_cardRedeemAccountHistory.EffectiveBalance = field.NewFloat32(tableName, "effective_balance")
|
||||
_cardRedeemAccountHistory.Balance = field.NewFloat32(tableName, "balance")
|
||||
_cardRedeemAccountHistory.Remark = field.NewString(tableName, "remark")
|
||||
_cardRedeemAccountHistory.OperationStatus = field.NewString(tableName, "operation_status")
|
||||
_cardRedeemAccountHistory.CreatedAt = field.NewTime(tableName, "created_at")
|
||||
_cardRedeemAccountHistory.UpdatedAt = field.NewTime(tableName, "updated_at")
|
||||
_cardRedeemAccountHistory.DeletedAt = field.NewField(tableName, "deleted_at")
|
||||
|
||||
_cardRedeemAccountHistory.fillFieldMap()
|
||||
|
||||
return _cardRedeemAccountHistory
|
||||
}
|
||||
|
||||
type cardRedeemAccountHistory struct {
|
||||
cardRedeemAccountHistoryDo cardRedeemAccountHistoryDo
|
||||
|
||||
ALL field.Asterisk
|
||||
ID field.Int32
|
||||
AccountID field.String // 账号
|
||||
AccountName field.String
|
||||
Cookie field.String
|
||||
OrderNo field.String // 订单号
|
||||
Amount field.Float32 // 金额变化
|
||||
EffectiveBalance field.Float32 // 余额(自身充值变化)
|
||||
Balance field.Float32 // 余额(所有余额)
|
||||
Remark field.String
|
||||
OperationStatus field.String // 操作状态
|
||||
CreatedAt field.Time
|
||||
UpdatedAt field.Time
|
||||
DeletedAt field.Field
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistory) Table(newTableName string) *cardRedeemAccountHistory {
|
||||
c.cardRedeemAccountHistoryDo.UseTable(newTableName)
|
||||
return c.updateTableName(newTableName)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistory) As(alias string) *cardRedeemAccountHistory {
|
||||
c.cardRedeemAccountHistoryDo.DO = *(c.cardRedeemAccountHistoryDo.As(alias).(*gen.DO))
|
||||
return c.updateTableName(alias)
|
||||
}
|
||||
|
||||
func (c *cardRedeemAccountHistory) updateTableName(table string) *cardRedeemAccountHistory {
|
||||
c.ALL = field.NewAsterisk(table)
|
||||
c.ID = field.NewInt32(table, "id")
|
||||
c.AccountID = field.NewString(table, "account_id")
|
||||
c.AccountName = field.NewString(table, "account_name")
|
||||
c.Cookie = field.NewString(table, "cookie")
|
||||
c.OrderNo = field.NewString(table, "order_no")
|
||||
c.Amount = field.NewFloat32(table, "amount")
|
||||
c.EffectiveBalance = field.NewFloat32(table, "effective_balance")
|
||||
c.Balance = field.NewFloat32(table, "balance")
|
||||
c.Remark = field.NewString(table, "remark")
|
||||
c.OperationStatus = field.NewString(table, "operation_status")
|
||||
c.CreatedAt = field.NewTime(table, "created_at")
|
||||
c.UpdatedAt = field.NewTime(table, "updated_at")
|
||||
c.DeletedAt = field.NewField(table, "deleted_at")
|
||||
|
||||
c.fillFieldMap()
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *cardRedeemAccountHistory) WithContext(ctx context.Context) *cardRedeemAccountHistoryDo {
|
||||
return c.cardRedeemAccountHistoryDo.WithContext(ctx)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistory) TableName() string { return c.cardRedeemAccountHistoryDo.TableName() }
|
||||
|
||||
func (c cardRedeemAccountHistory) Alias() string { return c.cardRedeemAccountHistoryDo.Alias() }
|
||||
|
||||
func (c cardRedeemAccountHistory) Columns(cols ...field.Expr) gen.Columns {
|
||||
return c.cardRedeemAccountHistoryDo.Columns(cols...)
|
||||
}
|
||||
|
||||
func (c *cardRedeemAccountHistory) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
||||
_f, ok := c.fieldMap[fieldName]
|
||||
if !ok || _f == nil {
|
||||
return nil, false
|
||||
}
|
||||
_oe, ok := _f.(field.OrderExpr)
|
||||
return _oe, ok
|
||||
}
|
||||
|
||||
func (c *cardRedeemAccountHistory) fillFieldMap() {
|
||||
c.fieldMap = make(map[string]field.Expr, 13)
|
||||
c.fieldMap["id"] = c.ID
|
||||
c.fieldMap["account_id"] = c.AccountID
|
||||
c.fieldMap["account_name"] = c.AccountName
|
||||
c.fieldMap["cookie"] = c.Cookie
|
||||
c.fieldMap["order_no"] = c.OrderNo
|
||||
c.fieldMap["amount"] = c.Amount
|
||||
c.fieldMap["effective_balance"] = c.EffectiveBalance
|
||||
c.fieldMap["balance"] = c.Balance
|
||||
c.fieldMap["remark"] = c.Remark
|
||||
c.fieldMap["operation_status"] = c.OperationStatus
|
||||
c.fieldMap["created_at"] = c.CreatedAt
|
||||
c.fieldMap["updated_at"] = c.UpdatedAt
|
||||
c.fieldMap["deleted_at"] = c.DeletedAt
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistory) clone(db *gorm.DB) cardRedeemAccountHistory {
|
||||
c.cardRedeemAccountHistoryDo.ReplaceConnPool(db.Statement.ConnPool)
|
||||
return c
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistory) replaceDB(db *gorm.DB) cardRedeemAccountHistory {
|
||||
c.cardRedeemAccountHistoryDo.ReplaceDB(db)
|
||||
return c
|
||||
}
|
||||
|
||||
type cardRedeemAccountHistoryDo struct{ gen.DO }
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Debug() *cardRedeemAccountHistoryDo {
|
||||
return c.withDO(c.DO.Debug())
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) WithContext(ctx context.Context) *cardRedeemAccountHistoryDo {
|
||||
return c.withDO(c.DO.WithContext(ctx))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) ReadDB() *cardRedeemAccountHistoryDo {
|
||||
return c.Clauses(dbresolver.Read)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) WriteDB() *cardRedeemAccountHistoryDo {
|
||||
return c.Clauses(dbresolver.Write)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Session(config *gorm.Session) *cardRedeemAccountHistoryDo {
|
||||
return c.withDO(c.DO.Session(config))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Clauses(conds ...clause.Expression) *cardRedeemAccountHistoryDo {
|
||||
return c.withDO(c.DO.Clauses(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Returning(value interface{}, columns ...string) *cardRedeemAccountHistoryDo {
|
||||
return c.withDO(c.DO.Returning(value, columns...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Not(conds ...gen.Condition) *cardRedeemAccountHistoryDo {
|
||||
return c.withDO(c.DO.Not(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Or(conds ...gen.Condition) *cardRedeemAccountHistoryDo {
|
||||
return c.withDO(c.DO.Or(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Select(conds ...field.Expr) *cardRedeemAccountHistoryDo {
|
||||
return c.withDO(c.DO.Select(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Where(conds ...gen.Condition) *cardRedeemAccountHistoryDo {
|
||||
return c.withDO(c.DO.Where(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Order(conds ...field.Expr) *cardRedeemAccountHistoryDo {
|
||||
return c.withDO(c.DO.Order(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Distinct(cols ...field.Expr) *cardRedeemAccountHistoryDo {
|
||||
return c.withDO(c.DO.Distinct(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Omit(cols ...field.Expr) *cardRedeemAccountHistoryDo {
|
||||
return c.withDO(c.DO.Omit(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Join(table schema.Tabler, on ...field.Expr) *cardRedeemAccountHistoryDo {
|
||||
return c.withDO(c.DO.Join(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) LeftJoin(table schema.Tabler, on ...field.Expr) *cardRedeemAccountHistoryDo {
|
||||
return c.withDO(c.DO.LeftJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) RightJoin(table schema.Tabler, on ...field.Expr) *cardRedeemAccountHistoryDo {
|
||||
return c.withDO(c.DO.RightJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Group(cols ...field.Expr) *cardRedeemAccountHistoryDo {
|
||||
return c.withDO(c.DO.Group(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Having(conds ...gen.Condition) *cardRedeemAccountHistoryDo {
|
||||
return c.withDO(c.DO.Having(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Limit(limit int) *cardRedeemAccountHistoryDo {
|
||||
return c.withDO(c.DO.Limit(limit))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Offset(offset int) *cardRedeemAccountHistoryDo {
|
||||
return c.withDO(c.DO.Offset(offset))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *cardRedeemAccountHistoryDo {
|
||||
return c.withDO(c.DO.Scopes(funcs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Unscoped() *cardRedeemAccountHistoryDo {
|
||||
return c.withDO(c.DO.Unscoped())
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Create(values ...*model.CardRedeemAccountHistory) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Create(values)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) CreateInBatches(values []*model.CardRedeemAccountHistory, batchSize int) error {
|
||||
return c.DO.CreateInBatches(values, batchSize)
|
||||
}
|
||||
|
||||
// Save : !!! underlying implementation is different with GORM
|
||||
// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values)
|
||||
func (c cardRedeemAccountHistoryDo) Save(values ...*model.CardRedeemAccountHistory) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Save(values)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) First() (*model.CardRedeemAccountHistory, error) {
|
||||
if result, err := c.DO.First(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemAccountHistory), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Take() (*model.CardRedeemAccountHistory, error) {
|
||||
if result, err := c.DO.Take(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemAccountHistory), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Last() (*model.CardRedeemAccountHistory, error) {
|
||||
if result, err := c.DO.Last(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemAccountHistory), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Find() ([]*model.CardRedeemAccountHistory, error) {
|
||||
result, err := c.DO.Find()
|
||||
return result.([]*model.CardRedeemAccountHistory), err
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.CardRedeemAccountHistory, err error) {
|
||||
buf := make([]*model.CardRedeemAccountHistory, 0, batchSize)
|
||||
err = c.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error {
|
||||
defer func() { results = append(results, buf...) }()
|
||||
return fc(tx, batch)
|
||||
})
|
||||
return results, err
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) FindInBatches(result *[]*model.CardRedeemAccountHistory, batchSize int, fc func(tx gen.Dao, batch int) error) error {
|
||||
return c.DO.FindInBatches(result, batchSize, fc)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Attrs(attrs ...field.AssignExpr) *cardRedeemAccountHistoryDo {
|
||||
return c.withDO(c.DO.Attrs(attrs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Assign(attrs ...field.AssignExpr) *cardRedeemAccountHistoryDo {
|
||||
return c.withDO(c.DO.Assign(attrs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Joins(fields ...field.RelationField) *cardRedeemAccountHistoryDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Joins(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Preload(fields ...field.RelationField) *cardRedeemAccountHistoryDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Preload(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) FirstOrInit() (*model.CardRedeemAccountHistory, error) {
|
||||
if result, err := c.DO.FirstOrInit(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemAccountHistory), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) FirstOrCreate() (*model.CardRedeemAccountHistory, error) {
|
||||
if result, err := c.DO.FirstOrCreate(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemAccountHistory), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) FindByPage(offset int, limit int) (result []*model.CardRedeemAccountHistory, count int64, err error) {
|
||||
result, err = c.Offset(offset).Limit(limit).Find()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if size := len(result); 0 < limit && 0 < size && size < limit {
|
||||
count = int64(size + offset)
|
||||
return
|
||||
}
|
||||
|
||||
count, err = c.Offset(-1).Limit(-1).Count()
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) {
|
||||
count, err = c.Count()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = c.Offset(offset).Limit(limit).Scan(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Scan(result interface{}) (err error) {
|
||||
return c.DO.Scan(result)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountHistoryDo) Delete(models ...*model.CardRedeemAccountHistory) (result gen.ResultInfo, err error) {
|
||||
return c.DO.Delete(models)
|
||||
}
|
||||
|
||||
func (c *cardRedeemAccountHistoryDo) withDO(do gen.Dao) *cardRedeemAccountHistoryDo {
|
||||
c.DO = *do.(*gen.DO)
|
||||
return c
|
||||
}
|
||||
415
verification/internal/query/card_redeem_account_info.gen.go
Normal file
415
verification/internal/query/card_redeem_account_info.gen.go
Normal file
@@ -0,0 +1,415 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package query
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
|
||||
"gorm.io/gen"
|
||||
"gorm.io/gen/field"
|
||||
|
||||
"gorm.io/plugin/dbresolver"
|
||||
|
||||
"order/internal/model"
|
||||
)
|
||||
|
||||
func newCardRedeemAccountInfo(db *gorm.DB, opts ...gen.DOOption) cardRedeemAccountInfo {
|
||||
_cardRedeemAccountInfo := cardRedeemAccountInfo{}
|
||||
|
||||
_cardRedeemAccountInfo.cardRedeemAccountInfoDo.UseDB(db, opts...)
|
||||
_cardRedeemAccountInfo.cardRedeemAccountInfoDo.UseModel(&model.CardRedeemAccountInfo{})
|
||||
|
||||
tableName := _cardRedeemAccountInfo.cardRedeemAccountInfoDo.TableName()
|
||||
_cardRedeemAccountInfo.ALL = field.NewAsterisk(tableName)
|
||||
_cardRedeemAccountInfo.ID = field.NewString(tableName, "id")
|
||||
_cardRedeemAccountInfo.GroupID = field.NewInt32(tableName, "group_id")
|
||||
_cardRedeemAccountInfo.Name = field.NewString(tableName, "name")
|
||||
_cardRedeemAccountInfo.Cookie = field.NewString(tableName, "cookie")
|
||||
_cardRedeemAccountInfo.Nickname = field.NewString(tableName, "nickname")
|
||||
_cardRedeemAccountInfo.Username = field.NewString(tableName, "username")
|
||||
_cardRedeemAccountInfo.CreateUserID = field.NewString(tableName, "create_user_id")
|
||||
_cardRedeemAccountInfo.Category = field.NewString(tableName, "category")
|
||||
_cardRedeemAccountInfo.AmountTotalSum = field.NewFloat32(tableName, "amount_total_sum")
|
||||
_cardRedeemAccountInfo.AmountTodaySum = field.NewFloat32(tableName, "amount_today_sum")
|
||||
_cardRedeemAccountInfo.Balance = field.NewFloat32(tableName, "balance")
|
||||
_cardRedeemAccountInfo.EffectiveBalance = field.NewFloat32(tableName, "effective_balance")
|
||||
_cardRedeemAccountInfo.Status = field.NewInt32(tableName, "status")
|
||||
_cardRedeemAccountInfo.MaxCountLimit = field.NewInt32(tableName, "max_count_limit")
|
||||
_cardRedeemAccountInfo.MaxAmountLimit = field.NewInt32(tableName, "max_amount_limit")
|
||||
_cardRedeemAccountInfo.AmountTotalCount = field.NewInt32(tableName, "amount_total_count")
|
||||
_cardRedeemAccountInfo.AmountTodayCount = field.NewInt32(tableName, "amount_today_count")
|
||||
_cardRedeemAccountInfo.AccountStatus = field.NewField(tableName, "account_status")
|
||||
_cardRedeemAccountInfo.Remark = field.NewString(tableName, "remark")
|
||||
_cardRedeemAccountInfo.CreatedAt = field.NewTime(tableName, "created_at")
|
||||
_cardRedeemAccountInfo.UpdatedAt = field.NewTime(tableName, "updated_at")
|
||||
_cardRedeemAccountInfo.DeletedAt = field.NewField(tableName, "deleted_at")
|
||||
|
||||
_cardRedeemAccountInfo.fillFieldMap()
|
||||
|
||||
return _cardRedeemAccountInfo
|
||||
}
|
||||
|
||||
type cardRedeemAccountInfo struct {
|
||||
cardRedeemAccountInfoDo cardRedeemAccountInfoDo
|
||||
|
||||
ALL field.Asterisk
|
||||
ID field.String
|
||||
GroupID field.Int32
|
||||
Name field.String
|
||||
Cookie field.String // cookie
|
||||
Nickname field.String // 用户昵称
|
||||
Username field.String // 京东用户ID
|
||||
CreateUserID field.String // 创建人
|
||||
Category field.String // 账户类型
|
||||
AmountTotalSum field.Float32 // 账单所有统计金额
|
||||
AmountTodaySum field.Float32 // 账单今日统计金额
|
||||
Balance field.Float32 // 余额
|
||||
EffectiveBalance field.Float32 // 有效充值余额
|
||||
Status field.Int32 // 状态 1.正常 0.禁用
|
||||
MaxCountLimit field.Int32 // 账号最大充值次数
|
||||
MaxAmountLimit field.Int32 // 最大充值限制
|
||||
AmountTotalCount field.Int32
|
||||
AmountTodayCount field.Int32
|
||||
AccountStatus field.Field // 账号是否可用
|
||||
Remark field.String
|
||||
CreatedAt field.Time
|
||||
UpdatedAt field.Time
|
||||
DeletedAt field.Field
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfo) Table(newTableName string) *cardRedeemAccountInfo {
|
||||
c.cardRedeemAccountInfoDo.UseTable(newTableName)
|
||||
return c.updateTableName(newTableName)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfo) As(alias string) *cardRedeemAccountInfo {
|
||||
c.cardRedeemAccountInfoDo.DO = *(c.cardRedeemAccountInfoDo.As(alias).(*gen.DO))
|
||||
return c.updateTableName(alias)
|
||||
}
|
||||
|
||||
func (c *cardRedeemAccountInfo) updateTableName(table string) *cardRedeemAccountInfo {
|
||||
c.ALL = field.NewAsterisk(table)
|
||||
c.ID = field.NewString(table, "id")
|
||||
c.GroupID = field.NewInt32(table, "group_id")
|
||||
c.Name = field.NewString(table, "name")
|
||||
c.Cookie = field.NewString(table, "cookie")
|
||||
c.Nickname = field.NewString(table, "nickname")
|
||||
c.Username = field.NewString(table, "username")
|
||||
c.CreateUserID = field.NewString(table, "create_user_id")
|
||||
c.Category = field.NewString(table, "category")
|
||||
c.AmountTotalSum = field.NewFloat32(table, "amount_total_sum")
|
||||
c.AmountTodaySum = field.NewFloat32(table, "amount_today_sum")
|
||||
c.Balance = field.NewFloat32(table, "balance")
|
||||
c.EffectiveBalance = field.NewFloat32(table, "effective_balance")
|
||||
c.Status = field.NewInt32(table, "status")
|
||||
c.MaxCountLimit = field.NewInt32(table, "max_count_limit")
|
||||
c.MaxAmountLimit = field.NewInt32(table, "max_amount_limit")
|
||||
c.AmountTotalCount = field.NewInt32(table, "amount_total_count")
|
||||
c.AmountTodayCount = field.NewInt32(table, "amount_today_count")
|
||||
c.AccountStatus = field.NewField(table, "account_status")
|
||||
c.Remark = field.NewString(table, "remark")
|
||||
c.CreatedAt = field.NewTime(table, "created_at")
|
||||
c.UpdatedAt = field.NewTime(table, "updated_at")
|
||||
c.DeletedAt = field.NewField(table, "deleted_at")
|
||||
|
||||
c.fillFieldMap()
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *cardRedeemAccountInfo) WithContext(ctx context.Context) *cardRedeemAccountInfoDo {
|
||||
return c.cardRedeemAccountInfoDo.WithContext(ctx)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfo) TableName() string { return c.cardRedeemAccountInfoDo.TableName() }
|
||||
|
||||
func (c cardRedeemAccountInfo) Alias() string { return c.cardRedeemAccountInfoDo.Alias() }
|
||||
|
||||
func (c cardRedeemAccountInfo) Columns(cols ...field.Expr) gen.Columns {
|
||||
return c.cardRedeemAccountInfoDo.Columns(cols...)
|
||||
}
|
||||
|
||||
func (c *cardRedeemAccountInfo) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
||||
_f, ok := c.fieldMap[fieldName]
|
||||
if !ok || _f == nil {
|
||||
return nil, false
|
||||
}
|
||||
_oe, ok := _f.(field.OrderExpr)
|
||||
return _oe, ok
|
||||
}
|
||||
|
||||
func (c *cardRedeemAccountInfo) fillFieldMap() {
|
||||
c.fieldMap = make(map[string]field.Expr, 22)
|
||||
c.fieldMap["id"] = c.ID
|
||||
c.fieldMap["group_id"] = c.GroupID
|
||||
c.fieldMap["name"] = c.Name
|
||||
c.fieldMap["cookie"] = c.Cookie
|
||||
c.fieldMap["nickname"] = c.Nickname
|
||||
c.fieldMap["username"] = c.Username
|
||||
c.fieldMap["create_user_id"] = c.CreateUserID
|
||||
c.fieldMap["category"] = c.Category
|
||||
c.fieldMap["amount_total_sum"] = c.AmountTotalSum
|
||||
c.fieldMap["amount_today_sum"] = c.AmountTodaySum
|
||||
c.fieldMap["balance"] = c.Balance
|
||||
c.fieldMap["effective_balance"] = c.EffectiveBalance
|
||||
c.fieldMap["status"] = c.Status
|
||||
c.fieldMap["max_count_limit"] = c.MaxCountLimit
|
||||
c.fieldMap["max_amount_limit"] = c.MaxAmountLimit
|
||||
c.fieldMap["amount_total_count"] = c.AmountTotalCount
|
||||
c.fieldMap["amount_today_count"] = c.AmountTodayCount
|
||||
c.fieldMap["account_status"] = c.AccountStatus
|
||||
c.fieldMap["remark"] = c.Remark
|
||||
c.fieldMap["created_at"] = c.CreatedAt
|
||||
c.fieldMap["updated_at"] = c.UpdatedAt
|
||||
c.fieldMap["deleted_at"] = c.DeletedAt
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfo) clone(db *gorm.DB) cardRedeemAccountInfo {
|
||||
c.cardRedeemAccountInfoDo.ReplaceConnPool(db.Statement.ConnPool)
|
||||
return c
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfo) replaceDB(db *gorm.DB) cardRedeemAccountInfo {
|
||||
c.cardRedeemAccountInfoDo.ReplaceDB(db)
|
||||
return c
|
||||
}
|
||||
|
||||
type cardRedeemAccountInfoDo struct{ gen.DO }
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Debug() *cardRedeemAccountInfoDo {
|
||||
return c.withDO(c.DO.Debug())
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) WithContext(ctx context.Context) *cardRedeemAccountInfoDo {
|
||||
return c.withDO(c.DO.WithContext(ctx))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) ReadDB() *cardRedeemAccountInfoDo {
|
||||
return c.Clauses(dbresolver.Read)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) WriteDB() *cardRedeemAccountInfoDo {
|
||||
return c.Clauses(dbresolver.Write)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Session(config *gorm.Session) *cardRedeemAccountInfoDo {
|
||||
return c.withDO(c.DO.Session(config))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Clauses(conds ...clause.Expression) *cardRedeemAccountInfoDo {
|
||||
return c.withDO(c.DO.Clauses(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Returning(value interface{}, columns ...string) *cardRedeemAccountInfoDo {
|
||||
return c.withDO(c.DO.Returning(value, columns...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Not(conds ...gen.Condition) *cardRedeemAccountInfoDo {
|
||||
return c.withDO(c.DO.Not(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Or(conds ...gen.Condition) *cardRedeemAccountInfoDo {
|
||||
return c.withDO(c.DO.Or(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Select(conds ...field.Expr) *cardRedeemAccountInfoDo {
|
||||
return c.withDO(c.DO.Select(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Where(conds ...gen.Condition) *cardRedeemAccountInfoDo {
|
||||
return c.withDO(c.DO.Where(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Order(conds ...field.Expr) *cardRedeemAccountInfoDo {
|
||||
return c.withDO(c.DO.Order(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Distinct(cols ...field.Expr) *cardRedeemAccountInfoDo {
|
||||
return c.withDO(c.DO.Distinct(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Omit(cols ...field.Expr) *cardRedeemAccountInfoDo {
|
||||
return c.withDO(c.DO.Omit(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Join(table schema.Tabler, on ...field.Expr) *cardRedeemAccountInfoDo {
|
||||
return c.withDO(c.DO.Join(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) LeftJoin(table schema.Tabler, on ...field.Expr) *cardRedeemAccountInfoDo {
|
||||
return c.withDO(c.DO.LeftJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) RightJoin(table schema.Tabler, on ...field.Expr) *cardRedeemAccountInfoDo {
|
||||
return c.withDO(c.DO.RightJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Group(cols ...field.Expr) *cardRedeemAccountInfoDo {
|
||||
return c.withDO(c.DO.Group(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Having(conds ...gen.Condition) *cardRedeemAccountInfoDo {
|
||||
return c.withDO(c.DO.Having(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Limit(limit int) *cardRedeemAccountInfoDo {
|
||||
return c.withDO(c.DO.Limit(limit))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Offset(offset int) *cardRedeemAccountInfoDo {
|
||||
return c.withDO(c.DO.Offset(offset))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *cardRedeemAccountInfoDo {
|
||||
return c.withDO(c.DO.Scopes(funcs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Unscoped() *cardRedeemAccountInfoDo {
|
||||
return c.withDO(c.DO.Unscoped())
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Create(values ...*model.CardRedeemAccountInfo) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Create(values)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) CreateInBatches(values []*model.CardRedeemAccountInfo, batchSize int) error {
|
||||
return c.DO.CreateInBatches(values, batchSize)
|
||||
}
|
||||
|
||||
// Save : !!! underlying implementation is different with GORM
|
||||
// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values)
|
||||
func (c cardRedeemAccountInfoDo) Save(values ...*model.CardRedeemAccountInfo) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Save(values)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) First() (*model.CardRedeemAccountInfo, error) {
|
||||
if result, err := c.DO.First(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemAccountInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Take() (*model.CardRedeemAccountInfo, error) {
|
||||
if result, err := c.DO.Take(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemAccountInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Last() (*model.CardRedeemAccountInfo, error) {
|
||||
if result, err := c.DO.Last(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemAccountInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Find() ([]*model.CardRedeemAccountInfo, error) {
|
||||
result, err := c.DO.Find()
|
||||
return result.([]*model.CardRedeemAccountInfo), err
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.CardRedeemAccountInfo, err error) {
|
||||
buf := make([]*model.CardRedeemAccountInfo, 0, batchSize)
|
||||
err = c.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error {
|
||||
defer func() { results = append(results, buf...) }()
|
||||
return fc(tx, batch)
|
||||
})
|
||||
return results, err
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) FindInBatches(result *[]*model.CardRedeemAccountInfo, batchSize int, fc func(tx gen.Dao, batch int) error) error {
|
||||
return c.DO.FindInBatches(result, batchSize, fc)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Attrs(attrs ...field.AssignExpr) *cardRedeemAccountInfoDo {
|
||||
return c.withDO(c.DO.Attrs(attrs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Assign(attrs ...field.AssignExpr) *cardRedeemAccountInfoDo {
|
||||
return c.withDO(c.DO.Assign(attrs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Joins(fields ...field.RelationField) *cardRedeemAccountInfoDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Joins(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Preload(fields ...field.RelationField) *cardRedeemAccountInfoDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Preload(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) FirstOrInit() (*model.CardRedeemAccountInfo, error) {
|
||||
if result, err := c.DO.FirstOrInit(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemAccountInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) FirstOrCreate() (*model.CardRedeemAccountInfo, error) {
|
||||
if result, err := c.DO.FirstOrCreate(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemAccountInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) FindByPage(offset int, limit int) (result []*model.CardRedeemAccountInfo, count int64, err error) {
|
||||
result, err = c.Offset(offset).Limit(limit).Find()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if size := len(result); 0 < limit && 0 < size && size < limit {
|
||||
count = int64(size + offset)
|
||||
return
|
||||
}
|
||||
|
||||
count, err = c.Offset(-1).Limit(-1).Count()
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) {
|
||||
count, err = c.Count()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = c.Offset(offset).Limit(limit).Scan(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Scan(result interface{}) (err error) {
|
||||
return c.DO.Scan(result)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountInfoDo) Delete(models ...*model.CardRedeemAccountInfo) (result gen.ResultInfo, err error) {
|
||||
return c.DO.Delete(models)
|
||||
}
|
||||
|
||||
func (c *cardRedeemAccountInfoDo) withDO(do gen.Dao) *cardRedeemAccountInfoDo {
|
||||
c.DO = *do.(*gen.DO)
|
||||
return c
|
||||
}
|
||||
371
verification/internal/query/card_redeem_account_summary.gen.go
Normal file
371
verification/internal/query/card_redeem_account_summary.gen.go
Normal file
@@ -0,0 +1,371 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package query
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
|
||||
"gorm.io/gen"
|
||||
"gorm.io/gen/field"
|
||||
|
||||
"gorm.io/plugin/dbresolver"
|
||||
|
||||
"order/internal/model"
|
||||
)
|
||||
|
||||
func newCardRedeemAccountSummary(db *gorm.DB, opts ...gen.DOOption) cardRedeemAccountSummary {
|
||||
_cardRedeemAccountSummary := cardRedeemAccountSummary{}
|
||||
|
||||
_cardRedeemAccountSummary.cardRedeemAccountSummaryDo.UseDB(db, opts...)
|
||||
_cardRedeemAccountSummary.cardRedeemAccountSummaryDo.UseModel(&model.CardRedeemAccountSummary{})
|
||||
|
||||
tableName := _cardRedeemAccountSummary.cardRedeemAccountSummaryDo.TableName()
|
||||
_cardRedeemAccountSummary.ALL = field.NewAsterisk(tableName)
|
||||
_cardRedeemAccountSummary.ID = field.NewInt32(tableName, "id")
|
||||
_cardRedeemAccountSummary.AccountID = field.NewString(tableName, "account_id")
|
||||
_cardRedeemAccountSummary.AmountTotalSum = field.NewFloat32(tableName, "amount_total_sum")
|
||||
_cardRedeemAccountSummary.AmountTodaySum = field.NewFloat32(tableName, "amount_today_sum")
|
||||
_cardRedeemAccountSummary.AmountTotalCount = field.NewInt32(tableName, "amount_total_count")
|
||||
_cardRedeemAccountSummary.AmountTodayCount = field.NewInt32(tableName, "amount_today_count")
|
||||
_cardRedeemAccountSummary.Date = field.NewTime(tableName, "date")
|
||||
_cardRedeemAccountSummary.Category = field.NewString(tableName, "category")
|
||||
_cardRedeemAccountSummary.CreatedAt = field.NewTime(tableName, "created_at")
|
||||
_cardRedeemAccountSummary.UpdatedAt = field.NewTime(tableName, "updated_at")
|
||||
_cardRedeemAccountSummary.DeletedAt = field.NewField(tableName, "deleted_at")
|
||||
|
||||
_cardRedeemAccountSummary.fillFieldMap()
|
||||
|
||||
return _cardRedeemAccountSummary
|
||||
}
|
||||
|
||||
type cardRedeemAccountSummary struct {
|
||||
cardRedeemAccountSummaryDo cardRedeemAccountSummaryDo
|
||||
|
||||
ALL field.Asterisk
|
||||
ID field.Int32
|
||||
AccountID field.String
|
||||
AmountTotalSum field.Float32
|
||||
AmountTodaySum field.Float32
|
||||
AmountTotalCount field.Int32
|
||||
AmountTodayCount field.Int32
|
||||
Date field.Time
|
||||
Category field.String
|
||||
CreatedAt field.Time
|
||||
UpdatedAt field.Time
|
||||
DeletedAt field.Field
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummary) Table(newTableName string) *cardRedeemAccountSummary {
|
||||
c.cardRedeemAccountSummaryDo.UseTable(newTableName)
|
||||
return c.updateTableName(newTableName)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummary) As(alias string) *cardRedeemAccountSummary {
|
||||
c.cardRedeemAccountSummaryDo.DO = *(c.cardRedeemAccountSummaryDo.As(alias).(*gen.DO))
|
||||
return c.updateTableName(alias)
|
||||
}
|
||||
|
||||
func (c *cardRedeemAccountSummary) updateTableName(table string) *cardRedeemAccountSummary {
|
||||
c.ALL = field.NewAsterisk(table)
|
||||
c.ID = field.NewInt32(table, "id")
|
||||
c.AccountID = field.NewString(table, "account_id")
|
||||
c.AmountTotalSum = field.NewFloat32(table, "amount_total_sum")
|
||||
c.AmountTodaySum = field.NewFloat32(table, "amount_today_sum")
|
||||
c.AmountTotalCount = field.NewInt32(table, "amount_total_count")
|
||||
c.AmountTodayCount = field.NewInt32(table, "amount_today_count")
|
||||
c.Date = field.NewTime(table, "date")
|
||||
c.Category = field.NewString(table, "category")
|
||||
c.CreatedAt = field.NewTime(table, "created_at")
|
||||
c.UpdatedAt = field.NewTime(table, "updated_at")
|
||||
c.DeletedAt = field.NewField(table, "deleted_at")
|
||||
|
||||
c.fillFieldMap()
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *cardRedeemAccountSummary) WithContext(ctx context.Context) *cardRedeemAccountSummaryDo {
|
||||
return c.cardRedeemAccountSummaryDo.WithContext(ctx)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummary) TableName() string { return c.cardRedeemAccountSummaryDo.TableName() }
|
||||
|
||||
func (c cardRedeemAccountSummary) Alias() string { return c.cardRedeemAccountSummaryDo.Alias() }
|
||||
|
||||
func (c cardRedeemAccountSummary) Columns(cols ...field.Expr) gen.Columns {
|
||||
return c.cardRedeemAccountSummaryDo.Columns(cols...)
|
||||
}
|
||||
|
||||
func (c *cardRedeemAccountSummary) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
||||
_f, ok := c.fieldMap[fieldName]
|
||||
if !ok || _f == nil {
|
||||
return nil, false
|
||||
}
|
||||
_oe, ok := _f.(field.OrderExpr)
|
||||
return _oe, ok
|
||||
}
|
||||
|
||||
func (c *cardRedeemAccountSummary) fillFieldMap() {
|
||||
c.fieldMap = make(map[string]field.Expr, 11)
|
||||
c.fieldMap["id"] = c.ID
|
||||
c.fieldMap["account_id"] = c.AccountID
|
||||
c.fieldMap["amount_total_sum"] = c.AmountTotalSum
|
||||
c.fieldMap["amount_today_sum"] = c.AmountTodaySum
|
||||
c.fieldMap["amount_total_count"] = c.AmountTotalCount
|
||||
c.fieldMap["amount_today_count"] = c.AmountTodayCount
|
||||
c.fieldMap["date"] = c.Date
|
||||
c.fieldMap["category"] = c.Category
|
||||
c.fieldMap["created_at"] = c.CreatedAt
|
||||
c.fieldMap["updated_at"] = c.UpdatedAt
|
||||
c.fieldMap["deleted_at"] = c.DeletedAt
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummary) clone(db *gorm.DB) cardRedeemAccountSummary {
|
||||
c.cardRedeemAccountSummaryDo.ReplaceConnPool(db.Statement.ConnPool)
|
||||
return c
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummary) replaceDB(db *gorm.DB) cardRedeemAccountSummary {
|
||||
c.cardRedeemAccountSummaryDo.ReplaceDB(db)
|
||||
return c
|
||||
}
|
||||
|
||||
type cardRedeemAccountSummaryDo struct{ gen.DO }
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Debug() *cardRedeemAccountSummaryDo {
|
||||
return c.withDO(c.DO.Debug())
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) WithContext(ctx context.Context) *cardRedeemAccountSummaryDo {
|
||||
return c.withDO(c.DO.WithContext(ctx))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) ReadDB() *cardRedeemAccountSummaryDo {
|
||||
return c.Clauses(dbresolver.Read)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) WriteDB() *cardRedeemAccountSummaryDo {
|
||||
return c.Clauses(dbresolver.Write)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Session(config *gorm.Session) *cardRedeemAccountSummaryDo {
|
||||
return c.withDO(c.DO.Session(config))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Clauses(conds ...clause.Expression) *cardRedeemAccountSummaryDo {
|
||||
return c.withDO(c.DO.Clauses(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Returning(value interface{}, columns ...string) *cardRedeemAccountSummaryDo {
|
||||
return c.withDO(c.DO.Returning(value, columns...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Not(conds ...gen.Condition) *cardRedeemAccountSummaryDo {
|
||||
return c.withDO(c.DO.Not(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Or(conds ...gen.Condition) *cardRedeemAccountSummaryDo {
|
||||
return c.withDO(c.DO.Or(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Select(conds ...field.Expr) *cardRedeemAccountSummaryDo {
|
||||
return c.withDO(c.DO.Select(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Where(conds ...gen.Condition) *cardRedeemAccountSummaryDo {
|
||||
return c.withDO(c.DO.Where(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Order(conds ...field.Expr) *cardRedeemAccountSummaryDo {
|
||||
return c.withDO(c.DO.Order(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Distinct(cols ...field.Expr) *cardRedeemAccountSummaryDo {
|
||||
return c.withDO(c.DO.Distinct(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Omit(cols ...field.Expr) *cardRedeemAccountSummaryDo {
|
||||
return c.withDO(c.DO.Omit(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Join(table schema.Tabler, on ...field.Expr) *cardRedeemAccountSummaryDo {
|
||||
return c.withDO(c.DO.Join(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) LeftJoin(table schema.Tabler, on ...field.Expr) *cardRedeemAccountSummaryDo {
|
||||
return c.withDO(c.DO.LeftJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) RightJoin(table schema.Tabler, on ...field.Expr) *cardRedeemAccountSummaryDo {
|
||||
return c.withDO(c.DO.RightJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Group(cols ...field.Expr) *cardRedeemAccountSummaryDo {
|
||||
return c.withDO(c.DO.Group(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Having(conds ...gen.Condition) *cardRedeemAccountSummaryDo {
|
||||
return c.withDO(c.DO.Having(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Limit(limit int) *cardRedeemAccountSummaryDo {
|
||||
return c.withDO(c.DO.Limit(limit))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Offset(offset int) *cardRedeemAccountSummaryDo {
|
||||
return c.withDO(c.DO.Offset(offset))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *cardRedeemAccountSummaryDo {
|
||||
return c.withDO(c.DO.Scopes(funcs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Unscoped() *cardRedeemAccountSummaryDo {
|
||||
return c.withDO(c.DO.Unscoped())
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Create(values ...*model.CardRedeemAccountSummary) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Create(values)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) CreateInBatches(values []*model.CardRedeemAccountSummary, batchSize int) error {
|
||||
return c.DO.CreateInBatches(values, batchSize)
|
||||
}
|
||||
|
||||
// Save : !!! underlying implementation is different with GORM
|
||||
// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values)
|
||||
func (c cardRedeemAccountSummaryDo) Save(values ...*model.CardRedeemAccountSummary) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Save(values)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) First() (*model.CardRedeemAccountSummary, error) {
|
||||
if result, err := c.DO.First(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemAccountSummary), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Take() (*model.CardRedeemAccountSummary, error) {
|
||||
if result, err := c.DO.Take(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemAccountSummary), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Last() (*model.CardRedeemAccountSummary, error) {
|
||||
if result, err := c.DO.Last(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemAccountSummary), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Find() ([]*model.CardRedeemAccountSummary, error) {
|
||||
result, err := c.DO.Find()
|
||||
return result.([]*model.CardRedeemAccountSummary), err
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.CardRedeemAccountSummary, err error) {
|
||||
buf := make([]*model.CardRedeemAccountSummary, 0, batchSize)
|
||||
err = c.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error {
|
||||
defer func() { results = append(results, buf...) }()
|
||||
return fc(tx, batch)
|
||||
})
|
||||
return results, err
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) FindInBatches(result *[]*model.CardRedeemAccountSummary, batchSize int, fc func(tx gen.Dao, batch int) error) error {
|
||||
return c.DO.FindInBatches(result, batchSize, fc)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Attrs(attrs ...field.AssignExpr) *cardRedeemAccountSummaryDo {
|
||||
return c.withDO(c.DO.Attrs(attrs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Assign(attrs ...field.AssignExpr) *cardRedeemAccountSummaryDo {
|
||||
return c.withDO(c.DO.Assign(attrs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Joins(fields ...field.RelationField) *cardRedeemAccountSummaryDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Joins(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Preload(fields ...field.RelationField) *cardRedeemAccountSummaryDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Preload(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) FirstOrInit() (*model.CardRedeemAccountSummary, error) {
|
||||
if result, err := c.DO.FirstOrInit(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemAccountSummary), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) FirstOrCreate() (*model.CardRedeemAccountSummary, error) {
|
||||
if result, err := c.DO.FirstOrCreate(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemAccountSummary), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) FindByPage(offset int, limit int) (result []*model.CardRedeemAccountSummary, count int64, err error) {
|
||||
result, err = c.Offset(offset).Limit(limit).Find()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if size := len(result); 0 < limit && 0 < size && size < limit {
|
||||
count = int64(size + offset)
|
||||
return
|
||||
}
|
||||
|
||||
count, err = c.Offset(-1).Limit(-1).Count()
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) {
|
||||
count, err = c.Count()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = c.Offset(offset).Limit(limit).Scan(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Scan(result interface{}) (err error) {
|
||||
return c.DO.Scan(result)
|
||||
}
|
||||
|
||||
func (c cardRedeemAccountSummaryDo) Delete(models ...*model.CardRedeemAccountSummary) (result gen.ResultInfo, err error) {
|
||||
return c.DO.Delete(models)
|
||||
}
|
||||
|
||||
func (c *cardRedeemAccountSummaryDo) withDO(do gen.Dao) *cardRedeemAccountSummaryDo {
|
||||
c.DO = *do.(*gen.DO)
|
||||
return c
|
||||
}
|
||||
367
verification/internal/query/card_redeem_cookie_info.gen.go
Normal file
367
verification/internal/query/card_redeem_cookie_info.gen.go
Normal file
@@ -0,0 +1,367 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package query
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
|
||||
"gorm.io/gen"
|
||||
"gorm.io/gen/field"
|
||||
|
||||
"gorm.io/plugin/dbresolver"
|
||||
|
||||
"order/internal/model"
|
||||
)
|
||||
|
||||
func newCardRedeemCookieInfo(db *gorm.DB, opts ...gen.DOOption) cardRedeemCookieInfo {
|
||||
_cardRedeemCookieInfo := cardRedeemCookieInfo{}
|
||||
|
||||
_cardRedeemCookieInfo.cardRedeemCookieInfoDo.UseDB(db, opts...)
|
||||
_cardRedeemCookieInfo.cardRedeemCookieInfoDo.UseModel(&model.CardRedeemCookieInfo{})
|
||||
|
||||
tableName := _cardRedeemCookieInfo.cardRedeemCookieInfoDo.TableName()
|
||||
_cardRedeemCookieInfo.ALL = field.NewAsterisk(tableName)
|
||||
_cardRedeemCookieInfo.ID = field.NewInt32(tableName, "id")
|
||||
_cardRedeemCookieInfo.Name = field.NewString(tableName, "name")
|
||||
_cardRedeemCookieInfo.Cookie = field.NewString(tableName, "cookie")
|
||||
_cardRedeemCookieInfo.Notes = field.NewString(tableName, "notes")
|
||||
_cardRedeemCookieInfo.Status = field.NewString(tableName, "status")
|
||||
_cardRedeemCookieInfo.Category = field.NewString(tableName, "category")
|
||||
_cardRedeemCookieInfo.FailCount = field.NewInt32(tableName, "fail_count")
|
||||
_cardRedeemCookieInfo.CreatedAt = field.NewTime(tableName, "created_at")
|
||||
_cardRedeemCookieInfo.UpdatedAt = field.NewTime(tableName, "updated_at")
|
||||
_cardRedeemCookieInfo.DeletedAt = field.NewField(tableName, "deleted_at")
|
||||
|
||||
_cardRedeemCookieInfo.fillFieldMap()
|
||||
|
||||
return _cardRedeemCookieInfo
|
||||
}
|
||||
|
||||
type cardRedeemCookieInfo struct {
|
||||
cardRedeemCookieInfoDo cardRedeemCookieInfoDo
|
||||
|
||||
ALL field.Asterisk
|
||||
ID field.Int32
|
||||
Name field.String
|
||||
Cookie field.String
|
||||
Notes field.String
|
||||
Status field.String
|
||||
Category field.String
|
||||
FailCount field.Int32 // 调用次数
|
||||
CreatedAt field.Time
|
||||
UpdatedAt field.Time
|
||||
DeletedAt field.Field
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfo) Table(newTableName string) *cardRedeemCookieInfo {
|
||||
c.cardRedeemCookieInfoDo.UseTable(newTableName)
|
||||
return c.updateTableName(newTableName)
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfo) As(alias string) *cardRedeemCookieInfo {
|
||||
c.cardRedeemCookieInfoDo.DO = *(c.cardRedeemCookieInfoDo.As(alias).(*gen.DO))
|
||||
return c.updateTableName(alias)
|
||||
}
|
||||
|
||||
func (c *cardRedeemCookieInfo) updateTableName(table string) *cardRedeemCookieInfo {
|
||||
c.ALL = field.NewAsterisk(table)
|
||||
c.ID = field.NewInt32(table, "id")
|
||||
c.Name = field.NewString(table, "name")
|
||||
c.Cookie = field.NewString(table, "cookie")
|
||||
c.Notes = field.NewString(table, "notes")
|
||||
c.Status = field.NewString(table, "status")
|
||||
c.Category = field.NewString(table, "category")
|
||||
c.FailCount = field.NewInt32(table, "fail_count")
|
||||
c.CreatedAt = field.NewTime(table, "created_at")
|
||||
c.UpdatedAt = field.NewTime(table, "updated_at")
|
||||
c.DeletedAt = field.NewField(table, "deleted_at")
|
||||
|
||||
c.fillFieldMap()
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *cardRedeemCookieInfo) WithContext(ctx context.Context) *cardRedeemCookieInfoDo {
|
||||
return c.cardRedeemCookieInfoDo.WithContext(ctx)
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfo) TableName() string { return c.cardRedeemCookieInfoDo.TableName() }
|
||||
|
||||
func (c cardRedeemCookieInfo) Alias() string { return c.cardRedeemCookieInfoDo.Alias() }
|
||||
|
||||
func (c cardRedeemCookieInfo) Columns(cols ...field.Expr) gen.Columns {
|
||||
return c.cardRedeemCookieInfoDo.Columns(cols...)
|
||||
}
|
||||
|
||||
func (c *cardRedeemCookieInfo) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
||||
_f, ok := c.fieldMap[fieldName]
|
||||
if !ok || _f == nil {
|
||||
return nil, false
|
||||
}
|
||||
_oe, ok := _f.(field.OrderExpr)
|
||||
return _oe, ok
|
||||
}
|
||||
|
||||
func (c *cardRedeemCookieInfo) fillFieldMap() {
|
||||
c.fieldMap = make(map[string]field.Expr, 10)
|
||||
c.fieldMap["id"] = c.ID
|
||||
c.fieldMap["name"] = c.Name
|
||||
c.fieldMap["cookie"] = c.Cookie
|
||||
c.fieldMap["notes"] = c.Notes
|
||||
c.fieldMap["status"] = c.Status
|
||||
c.fieldMap["category"] = c.Category
|
||||
c.fieldMap["fail_count"] = c.FailCount
|
||||
c.fieldMap["created_at"] = c.CreatedAt
|
||||
c.fieldMap["updated_at"] = c.UpdatedAt
|
||||
c.fieldMap["deleted_at"] = c.DeletedAt
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfo) clone(db *gorm.DB) cardRedeemCookieInfo {
|
||||
c.cardRedeemCookieInfoDo.ReplaceConnPool(db.Statement.ConnPool)
|
||||
return c
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfo) replaceDB(db *gorm.DB) cardRedeemCookieInfo {
|
||||
c.cardRedeemCookieInfoDo.ReplaceDB(db)
|
||||
return c
|
||||
}
|
||||
|
||||
type cardRedeemCookieInfoDo struct{ gen.DO }
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Debug() *cardRedeemCookieInfoDo {
|
||||
return c.withDO(c.DO.Debug())
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) WithContext(ctx context.Context) *cardRedeemCookieInfoDo {
|
||||
return c.withDO(c.DO.WithContext(ctx))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) ReadDB() *cardRedeemCookieInfoDo {
|
||||
return c.Clauses(dbresolver.Read)
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) WriteDB() *cardRedeemCookieInfoDo {
|
||||
return c.Clauses(dbresolver.Write)
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Session(config *gorm.Session) *cardRedeemCookieInfoDo {
|
||||
return c.withDO(c.DO.Session(config))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Clauses(conds ...clause.Expression) *cardRedeemCookieInfoDo {
|
||||
return c.withDO(c.DO.Clauses(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Returning(value interface{}, columns ...string) *cardRedeemCookieInfoDo {
|
||||
return c.withDO(c.DO.Returning(value, columns...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Not(conds ...gen.Condition) *cardRedeemCookieInfoDo {
|
||||
return c.withDO(c.DO.Not(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Or(conds ...gen.Condition) *cardRedeemCookieInfoDo {
|
||||
return c.withDO(c.DO.Or(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Select(conds ...field.Expr) *cardRedeemCookieInfoDo {
|
||||
return c.withDO(c.DO.Select(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Where(conds ...gen.Condition) *cardRedeemCookieInfoDo {
|
||||
return c.withDO(c.DO.Where(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Order(conds ...field.Expr) *cardRedeemCookieInfoDo {
|
||||
return c.withDO(c.DO.Order(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Distinct(cols ...field.Expr) *cardRedeemCookieInfoDo {
|
||||
return c.withDO(c.DO.Distinct(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Omit(cols ...field.Expr) *cardRedeemCookieInfoDo {
|
||||
return c.withDO(c.DO.Omit(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Join(table schema.Tabler, on ...field.Expr) *cardRedeemCookieInfoDo {
|
||||
return c.withDO(c.DO.Join(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) LeftJoin(table schema.Tabler, on ...field.Expr) *cardRedeemCookieInfoDo {
|
||||
return c.withDO(c.DO.LeftJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) RightJoin(table schema.Tabler, on ...field.Expr) *cardRedeemCookieInfoDo {
|
||||
return c.withDO(c.DO.RightJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Group(cols ...field.Expr) *cardRedeemCookieInfoDo {
|
||||
return c.withDO(c.DO.Group(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Having(conds ...gen.Condition) *cardRedeemCookieInfoDo {
|
||||
return c.withDO(c.DO.Having(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Limit(limit int) *cardRedeemCookieInfoDo {
|
||||
return c.withDO(c.DO.Limit(limit))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Offset(offset int) *cardRedeemCookieInfoDo {
|
||||
return c.withDO(c.DO.Offset(offset))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *cardRedeemCookieInfoDo {
|
||||
return c.withDO(c.DO.Scopes(funcs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Unscoped() *cardRedeemCookieInfoDo {
|
||||
return c.withDO(c.DO.Unscoped())
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Create(values ...*model.CardRedeemCookieInfo) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Create(values)
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) CreateInBatches(values []*model.CardRedeemCookieInfo, batchSize int) error {
|
||||
return c.DO.CreateInBatches(values, batchSize)
|
||||
}
|
||||
|
||||
// Save : !!! underlying implementation is different with GORM
|
||||
// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values)
|
||||
func (c cardRedeemCookieInfoDo) Save(values ...*model.CardRedeemCookieInfo) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Save(values)
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) First() (*model.CardRedeemCookieInfo, error) {
|
||||
if result, err := c.DO.First(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemCookieInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Take() (*model.CardRedeemCookieInfo, error) {
|
||||
if result, err := c.DO.Take(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemCookieInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Last() (*model.CardRedeemCookieInfo, error) {
|
||||
if result, err := c.DO.Last(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemCookieInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Find() ([]*model.CardRedeemCookieInfo, error) {
|
||||
result, err := c.DO.Find()
|
||||
return result.([]*model.CardRedeemCookieInfo), err
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.CardRedeemCookieInfo, err error) {
|
||||
buf := make([]*model.CardRedeemCookieInfo, 0, batchSize)
|
||||
err = c.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error {
|
||||
defer func() { results = append(results, buf...) }()
|
||||
return fc(tx, batch)
|
||||
})
|
||||
return results, err
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) FindInBatches(result *[]*model.CardRedeemCookieInfo, batchSize int, fc func(tx gen.Dao, batch int) error) error {
|
||||
return c.DO.FindInBatches(result, batchSize, fc)
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Attrs(attrs ...field.AssignExpr) *cardRedeemCookieInfoDo {
|
||||
return c.withDO(c.DO.Attrs(attrs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Assign(attrs ...field.AssignExpr) *cardRedeemCookieInfoDo {
|
||||
return c.withDO(c.DO.Assign(attrs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Joins(fields ...field.RelationField) *cardRedeemCookieInfoDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Joins(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Preload(fields ...field.RelationField) *cardRedeemCookieInfoDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Preload(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) FirstOrInit() (*model.CardRedeemCookieInfo, error) {
|
||||
if result, err := c.DO.FirstOrInit(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemCookieInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) FirstOrCreate() (*model.CardRedeemCookieInfo, error) {
|
||||
if result, err := c.DO.FirstOrCreate(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemCookieInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) FindByPage(offset int, limit int) (result []*model.CardRedeemCookieInfo, count int64, err error) {
|
||||
result, err = c.Offset(offset).Limit(limit).Find()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if size := len(result); 0 < limit && 0 < size && size < limit {
|
||||
count = int64(size + offset)
|
||||
return
|
||||
}
|
||||
|
||||
count, err = c.Offset(-1).Limit(-1).Count()
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) {
|
||||
count, err = c.Count()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = c.Offset(offset).Limit(limit).Scan(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Scan(result interface{}) (err error) {
|
||||
return c.DO.Scan(result)
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieInfoDo) Delete(models ...*model.CardRedeemCookieInfo) (result gen.ResultInfo, err error) {
|
||||
return c.DO.Delete(models)
|
||||
}
|
||||
|
||||
func (c *cardRedeemCookieInfoDo) withDO(do gen.Dao) *cardRedeemCookieInfoDo {
|
||||
c.DO = *do.(*gen.DO)
|
||||
return c
|
||||
}
|
||||
371
verification/internal/query/card_redeem_cookie_order.gen.go
Normal file
371
verification/internal/query/card_redeem_cookie_order.gen.go
Normal file
@@ -0,0 +1,371 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package query
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
|
||||
"gorm.io/gen"
|
||||
"gorm.io/gen/field"
|
||||
|
||||
"gorm.io/plugin/dbresolver"
|
||||
|
||||
"order/internal/model"
|
||||
)
|
||||
|
||||
func newCardRedeemCookieOrder(db *gorm.DB, opts ...gen.DOOption) cardRedeemCookieOrder {
|
||||
_cardRedeemCookieOrder := cardRedeemCookieOrder{}
|
||||
|
||||
_cardRedeemCookieOrder.cardRedeemCookieOrderDo.UseDB(db, opts...)
|
||||
_cardRedeemCookieOrder.cardRedeemCookieOrderDo.UseModel(&model.CardRedeemCookieOrder{})
|
||||
|
||||
tableName := _cardRedeemCookieOrder.cardRedeemCookieOrderDo.TableName()
|
||||
_cardRedeemCookieOrder.ALL = field.NewAsterisk(tableName)
|
||||
_cardRedeemCookieOrder.ID = field.NewInt32(tableName, "id")
|
||||
_cardRedeemCookieOrder.BankOrderID = field.NewString(tableName, "bank_order_id")
|
||||
_cardRedeemCookieOrder.OrderAmount = field.NewFloat32(tableName, "order_amount")
|
||||
_cardRedeemCookieOrder.CookieID = field.NewInt32(tableName, "cookie_id")
|
||||
_cardRedeemCookieOrder.OrderNo = field.NewString(tableName, "order_no")
|
||||
_cardRedeemCookieOrder.JdOrderNo = field.NewString(tableName, "jd_order_no")
|
||||
_cardRedeemCookieOrder.Status = field.NewString(tableName, "status")
|
||||
_cardRedeemCookieOrder.Note = field.NewString(tableName, "note")
|
||||
_cardRedeemCookieOrder.DeletedAt = field.NewField(tableName, "deleted_at")
|
||||
_cardRedeemCookieOrder.CreatedAt = field.NewTime(tableName, "created_at")
|
||||
_cardRedeemCookieOrder.UpdatedAt = field.NewTime(tableName, "updated_at")
|
||||
|
||||
_cardRedeemCookieOrder.fillFieldMap()
|
||||
|
||||
return _cardRedeemCookieOrder
|
||||
}
|
||||
|
||||
type cardRedeemCookieOrder struct {
|
||||
cardRedeemCookieOrderDo cardRedeemCookieOrderDo
|
||||
|
||||
ALL field.Asterisk
|
||||
ID field.Int32
|
||||
BankOrderID field.String // 订单id
|
||||
OrderAmount field.Float32 // 订单金额
|
||||
CookieID field.Int32
|
||||
OrderNo field.String // 订单编号
|
||||
JdOrderNo field.String
|
||||
Status field.String
|
||||
Note field.String
|
||||
DeletedAt field.Field
|
||||
CreatedAt field.Time
|
||||
UpdatedAt field.Time
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrder) Table(newTableName string) *cardRedeemCookieOrder {
|
||||
c.cardRedeemCookieOrderDo.UseTable(newTableName)
|
||||
return c.updateTableName(newTableName)
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrder) As(alias string) *cardRedeemCookieOrder {
|
||||
c.cardRedeemCookieOrderDo.DO = *(c.cardRedeemCookieOrderDo.As(alias).(*gen.DO))
|
||||
return c.updateTableName(alias)
|
||||
}
|
||||
|
||||
func (c *cardRedeemCookieOrder) updateTableName(table string) *cardRedeemCookieOrder {
|
||||
c.ALL = field.NewAsterisk(table)
|
||||
c.ID = field.NewInt32(table, "id")
|
||||
c.BankOrderID = field.NewString(table, "bank_order_id")
|
||||
c.OrderAmount = field.NewFloat32(table, "order_amount")
|
||||
c.CookieID = field.NewInt32(table, "cookie_id")
|
||||
c.OrderNo = field.NewString(table, "order_no")
|
||||
c.JdOrderNo = field.NewString(table, "jd_order_no")
|
||||
c.Status = field.NewString(table, "status")
|
||||
c.Note = field.NewString(table, "note")
|
||||
c.DeletedAt = field.NewField(table, "deleted_at")
|
||||
c.CreatedAt = field.NewTime(table, "created_at")
|
||||
c.UpdatedAt = field.NewTime(table, "updated_at")
|
||||
|
||||
c.fillFieldMap()
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *cardRedeemCookieOrder) WithContext(ctx context.Context) *cardRedeemCookieOrderDo {
|
||||
return c.cardRedeemCookieOrderDo.WithContext(ctx)
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrder) TableName() string { return c.cardRedeemCookieOrderDo.TableName() }
|
||||
|
||||
func (c cardRedeemCookieOrder) Alias() string { return c.cardRedeemCookieOrderDo.Alias() }
|
||||
|
||||
func (c cardRedeemCookieOrder) Columns(cols ...field.Expr) gen.Columns {
|
||||
return c.cardRedeemCookieOrderDo.Columns(cols...)
|
||||
}
|
||||
|
||||
func (c *cardRedeemCookieOrder) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
||||
_f, ok := c.fieldMap[fieldName]
|
||||
if !ok || _f == nil {
|
||||
return nil, false
|
||||
}
|
||||
_oe, ok := _f.(field.OrderExpr)
|
||||
return _oe, ok
|
||||
}
|
||||
|
||||
func (c *cardRedeemCookieOrder) fillFieldMap() {
|
||||
c.fieldMap = make(map[string]field.Expr, 11)
|
||||
c.fieldMap["id"] = c.ID
|
||||
c.fieldMap["bank_order_id"] = c.BankOrderID
|
||||
c.fieldMap["order_amount"] = c.OrderAmount
|
||||
c.fieldMap["cookie_id"] = c.CookieID
|
||||
c.fieldMap["order_no"] = c.OrderNo
|
||||
c.fieldMap["jd_order_no"] = c.JdOrderNo
|
||||
c.fieldMap["status"] = c.Status
|
||||
c.fieldMap["note"] = c.Note
|
||||
c.fieldMap["deleted_at"] = c.DeletedAt
|
||||
c.fieldMap["created_at"] = c.CreatedAt
|
||||
c.fieldMap["updated_at"] = c.UpdatedAt
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrder) clone(db *gorm.DB) cardRedeemCookieOrder {
|
||||
c.cardRedeemCookieOrderDo.ReplaceConnPool(db.Statement.ConnPool)
|
||||
return c
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrder) replaceDB(db *gorm.DB) cardRedeemCookieOrder {
|
||||
c.cardRedeemCookieOrderDo.ReplaceDB(db)
|
||||
return c
|
||||
}
|
||||
|
||||
type cardRedeemCookieOrderDo struct{ gen.DO }
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Debug() *cardRedeemCookieOrderDo {
|
||||
return c.withDO(c.DO.Debug())
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) WithContext(ctx context.Context) *cardRedeemCookieOrderDo {
|
||||
return c.withDO(c.DO.WithContext(ctx))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) ReadDB() *cardRedeemCookieOrderDo {
|
||||
return c.Clauses(dbresolver.Read)
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) WriteDB() *cardRedeemCookieOrderDo {
|
||||
return c.Clauses(dbresolver.Write)
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Session(config *gorm.Session) *cardRedeemCookieOrderDo {
|
||||
return c.withDO(c.DO.Session(config))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Clauses(conds ...clause.Expression) *cardRedeemCookieOrderDo {
|
||||
return c.withDO(c.DO.Clauses(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Returning(value interface{}, columns ...string) *cardRedeemCookieOrderDo {
|
||||
return c.withDO(c.DO.Returning(value, columns...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Not(conds ...gen.Condition) *cardRedeemCookieOrderDo {
|
||||
return c.withDO(c.DO.Not(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Or(conds ...gen.Condition) *cardRedeemCookieOrderDo {
|
||||
return c.withDO(c.DO.Or(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Select(conds ...field.Expr) *cardRedeemCookieOrderDo {
|
||||
return c.withDO(c.DO.Select(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Where(conds ...gen.Condition) *cardRedeemCookieOrderDo {
|
||||
return c.withDO(c.DO.Where(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Order(conds ...field.Expr) *cardRedeemCookieOrderDo {
|
||||
return c.withDO(c.DO.Order(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Distinct(cols ...field.Expr) *cardRedeemCookieOrderDo {
|
||||
return c.withDO(c.DO.Distinct(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Omit(cols ...field.Expr) *cardRedeemCookieOrderDo {
|
||||
return c.withDO(c.DO.Omit(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Join(table schema.Tabler, on ...field.Expr) *cardRedeemCookieOrderDo {
|
||||
return c.withDO(c.DO.Join(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) LeftJoin(table schema.Tabler, on ...field.Expr) *cardRedeemCookieOrderDo {
|
||||
return c.withDO(c.DO.LeftJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) RightJoin(table schema.Tabler, on ...field.Expr) *cardRedeemCookieOrderDo {
|
||||
return c.withDO(c.DO.RightJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Group(cols ...field.Expr) *cardRedeemCookieOrderDo {
|
||||
return c.withDO(c.DO.Group(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Having(conds ...gen.Condition) *cardRedeemCookieOrderDo {
|
||||
return c.withDO(c.DO.Having(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Limit(limit int) *cardRedeemCookieOrderDo {
|
||||
return c.withDO(c.DO.Limit(limit))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Offset(offset int) *cardRedeemCookieOrderDo {
|
||||
return c.withDO(c.DO.Offset(offset))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *cardRedeemCookieOrderDo {
|
||||
return c.withDO(c.DO.Scopes(funcs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Unscoped() *cardRedeemCookieOrderDo {
|
||||
return c.withDO(c.DO.Unscoped())
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Create(values ...*model.CardRedeemCookieOrder) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Create(values)
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) CreateInBatches(values []*model.CardRedeemCookieOrder, batchSize int) error {
|
||||
return c.DO.CreateInBatches(values, batchSize)
|
||||
}
|
||||
|
||||
// Save : !!! underlying implementation is different with GORM
|
||||
// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values)
|
||||
func (c cardRedeemCookieOrderDo) Save(values ...*model.CardRedeemCookieOrder) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Save(values)
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) First() (*model.CardRedeemCookieOrder, error) {
|
||||
if result, err := c.DO.First(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemCookieOrder), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Take() (*model.CardRedeemCookieOrder, error) {
|
||||
if result, err := c.DO.Take(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemCookieOrder), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Last() (*model.CardRedeemCookieOrder, error) {
|
||||
if result, err := c.DO.Last(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemCookieOrder), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Find() ([]*model.CardRedeemCookieOrder, error) {
|
||||
result, err := c.DO.Find()
|
||||
return result.([]*model.CardRedeemCookieOrder), err
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.CardRedeemCookieOrder, err error) {
|
||||
buf := make([]*model.CardRedeemCookieOrder, 0, batchSize)
|
||||
err = c.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error {
|
||||
defer func() { results = append(results, buf...) }()
|
||||
return fc(tx, batch)
|
||||
})
|
||||
return results, err
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) FindInBatches(result *[]*model.CardRedeemCookieOrder, batchSize int, fc func(tx gen.Dao, batch int) error) error {
|
||||
return c.DO.FindInBatches(result, batchSize, fc)
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Attrs(attrs ...field.AssignExpr) *cardRedeemCookieOrderDo {
|
||||
return c.withDO(c.DO.Attrs(attrs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Assign(attrs ...field.AssignExpr) *cardRedeemCookieOrderDo {
|
||||
return c.withDO(c.DO.Assign(attrs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Joins(fields ...field.RelationField) *cardRedeemCookieOrderDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Joins(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Preload(fields ...field.RelationField) *cardRedeemCookieOrderDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Preload(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) FirstOrInit() (*model.CardRedeemCookieOrder, error) {
|
||||
if result, err := c.DO.FirstOrInit(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemCookieOrder), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) FirstOrCreate() (*model.CardRedeemCookieOrder, error) {
|
||||
if result, err := c.DO.FirstOrCreate(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemCookieOrder), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) FindByPage(offset int, limit int) (result []*model.CardRedeemCookieOrder, count int64, err error) {
|
||||
result, err = c.Offset(offset).Limit(limit).Find()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if size := len(result); 0 < limit && 0 < size && size < limit {
|
||||
count = int64(size + offset)
|
||||
return
|
||||
}
|
||||
|
||||
count, err = c.Offset(-1).Limit(-1).Count()
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) {
|
||||
count, err = c.Count()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = c.Offset(offset).Limit(limit).Scan(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Scan(result interface{}) (err error) {
|
||||
return c.DO.Scan(result)
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderDo) Delete(models ...*model.CardRedeemCookieOrder) (result gen.ResultInfo, err error) {
|
||||
return c.DO.Delete(models)
|
||||
}
|
||||
|
||||
func (c *cardRedeemCookieOrderDo) withDO(do gen.Dao) *cardRedeemCookieOrderDo {
|
||||
c.DO = *do.(*gen.DO)
|
||||
return c
|
||||
}
|
||||
395
verification/internal/query/card_redeem_cookie_order_jd.gen.go
Normal file
395
verification/internal/query/card_redeem_cookie_order_jd.gen.go
Normal file
@@ -0,0 +1,395 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package query
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
|
||||
"gorm.io/gen"
|
||||
"gorm.io/gen/field"
|
||||
|
||||
"gorm.io/plugin/dbresolver"
|
||||
|
||||
"order/internal/model"
|
||||
)
|
||||
|
||||
func newCardRedeemCookieOrderJd(db *gorm.DB, opts ...gen.DOOption) cardRedeemCookieOrderJd {
|
||||
_cardRedeemCookieOrderJd := cardRedeemCookieOrderJd{}
|
||||
|
||||
_cardRedeemCookieOrderJd.cardRedeemCookieOrderJdDo.UseDB(db, opts...)
|
||||
_cardRedeemCookieOrderJd.cardRedeemCookieOrderJdDo.UseModel(&model.CardRedeemCookieOrderJd{})
|
||||
|
||||
tableName := _cardRedeemCookieOrderJd.cardRedeemCookieOrderJdDo.TableName()
|
||||
_cardRedeemCookieOrderJd.ALL = field.NewAsterisk(tableName)
|
||||
_cardRedeemCookieOrderJd.ID = field.NewInt32(tableName, "id")
|
||||
_cardRedeemCookieOrderJd.CookieOrderID = field.NewInt32(tableName, "cookie_order_id")
|
||||
_cardRedeemCookieOrderJd.CookieAccountID = field.NewInt32(tableName, "cookie_account_id")
|
||||
_cardRedeemCookieOrderJd.ResponseData = field.NewString(tableName, "response_data")
|
||||
_cardRedeemCookieOrderJd.Status = field.NewString(tableName, "status")
|
||||
_cardRedeemCookieOrderJd.PayID = field.NewString(tableName, "pay_id")
|
||||
_cardRedeemCookieOrderJd.WebPayLink = field.NewString(tableName, "web_pay_link")
|
||||
_cardRedeemCookieOrderJd.ClientPayLink = field.NewString(tableName, "client_pay_link")
|
||||
_cardRedeemCookieOrderJd.OrderNo = field.NewString(tableName, "order_no")
|
||||
_cardRedeemCookieOrderJd.UserAgent = field.NewString(tableName, "user_agent")
|
||||
_cardRedeemCookieOrderJd.UserClient = field.NewString(tableName, "user_client")
|
||||
_cardRedeemCookieOrderJd.Note = field.NewString(tableName, "note")
|
||||
_cardRedeemCookieOrderJd.CreatedAt = field.NewTime(tableName, "created_at")
|
||||
_cardRedeemCookieOrderJd.UpdatedAt = field.NewTime(tableName, "updated_at")
|
||||
_cardRedeemCookieOrderJd.DeletedAt = field.NewField(tableName, "deleted_at")
|
||||
_cardRedeemCookieOrderJd.CardNo = field.NewString(tableName, "card_no")
|
||||
_cardRedeemCookieOrderJd.CardPassword = field.NewString(tableName, "card_password")
|
||||
|
||||
_cardRedeemCookieOrderJd.fillFieldMap()
|
||||
|
||||
return _cardRedeemCookieOrderJd
|
||||
}
|
||||
|
||||
type cardRedeemCookieOrderJd struct {
|
||||
cardRedeemCookieOrderJdDo cardRedeemCookieOrderJdDo
|
||||
|
||||
ALL field.Asterisk
|
||||
ID field.Int32
|
||||
CookieOrderID field.Int32 // 订单 id
|
||||
CookieAccountID field.Int32 // cookieid
|
||||
ResponseData field.String // 返回值
|
||||
Status field.String
|
||||
PayID field.String
|
||||
WebPayLink field.String
|
||||
ClientPayLink field.String
|
||||
OrderNo field.String
|
||||
UserAgent field.String
|
||||
UserClient field.String
|
||||
Note field.String
|
||||
CreatedAt field.Time
|
||||
UpdatedAt field.Time
|
||||
DeletedAt field.Field
|
||||
CardNo field.String
|
||||
CardPassword field.String
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJd) Table(newTableName string) *cardRedeemCookieOrderJd {
|
||||
c.cardRedeemCookieOrderJdDo.UseTable(newTableName)
|
||||
return c.updateTableName(newTableName)
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJd) As(alias string) *cardRedeemCookieOrderJd {
|
||||
c.cardRedeemCookieOrderJdDo.DO = *(c.cardRedeemCookieOrderJdDo.As(alias).(*gen.DO))
|
||||
return c.updateTableName(alias)
|
||||
}
|
||||
|
||||
func (c *cardRedeemCookieOrderJd) updateTableName(table string) *cardRedeemCookieOrderJd {
|
||||
c.ALL = field.NewAsterisk(table)
|
||||
c.ID = field.NewInt32(table, "id")
|
||||
c.CookieOrderID = field.NewInt32(table, "cookie_order_id")
|
||||
c.CookieAccountID = field.NewInt32(table, "cookie_account_id")
|
||||
c.ResponseData = field.NewString(table, "response_data")
|
||||
c.Status = field.NewString(table, "status")
|
||||
c.PayID = field.NewString(table, "pay_id")
|
||||
c.WebPayLink = field.NewString(table, "web_pay_link")
|
||||
c.ClientPayLink = field.NewString(table, "client_pay_link")
|
||||
c.OrderNo = field.NewString(table, "order_no")
|
||||
c.UserAgent = field.NewString(table, "user_agent")
|
||||
c.UserClient = field.NewString(table, "user_client")
|
||||
c.Note = field.NewString(table, "note")
|
||||
c.CreatedAt = field.NewTime(table, "created_at")
|
||||
c.UpdatedAt = field.NewTime(table, "updated_at")
|
||||
c.DeletedAt = field.NewField(table, "deleted_at")
|
||||
c.CardNo = field.NewString(table, "card_no")
|
||||
c.CardPassword = field.NewString(table, "card_password")
|
||||
|
||||
c.fillFieldMap()
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *cardRedeemCookieOrderJd) WithContext(ctx context.Context) *cardRedeemCookieOrderJdDo {
|
||||
return c.cardRedeemCookieOrderJdDo.WithContext(ctx)
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJd) TableName() string { return c.cardRedeemCookieOrderJdDo.TableName() }
|
||||
|
||||
func (c cardRedeemCookieOrderJd) Alias() string { return c.cardRedeemCookieOrderJdDo.Alias() }
|
||||
|
||||
func (c cardRedeemCookieOrderJd) Columns(cols ...field.Expr) gen.Columns {
|
||||
return c.cardRedeemCookieOrderJdDo.Columns(cols...)
|
||||
}
|
||||
|
||||
func (c *cardRedeemCookieOrderJd) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
||||
_f, ok := c.fieldMap[fieldName]
|
||||
if !ok || _f == nil {
|
||||
return nil, false
|
||||
}
|
||||
_oe, ok := _f.(field.OrderExpr)
|
||||
return _oe, ok
|
||||
}
|
||||
|
||||
func (c *cardRedeemCookieOrderJd) fillFieldMap() {
|
||||
c.fieldMap = make(map[string]field.Expr, 17)
|
||||
c.fieldMap["id"] = c.ID
|
||||
c.fieldMap["cookie_order_id"] = c.CookieOrderID
|
||||
c.fieldMap["cookie_account_id"] = c.CookieAccountID
|
||||
c.fieldMap["response_data"] = c.ResponseData
|
||||
c.fieldMap["status"] = c.Status
|
||||
c.fieldMap["pay_id"] = c.PayID
|
||||
c.fieldMap["web_pay_link"] = c.WebPayLink
|
||||
c.fieldMap["client_pay_link"] = c.ClientPayLink
|
||||
c.fieldMap["order_no"] = c.OrderNo
|
||||
c.fieldMap["user_agent"] = c.UserAgent
|
||||
c.fieldMap["user_client"] = c.UserClient
|
||||
c.fieldMap["note"] = c.Note
|
||||
c.fieldMap["created_at"] = c.CreatedAt
|
||||
c.fieldMap["updated_at"] = c.UpdatedAt
|
||||
c.fieldMap["deleted_at"] = c.DeletedAt
|
||||
c.fieldMap["card_no"] = c.CardNo
|
||||
c.fieldMap["card_password"] = c.CardPassword
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJd) clone(db *gorm.DB) cardRedeemCookieOrderJd {
|
||||
c.cardRedeemCookieOrderJdDo.ReplaceConnPool(db.Statement.ConnPool)
|
||||
return c
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJd) replaceDB(db *gorm.DB) cardRedeemCookieOrderJd {
|
||||
c.cardRedeemCookieOrderJdDo.ReplaceDB(db)
|
||||
return c
|
||||
}
|
||||
|
||||
type cardRedeemCookieOrderJdDo struct{ gen.DO }
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Debug() *cardRedeemCookieOrderJdDo {
|
||||
return c.withDO(c.DO.Debug())
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) WithContext(ctx context.Context) *cardRedeemCookieOrderJdDo {
|
||||
return c.withDO(c.DO.WithContext(ctx))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) ReadDB() *cardRedeemCookieOrderJdDo {
|
||||
return c.Clauses(dbresolver.Read)
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) WriteDB() *cardRedeemCookieOrderJdDo {
|
||||
return c.Clauses(dbresolver.Write)
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Session(config *gorm.Session) *cardRedeemCookieOrderJdDo {
|
||||
return c.withDO(c.DO.Session(config))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Clauses(conds ...clause.Expression) *cardRedeemCookieOrderJdDo {
|
||||
return c.withDO(c.DO.Clauses(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Returning(value interface{}, columns ...string) *cardRedeemCookieOrderJdDo {
|
||||
return c.withDO(c.DO.Returning(value, columns...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Not(conds ...gen.Condition) *cardRedeemCookieOrderJdDo {
|
||||
return c.withDO(c.DO.Not(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Or(conds ...gen.Condition) *cardRedeemCookieOrderJdDo {
|
||||
return c.withDO(c.DO.Or(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Select(conds ...field.Expr) *cardRedeemCookieOrderJdDo {
|
||||
return c.withDO(c.DO.Select(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Where(conds ...gen.Condition) *cardRedeemCookieOrderJdDo {
|
||||
return c.withDO(c.DO.Where(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Order(conds ...field.Expr) *cardRedeemCookieOrderJdDo {
|
||||
return c.withDO(c.DO.Order(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Distinct(cols ...field.Expr) *cardRedeemCookieOrderJdDo {
|
||||
return c.withDO(c.DO.Distinct(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Omit(cols ...field.Expr) *cardRedeemCookieOrderJdDo {
|
||||
return c.withDO(c.DO.Omit(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Join(table schema.Tabler, on ...field.Expr) *cardRedeemCookieOrderJdDo {
|
||||
return c.withDO(c.DO.Join(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) LeftJoin(table schema.Tabler, on ...field.Expr) *cardRedeemCookieOrderJdDo {
|
||||
return c.withDO(c.DO.LeftJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) RightJoin(table schema.Tabler, on ...field.Expr) *cardRedeemCookieOrderJdDo {
|
||||
return c.withDO(c.DO.RightJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Group(cols ...field.Expr) *cardRedeemCookieOrderJdDo {
|
||||
return c.withDO(c.DO.Group(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Having(conds ...gen.Condition) *cardRedeemCookieOrderJdDo {
|
||||
return c.withDO(c.DO.Having(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Limit(limit int) *cardRedeemCookieOrderJdDo {
|
||||
return c.withDO(c.DO.Limit(limit))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Offset(offset int) *cardRedeemCookieOrderJdDo {
|
||||
return c.withDO(c.DO.Offset(offset))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *cardRedeemCookieOrderJdDo {
|
||||
return c.withDO(c.DO.Scopes(funcs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Unscoped() *cardRedeemCookieOrderJdDo {
|
||||
return c.withDO(c.DO.Unscoped())
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Create(values ...*model.CardRedeemCookieOrderJd) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Create(values)
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) CreateInBatches(values []*model.CardRedeemCookieOrderJd, batchSize int) error {
|
||||
return c.DO.CreateInBatches(values, batchSize)
|
||||
}
|
||||
|
||||
// Save : !!! underlying implementation is different with GORM
|
||||
// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values)
|
||||
func (c cardRedeemCookieOrderJdDo) Save(values ...*model.CardRedeemCookieOrderJd) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Save(values)
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) First() (*model.CardRedeemCookieOrderJd, error) {
|
||||
if result, err := c.DO.First(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemCookieOrderJd), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Take() (*model.CardRedeemCookieOrderJd, error) {
|
||||
if result, err := c.DO.Take(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemCookieOrderJd), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Last() (*model.CardRedeemCookieOrderJd, error) {
|
||||
if result, err := c.DO.Last(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemCookieOrderJd), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Find() ([]*model.CardRedeemCookieOrderJd, error) {
|
||||
result, err := c.DO.Find()
|
||||
return result.([]*model.CardRedeemCookieOrderJd), err
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.CardRedeemCookieOrderJd, err error) {
|
||||
buf := make([]*model.CardRedeemCookieOrderJd, 0, batchSize)
|
||||
err = c.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error {
|
||||
defer func() { results = append(results, buf...) }()
|
||||
return fc(tx, batch)
|
||||
})
|
||||
return results, err
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) FindInBatches(result *[]*model.CardRedeemCookieOrderJd, batchSize int, fc func(tx gen.Dao, batch int) error) error {
|
||||
return c.DO.FindInBatches(result, batchSize, fc)
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Attrs(attrs ...field.AssignExpr) *cardRedeemCookieOrderJdDo {
|
||||
return c.withDO(c.DO.Attrs(attrs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Assign(attrs ...field.AssignExpr) *cardRedeemCookieOrderJdDo {
|
||||
return c.withDO(c.DO.Assign(attrs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Joins(fields ...field.RelationField) *cardRedeemCookieOrderJdDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Joins(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Preload(fields ...field.RelationField) *cardRedeemCookieOrderJdDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Preload(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) FirstOrInit() (*model.CardRedeemCookieOrderJd, error) {
|
||||
if result, err := c.DO.FirstOrInit(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemCookieOrderJd), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) FirstOrCreate() (*model.CardRedeemCookieOrderJd, error) {
|
||||
if result, err := c.DO.FirstOrCreate(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemCookieOrderJd), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) FindByPage(offset int, limit int) (result []*model.CardRedeemCookieOrderJd, count int64, err error) {
|
||||
result, err = c.Offset(offset).Limit(limit).Find()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if size := len(result); 0 < limit && 0 < size && size < limit {
|
||||
count = int64(size + offset)
|
||||
return
|
||||
}
|
||||
|
||||
count, err = c.Offset(-1).Limit(-1).Count()
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) {
|
||||
count, err = c.Count()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = c.Offset(offset).Limit(limit).Scan(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Scan(result interface{}) (err error) {
|
||||
return c.DO.Scan(result)
|
||||
}
|
||||
|
||||
func (c cardRedeemCookieOrderJdDo) Delete(models ...*model.CardRedeemCookieOrderJd) (result gen.ResultInfo, err error) {
|
||||
return c.DO.Delete(models)
|
||||
}
|
||||
|
||||
func (c *cardRedeemCookieOrderJdDo) withDO(do gen.Dao) *cardRedeemCookieOrderJdDo {
|
||||
c.DO = *do.(*gen.DO)
|
||||
return c
|
||||
}
|
||||
367
verification/internal/query/card_redeem_order_history.gen.go
Normal file
367
verification/internal/query/card_redeem_order_history.gen.go
Normal file
@@ -0,0 +1,367 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package query
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
|
||||
"gorm.io/gen"
|
||||
"gorm.io/gen/field"
|
||||
|
||||
"gorm.io/plugin/dbresolver"
|
||||
|
||||
"order/internal/model"
|
||||
)
|
||||
|
||||
func newCardRedeemOrderHistory(db *gorm.DB, opts ...gen.DOOption) cardRedeemOrderHistory {
|
||||
_cardRedeemOrderHistory := cardRedeemOrderHistory{}
|
||||
|
||||
_cardRedeemOrderHistory.cardRedeemOrderHistoryDo.UseDB(db, opts...)
|
||||
_cardRedeemOrderHistory.cardRedeemOrderHistoryDo.UseModel(&model.CardRedeemOrderHistory{})
|
||||
|
||||
tableName := _cardRedeemOrderHistory.cardRedeemOrderHistoryDo.TableName()
|
||||
_cardRedeemOrderHistory.ALL = field.NewAsterisk(tableName)
|
||||
_cardRedeemOrderHistory.ID = field.NewInt32(tableName, "id")
|
||||
_cardRedeemOrderHistory.OrderNo = field.NewString(tableName, "order_no")
|
||||
_cardRedeemOrderHistory.AccountID = field.NewString(tableName, "account_id")
|
||||
_cardRedeemOrderHistory.OperationStatus = field.NewInt32(tableName, "operation_status")
|
||||
_cardRedeemOrderHistory.ResponseRawData = field.NewString(tableName, "response_raw_data")
|
||||
_cardRedeemOrderHistory.Amount = field.NewFloat32(tableName, "amount")
|
||||
_cardRedeemOrderHistory.Remark = field.NewString(tableName, "remark")
|
||||
_cardRedeemOrderHistory.CreatedAt = field.NewTime(tableName, "created_at")
|
||||
_cardRedeemOrderHistory.UpdatedAt = field.NewTime(tableName, "updated_at")
|
||||
_cardRedeemOrderHistory.DeletedAt = field.NewField(tableName, "deleted_at")
|
||||
|
||||
_cardRedeemOrderHistory.fillFieldMap()
|
||||
|
||||
return _cardRedeemOrderHistory
|
||||
}
|
||||
|
||||
type cardRedeemOrderHistory struct {
|
||||
cardRedeemOrderHistoryDo cardRedeemOrderHistoryDo
|
||||
|
||||
ALL field.Asterisk
|
||||
ID field.Int32
|
||||
OrderNo field.String
|
||||
AccountID field.String
|
||||
OperationStatus field.Int32
|
||||
ResponseRawData field.String
|
||||
Amount field.Float32
|
||||
Remark field.String
|
||||
CreatedAt field.Time
|
||||
UpdatedAt field.Time
|
||||
DeletedAt field.Field
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistory) Table(newTableName string) *cardRedeemOrderHistory {
|
||||
c.cardRedeemOrderHistoryDo.UseTable(newTableName)
|
||||
return c.updateTableName(newTableName)
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistory) As(alias string) *cardRedeemOrderHistory {
|
||||
c.cardRedeemOrderHistoryDo.DO = *(c.cardRedeemOrderHistoryDo.As(alias).(*gen.DO))
|
||||
return c.updateTableName(alias)
|
||||
}
|
||||
|
||||
func (c *cardRedeemOrderHistory) updateTableName(table string) *cardRedeemOrderHistory {
|
||||
c.ALL = field.NewAsterisk(table)
|
||||
c.ID = field.NewInt32(table, "id")
|
||||
c.OrderNo = field.NewString(table, "order_no")
|
||||
c.AccountID = field.NewString(table, "account_id")
|
||||
c.OperationStatus = field.NewInt32(table, "operation_status")
|
||||
c.ResponseRawData = field.NewString(table, "response_raw_data")
|
||||
c.Amount = field.NewFloat32(table, "amount")
|
||||
c.Remark = field.NewString(table, "remark")
|
||||
c.CreatedAt = field.NewTime(table, "created_at")
|
||||
c.UpdatedAt = field.NewTime(table, "updated_at")
|
||||
c.DeletedAt = field.NewField(table, "deleted_at")
|
||||
|
||||
c.fillFieldMap()
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *cardRedeemOrderHistory) WithContext(ctx context.Context) *cardRedeemOrderHistoryDo {
|
||||
return c.cardRedeemOrderHistoryDo.WithContext(ctx)
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistory) TableName() string { return c.cardRedeemOrderHistoryDo.TableName() }
|
||||
|
||||
func (c cardRedeemOrderHistory) Alias() string { return c.cardRedeemOrderHistoryDo.Alias() }
|
||||
|
||||
func (c cardRedeemOrderHistory) Columns(cols ...field.Expr) gen.Columns {
|
||||
return c.cardRedeemOrderHistoryDo.Columns(cols...)
|
||||
}
|
||||
|
||||
func (c *cardRedeemOrderHistory) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
||||
_f, ok := c.fieldMap[fieldName]
|
||||
if !ok || _f == nil {
|
||||
return nil, false
|
||||
}
|
||||
_oe, ok := _f.(field.OrderExpr)
|
||||
return _oe, ok
|
||||
}
|
||||
|
||||
func (c *cardRedeemOrderHistory) fillFieldMap() {
|
||||
c.fieldMap = make(map[string]field.Expr, 10)
|
||||
c.fieldMap["id"] = c.ID
|
||||
c.fieldMap["order_no"] = c.OrderNo
|
||||
c.fieldMap["account_id"] = c.AccountID
|
||||
c.fieldMap["operation_status"] = c.OperationStatus
|
||||
c.fieldMap["response_raw_data"] = c.ResponseRawData
|
||||
c.fieldMap["amount"] = c.Amount
|
||||
c.fieldMap["remark"] = c.Remark
|
||||
c.fieldMap["created_at"] = c.CreatedAt
|
||||
c.fieldMap["updated_at"] = c.UpdatedAt
|
||||
c.fieldMap["deleted_at"] = c.DeletedAt
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistory) clone(db *gorm.DB) cardRedeemOrderHistory {
|
||||
c.cardRedeemOrderHistoryDo.ReplaceConnPool(db.Statement.ConnPool)
|
||||
return c
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistory) replaceDB(db *gorm.DB) cardRedeemOrderHistory {
|
||||
c.cardRedeemOrderHistoryDo.ReplaceDB(db)
|
||||
return c
|
||||
}
|
||||
|
||||
type cardRedeemOrderHistoryDo struct{ gen.DO }
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Debug() *cardRedeemOrderHistoryDo {
|
||||
return c.withDO(c.DO.Debug())
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) WithContext(ctx context.Context) *cardRedeemOrderHistoryDo {
|
||||
return c.withDO(c.DO.WithContext(ctx))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) ReadDB() *cardRedeemOrderHistoryDo {
|
||||
return c.Clauses(dbresolver.Read)
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) WriteDB() *cardRedeemOrderHistoryDo {
|
||||
return c.Clauses(dbresolver.Write)
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Session(config *gorm.Session) *cardRedeemOrderHistoryDo {
|
||||
return c.withDO(c.DO.Session(config))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Clauses(conds ...clause.Expression) *cardRedeemOrderHistoryDo {
|
||||
return c.withDO(c.DO.Clauses(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Returning(value interface{}, columns ...string) *cardRedeemOrderHistoryDo {
|
||||
return c.withDO(c.DO.Returning(value, columns...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Not(conds ...gen.Condition) *cardRedeemOrderHistoryDo {
|
||||
return c.withDO(c.DO.Not(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Or(conds ...gen.Condition) *cardRedeemOrderHistoryDo {
|
||||
return c.withDO(c.DO.Or(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Select(conds ...field.Expr) *cardRedeemOrderHistoryDo {
|
||||
return c.withDO(c.DO.Select(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Where(conds ...gen.Condition) *cardRedeemOrderHistoryDo {
|
||||
return c.withDO(c.DO.Where(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Order(conds ...field.Expr) *cardRedeemOrderHistoryDo {
|
||||
return c.withDO(c.DO.Order(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Distinct(cols ...field.Expr) *cardRedeemOrderHistoryDo {
|
||||
return c.withDO(c.DO.Distinct(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Omit(cols ...field.Expr) *cardRedeemOrderHistoryDo {
|
||||
return c.withDO(c.DO.Omit(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Join(table schema.Tabler, on ...field.Expr) *cardRedeemOrderHistoryDo {
|
||||
return c.withDO(c.DO.Join(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) LeftJoin(table schema.Tabler, on ...field.Expr) *cardRedeemOrderHistoryDo {
|
||||
return c.withDO(c.DO.LeftJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) RightJoin(table schema.Tabler, on ...field.Expr) *cardRedeemOrderHistoryDo {
|
||||
return c.withDO(c.DO.RightJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Group(cols ...field.Expr) *cardRedeemOrderHistoryDo {
|
||||
return c.withDO(c.DO.Group(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Having(conds ...gen.Condition) *cardRedeemOrderHistoryDo {
|
||||
return c.withDO(c.DO.Having(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Limit(limit int) *cardRedeemOrderHistoryDo {
|
||||
return c.withDO(c.DO.Limit(limit))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Offset(offset int) *cardRedeemOrderHistoryDo {
|
||||
return c.withDO(c.DO.Offset(offset))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *cardRedeemOrderHistoryDo {
|
||||
return c.withDO(c.DO.Scopes(funcs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Unscoped() *cardRedeemOrderHistoryDo {
|
||||
return c.withDO(c.DO.Unscoped())
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Create(values ...*model.CardRedeemOrderHistory) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Create(values)
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) CreateInBatches(values []*model.CardRedeemOrderHistory, batchSize int) error {
|
||||
return c.DO.CreateInBatches(values, batchSize)
|
||||
}
|
||||
|
||||
// Save : !!! underlying implementation is different with GORM
|
||||
// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values)
|
||||
func (c cardRedeemOrderHistoryDo) Save(values ...*model.CardRedeemOrderHistory) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Save(values)
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) First() (*model.CardRedeemOrderHistory, error) {
|
||||
if result, err := c.DO.First(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemOrderHistory), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Take() (*model.CardRedeemOrderHistory, error) {
|
||||
if result, err := c.DO.Take(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemOrderHistory), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Last() (*model.CardRedeemOrderHistory, error) {
|
||||
if result, err := c.DO.Last(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemOrderHistory), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Find() ([]*model.CardRedeemOrderHistory, error) {
|
||||
result, err := c.DO.Find()
|
||||
return result.([]*model.CardRedeemOrderHistory), err
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.CardRedeemOrderHistory, err error) {
|
||||
buf := make([]*model.CardRedeemOrderHistory, 0, batchSize)
|
||||
err = c.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error {
|
||||
defer func() { results = append(results, buf...) }()
|
||||
return fc(tx, batch)
|
||||
})
|
||||
return results, err
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) FindInBatches(result *[]*model.CardRedeemOrderHistory, batchSize int, fc func(tx gen.Dao, batch int) error) error {
|
||||
return c.DO.FindInBatches(result, batchSize, fc)
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Attrs(attrs ...field.AssignExpr) *cardRedeemOrderHistoryDo {
|
||||
return c.withDO(c.DO.Attrs(attrs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Assign(attrs ...field.AssignExpr) *cardRedeemOrderHistoryDo {
|
||||
return c.withDO(c.DO.Assign(attrs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Joins(fields ...field.RelationField) *cardRedeemOrderHistoryDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Joins(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Preload(fields ...field.RelationField) *cardRedeemOrderHistoryDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Preload(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) FirstOrInit() (*model.CardRedeemOrderHistory, error) {
|
||||
if result, err := c.DO.FirstOrInit(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemOrderHistory), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) FirstOrCreate() (*model.CardRedeemOrderHistory, error) {
|
||||
if result, err := c.DO.FirstOrCreate(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemOrderHistory), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) FindByPage(offset int, limit int) (result []*model.CardRedeemOrderHistory, count int64, err error) {
|
||||
result, err = c.Offset(offset).Limit(limit).Find()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if size := len(result); 0 < limit && 0 < size && size < limit {
|
||||
count = int64(size + offset)
|
||||
return
|
||||
}
|
||||
|
||||
count, err = c.Offset(-1).Limit(-1).Count()
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) {
|
||||
count, err = c.Count()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = c.Offset(offset).Limit(limit).Scan(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Scan(result interface{}) (err error) {
|
||||
return c.DO.Scan(result)
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderHistoryDo) Delete(models ...*model.CardRedeemOrderHistory) (result gen.ResultInfo, err error) {
|
||||
return c.DO.Delete(models)
|
||||
}
|
||||
|
||||
func (c *cardRedeemOrderHistoryDo) withDO(do gen.Dao) *cardRedeemOrderHistoryDo {
|
||||
c.DO = *do.(*gen.DO)
|
||||
return c
|
||||
}
|
||||
415
verification/internal/query/card_redeem_order_info.gen.go
Normal file
415
verification/internal/query/card_redeem_order_info.gen.go
Normal file
@@ -0,0 +1,415 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package query
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
|
||||
"gorm.io/gen"
|
||||
"gorm.io/gen/field"
|
||||
|
||||
"gorm.io/plugin/dbresolver"
|
||||
|
||||
"order/internal/model"
|
||||
)
|
||||
|
||||
func newCardRedeemOrderInfo(db *gorm.DB, opts ...gen.DOOption) cardRedeemOrderInfo {
|
||||
_cardRedeemOrderInfo := cardRedeemOrderInfo{}
|
||||
|
||||
_cardRedeemOrderInfo.cardRedeemOrderInfoDo.UseDB(db, opts...)
|
||||
_cardRedeemOrderInfo.cardRedeemOrderInfoDo.UseModel(&model.CardRedeemOrderInfo{})
|
||||
|
||||
tableName := _cardRedeemOrderInfo.cardRedeemOrderInfoDo.TableName()
|
||||
_cardRedeemOrderInfo.ALL = field.NewAsterisk(tableName)
|
||||
_cardRedeemOrderInfo.OrderNo = field.NewString(tableName, "order_no")
|
||||
_cardRedeemOrderInfo.CardNo = field.NewString(tableName, "card_no")
|
||||
_cardRedeemOrderInfo.MerchantID = field.NewString(tableName, "merchant_id")
|
||||
_cardRedeemOrderInfo.Attach = field.NewString(tableName, "attach")
|
||||
_cardRedeemOrderInfo.CreatedUserID = field.NewString(tableName, "created_user_id")
|
||||
_cardRedeemOrderInfo.AccountID = field.NewString(tableName, "account_id")
|
||||
_cardRedeemOrderInfo.AccountName = field.NewString(tableName, "account_name")
|
||||
_cardRedeemOrderInfo.GiftCardPwd = field.NewString(tableName, "gift_card_pwd")
|
||||
_cardRedeemOrderInfo.CardTypeName = field.NewString(tableName, "card_type_name")
|
||||
_cardRedeemOrderInfo.NotifyURL = field.NewString(tableName, "notify_url")
|
||||
_cardRedeemOrderInfo.Remark = field.NewString(tableName, "remark")
|
||||
_cardRedeemOrderInfo.OrderAmount = field.NewFloat32(tableName, "order_amount")
|
||||
_cardRedeemOrderInfo.ActualAmount = field.NewFloat32(tableName, "actual_amount")
|
||||
_cardRedeemOrderInfo.Category = field.NewString(tableName, "category")
|
||||
_cardRedeemOrderInfo.CallbackCount = field.NewInt32(tableName, "callback_count")
|
||||
_cardRedeemOrderInfo.NotifyStatus = field.NewInt32(tableName, "notify_status")
|
||||
_cardRedeemOrderInfo.Status = field.NewInt32(tableName, "status")
|
||||
_cardRedeemOrderInfo.OrderStatus = field.NewInt32(tableName, "order_status")
|
||||
_cardRedeemOrderInfo.CreatedAt = field.NewTime(tableName, "created_at")
|
||||
_cardRedeemOrderInfo.UpdatedAt = field.NewTime(tableName, "updated_at")
|
||||
_cardRedeemOrderInfo.DeletedAt = field.NewField(tableName, "deleted_at")
|
||||
|
||||
_cardRedeemOrderInfo.fillFieldMap()
|
||||
|
||||
return _cardRedeemOrderInfo
|
||||
}
|
||||
|
||||
type cardRedeemOrderInfo struct {
|
||||
cardRedeemOrderInfoDo cardRedeemOrderInfoDo
|
||||
|
||||
ALL field.Asterisk
|
||||
OrderNo field.String
|
||||
CardNo field.String // 卡号
|
||||
MerchantID field.String
|
||||
Attach field.String
|
||||
CreatedUserID field.String // 创建用户
|
||||
AccountID field.String
|
||||
AccountName field.String // 账号名称
|
||||
GiftCardPwd field.String // 卡密
|
||||
CardTypeName field.String // 卡种
|
||||
NotifyURL field.String // 回调
|
||||
Remark field.String // 备注
|
||||
OrderAmount field.Float32 // 订单金额
|
||||
ActualAmount field.Float32 // 实际金额
|
||||
Category field.String // 账户类型
|
||||
CallbackCount field.Int32 // 回调次数
|
||||
NotifyStatus field.Int32 // 回调状态 0没有回调 1.回调成功 2.回调失败
|
||||
Status field.Int32 // 1.兑换成功 0.失败
|
||||
/*
|
||||
订单状态 订单原本状态
|
||||
|
||||
*/
|
||||
OrderStatus field.Int32
|
||||
CreatedAt field.Time
|
||||
UpdatedAt field.Time
|
||||
DeletedAt field.Field
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfo) Table(newTableName string) *cardRedeemOrderInfo {
|
||||
c.cardRedeemOrderInfoDo.UseTable(newTableName)
|
||||
return c.updateTableName(newTableName)
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfo) As(alias string) *cardRedeemOrderInfo {
|
||||
c.cardRedeemOrderInfoDo.DO = *(c.cardRedeemOrderInfoDo.As(alias).(*gen.DO))
|
||||
return c.updateTableName(alias)
|
||||
}
|
||||
|
||||
func (c *cardRedeemOrderInfo) updateTableName(table string) *cardRedeemOrderInfo {
|
||||
c.ALL = field.NewAsterisk(table)
|
||||
c.OrderNo = field.NewString(table, "order_no")
|
||||
c.CardNo = field.NewString(table, "card_no")
|
||||
c.MerchantID = field.NewString(table, "merchant_id")
|
||||
c.Attach = field.NewString(table, "attach")
|
||||
c.CreatedUserID = field.NewString(table, "created_user_id")
|
||||
c.AccountID = field.NewString(table, "account_id")
|
||||
c.AccountName = field.NewString(table, "account_name")
|
||||
c.GiftCardPwd = field.NewString(table, "gift_card_pwd")
|
||||
c.CardTypeName = field.NewString(table, "card_type_name")
|
||||
c.NotifyURL = field.NewString(table, "notify_url")
|
||||
c.Remark = field.NewString(table, "remark")
|
||||
c.OrderAmount = field.NewFloat32(table, "order_amount")
|
||||
c.ActualAmount = field.NewFloat32(table, "actual_amount")
|
||||
c.Category = field.NewString(table, "category")
|
||||
c.CallbackCount = field.NewInt32(table, "callback_count")
|
||||
c.NotifyStatus = field.NewInt32(table, "notify_status")
|
||||
c.Status = field.NewInt32(table, "status")
|
||||
c.OrderStatus = field.NewInt32(table, "order_status")
|
||||
c.CreatedAt = field.NewTime(table, "created_at")
|
||||
c.UpdatedAt = field.NewTime(table, "updated_at")
|
||||
c.DeletedAt = field.NewField(table, "deleted_at")
|
||||
|
||||
c.fillFieldMap()
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *cardRedeemOrderInfo) WithContext(ctx context.Context) *cardRedeemOrderInfoDo {
|
||||
return c.cardRedeemOrderInfoDo.WithContext(ctx)
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfo) TableName() string { return c.cardRedeemOrderInfoDo.TableName() }
|
||||
|
||||
func (c cardRedeemOrderInfo) Alias() string { return c.cardRedeemOrderInfoDo.Alias() }
|
||||
|
||||
func (c cardRedeemOrderInfo) Columns(cols ...field.Expr) gen.Columns {
|
||||
return c.cardRedeemOrderInfoDo.Columns(cols...)
|
||||
}
|
||||
|
||||
func (c *cardRedeemOrderInfo) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
||||
_f, ok := c.fieldMap[fieldName]
|
||||
if !ok || _f == nil {
|
||||
return nil, false
|
||||
}
|
||||
_oe, ok := _f.(field.OrderExpr)
|
||||
return _oe, ok
|
||||
}
|
||||
|
||||
func (c *cardRedeemOrderInfo) fillFieldMap() {
|
||||
c.fieldMap = make(map[string]field.Expr, 21)
|
||||
c.fieldMap["order_no"] = c.OrderNo
|
||||
c.fieldMap["card_no"] = c.CardNo
|
||||
c.fieldMap["merchant_id"] = c.MerchantID
|
||||
c.fieldMap["attach"] = c.Attach
|
||||
c.fieldMap["created_user_id"] = c.CreatedUserID
|
||||
c.fieldMap["account_id"] = c.AccountID
|
||||
c.fieldMap["account_name"] = c.AccountName
|
||||
c.fieldMap["gift_card_pwd"] = c.GiftCardPwd
|
||||
c.fieldMap["card_type_name"] = c.CardTypeName
|
||||
c.fieldMap["notify_url"] = c.NotifyURL
|
||||
c.fieldMap["remark"] = c.Remark
|
||||
c.fieldMap["order_amount"] = c.OrderAmount
|
||||
c.fieldMap["actual_amount"] = c.ActualAmount
|
||||
c.fieldMap["category"] = c.Category
|
||||
c.fieldMap["callback_count"] = c.CallbackCount
|
||||
c.fieldMap["notify_status"] = c.NotifyStatus
|
||||
c.fieldMap["status"] = c.Status
|
||||
c.fieldMap["order_status"] = c.OrderStatus
|
||||
c.fieldMap["created_at"] = c.CreatedAt
|
||||
c.fieldMap["updated_at"] = c.UpdatedAt
|
||||
c.fieldMap["deleted_at"] = c.DeletedAt
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfo) clone(db *gorm.DB) cardRedeemOrderInfo {
|
||||
c.cardRedeemOrderInfoDo.ReplaceConnPool(db.Statement.ConnPool)
|
||||
return c
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfo) replaceDB(db *gorm.DB) cardRedeemOrderInfo {
|
||||
c.cardRedeemOrderInfoDo.ReplaceDB(db)
|
||||
return c
|
||||
}
|
||||
|
||||
type cardRedeemOrderInfoDo struct{ gen.DO }
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Debug() *cardRedeemOrderInfoDo {
|
||||
return c.withDO(c.DO.Debug())
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) WithContext(ctx context.Context) *cardRedeemOrderInfoDo {
|
||||
return c.withDO(c.DO.WithContext(ctx))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) ReadDB() *cardRedeemOrderInfoDo {
|
||||
return c.Clauses(dbresolver.Read)
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) WriteDB() *cardRedeemOrderInfoDo {
|
||||
return c.Clauses(dbresolver.Write)
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Session(config *gorm.Session) *cardRedeemOrderInfoDo {
|
||||
return c.withDO(c.DO.Session(config))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Clauses(conds ...clause.Expression) *cardRedeemOrderInfoDo {
|
||||
return c.withDO(c.DO.Clauses(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Returning(value interface{}, columns ...string) *cardRedeemOrderInfoDo {
|
||||
return c.withDO(c.DO.Returning(value, columns...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Not(conds ...gen.Condition) *cardRedeemOrderInfoDo {
|
||||
return c.withDO(c.DO.Not(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Or(conds ...gen.Condition) *cardRedeemOrderInfoDo {
|
||||
return c.withDO(c.DO.Or(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Select(conds ...field.Expr) *cardRedeemOrderInfoDo {
|
||||
return c.withDO(c.DO.Select(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Where(conds ...gen.Condition) *cardRedeemOrderInfoDo {
|
||||
return c.withDO(c.DO.Where(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Order(conds ...field.Expr) *cardRedeemOrderInfoDo {
|
||||
return c.withDO(c.DO.Order(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Distinct(cols ...field.Expr) *cardRedeemOrderInfoDo {
|
||||
return c.withDO(c.DO.Distinct(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Omit(cols ...field.Expr) *cardRedeemOrderInfoDo {
|
||||
return c.withDO(c.DO.Omit(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Join(table schema.Tabler, on ...field.Expr) *cardRedeemOrderInfoDo {
|
||||
return c.withDO(c.DO.Join(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) LeftJoin(table schema.Tabler, on ...field.Expr) *cardRedeemOrderInfoDo {
|
||||
return c.withDO(c.DO.LeftJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) RightJoin(table schema.Tabler, on ...field.Expr) *cardRedeemOrderInfoDo {
|
||||
return c.withDO(c.DO.RightJoin(table, on...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Group(cols ...field.Expr) *cardRedeemOrderInfoDo {
|
||||
return c.withDO(c.DO.Group(cols...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Having(conds ...gen.Condition) *cardRedeemOrderInfoDo {
|
||||
return c.withDO(c.DO.Having(conds...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Limit(limit int) *cardRedeemOrderInfoDo {
|
||||
return c.withDO(c.DO.Limit(limit))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Offset(offset int) *cardRedeemOrderInfoDo {
|
||||
return c.withDO(c.DO.Offset(offset))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *cardRedeemOrderInfoDo {
|
||||
return c.withDO(c.DO.Scopes(funcs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Unscoped() *cardRedeemOrderInfoDo {
|
||||
return c.withDO(c.DO.Unscoped())
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Create(values ...*model.CardRedeemOrderInfo) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Create(values)
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) CreateInBatches(values []*model.CardRedeemOrderInfo, batchSize int) error {
|
||||
return c.DO.CreateInBatches(values, batchSize)
|
||||
}
|
||||
|
||||
// Save : !!! underlying implementation is different with GORM
|
||||
// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values)
|
||||
func (c cardRedeemOrderInfoDo) Save(values ...*model.CardRedeemOrderInfo) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return c.DO.Save(values)
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) First() (*model.CardRedeemOrderInfo, error) {
|
||||
if result, err := c.DO.First(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemOrderInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Take() (*model.CardRedeemOrderInfo, error) {
|
||||
if result, err := c.DO.Take(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemOrderInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Last() (*model.CardRedeemOrderInfo, error) {
|
||||
if result, err := c.DO.Last(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemOrderInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Find() ([]*model.CardRedeemOrderInfo, error) {
|
||||
result, err := c.DO.Find()
|
||||
return result.([]*model.CardRedeemOrderInfo), err
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.CardRedeemOrderInfo, err error) {
|
||||
buf := make([]*model.CardRedeemOrderInfo, 0, batchSize)
|
||||
err = c.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error {
|
||||
defer func() { results = append(results, buf...) }()
|
||||
return fc(tx, batch)
|
||||
})
|
||||
return results, err
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) FindInBatches(result *[]*model.CardRedeemOrderInfo, batchSize int, fc func(tx gen.Dao, batch int) error) error {
|
||||
return c.DO.FindInBatches(result, batchSize, fc)
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Attrs(attrs ...field.AssignExpr) *cardRedeemOrderInfoDo {
|
||||
return c.withDO(c.DO.Attrs(attrs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Assign(attrs ...field.AssignExpr) *cardRedeemOrderInfoDo {
|
||||
return c.withDO(c.DO.Assign(attrs...))
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Joins(fields ...field.RelationField) *cardRedeemOrderInfoDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Joins(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Preload(fields ...field.RelationField) *cardRedeemOrderInfoDo {
|
||||
for _, _f := range fields {
|
||||
c = *c.withDO(c.DO.Preload(_f))
|
||||
}
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) FirstOrInit() (*model.CardRedeemOrderInfo, error) {
|
||||
if result, err := c.DO.FirstOrInit(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemOrderInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) FirstOrCreate() (*model.CardRedeemOrderInfo, error) {
|
||||
if result, err := c.DO.FirstOrCreate(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.CardRedeemOrderInfo), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) FindByPage(offset int, limit int) (result []*model.CardRedeemOrderInfo, count int64, err error) {
|
||||
result, err = c.Offset(offset).Limit(limit).Find()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if size := len(result); 0 < limit && 0 < size && size < limit {
|
||||
count = int64(size + offset)
|
||||
return
|
||||
}
|
||||
|
||||
count, err = c.Offset(-1).Limit(-1).Count()
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) {
|
||||
count, err = c.Count()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = c.Offset(offset).Limit(limit).Scan(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Scan(result interface{}) (err error) {
|
||||
return c.DO.Scan(result)
|
||||
}
|
||||
|
||||
func (c cardRedeemOrderInfoDo) Delete(models ...*model.CardRedeemOrderInfo) (result gen.ResultInfo, err error) {
|
||||
return c.DO.Delete(models)
|
||||
}
|
||||
|
||||
func (c *cardRedeemOrderInfoDo) withDO(do gen.Dao) *cardRedeemOrderInfoDo {
|
||||
c.DO = *do.(*gen.DO)
|
||||
return c
|
||||
}
|
||||
489
verification/internal/query/gen.go
Normal file
489
verification/internal/query/gen.go
Normal file
@@ -0,0 +1,489 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package query
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"gorm.io/gen"
|
||||
|
||||
"gorm.io/plugin/dbresolver"
|
||||
)
|
||||
|
||||
func Use(db *gorm.DB, opts ...gen.DOOption) *Query {
|
||||
return &Query{
|
||||
db: db,
|
||||
AccountHistoryInfo: newAccountHistoryInfo(db, opts...),
|
||||
AccountInfo: newAccountInfo(db, opts...),
|
||||
AgentInfo: newAgentInfo(db, opts...),
|
||||
BankCardInfo: newBankCardInfo(db, opts...),
|
||||
CardAppleAccountInfo: newCardAppleAccountInfo(db, opts...),
|
||||
CardAppleAccountInfoHistory: newCardAppleAccountInfoHistory(db, opts...),
|
||||
CardAppleHiddenSetting: newCardAppleHiddenSetting(db, opts...),
|
||||
CardAppleHiddenSettingsRechargeInfo: newCardAppleHiddenSettingsRechargeInfo(db, opts...),
|
||||
CardAppleHistoryInfo: newCardAppleHistoryInfo(db, opts...),
|
||||
CardAppleRechargeInfo: newCardAppleRechargeInfo(db, opts...),
|
||||
CardRedeemAccountDeduction: newCardRedeemAccountDeduction(db, opts...),
|
||||
CardRedeemAccountGroup: newCardRedeemAccountGroup(db, opts...),
|
||||
CardRedeemAccountHistory: newCardRedeemAccountHistory(db, opts...),
|
||||
CardRedeemAccountInfo: newCardRedeemAccountInfo(db, opts...),
|
||||
CardRedeemAccountSummary: newCardRedeemAccountSummary(db, opts...),
|
||||
CardRedeemCookieInfo: newCardRedeemCookieInfo(db, opts...),
|
||||
CardRedeemCookieOrder: newCardRedeemCookieOrder(db, opts...),
|
||||
CardRedeemCookieOrderJd: newCardRedeemCookieOrderJd(db, opts...),
|
||||
CardRedeemOrderHistory: newCardRedeemOrderHistory(db, opts...),
|
||||
CardRedeemOrderInfo: newCardRedeemOrderInfo(db, opts...),
|
||||
LegendAnyMoney: newLegendAnyMoney(db, opts...),
|
||||
LegendArea: newLegendArea(db, opts...),
|
||||
LegendFixMoney: newLegendFixMoney(db, opts...),
|
||||
LegendFixPresent: newLegendFixPresent(db, opts...),
|
||||
LegendGroup: newLegendGroup(db, opts...),
|
||||
LegendScalePresent: newLegendScalePresent(db, opts...),
|
||||
LegendScaleTemplate: newLegendScaleTemplate(db, opts...),
|
||||
MenuInfo: newMenuInfo(db, opts...),
|
||||
MerchantDeployInfo: newMerchantDeployInfo(db, opts...),
|
||||
MerchantHiddenConfig: newMerchantHiddenConfig(db, opts...),
|
||||
MerchantHiddenRecord: newMerchantHiddenRecord(db, opts...),
|
||||
MerchantInfo: newMerchantInfo(db, opts...),
|
||||
MerchantLoadInfo: newMerchantLoadInfo(db, opts...),
|
||||
Migration: newMigration(db, opts...),
|
||||
NotifyInfo: newNotifyInfo(db, opts...),
|
||||
OrderInfo: newOrderInfo(db, opts...),
|
||||
OrderProfitInfo: newOrderProfitInfo(db, opts...),
|
||||
OrderSettleInfo: newOrderSettleInfo(db, opts...),
|
||||
PayforInfo: newPayforInfo(db, opts...),
|
||||
PowerInfo: newPowerInfo(db, opts...),
|
||||
RechargeTMallAccount: newRechargeTMallAccount(db, opts...),
|
||||
RechargeTMallOrder: newRechargeTMallOrder(db, opts...),
|
||||
RechargeTMallOrderFake: newRechargeTMallOrderFake(db, opts...),
|
||||
RechargeTMallOrderHistory: newRechargeTMallOrderHistory(db, opts...),
|
||||
RechargeTMallShop: newRechargeTMallShop(db, opts...),
|
||||
RechargeTMallShopHistory: newRechargeTMallShopHistory(db, opts...),
|
||||
RestrictClientAccessIPRelation: newRestrictClientAccessIPRelation(db, opts...),
|
||||
RestrictClientAccessRecord: newRestrictClientAccessRecord(db, opts...),
|
||||
RestrictIPOrderAccess: newRestrictIPOrderAccess(db, opts...),
|
||||
RestrictIPRecord: newRestrictIPRecord(db, opts...),
|
||||
RoadInfo: newRoadInfo(db, opts...),
|
||||
RoadPoolInfo: newRoadPoolInfo(db, opts...),
|
||||
RoleInfo: newRoleInfo(db, opts...),
|
||||
SchemaMigration: newSchemaMigration(db, opts...),
|
||||
SecondMenuInfo: newSecondMenuInfo(db, opts...),
|
||||
SysAuthRule: newSysAuthRule(db, opts...),
|
||||
SysCasbinRule: newSysCasbinRule(db, opts...),
|
||||
SysConfigDict: newSysConfigDict(db, opts...),
|
||||
SysRole: newSysRole(db, opts...),
|
||||
SysUser: newSysUser(db, opts...),
|
||||
SysUserConfigChannel: newSysUserConfigChannel(db, opts...),
|
||||
SysUserDeduction: newSysUserDeduction(db, opts...),
|
||||
SysUserLoginLog: newSysUserLoginLog(db, opts...),
|
||||
SysUserPayment: newSysUserPayment(db, opts...),
|
||||
SysUserPaymentRecord: newSysUserPaymentRecord(db, opts...),
|
||||
TaskOrderFake: newTaskOrderFake(db, opts...),
|
||||
UserInfo: newUserInfo(db, opts...),
|
||||
}
|
||||
}
|
||||
|
||||
type Query struct {
|
||||
db *gorm.DB
|
||||
|
||||
AccountHistoryInfo accountHistoryInfo
|
||||
AccountInfo accountInfo
|
||||
AgentInfo agentInfo
|
||||
BankCardInfo bankCardInfo
|
||||
CardAppleAccountInfo cardAppleAccountInfo
|
||||
CardAppleAccountInfoHistory cardAppleAccountInfoHistory
|
||||
CardAppleHiddenSetting cardAppleHiddenSetting
|
||||
CardAppleHiddenSettingsRechargeInfo cardAppleHiddenSettingsRechargeInfo
|
||||
CardAppleHistoryInfo cardAppleHistoryInfo
|
||||
CardAppleRechargeInfo cardAppleRechargeInfo
|
||||
CardRedeemAccountDeduction cardRedeemAccountDeduction
|
||||
CardRedeemAccountGroup cardRedeemAccountGroup
|
||||
CardRedeemAccountHistory cardRedeemAccountHistory
|
||||
CardRedeemAccountInfo cardRedeemAccountInfo
|
||||
CardRedeemAccountSummary cardRedeemAccountSummary
|
||||
CardRedeemCookieInfo cardRedeemCookieInfo
|
||||
CardRedeemCookieOrder cardRedeemCookieOrder
|
||||
CardRedeemCookieOrderJd cardRedeemCookieOrderJd
|
||||
CardRedeemOrderHistory cardRedeemOrderHistory
|
||||
CardRedeemOrderInfo cardRedeemOrderInfo
|
||||
LegendAnyMoney legendAnyMoney
|
||||
LegendArea legendArea
|
||||
LegendFixMoney legendFixMoney
|
||||
LegendFixPresent legendFixPresent
|
||||
LegendGroup legendGroup
|
||||
LegendScalePresent legendScalePresent
|
||||
LegendScaleTemplate legendScaleTemplate
|
||||
MenuInfo menuInfo
|
||||
MerchantDeployInfo merchantDeployInfo
|
||||
MerchantHiddenConfig merchantHiddenConfig
|
||||
MerchantHiddenRecord merchantHiddenRecord
|
||||
MerchantInfo merchantInfo
|
||||
MerchantLoadInfo merchantLoadInfo
|
||||
Migration migration
|
||||
NotifyInfo notifyInfo
|
||||
OrderInfo orderInfo
|
||||
OrderProfitInfo orderProfitInfo
|
||||
OrderSettleInfo orderSettleInfo
|
||||
PayforInfo payforInfo
|
||||
PowerInfo powerInfo
|
||||
RechargeTMallAccount rechargeTMallAccount
|
||||
RechargeTMallOrder rechargeTMallOrder
|
||||
RechargeTMallOrderFake rechargeTMallOrderFake
|
||||
RechargeTMallOrderHistory rechargeTMallOrderHistory
|
||||
RechargeTMallShop rechargeTMallShop
|
||||
RechargeTMallShopHistory rechargeTMallShopHistory
|
||||
RestrictClientAccessIPRelation restrictClientAccessIPRelation
|
||||
RestrictClientAccessRecord restrictClientAccessRecord
|
||||
RestrictIPOrderAccess restrictIPOrderAccess
|
||||
RestrictIPRecord restrictIPRecord
|
||||
RoadInfo roadInfo
|
||||
RoadPoolInfo roadPoolInfo
|
||||
RoleInfo roleInfo
|
||||
SchemaMigration schemaMigration
|
||||
SecondMenuInfo secondMenuInfo
|
||||
SysAuthRule sysAuthRule
|
||||
SysCasbinRule sysCasbinRule
|
||||
SysConfigDict sysConfigDict
|
||||
SysRole sysRole
|
||||
SysUser sysUser
|
||||
SysUserConfigChannel sysUserConfigChannel
|
||||
SysUserDeduction sysUserDeduction
|
||||
SysUserLoginLog sysUserLoginLog
|
||||
SysUserPayment sysUserPayment
|
||||
SysUserPaymentRecord sysUserPaymentRecord
|
||||
TaskOrderFake taskOrderFake
|
||||
UserInfo userInfo
|
||||
}
|
||||
|
||||
func (q *Query) Available() bool { return q.db != nil }
|
||||
|
||||
func (q *Query) clone(db *gorm.DB) *Query {
|
||||
return &Query{
|
||||
db: db,
|
||||
AccountHistoryInfo: q.AccountHistoryInfo.clone(db),
|
||||
AccountInfo: q.AccountInfo.clone(db),
|
||||
AgentInfo: q.AgentInfo.clone(db),
|
||||
BankCardInfo: q.BankCardInfo.clone(db),
|
||||
CardAppleAccountInfo: q.CardAppleAccountInfo.clone(db),
|
||||
CardAppleAccountInfoHistory: q.CardAppleAccountInfoHistory.clone(db),
|
||||
CardAppleHiddenSetting: q.CardAppleHiddenSetting.clone(db),
|
||||
CardAppleHiddenSettingsRechargeInfo: q.CardAppleHiddenSettingsRechargeInfo.clone(db),
|
||||
CardAppleHistoryInfo: q.CardAppleHistoryInfo.clone(db),
|
||||
CardAppleRechargeInfo: q.CardAppleRechargeInfo.clone(db),
|
||||
CardRedeemAccountDeduction: q.CardRedeemAccountDeduction.clone(db),
|
||||
CardRedeemAccountGroup: q.CardRedeemAccountGroup.clone(db),
|
||||
CardRedeemAccountHistory: q.CardRedeemAccountHistory.clone(db),
|
||||
CardRedeemAccountInfo: q.CardRedeemAccountInfo.clone(db),
|
||||
CardRedeemAccountSummary: q.CardRedeemAccountSummary.clone(db),
|
||||
CardRedeemCookieInfo: q.CardRedeemCookieInfo.clone(db),
|
||||
CardRedeemCookieOrder: q.CardRedeemCookieOrder.clone(db),
|
||||
CardRedeemCookieOrderJd: q.CardRedeemCookieOrderJd.clone(db),
|
||||
CardRedeemOrderHistory: q.CardRedeemOrderHistory.clone(db),
|
||||
CardRedeemOrderInfo: q.CardRedeemOrderInfo.clone(db),
|
||||
LegendAnyMoney: q.LegendAnyMoney.clone(db),
|
||||
LegendArea: q.LegendArea.clone(db),
|
||||
LegendFixMoney: q.LegendFixMoney.clone(db),
|
||||
LegendFixPresent: q.LegendFixPresent.clone(db),
|
||||
LegendGroup: q.LegendGroup.clone(db),
|
||||
LegendScalePresent: q.LegendScalePresent.clone(db),
|
||||
LegendScaleTemplate: q.LegendScaleTemplate.clone(db),
|
||||
MenuInfo: q.MenuInfo.clone(db),
|
||||
MerchantDeployInfo: q.MerchantDeployInfo.clone(db),
|
||||
MerchantHiddenConfig: q.MerchantHiddenConfig.clone(db),
|
||||
MerchantHiddenRecord: q.MerchantHiddenRecord.clone(db),
|
||||
MerchantInfo: q.MerchantInfo.clone(db),
|
||||
MerchantLoadInfo: q.MerchantLoadInfo.clone(db),
|
||||
Migration: q.Migration.clone(db),
|
||||
NotifyInfo: q.NotifyInfo.clone(db),
|
||||
OrderInfo: q.OrderInfo.clone(db),
|
||||
OrderProfitInfo: q.OrderProfitInfo.clone(db),
|
||||
OrderSettleInfo: q.OrderSettleInfo.clone(db),
|
||||
PayforInfo: q.PayforInfo.clone(db),
|
||||
PowerInfo: q.PowerInfo.clone(db),
|
||||
RechargeTMallAccount: q.RechargeTMallAccount.clone(db),
|
||||
RechargeTMallOrder: q.RechargeTMallOrder.clone(db),
|
||||
RechargeTMallOrderFake: q.RechargeTMallOrderFake.clone(db),
|
||||
RechargeTMallOrderHistory: q.RechargeTMallOrderHistory.clone(db),
|
||||
RechargeTMallShop: q.RechargeTMallShop.clone(db),
|
||||
RechargeTMallShopHistory: q.RechargeTMallShopHistory.clone(db),
|
||||
RestrictClientAccessIPRelation: q.RestrictClientAccessIPRelation.clone(db),
|
||||
RestrictClientAccessRecord: q.RestrictClientAccessRecord.clone(db),
|
||||
RestrictIPOrderAccess: q.RestrictIPOrderAccess.clone(db),
|
||||
RestrictIPRecord: q.RestrictIPRecord.clone(db),
|
||||
RoadInfo: q.RoadInfo.clone(db),
|
||||
RoadPoolInfo: q.RoadPoolInfo.clone(db),
|
||||
RoleInfo: q.RoleInfo.clone(db),
|
||||
SchemaMigration: q.SchemaMigration.clone(db),
|
||||
SecondMenuInfo: q.SecondMenuInfo.clone(db),
|
||||
SysAuthRule: q.SysAuthRule.clone(db),
|
||||
SysCasbinRule: q.SysCasbinRule.clone(db),
|
||||
SysConfigDict: q.SysConfigDict.clone(db),
|
||||
SysRole: q.SysRole.clone(db),
|
||||
SysUser: q.SysUser.clone(db),
|
||||
SysUserConfigChannel: q.SysUserConfigChannel.clone(db),
|
||||
SysUserDeduction: q.SysUserDeduction.clone(db),
|
||||
SysUserLoginLog: q.SysUserLoginLog.clone(db),
|
||||
SysUserPayment: q.SysUserPayment.clone(db),
|
||||
SysUserPaymentRecord: q.SysUserPaymentRecord.clone(db),
|
||||
TaskOrderFake: q.TaskOrderFake.clone(db),
|
||||
UserInfo: q.UserInfo.clone(db),
|
||||
}
|
||||
}
|
||||
|
||||
func (q *Query) ReadDB() *Query {
|
||||
return q.ReplaceDB(q.db.Clauses(dbresolver.Read))
|
||||
}
|
||||
|
||||
func (q *Query) WriteDB() *Query {
|
||||
return q.ReplaceDB(q.db.Clauses(dbresolver.Write))
|
||||
}
|
||||
|
||||
func (q *Query) ReplaceDB(db *gorm.DB) *Query {
|
||||
return &Query{
|
||||
db: db,
|
||||
AccountHistoryInfo: q.AccountHistoryInfo.replaceDB(db),
|
||||
AccountInfo: q.AccountInfo.replaceDB(db),
|
||||
AgentInfo: q.AgentInfo.replaceDB(db),
|
||||
BankCardInfo: q.BankCardInfo.replaceDB(db),
|
||||
CardAppleAccountInfo: q.CardAppleAccountInfo.replaceDB(db),
|
||||
CardAppleAccountInfoHistory: q.CardAppleAccountInfoHistory.replaceDB(db),
|
||||
CardAppleHiddenSetting: q.CardAppleHiddenSetting.replaceDB(db),
|
||||
CardAppleHiddenSettingsRechargeInfo: q.CardAppleHiddenSettingsRechargeInfo.replaceDB(db),
|
||||
CardAppleHistoryInfo: q.CardAppleHistoryInfo.replaceDB(db),
|
||||
CardAppleRechargeInfo: q.CardAppleRechargeInfo.replaceDB(db),
|
||||
CardRedeemAccountDeduction: q.CardRedeemAccountDeduction.replaceDB(db),
|
||||
CardRedeemAccountGroup: q.CardRedeemAccountGroup.replaceDB(db),
|
||||
CardRedeemAccountHistory: q.CardRedeemAccountHistory.replaceDB(db),
|
||||
CardRedeemAccountInfo: q.CardRedeemAccountInfo.replaceDB(db),
|
||||
CardRedeemAccountSummary: q.CardRedeemAccountSummary.replaceDB(db),
|
||||
CardRedeemCookieInfo: q.CardRedeemCookieInfo.replaceDB(db),
|
||||
CardRedeemCookieOrder: q.CardRedeemCookieOrder.replaceDB(db),
|
||||
CardRedeemCookieOrderJd: q.CardRedeemCookieOrderJd.replaceDB(db),
|
||||
CardRedeemOrderHistory: q.CardRedeemOrderHistory.replaceDB(db),
|
||||
CardRedeemOrderInfo: q.CardRedeemOrderInfo.replaceDB(db),
|
||||
LegendAnyMoney: q.LegendAnyMoney.replaceDB(db),
|
||||
LegendArea: q.LegendArea.replaceDB(db),
|
||||
LegendFixMoney: q.LegendFixMoney.replaceDB(db),
|
||||
LegendFixPresent: q.LegendFixPresent.replaceDB(db),
|
||||
LegendGroup: q.LegendGroup.replaceDB(db),
|
||||
LegendScalePresent: q.LegendScalePresent.replaceDB(db),
|
||||
LegendScaleTemplate: q.LegendScaleTemplate.replaceDB(db),
|
||||
MenuInfo: q.MenuInfo.replaceDB(db),
|
||||
MerchantDeployInfo: q.MerchantDeployInfo.replaceDB(db),
|
||||
MerchantHiddenConfig: q.MerchantHiddenConfig.replaceDB(db),
|
||||
MerchantHiddenRecord: q.MerchantHiddenRecord.replaceDB(db),
|
||||
MerchantInfo: q.MerchantInfo.replaceDB(db),
|
||||
MerchantLoadInfo: q.MerchantLoadInfo.replaceDB(db),
|
||||
Migration: q.Migration.replaceDB(db),
|
||||
NotifyInfo: q.NotifyInfo.replaceDB(db),
|
||||
OrderInfo: q.OrderInfo.replaceDB(db),
|
||||
OrderProfitInfo: q.OrderProfitInfo.replaceDB(db),
|
||||
OrderSettleInfo: q.OrderSettleInfo.replaceDB(db),
|
||||
PayforInfo: q.PayforInfo.replaceDB(db),
|
||||
PowerInfo: q.PowerInfo.replaceDB(db),
|
||||
RechargeTMallAccount: q.RechargeTMallAccount.replaceDB(db),
|
||||
RechargeTMallOrder: q.RechargeTMallOrder.replaceDB(db),
|
||||
RechargeTMallOrderFake: q.RechargeTMallOrderFake.replaceDB(db),
|
||||
RechargeTMallOrderHistory: q.RechargeTMallOrderHistory.replaceDB(db),
|
||||
RechargeTMallShop: q.RechargeTMallShop.replaceDB(db),
|
||||
RechargeTMallShopHistory: q.RechargeTMallShopHistory.replaceDB(db),
|
||||
RestrictClientAccessIPRelation: q.RestrictClientAccessIPRelation.replaceDB(db),
|
||||
RestrictClientAccessRecord: q.RestrictClientAccessRecord.replaceDB(db),
|
||||
RestrictIPOrderAccess: q.RestrictIPOrderAccess.replaceDB(db),
|
||||
RestrictIPRecord: q.RestrictIPRecord.replaceDB(db),
|
||||
RoadInfo: q.RoadInfo.replaceDB(db),
|
||||
RoadPoolInfo: q.RoadPoolInfo.replaceDB(db),
|
||||
RoleInfo: q.RoleInfo.replaceDB(db),
|
||||
SchemaMigration: q.SchemaMigration.replaceDB(db),
|
||||
SecondMenuInfo: q.SecondMenuInfo.replaceDB(db),
|
||||
SysAuthRule: q.SysAuthRule.replaceDB(db),
|
||||
SysCasbinRule: q.SysCasbinRule.replaceDB(db),
|
||||
SysConfigDict: q.SysConfigDict.replaceDB(db),
|
||||
SysRole: q.SysRole.replaceDB(db),
|
||||
SysUser: q.SysUser.replaceDB(db),
|
||||
SysUserConfigChannel: q.SysUserConfigChannel.replaceDB(db),
|
||||
SysUserDeduction: q.SysUserDeduction.replaceDB(db),
|
||||
SysUserLoginLog: q.SysUserLoginLog.replaceDB(db),
|
||||
SysUserPayment: q.SysUserPayment.replaceDB(db),
|
||||
SysUserPaymentRecord: q.SysUserPaymentRecord.replaceDB(db),
|
||||
TaskOrderFake: q.TaskOrderFake.replaceDB(db),
|
||||
UserInfo: q.UserInfo.replaceDB(db),
|
||||
}
|
||||
}
|
||||
|
||||
type queryCtx struct {
|
||||
AccountHistoryInfo *accountHistoryInfoDo
|
||||
AccountInfo *accountInfoDo
|
||||
AgentInfo *agentInfoDo
|
||||
BankCardInfo *bankCardInfoDo
|
||||
CardAppleAccountInfo *cardAppleAccountInfoDo
|
||||
CardAppleAccountInfoHistory *cardAppleAccountInfoHistoryDo
|
||||
CardAppleHiddenSetting *cardAppleHiddenSettingDo
|
||||
CardAppleHiddenSettingsRechargeInfo *cardAppleHiddenSettingsRechargeInfoDo
|
||||
CardAppleHistoryInfo *cardAppleHistoryInfoDo
|
||||
CardAppleRechargeInfo *cardAppleRechargeInfoDo
|
||||
CardRedeemAccountDeduction *cardRedeemAccountDeductionDo
|
||||
CardRedeemAccountGroup *cardRedeemAccountGroupDo
|
||||
CardRedeemAccountHistory *cardRedeemAccountHistoryDo
|
||||
CardRedeemAccountInfo *cardRedeemAccountInfoDo
|
||||
CardRedeemAccountSummary *cardRedeemAccountSummaryDo
|
||||
CardRedeemCookieInfo *cardRedeemCookieInfoDo
|
||||
CardRedeemCookieOrder *cardRedeemCookieOrderDo
|
||||
CardRedeemCookieOrderJd *cardRedeemCookieOrderJdDo
|
||||
CardRedeemOrderHistory *cardRedeemOrderHistoryDo
|
||||
CardRedeemOrderInfo *cardRedeemOrderInfoDo
|
||||
LegendAnyMoney *legendAnyMoneyDo
|
||||
LegendArea *legendAreaDo
|
||||
LegendFixMoney *legendFixMoneyDo
|
||||
LegendFixPresent *legendFixPresentDo
|
||||
LegendGroup *legendGroupDo
|
||||
LegendScalePresent *legendScalePresentDo
|
||||
LegendScaleTemplate *legendScaleTemplateDo
|
||||
MenuInfo *menuInfoDo
|
||||
MerchantDeployInfo *merchantDeployInfoDo
|
||||
MerchantHiddenConfig *merchantHiddenConfigDo
|
||||
MerchantHiddenRecord *merchantHiddenRecordDo
|
||||
MerchantInfo *merchantInfoDo
|
||||
MerchantLoadInfo *merchantLoadInfoDo
|
||||
Migration *migrationDo
|
||||
NotifyInfo *notifyInfoDo
|
||||
OrderInfo *orderInfoDo
|
||||
OrderProfitInfo *orderProfitInfoDo
|
||||
OrderSettleInfo *orderSettleInfoDo
|
||||
PayforInfo *payforInfoDo
|
||||
PowerInfo *powerInfoDo
|
||||
RechargeTMallAccount *rechargeTMallAccountDo
|
||||
RechargeTMallOrder *rechargeTMallOrderDo
|
||||
RechargeTMallOrderFake *rechargeTMallOrderFakeDo
|
||||
RechargeTMallOrderHistory *rechargeTMallOrderHistoryDo
|
||||
RechargeTMallShop *rechargeTMallShopDo
|
||||
RechargeTMallShopHistory *rechargeTMallShopHistoryDo
|
||||
RestrictClientAccessIPRelation *restrictClientAccessIPRelationDo
|
||||
RestrictClientAccessRecord *restrictClientAccessRecordDo
|
||||
RestrictIPOrderAccess *restrictIPOrderAccessDo
|
||||
RestrictIPRecord *restrictIPRecordDo
|
||||
RoadInfo *roadInfoDo
|
||||
RoadPoolInfo *roadPoolInfoDo
|
||||
RoleInfo *roleInfoDo
|
||||
SchemaMigration *schemaMigrationDo
|
||||
SecondMenuInfo *secondMenuInfoDo
|
||||
SysAuthRule *sysAuthRuleDo
|
||||
SysCasbinRule *sysCasbinRuleDo
|
||||
SysConfigDict *sysConfigDictDo
|
||||
SysRole *sysRoleDo
|
||||
SysUser *sysUserDo
|
||||
SysUserConfigChannel *sysUserConfigChannelDo
|
||||
SysUserDeduction *sysUserDeductionDo
|
||||
SysUserLoginLog *sysUserLoginLogDo
|
||||
SysUserPayment *sysUserPaymentDo
|
||||
SysUserPaymentRecord *sysUserPaymentRecordDo
|
||||
TaskOrderFake *taskOrderFakeDo
|
||||
UserInfo *userInfoDo
|
||||
}
|
||||
|
||||
func (q *Query) WithContext(ctx context.Context) *queryCtx {
|
||||
return &queryCtx{
|
||||
AccountHistoryInfo: q.AccountHistoryInfo.WithContext(ctx),
|
||||
AccountInfo: q.AccountInfo.WithContext(ctx),
|
||||
AgentInfo: q.AgentInfo.WithContext(ctx),
|
||||
BankCardInfo: q.BankCardInfo.WithContext(ctx),
|
||||
CardAppleAccountInfo: q.CardAppleAccountInfo.WithContext(ctx),
|
||||
CardAppleAccountInfoHistory: q.CardAppleAccountInfoHistory.WithContext(ctx),
|
||||
CardAppleHiddenSetting: q.CardAppleHiddenSetting.WithContext(ctx),
|
||||
CardAppleHiddenSettingsRechargeInfo: q.CardAppleHiddenSettingsRechargeInfo.WithContext(ctx),
|
||||
CardAppleHistoryInfo: q.CardAppleHistoryInfo.WithContext(ctx),
|
||||
CardAppleRechargeInfo: q.CardAppleRechargeInfo.WithContext(ctx),
|
||||
CardRedeemAccountDeduction: q.CardRedeemAccountDeduction.WithContext(ctx),
|
||||
CardRedeemAccountGroup: q.CardRedeemAccountGroup.WithContext(ctx),
|
||||
CardRedeemAccountHistory: q.CardRedeemAccountHistory.WithContext(ctx),
|
||||
CardRedeemAccountInfo: q.CardRedeemAccountInfo.WithContext(ctx),
|
||||
CardRedeemAccountSummary: q.CardRedeemAccountSummary.WithContext(ctx),
|
||||
CardRedeemCookieInfo: q.CardRedeemCookieInfo.WithContext(ctx),
|
||||
CardRedeemCookieOrder: q.CardRedeemCookieOrder.WithContext(ctx),
|
||||
CardRedeemCookieOrderJd: q.CardRedeemCookieOrderJd.WithContext(ctx),
|
||||
CardRedeemOrderHistory: q.CardRedeemOrderHistory.WithContext(ctx),
|
||||
CardRedeemOrderInfo: q.CardRedeemOrderInfo.WithContext(ctx),
|
||||
LegendAnyMoney: q.LegendAnyMoney.WithContext(ctx),
|
||||
LegendArea: q.LegendArea.WithContext(ctx),
|
||||
LegendFixMoney: q.LegendFixMoney.WithContext(ctx),
|
||||
LegendFixPresent: q.LegendFixPresent.WithContext(ctx),
|
||||
LegendGroup: q.LegendGroup.WithContext(ctx),
|
||||
LegendScalePresent: q.LegendScalePresent.WithContext(ctx),
|
||||
LegendScaleTemplate: q.LegendScaleTemplate.WithContext(ctx),
|
||||
MenuInfo: q.MenuInfo.WithContext(ctx),
|
||||
MerchantDeployInfo: q.MerchantDeployInfo.WithContext(ctx),
|
||||
MerchantHiddenConfig: q.MerchantHiddenConfig.WithContext(ctx),
|
||||
MerchantHiddenRecord: q.MerchantHiddenRecord.WithContext(ctx),
|
||||
MerchantInfo: q.MerchantInfo.WithContext(ctx),
|
||||
MerchantLoadInfo: q.MerchantLoadInfo.WithContext(ctx),
|
||||
Migration: q.Migration.WithContext(ctx),
|
||||
NotifyInfo: q.NotifyInfo.WithContext(ctx),
|
||||
OrderInfo: q.OrderInfo.WithContext(ctx),
|
||||
OrderProfitInfo: q.OrderProfitInfo.WithContext(ctx),
|
||||
OrderSettleInfo: q.OrderSettleInfo.WithContext(ctx),
|
||||
PayforInfo: q.PayforInfo.WithContext(ctx),
|
||||
PowerInfo: q.PowerInfo.WithContext(ctx),
|
||||
RechargeTMallAccount: q.RechargeTMallAccount.WithContext(ctx),
|
||||
RechargeTMallOrder: q.RechargeTMallOrder.WithContext(ctx),
|
||||
RechargeTMallOrderFake: q.RechargeTMallOrderFake.WithContext(ctx),
|
||||
RechargeTMallOrderHistory: q.RechargeTMallOrderHistory.WithContext(ctx),
|
||||
RechargeTMallShop: q.RechargeTMallShop.WithContext(ctx),
|
||||
RechargeTMallShopHistory: q.RechargeTMallShopHistory.WithContext(ctx),
|
||||
RestrictClientAccessIPRelation: q.RestrictClientAccessIPRelation.WithContext(ctx),
|
||||
RestrictClientAccessRecord: q.RestrictClientAccessRecord.WithContext(ctx),
|
||||
RestrictIPOrderAccess: q.RestrictIPOrderAccess.WithContext(ctx),
|
||||
RestrictIPRecord: q.RestrictIPRecord.WithContext(ctx),
|
||||
RoadInfo: q.RoadInfo.WithContext(ctx),
|
||||
RoadPoolInfo: q.RoadPoolInfo.WithContext(ctx),
|
||||
RoleInfo: q.RoleInfo.WithContext(ctx),
|
||||
SchemaMigration: q.SchemaMigration.WithContext(ctx),
|
||||
SecondMenuInfo: q.SecondMenuInfo.WithContext(ctx),
|
||||
SysAuthRule: q.SysAuthRule.WithContext(ctx),
|
||||
SysCasbinRule: q.SysCasbinRule.WithContext(ctx),
|
||||
SysConfigDict: q.SysConfigDict.WithContext(ctx),
|
||||
SysRole: q.SysRole.WithContext(ctx),
|
||||
SysUser: q.SysUser.WithContext(ctx),
|
||||
SysUserConfigChannel: q.SysUserConfigChannel.WithContext(ctx),
|
||||
SysUserDeduction: q.SysUserDeduction.WithContext(ctx),
|
||||
SysUserLoginLog: q.SysUserLoginLog.WithContext(ctx),
|
||||
SysUserPayment: q.SysUserPayment.WithContext(ctx),
|
||||
SysUserPaymentRecord: q.SysUserPaymentRecord.WithContext(ctx),
|
||||
TaskOrderFake: q.TaskOrderFake.WithContext(ctx),
|
||||
UserInfo: q.UserInfo.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (q *Query) Transaction(fc func(tx *Query) error, opts ...*sql.TxOptions) error {
|
||||
return q.db.Transaction(func(tx *gorm.DB) error { return fc(q.clone(tx)) }, opts...)
|
||||
}
|
||||
|
||||
func (q *Query) Begin(opts ...*sql.TxOptions) *QueryTx {
|
||||
tx := q.db.Begin(opts...)
|
||||
return &QueryTx{Query: q.clone(tx), Error: tx.Error}
|
||||
}
|
||||
|
||||
type QueryTx struct {
|
||||
*Query
|
||||
Error error
|
||||
}
|
||||
|
||||
func (q *QueryTx) Commit() error {
|
||||
return q.db.Commit().Error
|
||||
}
|
||||
|
||||
func (q *QueryTx) Rollback() error {
|
||||
return q.db.Rollback().Error
|
||||
}
|
||||
|
||||
func (q *QueryTx) SavePoint(name string) error {
|
||||
return q.db.SavePoint(name).Error
|
||||
}
|
||||
|
||||
func (q *QueryTx) RollbackTo(name string) error {
|
||||
return q.db.RollbackTo(name).Error
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user