chore: 并入 iotlcm-openapi 历史到 openapi/(原提交 3b05d5a)

This commit is contained in:
MiFaZhan
2026-11-02 13:28:02 +08:00
484 changed files with 34732 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
# 统一使用 LF,避免跨平台协作时产生整文件 diff
* text=auto eol=lf
# 二进制文件不做行尾转换
*.png binary
*.jpg binary
*.gif binary
*.ico binary
*.woff binary
*.woff2 binary
*.ttf binary
*.pdf binary
*.exe binary
*.go linguist-language=Go
@@ -0,0 +1,64 @@
name: mirror-to-gitee
# 把本仓同步到 Gitee 企业仓 snowgoat/<同名仓库>。
# 触发:main 分支推送、v* tag 推送、手动;另有每日兜底重试。
on:
push:
branches:
- main
tags:
- 'v*'
schedule:
# Gitea Actions 的 cron 用 UTC:18:30 UTC = 次日 02:30 北京时间
- cron: '30 18 * * *'
workflow_dispatch:
concurrency:
group: mirror-${{ github.ref }}
cancel-in-progress: true
jobs:
mirror:
runs-on: host
steps:
- name: 同步到 Gitee
env:
SRC_TOKEN: ${{ secrets.SRC_GIT_TOKEN }}
DST_TOKEN: ${{ secrets.GITEE_TOKEN }}
DST_OWNER: ${{ secrets.GITEE_OWNER }}
DST_USER: ${{ secrets.GITEE_USER }}
REPO_NAME: ${{ github.event.repository.name }}
run: |
set -u
if [ -z "${REPO_NAME:-}" ]; then
echo "未取到仓库名,退出"; exit 1
fi
WORK=$(mktemp -d)
trap 'rm -rf "$WORK"' EXIT
echo "源:git.5iot.com/iotlcm-public/$REPO_NAME"
echo "目标:gitee.com/$DST_OWNER/$REPO_NAME"
git clone --mirror "https://jenkins:${SRC_TOKEN}@git.5iot.com/iotlcm-public/${REPO_NAME}.git" "$WORK/repo.git"
cd "$WORK/repo.git"
echo "本地 ref:$(git for-each-ref --format='%(refname:short)' | tr '\n' ' ')"
# Gitee 在推送密集时会返回 429 Pending queue overflowed / 408 Authorization server timeout,
# 属服务端限流,退避重试即可。
attempt=0
while [ "$attempt" -lt 5 ]; do
attempt=$((attempt + 1))
echo "----- 推送尝试 $attempt/5"
if git push --mirror "https://${DST_USER}:${DST_TOKEN}@gitee.com/${DST_OWNER}/${REPO_NAME}.git" 2>&1; then
echo "✅ 已同步到 Gitee"
exit 0
fi
wait_s=$((attempt * 30))
echo "推送失败,${wait_s}s 后重试"
sleep "$wait_s"
done
echo "❌ 连续 5 次推送失败,请检查 Gitee 状态或令牌"
exit 1
@@ -0,0 +1,80 @@
name: trigger-jenkins-oss
# 打 tag 时触发 Jenkins 构建开源镜像并推送到镜像仓库。
# 仅在 tag 推送时触发;main 分支的日常提交不触发。
on:
push:
tags:
- 'v*'
workflow_dispatch:
# 同一 ref 连续触发时取消旧任务,只跑最新的
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
trigger:
runs-on: host
steps:
- name: 触发 Jenkins 镜像构建
env:
JU: ${{ secrets.JENKINS_USER }}
JT: ${{ secrets.JENKINS_API_TOKEN }}
JURL: ${{ secrets.JENKINS_URL }}
JOB_PATH: ${{ secrets.JENKINS_JOB_PATH }}
REPO_NAME: ${{ github.event.repository.name }}
TAG_NAME: ${{ github.ref_name }}
run: |
set -eu
# 只有 tag 推送才构建;手动触发时按 tag 取,没有就退出
case "${GITHUB_REF:-}" in
refs/tags/v*) ;;
*)
if [ "${GITHUB_EVENT_NAME:-}" != "workflow_dispatch" ]; then
echo "非 tag 推送,跳过:${GITHUB_REF:-unknown}"
exit 0
fi
;;
esac
if [ -z "${TAG_NAME:-}" ]; then
echo "未取到 tag 名,退出"
exit 1
fi
# job 在 Jenkins 文件夹下的路径(组织密钥 JENKINS_JOB_PATH),
# 例如 job/iotlcm-opensrc/job/iotlcm-oss-build。
# 用密钥而非硬编码,Jenkins 里移动 job 时不用改 11 个仓。
JP="${JOB_PATH:-job/iotlcm-oss-build}"
echo "仓库:$REPO_NAME 版本:$TAG_NAME job:$JP"
WORK=$(mktemp -d)
trap 'rm -rf "$WORK"' EXIT
# 取 CSRF crumb
curl -s -c "$WORK/cj" -u "$JU:$JT" "$JURL/crumbIssuer/api/json" -o "$WORK/crumb.json"
CR=$(python3 -c "import json;print(json.load(open('$WORK/crumb.json'))['crumb'])")
# 触发参数化任务:SERVICES=仓库名,VERSION=tag
code=$(curl -s -o "$WORK/out" -w '%{http_code}' -X POST -b "$WORK/cj" -u "$JU:$JT" \
-H "Jenkins-Crumb: $CR" \
--data-urlencode "SERVICES=$REPO_NAME" \
--data-urlencode "VERSION=$TAG_NAME" \
--data-urlencode "FORCE=true" \
"$JURL/$JP/buildWithParameters")
echo "Jenkins 触发 HTTP $code"
if [ "$code" != "201" ] && [ "$code" != "200" ] && [ "$code" != "302" ] && [ "$code" != "303" ]; then
echo "触发失败:"
cat "$WORK/out"
exit 1
fi
LINK="$JURL/$JP/"
echo "=========================================="
echo "Jenkins 构建:$LINK"
echo "=========================================="
echo "::notice title=Jenkins 镜像构建::[$LINK]($LINK)"
+24
View File
@@ -0,0 +1,24 @@
.buildpath
.hgignore.swp
.project
.orig
.swp
.idea/
.settings/
.vscode/
bin/
**/.DS_Store
gf
main
main.exe
output/
manifest/output/
temp/
temp.yaml
bin
resource/log/
resource/public/
resource/template/*
!resource/template/.gitkeep
kilo.json
hack/config.yaml
+201
View File
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+7
View File
@@ -0,0 +1,7 @@
ROOT_DIR = $(shell pwd)
NAMESPACE = "default"
DEPLOY_NAME = "template-single"
DOCKER_NAME = "template-single"
include ./hack/hack-cli.mk
include ./hack/hack.mk
+4
View File
@@ -0,0 +1,4 @@
# GoFrame Template For SingleRepo
Quick Start:
- https://goframe.org/quick
+14
View File
@@ -0,0 +1,14 @@
package common
import (
"context"
"git.5iot.com/iotlcm-public/iotlcm-openapi/api/common/v1"
)
type ICommonV1 interface {
SimSubscribe(ctx context.Context, req *v1.SimSubscribeReq) (res *v1.SingleRenewRes, err error)
BatchSimSubscribe(ctx context.Context, req *v1.BatchSimSubscribeReq) (res *v1.RenewRes, err error)
SimTrafficCutoff(ctx context.Context, req *v1.SimTrafficCutoffReq) (res *v1.SingleTrafficCutoffRes, err error)
BatchSimTrafficCutoff(ctx context.Context, req *v1.BatchSimTrafficCutoffReq) (res *v1.TrafficCutoffConfigRes, err error)
}
+64
View File
@@ -0,0 +1,64 @@
package v1
import (
"github.com/gogf/gf/v2/frame/g"
"git.5iot.com/iotlcm-public/iotlcm-openapi/internal/model"
)
type SimSubscribeReq struct {
g.Meta `path:"/sim-subscribe" method:"POST" tags:"V3 Change API" summary:"Single SIM subscription renewal"`
AppId string `json:"appId" v:"required#appId is required"`
Iccid string `json:"iccid,omitempty"`
Msisdn string `json:"msisdn,omitempty"`
Imsi string `json:"imsi,omitempty"`
PackageId string `json:"packageId" v:"required#packageId is required"`
Validity int `json:"validity" v:"required|min:1#validity is required|validity must be greater than 0"`
Remark string `json:"remark,omitempty"`
}
type BatchSimSubscribeReq struct {
g.Meta `path:"/batch-sim-subscribe" method:"POST" tags:"V3 Change API" summary:"Batch SIM subscription renewal"`
AppId string `json:"appId" v:"required#appId is required"`
Cards []model.CommonRenewCard `json:"cards,omitempty"`
Iccid []string `json:"iccid,omitempty"`
PackageId string `json:"packageId" v:"required#packageId is required"`
Validity int `json:"validity" v:"required|min:1#validity is required|validity must be greater than 0"`
Remark string `json:"remark,omitempty"`
}
// RenewReq 历史批量续费兼容入口,与 /batch-sim-subscribe 共用 SubmitRenew 实现。
// 说明:g.Meta 的 deprecated 标签在 GoFrame v2.9.6 中不被解析,无任何运行时或文档生成效果,
// 不能替代对外废弃告知;对外说明见 openapi-docs「标准入口与兼容入口」一节。
type RenewReq struct {
g.Meta `path:"/renew" method:"POST" tags:"V3 Compatibility API" summary:"Deprecated compatibility endpoint; use /change/batch-sim-subscribe"`
model.CommonRenewParam
}
type RenewRes struct{ model.CommonRenewRes }
type SingleRenewRes struct{ model.CommonSingleRenewRes }
type TrafficCutoffConfigRes struct {
model.CommonTrafficCutoffConfigRes
}
type SingleTrafficCutoffRes struct {
model.CommonSingleTrafficCutoffRes
}
type SimTrafficCutoffReq struct {
g.Meta `path:"/sim-traffic-cutoff" method:"POST" tags:"V3 Change API" summary:"Single traffic cutoff configuration"`
model.CommonTrafficCutoffSingleParam
}
type BatchSimTrafficCutoffReq struct {
g.Meta `path:"/batch-sim-traffic-cutoff" method:"POST" tags:"V3 Change API" summary:"Batch traffic cutoff configuration"`
model.CommonTrafficCutoffConfigParam
}
// TrafficCutoffConfigReq 历史批量达量断网变更入口,已决定下线:不登记资源、不授权,
// 调用返回 10014。与 /batch-sim-traffic-cutoff 的参数类型与实现完全相同,客户应改用标准入口。
// 路由与结构体保留以便可逆恢复(取消登记 SQL 文末注释即可),故不删除代码。
// 说明:deprecated 标签在 GoFrame v2.9.6 中不被解析,无运行时效果。
type TrafficCutoffConfigReq struct {
g.Meta `path:"/traffic-cutoff-config" method:"POST" tags:"V3 Compatibility API" summary:"Deprecated write endpoint; use /change/batch-sim-traffic-cutoff"`
model.CommonTrafficCutoffConfigParam
}
+20
View File
@@ -0,0 +1,20 @@
// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package old_api
import (
"context"
"git.5iot.com/iotlcm-public/iotlcm-openapi/api/old_api/v1"
)
type IOldApiV1 interface {
CardInfo(ctx context.Context, req *v1.CardInfoReq) (res *v1.CardInfoRes, err error)
SimDataUsage(ctx context.Context, req *v1.SimDataUsageReq) (res *v1.SimDataUsageRes, err error)
SimDataUsageMonthly(ctx context.Context, req *v1.SimDataUsageMonthlyReq) (res *v1.SimDataUsageMonthlyRes, err error)
SimStatus(ctx context.Context, req *v1.SimStatusReq) (res *v1.SimStatusRes, err error)
SimSession(ctx context.Context, req *v1.SimSessionReq) (res *v1.SimSessionRes, err error)
SimCardInfoList(ctx context.Context, req *v1.SimCardInfoListReq) (res *v1.SimCardInfoListRes, err error)
}
+59
View File
@@ -0,0 +1,59 @@
package v1
import (
"git.5iot.com/iotlcm-public/iotlcm-openapi/internal/model"
"github.com/gogf/gf/v2/frame/g"
)
type CardInfoReq struct {
g.Meta `path:"/cardInfo" method:"POST" tags:"old_Sim" summary:"查询SIM信息"`
model.SimCardInfoInput
}
type CardInfoRes struct {
model.SimCardInfoOutput
}
type SimDataUsageReq struct {
g.Meta `path:"/simDataUsage" method:"POST" tags:"old_Sim" summary:"查询SIM账期用量"`
model.SimDataUsageOldInput
}
type SimDataUsageRes struct {
model.SimDataUsageOldOutput
}
type SimDataUsageMonthlyReq struct {
g.Meta `path:"/simDataUsageMonthly" method:"POST" tags:"old_Sim" summary:"查询SIM历史用量"`
model.SimDataUsageMonthlyOldInput
}
type SimDataUsageMonthlyRes struct {
model.SimDataUsageMonthlyOldOutput
}
type SimStatusReq struct {
g.Meta `path:"/simStatus" method:"POST" tags:"old_Sim" summary:"查询SIM状态"`
model.SimStatusOldInput
}
type SimStatusRes struct {
model.SimStatusOldOutput
}
type SimSessionReq struct {
g.Meta `path:"/simSession" method:"POST" tags:"old_Sim" summary:"查询SIM会话"`
model.SimStatusOnlineOldInput
}
type SimSessionRes struct {
model.SimStatusOnlineOldOutput
}
type SimCardInfoListReq struct {
g.Meta `path:"/queryCardInfoList" method:"POST" tags:"old_Sim" summary:"查询SIM卡列表"`
model.QueryCardInfoListInput
}
type SimCardInfoListRes = []model.QueryCardInfoListOutput
+26
View File
@@ -0,0 +1,26 @@
// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package query
import (
"context"
"git.5iot.com/iotlcm-public/iotlcm-openapi/api/query/v1"
)
type IQueryV1 interface {
QuerySimInfo(ctx context.Context, req *v1.QuerySimInfoReq) (res *v1.QuerySimInfoRes, err error)
QuerySimLimit(ctx context.Context, req *v1.QuerySimLimitReq) (res *v1.QuerySimLimitRes, err error)
QuerySimImei(ctx context.Context, req *v1.QuerySimImeiReq) (res *v1.QuerySimImeiRes, err error)
QuerySimUsage(ctx context.Context, req *v1.QuerySimUsageReq) (res *v1.QuerySimUsageRes, err error)
QuerySimStatus(ctx context.Context, req *v1.QuerySimStatusReq) (res *v1.QuerySimStatusRes, err error)
QueryTrafficCutoffConfig(ctx context.Context, req *v1.QueryTrafficCutoffConfigReq) (res *v1.QueryTrafficCutoffConfigRes, err error)
QueryBatchStatus(ctx context.Context, req *v1.QueryBatchStatusReq) (res *v1.QueryBatchStatusRes, err error)
QuerySimStatusBatch(ctx context.Context, req *v1.QuerySimStatusBatchReq) (res *v1.QuerySimStatusBatchRes, err error)
QuerySimUsageBatch(ctx context.Context, req *v1.QuerySimUsageBatchReq) (res *v1.QuerySimUsageBatchRes, err error)
QuerySimImeiBatch(ctx context.Context, req *v1.QuerySimImeiBatchReq) (res *v1.QuerySimImeiBatchRes, err error)
Token(ctx context.Context, req *v1.TokenReq) (res *v1.TokenRes, err error)
OperatorToken(ctx context.Context, req *v1.OperatorTokenReq) (res *v1.OperatorTokenRes, err error)
}
+97
View File
@@ -0,0 +1,97 @@
package v1
import (
"git.5iot.com/iotlcm-public/iotlcm-openapi/internal/model"
"github.com/gogf/gf/v2/frame/g"
)
type QuerySimInfoReq struct {
g.Meta `path:"/sim-info" method:"POST" tags:"V3查询接口" summary:"查询SIM信息"`
model.QuerySimInput
}
type QuerySimInfoRes struct {
model.QuerySimInfoOutput
}
type QuerySimLimitReq struct {
g.Meta `path:"/sim-limit" method:"POST" tags:"V3查询接口" summary:"查询SIM流量限制"`
model.QuerySimInput
}
type QuerySimLimitRes struct {
model.QuerySimLimitOutput
}
type QuerySimImeiReq struct {
g.Meta `path:"/sim-imei" method:"POST" tags:"V3查询接口" summary:"查询SIM IMEI"`
model.QuerySimInput
}
type QuerySimImeiRes struct {
model.QuerySimImeiOutput
}
type QuerySimUsageReq struct {
g.Meta `path:"/sim-usage" method:"POST" tags:"V3查询接口" summary:"查询SIM流量使用"`
model.QuerySimInput
}
type QuerySimUsageRes struct {
model.QuerySimUsageOutput
}
type QuerySimStatusReq struct {
g.Meta `path:"/sim-status" method:"POST" tags:"V3查询接口" summary:"查询SIM卡状态"`
model.QuerySimInput
}
type QuerySimStatusRes struct {
model.QuerySimCardStatusOutput
}
type QueryTrafficCutoffConfigReq struct {
g.Meta `path:"/traffic-cutoff-config" method:"POST" tags:"V3查询接口" summary:"批量查询达量断网配置"`
model.QueryTrafficCutoffConfigParam
}
type QueryTrafficCutoffConfigRes struct {
model.QueryTrafficCutoffConfigOutput
}
type QueryBatchStatusReq struct {
g.Meta `path:"/batch-status" method:"POST" tags:"V3查询接口" summary:"查询批次状态"`
model.QueryBatchStatusParam
}
type QueryBatchStatusRes struct {
model.QueryBatchStatusOutput
}
type QuerySimStatusBatchReq struct {
g.Meta `path:"/sim-status-batch" method:"POST" tags:"V3查询接口" summary:"批量查询SIM卡状态"`
model.QuerySimStatusBatchParam
}
type QuerySimStatusBatchRes struct {
model.QuerySimStatusBatchOutput
}
type QuerySimUsageBatchReq struct {
g.Meta `path:"/sim-usage-batch" method:"POST" tags:"V3查询接口" summary:"批量查询SIM流量使用"`
model.QuerySimUsageBatchParam
}
type QuerySimUsageBatchRes struct {
model.QuerySimUsageBatchOutput
}
type QuerySimImeiBatchReq struct {
g.Meta `path:"/sim-imei-batch" method:"POST" tags:"V3查询接口" summary:"批量查询SIM IMEI"`
model.QuerySimImeiBatchParam
}
type QuerySimImeiBatchRes struct {
model.QuerySimImeiBatchOutput
}
+25
View File
@@ -0,0 +1,25 @@
package v1
import (
"git.5iot.com/iotlcm-public/iotlcm-openapi/internal/model"
"github.com/gogf/gf/v2/frame/g"
)
// 获取Token
type TokenReq struct {
g.Meta `path:"/token" method:"POST" tags:"V3-Token获取" summary:"获取平台API Token"`
model.TokenInputApi
}
type TokenRes struct {
model.TokenOutputApi
}
// 共享运营商token
type OperatorTokenReq struct {
g.Meta `path:"/operator-token" method:"POST" tags:"共享Token" summary:"共享运营商Token(需传入appId+chanKey)"`
model.OperatorTokenInput
}
type OperatorTokenRes struct {
model.OperatorTokenOutput
}
+48
View File
@@ -0,0 +1,48 @@
ARG BASE_REGISTRY=docker.io/library
FROM ${BASE_REGISTRY}/golang:1.25-alpine AS builder
LABEL maintainer="iotlcm-openapi"
ARG GOPROXY=https://goproxy.cn,direct
ENV GOPROXY=${GOPROXY} \
GOSUMDB=off
WORKDIR /app
ENV GO111MODULE=on \
CGO_ENABLED=0 \
GOOS=linux \
GOARCH=amd64
COPY go.mod go.sum ./
RUN go mod download || (go clean -modcache && go mod download)
ARG BuildVersion
ARG BuildTime
ARG CommitID
COPY . .
RUN go build -trimpath -ldflags="-s -w -X main.BuildVersion=${BuildVersion} -X main.BuildTime=${BuildTime} -X main.CommitID=${CommitID}" -o /app/bin/iotlcm-openapi .
FROM ${BASE_REGISTRY}/alpine:3.23 AS alpine
LABEL maintainer="iotlcm-openapi"
ARG ALPINE_MIRROR=mirrors.aliyun.com
RUN sed -i "s|dl-cdn.alpinelinux.org|${ALPINE_MIRROR}|g" /etc/apk/repositories && \
apk add --no-cache ca-certificates tzdata && \
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo "Asia/Shanghai" > /etc/timezone
ENV TZ=Asia/Shanghai \
WORKDIR=/app
WORKDIR $WORKDIR
COPY --from=builder /app/bin/iotlcm-openapi $WORKDIR/main
COPY --from=builder /app/resource $WORKDIR/resource
COPY --from=builder /app/manifest/i18n $WORKDIR/manifest/i18n
COPY --from=builder /app/build/config.example.yaml $WORKDIR/config/config.yaml
RUN mkdir -p $WORKDIR/config
RUN chmod +x $WORKDIR/main
EXPOSE 8000
CMD ["./main"]
+73
View File
@@ -0,0 +1,73 @@
system:
name: "IotLCM-OpenAPI"
version: "1.0"
description: "IotLCM OpenAPI Service"
gfmode: "dev"
server:
address: ":8000"
openapiPath: "/api.json"
swaggerPath: "/swagger"
maxHeaderBytes: "20KB"
clientMaxBodySize: "200MB"
readTimeout: "20m"
writeTimeout: "20m"
logger:
path: "/app/logs"
file: "{Y-m-d-H}.log"
level: "dev"
timeFormat: "2006-01-02T15:04:05"
stdout: true
header: true
jwt:
signingKey: "${JWT_SIGNING_KEY}"
expiresTime: "7d"
bufferTime: "1d"
issuer: "iotlcm"
database:
logger:
path: "/app/logs/sql"
level: "all"
stdout: true
default:
link: "${DB_DSN}"
debug: true
charset: "utf8mb4"
dryRun: false
maxIdle: 30
maxOpen: 100
maxLifetime: 120
cache:
adapter: "redis"
fileDir: "resource/cache"
redis:
default:
mode: "single"
sentinelMasterName: "iotlcm-master"
address: "127.0.0.1:6379"
db: 0
pass: "${SERVICE_PASSWORD}"
minIdle: 5
maxIdle: 30
maxActive: 5000
idleTimeout: "60s"
ClientName: "OpenAPICache"
router:
exceptLogin:
- /openapi/v3/query/token
- /openapi/v3/query/operator-token
upstream:
proxy:
address: "localhost:8510"
timeout: "10s"
rabbitmq:
enabled: true
dsn: "${SERVICE_DSN}"
+65
View File
@@ -0,0 +1,65 @@
module git.5iot.com/iotlcm-public/iotlcm-openapi
go 1.23.0
toolchain go1.23.5
require (
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.9.0
github.com/gogf/gf/contrib/drivers/sqlite/v2 v2.9.6
github.com/gogf/gf/contrib/nosql/redis/v2 v2.9.0
github.com/gogf/gf/v2 v2.9.6
github.com/golang-jwt/jwt/v4 v4.5.2
github.com/google/uuid v1.6.0
github.com/mileusna/useragent v1.3.5
github.com/rabbitmq/amqp091-go v1.10.0
github.com/redis/go-redis/v9 v9.7.0
github.com/xuri/excelize/v2 v2.9.0
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394
)
require (
github.com/BurntSushi/toml v1.5.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/emirpasic/gods/v2 v2.0.0-alpha // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/glebarez/go-sqlite v1.21.2 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-sql-driver/mysql v1.7.1 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
github.com/magiconair/properties v1.8.10 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/olekukonko/errors v1.1.0 // indirect
github.com/olekukonko/ll v0.0.9 // indirect
github.com/olekukonko/tablewriter v1.1.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/richardlehane/mscfb v1.0.4 // indirect
github.com/richardlehane/msoleps v1.0.4 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/xuri/efp v0.0.0-20240408161823-9ad904a10d6d // indirect
github.com/xuri/nfp v0.0.0-20240318013403-ab9948c2c4a7 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/otel v1.38.0 // indirect
go.opentelemetry.io/otel/metric v1.38.0 // indirect
go.opentelemetry.io/otel/sdk v1.38.0 // indirect
go.opentelemetry.io/otel/trace v1.38.0 // indirect
golang.org/x/crypto v0.38.0 // indirect
golang.org/x/image v0.23.0 // indirect
golang.org/x/net v0.40.0 // indirect
golang.org/x/sys v0.35.0 // indirect
golang.org/x/text v0.25.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
modernc.org/libc v1.22.5 // indirect
modernc.org/mathutil v1.5.0 // indirect
modernc.org/memory v1.5.0 // indirect
modernc.org/sqlite v1.23.1 // indirect
)
+142
View File
@@ -0,0 +1,142 @@
github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg=
github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c=
github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
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/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/emirpasic/gods/v2 v2.0.0-alpha h1:dwFlh8pBg1VMOXWGipNMRt8v96dKAIvBehtCt6OtunU=
github.com/emirpasic/gods/v2 v2.0.0-alpha/go.mod h1:W0y4M2dtBB9U5z3YlghmpuUhiaZT2h6yoeE+C1sCp6A=
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
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/glebarez/go-sqlite v1.21.2 h1:3a6LFC4sKahUunAmynQKLZceZCOzUthkRkEAl9gAXWo=
github.com/glebarez/go-sqlite v1.21.2/go.mod h1:sfxdZyhQjTM2Wry3gVYWaW072Ri1WMdWJi0k6+3382k=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.9.0 h1:1f7EeD0lfPHoXfaJDSL7cxRcSRelbsAKgF3MGXY+Uyo=
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.9.0/go.mod h1:tToO1PjGkLIR+9DbJ0wrKicYma0H/EUHXOpwel6Dw+0=
github.com/gogf/gf/contrib/drivers/sqlite/v2 v2.9.6 h1:3QZvWIlz3dLjNELQU+5ZZZWuzEx9gsRFLU+qIKVUG6M=
github.com/gogf/gf/contrib/drivers/sqlite/v2 v2.9.6/go.mod h1:7EEAe8UYI5dLeuwCWN3HgC62OhjIYbkynaoavw1U/k4=
github.com/gogf/gf/contrib/nosql/redis/v2 v2.9.0 h1:EEZqu1PNRSmm+7Cqm9A/8+ObgfbMzhE1ps9Z3LD7HgM=
github.com/gogf/gf/contrib/nosql/redis/v2 v2.9.0/go.mod h1:LHrxY+2IzNTHVTPG/s5yaz1VmXbj+CQ7Hr5SeVkHiTw=
github.com/gogf/gf/v2 v2.9.6 h1:fQ6uPtS1Ra8qY+OuzPPZTlgksJ4eOXmTZ1/a2l3Idog=
github.com/gogf/gf/v2 v2.9.6/go.mod h1:Svl1N+E8G/QshU2DUbh/3J/AJauqCgUnxHurXWR4Qx0=
github.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXeUI=
github.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ=
github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo=
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/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grokify/html-strip-tags-go v0.1.0 h1:03UrQLjAny8xci+R+qjCce/MYnpNXCtgzltlQbOBae4=
github.com/grokify/html-strip-tags-go v0.1.0/go.mod h1:ZdzgfHEzAfz9X6Xe5eBLVblWIxXfYSQ40S/VKrAOGpc=
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/magiconair/properties v1.8.10 h1:s31yESBquKXCV9a/ScB3ESkOjUYYv+X0rg8SYxI99mE=
github.com/magiconair/properties v1.8.10/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mileusna/useragent v1.3.5 h1:SJM5NzBmh/hO+4LGeATKpaEX9+b4vcGg2qXGLiNGDws=
github.com/mileusna/useragent v1.3.5/go.mod h1:3d8TOmwL/5I8pJjyVDteHtgDGcefrFUX4ccGOMKNYYc=
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
github.com/olekukonko/errors v1.1.0 h1:RNuGIh15QdDenh+hNvKrJkmxxjV4hcS50Db478Ou5sM=
github.com/olekukonko/errors v1.1.0/go.mod h1:ppzxA5jBKcO1vIpCXQ9ZqgDh8iwODz6OXIGKU8r5m4Y=
github.com/olekukonko/ll v0.0.9 h1:Y+1YqDfVkqMWuEQMclsF9HUR5+a82+dxJuL1HHSRpxI=
github.com/olekukonko/ll v0.0.9/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g=
github.com/olekukonko/tablewriter v1.1.0 h1:N0LHrshF4T39KvI96fn6GT8HEjXRXYNDrDjKFDB7RIY=
github.com/olekukonko/tablewriter v1.1.0/go.mod h1:5c+EBPeSqvXnLLgkm9isDdzR3wjfBkHR9Nhfp3NWrzo=
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/rabbitmq/amqp091-go v1.10.0 h1:STpn5XsHlHGcecLmMFCtg7mqq0RnD+zFr4uzukfVhBw=
github.com/rabbitmq/amqp091-go v1.10.0/go.mod h1:Hy4jKW5kQART1u+JkDTF9YYOQUHXqMuhrgxOEeS7G4o=
github.com/redis/go-redis/v9 v9.7.0 h1:HhLSs+B6O021gwzl+locl0zEDnyNkxMtf/Z3NNBMa9E=
github.com/redis/go-redis/v9 v9.7.0/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw=
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/richardlehane/mscfb v1.0.4 h1:WULscsljNPConisD5hR0+OyZjwK46Pfyr6mPu5ZawpM=
github.com/richardlehane/mscfb v1.0.4/go.mod h1:YzVpcZg9czvAuhk9T+a3avCpcFPMUWm7gK3DypaEsUk=
github.com/richardlehane/msoleps v1.0.1/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg=
github.com/richardlehane/msoleps v1.0.4 h1:WuESlvhX3gH2IHcd8UqyCuFY5yiq/GR/yqaSM/9/g00=
github.com/richardlehane/msoleps v1.0.4/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/xuri/efp v0.0.0-20240408161823-9ad904a10d6d h1:llb0neMWDQe87IzJLS4Ci7psK/lVsjIS2otl+1WyRyY=
github.com/xuri/efp v0.0.0-20240408161823-9ad904a10d6d/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI=
github.com/xuri/excelize/v2 v2.9.0 h1:1tgOaEq92IOEumR1/JfYS/eR0KHOCsRv/rYXXh6YJQE=
github.com/xuri/excelize/v2 v2.9.0/go.mod h1:uqey4QBZ9gdMeWApPLdhm9x+9o2lq4iVmjiLfBS5hdE=
github.com/xuri/nfp v0.0.0-20240318013403-ab9948c2c4a7 h1:hPVCafDV85blFTabnqKgNhDCkJX25eik94Si9cTER4A=
github.com/xuri/nfp v0.0.0-20240318013403-ab9948c2c4a7/go.mod h1:WwHg+CVyzlv/TX9xqBFXEZAuxOPxn2k1GNHwG41IIUQ=
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=
go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM=
go.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA=
go.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI=
go.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E=
go.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg=
go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM=
go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA=
go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE=
go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8=
golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw=
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 h1:nDVHiLt8aIbd/VzvPWN6kSOPE7+F/fNFDSXLVYkE/Iw=
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394/go.mod h1:sIifuuw/Yco/y6yb6+bDNfyeQ/MdPUy/hKEMYQV17cM=
golang.org/x/image v0.23.0 h1:HseQ7c2OpPKTPVzNjG5fwJsOTCiiwS4QdsYi5XU6H68=
golang.org/x/image v0.23.0/go.mod h1:wJJBTdLfCCf3tiHa1fNxpZmUI4mmoZvwMCPP0ddoNKY=
golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY=
golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4=
golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
modernc.org/libc v1.22.5 h1:91BNch/e5B0uPbJFgqbxXuOnxBQjlS//icfQEGmvyjE=
modernc.org/libc v1.22.5/go.mod h1:jj+Z7dTNX8fBScMVNRAYZ/jF91K8fdT2hYMThc3YjBY=
modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ=
modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
modernc.org/memory v1.5.0 h1:N+/8c5rE6EqugZwHii4IFsaJ7MUhoWX07J5tC/iI5Ds=
modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU=
modernc.org/sqlite v1.23.1 h1:nrSBg4aRQQwq59JpvGEQ15tNxoO5pX/kUjcRNwSAGQM=
modernc.org/sqlite v1.23.1/go.mod h1:OrDj17Mggn6MhE+iPbBNf7RGKODDE9NFT0f3EwDzJqk=
+18
View File
@@ -0,0 +1,18 @@
# Install/Update to the latest CLI tool.
.PHONY: cli
cli:
@set -e; \
echo "go install github.com/gogf/gf/cmd/gf/v2@latest"; \
go install github.com/gogf/gf/cmd/gf/v2@latest; \
echo "GoFame CLI installed successfully!"
# Check and install CLI tool.
.PHONY: cli.install
cli.install:
@set -e; \
gf -v > /dev/null 2>&1 || if [[ "$?" -ne "0" ]]; then \
echo "GoFame CLI is not installed, start proceeding auto installation..."; \
make cli; \
fi;
+75
View File
@@ -0,0 +1,75 @@
.DEFAULT_GOAL := build
# Update GoFrame and its CLI to latest stable version.
.PHONY: up
up: cli.install
@gf up -a
# Build binary using configuration from hack/config.yaml.
.PHONY: build
build: cli.install
@gf build -ew
# Parse api and generate controller/sdk.
.PHONY: ctrl
ctrl: cli.install
@gf gen ctrl
# Generate Go files for DAO/DO/Entity.
.PHONY: dao
dao: cli.install
@gf gen dao
# Parse current project go files and generate enums go file.
.PHONY: enums
enums: cli.install
@gf gen enums
# Generate Go files for Service.
.PHONY: service
service: cli.install
@gf gen service
# Build docker image.
.PHONY: image
image: cli.install
$(eval _TAG = $(shell git rev-parse --short HEAD))
ifneq (, $(shell git status --porcelain 2>/dev/null))
$(eval _TAG = $(_TAG).dirty)
endif
$(eval _TAG = $(if ${TAG}, ${TAG}, $(_TAG)))
$(eval _PUSH = $(if ${PUSH}, ${PUSH}, ))
@gf docker ${_PUSH} -tn $(DOCKER_NAME):${_TAG};
# Build docker image and automatically push to docker repo.
.PHONY: image.push
image.push: cli.install
@make image PUSH=-p;
# Deploy image and yaml to current kubectl environment.
.PHONY: deploy
deploy: cli.install
$(eval _TAG = $(if ${TAG}, ${TAG}, develop))
@set -e; \
mkdir -p $(ROOT_DIR)/temp/kustomize;\
cd $(ROOT_DIR)/manifest/deploy/kustomize/overlays/${_ENV};\
kustomize build > $(ROOT_DIR)/temp/kustomize.yaml;\
kubectl apply -f $(ROOT_DIR)/temp/kustomize.yaml; \
if [ $(DEPLOY_NAME) != "" ]; then \
kubectl patch -n $(NAMESPACE) deployment/$(DEPLOY_NAME) -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"$(shell date +%s)\"}}}}}"; \
fi;
# Parsing protobuf files and generating go files.
.PHONY: pb
pb: cli.install
@gf gen pb
# Generate protobuf files for database tables.
.PHONY: pbentity
pbentity: cli.install
@gf gen pbentity
+65
View File
@@ -0,0 +1,65 @@
package cmd
import (
"context"
"errors"
_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
_ "github.com/gogf/gf/contrib/drivers/sqlite/v2"
_ "github.com/gogf/gf/contrib/nosql/redis/v2"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gcmd"
"github.com/gogf/gf/v2/os/gtime"
"github.com/gogf/gf/v2/util/gmode"
"git.5iot.com/iotlcm-public/iotlcm-openapi/internal/library/cache"
"git.5iot.com/iotlcm-public/iotlcm-openapi/internal/library/rabbitmq"
_ "git.5iot.com/iotlcm-public/iotlcm-openapi/internal/logic"
"git.5iot.com/iotlcm-public/iotlcm-openapi/internal/router"
)
var (
Main = gcmd.Command{
Name: "main",
Usage: "main",
Brief: "start http server",
Func: func(ctx context.Context, parser *gcmd.Parser) (err error) {
if err = systemInit(ctx); err != nil {
return err
}
defer func() { _ = rabbitmq.Close() }()
s := g.Server()
s.SetDumpRouterMap(true)
router.InitRouter(ctx, s)
s.Run()
return nil
},
}
)
func systemInit(ctx context.Context) error {
if err := g.DB().PingMaster(); err != nil {
return errors.New("connect database failed")
}
setGFMode(ctx)
if err := gtime.SetTimeZone("Asia/Shanghai"); err != nil {
return err
}
cache.SetAdapter(ctx)
return nil
}
func setGFMode(ctx context.Context) {
gfmode := g.Cfg().MustGet(ctx, "system.gfmode").String()
if gfmode == "" {
gfmode = gmode.NOT_SET
}
for _, mode := range []string{gmode.DEVELOP, gmode.TESTING, gmode.STAGING, gmode.PRODUCT} {
if mode == gfmode {
gmode.Set(mode)
return
}
}
}
+181
View File
@@ -0,0 +1,181 @@
package consts
const (
// 批次异步状态 batch_async_status
BatchAsyncStatusCreated = 0 // 已创建
BatchAsyncStatusPending = 1 // 待处理
BatchAsyncStatusProcessing = 2 // 处理中
BatchAsyncStatusSuccess = 3 // 成功
BatchAsyncStatusFailed = 4 // 失败
BatchAsyncStatusPartialSuccess = 5 // 部分成功
)
const (
// 批次运行结果 run_result
BatchRunResultPending = 0 // 待运行
BatchRunResultRunning = 1 // 运行中
BatchRunResultSuccess = 2 // 成功
BatchRunResultFailed = 3 // 失败
BatchRunResultPartialSuccess = 4 // 部分成功
)
const (
// 批次业务状态 batch_status
BatchStatusNormal = 0 // 正常
BatchStatusAbandoned = 1 // 废弃
)
const (
// 批次明细状态 detail_status
BatchDetailStatusPending = 0 // 待处理
BatchDetailStatusRunning = 1 // 处理中
BatchDetailStatusSuccess = 2 // 成功
BatchDetailStatusFailed = 3 // 失败
)
const (
BatchSourceTypeBatchSelect = 0
BatchSourceTypeRange = 1
BatchSourceTypeBatchInput = 2
BatchSourceTypeFile = 3
)
const (
// 通用批次类型 1-99
BatchTypeInbound = 1 // 入库
BatchTypeOutbound = 2 // 出库
BatchTypeAllocate = 3 // 划拨
BatchTypePrepare = 4 // 预处理
// 卡业务专属批次类型 101-199
BatchTypeRenew = 101 // 卡续费
BatchTypeChange = 102 // 卡变更
BatchTypeStart = 103 // 卡开机
BatchTypeStop = 104 // 卡停机
BatchTypeRestart = 105 // 卡停复机
BatchTypeCancel = 106 // 卡销户
BatchTypeDataCut = 107 // 卡达量断网
BatchTypeUnsub = 108 // 卡退订
BatchTypeDataStart = 109 // 数据服务开通
BatchTypeDataStop = 110 // 数据服务停用
)
const (
// 通用批次编号前缀
BatchNoPrefixInbound = "IN"
BatchNoPrefixOutbound = "OUT"
BatchNoPrefixAllocate = "ALC"
// 卡业务专属批次编号前缀
BatchNoPrefixRenew = "REN"
BatchNoPrefixChange = "CHG"
BatchNoPrefixStart = "STR" // 开机
BatchNoPrefixStop = "STP" // 停机
BatchNoPrefixRestart = "RST" // 停复机
BatchNoPrefixCancel = "CAN" // 销户
BatchNoPrefixDataCut = "DCT" // 达量断网
BatchNoPrefixUnsub = "UNS" // 退订
BatchNoPrefixDataStart = "DOP" // 数据服务开通
BatchNoPrefixDataStop = "DST" // 数据服务停用
)
const (
BlankOutStatusYes = 0
BlankOutStatusNo = 1
)
const (
DownloadStatusPending = 0
DownloadStatusGenerated = 1
DownloadStatusRunning = 2
DownloadStatusFailed = 3
)
const (
ResourceTypeExcel = 1
ResourceExportSceneInbound = 1
ResourceExportSceneOutbound = 2
ResourceExportSceneAllocate = 3
ResourceExportSceneRenew = 101
ResourceExportSceneChange = 102
ResourceExportSceneUnsub = 108
ResourceExportSceneDataStart = 109
ResourceExportSceneDataStop = 110
)
const (
ImportStatusSuccess = "success"
ImportStatusFailed = "failed"
)
const (
ResourceBatchDownloadTaskSimCardInbound = "卡入库结果"
ResourceBatchDownloadTaskSimCardOutbound = "卡出库结果"
ResourceBatchDownloadTaskSimCardRenew = "卡续费结果"
ResourceBatchDownloadTaskSimCardChange = "卡变更套餐结果"
ResourceBatchDownloadTaskSimCardUnsub = "卡退订结果"
SimCardInboundMaxFileSize = 50 << 20
SimCardInboundSubDirImportInput = "sim-card-inbound/import-input"
SimCardInboundDefaultInputInlineMaxRows = 1000
SimCardOutboundMaxFileSize = 50 << 20
SimCardRenewMaxFileSize = 50 << 20
SimCardChangeMaxFileSize = 50 << 20
SimCardUnsubMaxFileSize = 50 << 20
SimCardInboundSubDirImportExcel = "sim-card-inbound/import"
SimCardInboundSubDirResultExcel = "sim-card-inbound/result"
SimCardOutboundSubDirImportExcel = "sim-card-outbound/import"
SimCardOutboundSubDirResultExcel = "sim-card-outbound/result"
SimCardRenewSubDirImportExcel = "sim-card-renew/import"
SimCardRenewSubDirResultExcel = "sim-card-renew/result"
SimCardChangeSubDirImportExcel = "sim-card-change/import"
SimCardChangeSubDirResultExcel = "sim-card-change/result"
SimCardUnsubSubDirImportExcel = "sim-card-unsub/import"
SimCardUnsubSubDirResultExcel = "sim-card-unsub/result"
SimCardDataStartMaxFileSize = 50 << 20
SimCardDataStopMaxFileSize = 50 << 20
SimCardDataStartSubDirImportExcel = "sim-card-data-start/import"
SimCardDataStartSubDirResultExcel = "sim-card-data-start/result"
SimCardDataStopSubDirImportExcel = "sim-card-data-stop/import"
SimCardDataStopSubDirResultExcel = "sim-card-data-stop/result"
)
const (
OrderTypeCardSubscribe = 1
OrderStatusCompleted = 5
CustomerTypeAgent = 1
PayTypeOffline = 3
PayStatusPaid = 2
ProductTypeCard = 1
PayModeYearMonth = 1
PackageBusinessTypeSubscribe = 0
OrderReturnStatusNone = 0
OrderReturnStatusPending = 1
OrderReturnStatusRunning = 2
OrderReturnStatusPartial = 3
OrderReturnStatusSuccess = 4
)
const (
PackageStatusNone = 0
PackageStatusPending = 1
PackageStatusEffective = 2
PackageStatusExpired = 3
)
const (
EffectiveStatusPending = 0
EffectiveStatusEffective = 1
EffectiveStatusExpired = 2
EffectiveStatusTerminated = 3
EffectiveStatusVoided = 4
)
+12
View File
@@ -0,0 +1,12 @@
// Package consts 定义缓存键模板。
package consts
const (
KeySysAuthToken = "login:%d:%s" // 系统认证token缓存 login:{userId}:{uuid}
KeySysAuthTokenReject = "login_reject:%d:%s:" // 系统认证token拒绝缓存 login_reject:{userId}:{uuid}
KeyApiAuthToken = "api:auth:token:%s" // 接口认证长令牌缓存 api:auth:token:{uuid}
KeyApiAuthActiveToken = "api:auth:active:%d" // 接口认证当前令牌索引 api:auth:active:{deptId}
KeyLoginScanWechat = "login:scan:wechat:%d" // 系统二维码登录缓存 hash Key:SceneId field:tempUserId value:QrcodeCacheModel
KeyUserBindWechat = "user:bind:wechat:%d" // 系统二维码绑定缓存 hash Key:SceneId field:userId value:QrcodeCacheModel
KeyUserMfaCode = "user:mfa:%d" // 用户mfa验证码缓存 user:mfa:{uuid}
)
+43
View File
@@ -0,0 +1,43 @@
// Package consts
// @Link https://github.com/xiujiecn/xiu-admin
// @Copyright Copyright (c) 2025 LiXiujie
// @Author Lxj <xxx@example.com>
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
package consts
import "github.com/gogf/gf/v2/errors/gcode"
var (
// 账号不存在
CodeUserNotFound = gcode.New(10001, "账号不存在", nil)
// 账号已删除
CodeUserDeleted = gcode.New(10002, "账号已删除", nil)
// 密码错误
CodeUserPasswordError = gcode.New(10003, "密码错误", nil)
// 账号已禁用
CodeUserDisabled = gcode.New(10004, "账号已禁用", nil)
// 账号已锁定
CodeUserLocked = gcode.New(10005, "账号已锁定", nil)
// 账号已过期
CodeUserExpired = gcode.New(10006, "账号已过期", nil)
// 验证码错误
CodeCaptchaError = gcode.New(10007, "验证码错误", nil)
// 用户名已存在
CodeUserExists = gcode.New(10008, "用户名已存在", nil)
// 部门不存在
CodeDeptNotFound = gcode.New(10009, "部门不存在", nil)
// 手机号已存在
CodePhoneExists = gcode.New(10010, "手机号已存在", nil)
// 邮箱已存在
CodeEmailExists = gcode.New(10011, "邮箱已存在", nil)
// 登录已过期
CodeLoginExpired = gcode.New(10012, "登录已过期", nil)
// 部门下有子部门,不能删除
CodeDeptHasSub = gcode.New(10013, "部门下有子部门,不能删除", nil)
// 没有权限(业务判定:资源未登记、资源停用、账号不可用或未授权)
CodeNoPermission = gcode.New(10014, "没有权限", nil)
// 无效Token
CodeInvalidToken = gcode.New(10015, "无效Token", nil)
// 权限校验失败(系统侧故障:权限数据查询异常,区别于 10014 无权限,避免误判为授权问题)
CodePermissionCheckFailed = gcode.New(10016, "权限校验失败", nil)
)
+21
View File
@@ -0,0 +1,21 @@
// Package consts
// @Link https://github.com/xiujiecn/xiu-admin
// @Copyright Copyright (c) 2025 LiXiujie
// @Author Lxj <xxx@example.com>
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
package consts
const (
ConfigOssUrlPath = "sys.oss.urlPath" // 上传文件Url路径 "http://ab.com/" 或 "/" 或 "resource/upload|http://ab.com/upload"
ConfigOssFileTypeKey = "sys.oss.fileType" // 上传文件类型
ConfigOssImgTypeKey = "sys.oss.imgType" // 上传图片类型
ConfigOssFileSizeKey = "sys.oss.fileSize" // 上传文件大小
ConfigOssImgSizeKey = "sys.oss.imgSize" // 上传图片大小
ConfigOnlineForceLogout = "sys.online.forceLogout" // 在线用户强制退出
ConfigOssNewFileTypePath = "sys.oss.newFileTypePath.%d" // 上传文件类型路径 ${newFileType}
)
const (
ConfigOnlineForceLogoutTrue = "true" // 在线用户强制退出
ConfigOnlineForceLogoutFalse = "false" // 在线用户强制退出
)
+10
View File
@@ -0,0 +1,10 @@
// Package consts
// @Link https://github.com/xiujiecn/xiu-admin
// @Copyright Copyright (c) 2025 LiXiujie
// @Author Lxj <xxx@example.com>
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
package consts
const (
ContextKey = "ContextKey" // 上下文变量存储键名,前后端系统共享
)
+6
View File
@@ -0,0 +1,6 @@
package consts
const (
DBNameDefault = "default"
DBNameMemory = "memorydb"
)
+55
View File
@@ -0,0 +1,55 @@
// Package consts
// @Link https://github.com/xiujiecn/xiu-admin
// @Copyright Copyright (c) 2025 LiXiujie
// @Author Lxj <xxx@example.com>
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
package consts
const (
EventKeyServerClose = "server_close" // 服务关闭 args=[]
)
const (
EventKeyUserLogin = "user_login" // 用户登录 args=[uid,]
EventKeyUserLogout = "user_logout" // 用户退出 args=[uid,]
EventKeyUserCreate = "user_create" // 用户创建 args=[uid,]
EventKeyUserDelete = "user_delete" // 用户删除 args=[uidArray,]
EventKeyUserUpdate = "user_update" // 用户更新 args=[uid,]
)
const (
EventKeyDBSysConfigUpdate = "db.sys_config_update" // 系统配置创建更新删除 args=[configId, tenantId,key?]
EventKeyDBSysConfigCreate = "db.sys_config_create" // 系统配置创建 args=[configId, tenantId,key?]
EventKeyDBSysConfigDelete = "db.sys_config_delete" // 系统配置删除 args=[configId, tenantId]
)
const (
EventKeyDBSysDeptCreate = "db.sys_dept_create" // 系统部门创建 args=[deptId,]
EventKeyDBSysDeptUpdate = "db.sys_dept_update" // 系统部门更新 args=[deptId,]
EventKeyDBSysDeptDelete = "db.sys_dept_delete" // 系统部门删除 args=[deptId[],]
)
const (
EventKeyDBSysTenantCreate = "db.sys_tenant_create" // 租户创建 args=[pk,]
EventKeyDBSysTenantUpdate = "db.sys_tenant_update" // 租户更新 args=[pk,]
EventKeyDBSysTenantDelete = "db.sys_tenant_delete" // 租户删除 args=[pk[],]
EventKeyDBSysRoleCreate = "db.sys_role_create" // 角色创建 args=[pk,]
EventKeyDBSysRoleUpdate = "db.sys_role_update" // 角色更新 args=[pk,]
EventKeyDBSysRoleDelete = "db.sys_role_delete" // 角色删除 args=[pk[],]
EventKeyDBSysMenuCreate = "db.sys_menu_create" // 菜单创建 args=[pk,]
EventKeyDBSysMenuUpdate = "db.sys_menu_update" // 菜单更新 args=[pk,]
EventKeyDBSysMenuDelete = "db.sys_menu_delete" // 菜单删除 args=[pk[],]
EventKeyDBSysPostCreate = "db.sys_post_create" // 岗位创建 args=[pk,]
EventKeyDBSysPostUpdate = "db.sys_post_update" // 岗位更新 args=[pk,]
EventKeyDBSysPostDelete = "db.sys_post_delete" // 岗位删除 args=[pk[],]
EventKeyDBSysDictDataCreate = "db.sys_dict_data_create" // 字典数据创建 args=[pk,]
EventKeyDBSysDictDataUpdate = "db.sys_dict_data_update" // 字典数据更新 args=[pk,]
EventKeyDBSysDictDataDelete = "db.sys_dict_data_delete" // 字典数据删除 args=[pk[],]
EventKeyDBSysDictTypeCreate = "db.sys_dict_type_create" // 字典类型创建 args=[pk,]
EventKeyDBSysDictTypeUpdate = "db.sys_dict_type_update" // 字典类型更新 args=[pk,]
EventKeyDBSysDictTypeDelete = "db.sys_dict_type_delete" // 字典类型删除 args=[pk[],]
)
+14
View File
@@ -0,0 +1,14 @@
// Package consts
// @Link https://github.com/xiujiecn/xiu-admin
// @Copyright Copyright (c) 2025 LiXiujie
// @Author Lxj <xxx@example.com>
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
package consts
const (
HTTPContentTypeXml = "text/xml"
HTTPContentTypeHtml = "text/html"
HTTPContentTypeStream = "text/event-stream"
HTTPContentTypeJson = "application/json"
HTTPContentTypeExcel = "application/octet-stream"
)
+15
View File
@@ -0,0 +1,15 @@
// Package consts
// @Link https://github.com/xiujiecn/xiu-admin
// @Copyright Copyright (c) 2025 LiXiujie
// @Author Lxj <xxx@example.com>
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
package consts
// 内存缓存KEY常量 注明 key组成和 过期时间 清理方式
const (
MemCacheDeptName = "dept_name_%d" // 部门名称缓存 部门id:name 24小时过期
MemCacheUserInfo = "user_info_%d" // 用户信息缓存 用户id:miniinfo 24小时过期 用户修改是清理
MemCacheUserAccessCodeList = "user_access_code_list_%d" // 用户访问码列表缓存 用户id:access_code_list 24小时过期 用户退出清理
MemCacheUserRoleDataAccessCodeList = "user_role_data_access_code_list_%d" // 用户角色数据访问码列表缓存 用户id:role_id:data_access_code_list 24小时过期 用户退出清理
MemCacheSystemConfig = "system_config_%s" // 系统配置缓存 租户ID:map[key]value 24小时过期
)
+26
View File
@@ -0,0 +1,26 @@
// Package consts
// @Link https://github.com/xiujiecn/xiu-admin
// @Copyright Copyright (c) 2025 LiXiujie
// @Author Lxj <xxx@example.com>
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
package consts
const (
QueueSysOptLog = "queue:sys_opt_log"
QueueTrafficUsageDailyRetry = "iotlcm.traffic_usage.daily.retry"
QueueTrafficUsageMonthlyRetry = "iotlcm.traffic_usage.monthly.retry"
QueueWorkOrderAutoClose = "iotlcm.work_order.auto_close"
QueueWorkOrderAutoCloseDelay = "iotlcm.work_order.auto_close.delay"
QueueWorkerDiagnostic = "iotlcm.worker.diagnostic"
QueueBatchExecute = "iotlcm.batch.execute"
)
// 数据库变动类型
const (
DbChgTypeAdd = "add" // 数据库变动新增
DbChgTypeEdit = "edit" // 数据库变动编辑
DbChgTypeDel = "del" // 数据库变动删除
)
const (
BroadcastDbChg = "broadcast:db:chg" // 数据库配置表变动更新广播消息 obj{table_name,pk,type:add/edit/del,data:{主要字段数据}}
)
@@ -0,0 +1,34 @@
package consts
const (
SimCardStatusOperTypeStop = "0"
SimCardStatusOperTypeStart = "1"
ResourceExportSceneStart = 103
ResourceExportSceneStop = 104
ResourceExportSceneRestart = 105
ResourceBatchDownloadTaskSimCardStart = "SIM卡批量复机结果"
ResourceBatchDownloadTaskSimCardStop = "SIM卡批量停机结果"
ResourceBatchDownloadTaskSimCardRestart = "SIM卡批量重启结果"
SimCardLifecycleMaxFileSize = 50 << 20
SimCardStartSubDirImportExcel = "sim-card-start/import"
SimCardStartSubDirResultExcel = "sim-card-start/result"
SimCardStopSubDirImportExcel = "sim-card-stop/import"
SimCardStopSubDirResultExcel = "sim-card-stop/result"
SimCardRestartSubDirImportExcel = "sim-card-restart/import"
SimCardRestartSubDirResultExcel = "sim-card-restart/result"
)
const (
SimCardDataOperTypeStart = 0
SimCardDataOperTypeStop = 1
SimCardDataApnName = "CMIOT"
DataOperationStart = "dataStart"
DataOperationStop = "dataStop"
ResourceBatchDownloadTaskSimCardDataStart = "SIM卡批量开通数据服务结果"
ResourceBatchDownloadTaskSimCardDataStop = "SIM卡批量停用数据服务结果"
)
+146
View File
@@ -0,0 +1,146 @@
// Package consts
// @Link https://github.com/xiujiecn/xiu-admin
// @Copyright Copyright (c) 2025 LiXiujie
// @Author Lxj <xxx@example.com>
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
package consts
var (
// 默认系统租客编号,禁止修改编号
DefaultSystemTenantCode = "000000"
SuperAdminRoleId = int64(1)
)
var (
// 状态: 0正常 1停用
SysStatusNormal = "0"
SysStatusDisable = "1"
)
var (
// 菜单状态: 0正常 1停用
SysMenuStatusNormal = "0"
SysMenuStatusDisable = "1"
)
var (
// 菜单类型: M目录 C菜单 F按钮
SysMenuTypeDir = "M"
SysMenuTypeMenu = "C"
SysMenuTypeBtn = "F"
)
var (
// 菜单可见: 0显示 1隐藏
SysMenuVisibleShow = "0"
SysMenuVisibleHide = "1"
)
var (
// 菜单是否为外链: 0是 1否
SysMenuIsFrameNo = 1
SysMenuIsFrameYes = 0
)
var (
// 用户状态: 0正常 1停用
SysUserStatusNormal = "0"
SysUserStatusDisable = "1"
SysUserStatusLocked = "2"
SysUserStatusExpired = "3"
SysUserStatusDeleted = "4"
)
var (
// 角色数据范围: 1全部数据权限 2自定数据权限 3本部门数据权限 4本部门及以下数据权限 5仅本人数据权限 6本部门及以下或本人数据权限 7本组织及本组织下一级数据权限 8本组织下一级数据权限
SysRoleMenuDataScopeRole = "0"
SysRoleDataScopeAll = "1"
SysRoleDataScopeCustom = "2"
SysRoleDataScopeDept = "3"
SysRoleDataScopeDeptAndBelow = "4"
SysRoleDataScopePersonal = "5"
SysRoleDataScopeDeptAndBelowOrPersonal = "6"
SysRoleDataScopeOrgAndNextLevel = "7"
SysRoleDataScopeOrgNextLevel = "8"
)
var (
// 上传文件类型: 1文件 2图片
SysUploadFileTypeFile = "file"
SysUploadFileTypeImg = "img"
)
var (
// 新文件类型
SysUploadNewFileTypeUserFile = 1 // 用户文件
SysUploadNewFileTypeUserImg = 2 // 用户图片
SysUploadNewFileTypeDeviceFile = 3 // 设备文件 ${device_key}
)
var (
// 新文件类型路径
SysUploadNewFileTypePathUserFile = "user/file" // 用户文件
SysUploadNewFileTypePathUserImg = "user/img" // 用户图片
SysUploadNewFileTypePathDeviceFile = "device" // 设备文件 ${device_key}
)
var (
// 用户性别: 0男 1女 2未知
SysUserSexMale = "0"
SysUserSexFemale = "1"
SysUserSexUnknown = "2"
)
var (
// 用户类型: pc端 app端
SysUserTypeSys = "sys_user"
SysUserTypeAPP = "app_user"
)
var (
// 部门状态: 0正常 1停用
SysDeptStatusNormal = "0"
SysDeptStatusDisable = "1"
)
var (
// 任务状态: 0正常 1停用
SysJobStatusNormal = "0"
SysJobStatusDisable = "1"
)
var (
// 计划执行策略 0不限制并发 1限制并发
SysJobMisfirePolicyMulty = 1
SysJobMisfirePolicyOnce = 2
)
var (
// 权限码前缀 x-check-permission
SysCheckPermissionPrefix = "cp"
SysCheckPermissionRolePrefix = "cpr:" // 角色权限码前缀+角色权限
SysCheckPermissionMenuPrefix = "cpm:" // 菜单权限码前缀+菜单权限
SysCheckPermissionDeptPrefix = "cpd:" // 部门权限码前缀+部门编码
SysCheckPermissionPostPrefix = "cpp:" // 岗位权限码前缀+岗位编码
SysCheckPermissionUserPrefix = "cpu:" // 用户权限码前缀+用户名
SysCheckPermissionCurrentUser = "cpc:current:user" // 当前登录用户默认权限
)
var StatusSlice = []int{0, 1}
// MethodSlice HTTP请求方法
var MethodSlice = []int{1, 2, 3, 4}
var (
// 公告范围: 1全部 2指定组织 3指定用户
NoticeRangeAll = 1
NoticeRangeDept = 2
NoticeRangeUser = 3
)
var (
// 租户配置
ConfigKeyTenantDefaultRegisterDeptId = "iot.register.dept"
ConfigKeyTenantDefaultRegisterRoleId = "iot.register.role"
)
var (
// 微信平台
SourceWechatMp = "wechat_mp"
)
@@ -0,0 +1,6 @@
package consts
const (
BatchTypeTrafficCutoffConfig = 41
BatchNoPrefixTrafficCutoffConfig = `TCC`
)
+90
View File
@@ -0,0 +1,90 @@
package consts
// V3 API enum labels are centralized here for urgent compatibility work.
// Move domain enum values to their own const files when the compatibility layer stabilizes.
const (
V3ApiSimAccessTypeIPv4 = 1
V3ApiSimAccessTypeIPv6 = 2
V3ApiSimAccessTypeIPv4IPv6 = 3
)
var V3ApiSimAccessTypeNameMap = map[int]string{
V3ApiSimAccessTypeIPv4: "IPV4",
V3ApiSimAccessTypeIPv6: "IPV6",
V3ApiSimAccessTypeIPv4IPv6: "IPV4/IPV6",
}
const (
V3ApiSimBossCardStatusPendingActivate = 1
V3ApiSimBossCardStatusActivated = 2
V3ApiSimBossCardStatusStopped = 4
V3ApiSimBossCardStatusTestable = 6
V3ApiSimBossCardStatusStock = 7
V3ApiSimBossCardStatusPreCancel = 8
V3ApiSimBossCardStatusCanceled = 9
)
var V3ApiSimBossCardStatusNameMap = map[int]string{
V3ApiSimBossCardStatusPendingActivate: "待激活",
V3ApiSimBossCardStatusActivated: "已激活",
V3ApiSimBossCardStatusStopped: "已停机",
V3ApiSimBossCardStatusTestable: "可测试",
V3ApiSimBossCardStatusStock: "库存",
V3ApiSimBossCardStatusPreCancel: "预销户",
V3ApiSimBossCardStatusCanceled: "已销户",
}
const (
V3ApiSimCardTypePlug = 1
V3ApiSimCardType5X6 = 2
V3ApiSimCardType2X2 = 3
V3ApiSimCardTypeMP1 = 4
V3ApiSimCardTypeMP2 = 5
V3ApiSimCardTypeMS0 = 6
V3ApiSimCardTypeMS1 = 7
)
var V3ApiSimCardTypeNameMap = map[int]string{
V3ApiSimCardTypePlug: "插拔",
V3ApiSimCardType5X6: "贴片卡5X6",
V3ApiSimCardType2X2: "贴片卡2X2",
V3ApiSimCardTypeMP1: "插拔卡(MP1)",
V3ApiSimCardTypeMP2: "插拔卡(MP2)",
V3ApiSimCardTypeMS0: "贴片卡(MS0)",
V3ApiSimCardTypeMS1: "贴片卡(MS1)",
}
const (
V3ApiSimNetModel3G = 1
V3ApiSimNetModel2G = 2
V3ApiSimNetModel4G = 3
V3ApiSimNetModel5G = 4
V3ApiSimNetModelNBIoT = 5
V3ApiSimNetModel5GSA = 6
V3ApiSimNetModel5GNSA = 7
V3ApiSimNetModel2G3G = 8
V3ApiSimNetModelTelecomNB = 9
V3ApiSimNetModelMobile4G = 10
V3ApiSimNetModelUnicomNB = 11
V3ApiSimNetModelUnicom4G = 12
V3ApiSimNetModelTelecom4G = 13
V3ApiSimNetModelRedCap = 14
)
var V3ApiSimNetModelNameMap = map[int]string{
V3ApiSimNetModel3G: "3G",
V3ApiSimNetModel2G: "2G",
V3ApiSimNetModel4G: "4G",
V3ApiSimNetModel5G: "5G",
V3ApiSimNetModelNBIoT: "NB-IOT",
V3ApiSimNetModel5GSA: "5G-SA",
V3ApiSimNetModel5GNSA: "5G-NSA",
V3ApiSimNetModel2G3G: "2G/3G",
V3ApiSimNetModelTelecomNB: "电信NB",
V3ApiSimNetModelMobile4G: "移动4G",
V3ApiSimNetModelUnicomNB: "联通NB",
V3ApiSimNetModelUnicom4G: "联通4G",
V3ApiSimNetModelTelecom4G: "电信4G",
V3ApiSimNetModelRedCap: "RedCap",
}
+23
View File
@@ -0,0 +1,23 @@
// Package consts
// @Link https://github.com/xiujiecn/xiu-admin
// @Copyright Copyright (c) 2025 LiXiujie
// @Author Lxj <xxx@example.com>
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
package consts
// 服务器监控信息
const (
MonitorServerHost = "host"
MonitorServerSysLoad = "sysLoad"
MonitorServerCpu = "cpu"
MonitorServerMem = "mem"
MonitorServerDisk = "disk"
MonitorServerNet = "net"
MonitorServerGo = "go"
)
// WEBSOCKET订阅Tag 服务器监控信息
const (
WSTagMonitorServer = "ws:tag:monitor:server" // WEBSOCKET订阅Tag 服务器监控信息
WSEventMonitorServer = "ws:event:monitor:server:%s" // WEBSOCKET订阅 服务器监控信息 %s in [host,sysLoad,cpu,disk,net,go]
)
@@ -0,0 +1,11 @@
package common
import (
"git.5iot.com/iotlcm-public/iotlcm-openapi/api/common"
)
type ControllerV1 struct{}
func NewV1() common.ICommonV1 {
return &ControllerV1{}
}
+114
View File
@@ -0,0 +1,114 @@
package common
import (
"context"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/frame/g"
v1 "git.5iot.com/iotlcm-public/iotlcm-openapi/api/common/v1"
"git.5iot.com/iotlcm-public/iotlcm-openapi/internal/model"
"git.5iot.com/iotlcm-public/iotlcm-openapi/internal/service"
)
func (c *ControllerV1) Renew(ctx context.Context, req *v1.RenewReq) (res *v1.RenewRes, err error) {
output, err := service.Common().SubmitRenew(ctx, &req.CommonRenewParam)
if err != nil {
return nil, err
}
return &v1.RenewRes{CommonRenewRes: *output}, nil
}
func (c *ControllerV1) TrafficCutoffConfig(ctx context.Context, req *v1.TrafficCutoffConfigReq) (res *v1.TrafficCutoffConfigRes, err error) {
if req == nil {
return nil, gerror.New("请求参数不能为空")
}
req.CommonTrafficCutoffConfigParam.IdempotencyKey = g.RequestFromCtx(ctx).Header.Get("Idempotency-Key")
output, err := service.Common().SubmitTrafficCutoffConfig(ctx, &req.CommonTrafficCutoffConfigParam)
if err != nil {
return nil, err
}
return &v1.TrafficCutoffConfigRes{CommonTrafficCutoffConfigRes: *output}, nil
}
func (c *ControllerV1) SimSubscribe(ctx context.Context, req *v1.SimSubscribeReq) (res *v1.SingleRenewRes, err error) {
if req == nil {
return nil, gerror.New("请求参数不能为空")
}
output, err := service.Common().SubmitSingleRenew(ctx, model.CommonRenewCard{
Iccid: req.Iccid,
Msisdn: req.Msisdn,
Imsi: req.Imsi,
PackageId: req.PackageId,
}, req.AppId, req.PackageId, req.Remark, req.Validity)
if err != nil {
return &v1.SingleRenewRes{CommonSingleRenewRes: model.CommonSingleRenewRes{
OrderId: "0",
OrderSn: "",
Iccid: req.Iccid,
Status: "failed",
ErrorCode: "RENEW_FAILED",
ErrorMessage: err.Error(),
}}, nil
}
return &v1.SingleRenewRes{CommonSingleRenewRes: *output}, nil
}
func (c *ControllerV1) BatchSimSubscribe(ctx context.Context, req *v1.BatchSimSubscribeReq) (res *v1.RenewRes, err error) {
if req == nil {
return nil, gerror.New("请求参数不能为空")
}
output, err := service.Common().SubmitBatchRenew(ctx, req.AppId, req.Cards, req.Iccid, req.PackageId, req.Remark, req.Validity)
if err != nil {
return nil, err
}
return &v1.RenewRes{CommonRenewRes: *output}, nil
}
func (c *ControllerV1) SimTrafficCutoff(ctx context.Context, req *v1.SimTrafficCutoffReq) (res *v1.SingleTrafficCutoffRes, err error) {
if req == nil {
return nil, gerror.New("请求参数不能为空")
}
output, err := service.Common().SubmitSingleTrafficCutoffConfig(ctx, &req.CommonTrafficCutoffSingleParam)
if err != nil {
threshold := req.TrafficCutoffThreshold
if req.TrafficCutoffStatus == 0 {
threshold = 0
}
return &v1.SingleTrafficCutoffRes{CommonSingleTrafficCutoffRes: model.CommonSingleTrafficCutoffRes{
Success: false,
Iccid: req.Iccid,
Msisdn: req.Msisdn,
Imsi: req.Imsi,
TrafficCutoffStatus: req.TrafficCutoffStatus,
TrafficCutoffThreshold: threshold,
TrafficCutoffThresholdUnit: "MB",
Message: err.Error(),
ErrorCode: "TRAFFIC_CUTOFF_FAILED",
}}, nil
}
return &v1.SingleTrafficCutoffRes{CommonSingleTrafficCutoffRes: *output}, nil
}
func (c *ControllerV1) BatchSimTrafficCutoff(ctx context.Context, req *v1.BatchSimTrafficCutoffReq) (res *v1.TrafficCutoffConfigRes, err error) {
if req == nil {
return nil, gerror.New("请求参数不能为空")
}
req.CommonTrafficCutoffConfigParam.IdempotencyKey = g.RequestFromCtx(ctx).Header.Get("Idempotency-Key")
output, err := service.Common().SubmitTrafficCutoffConfig(ctx, &req.CommonTrafficCutoffConfigParam)
if err != nil {
return nil, err
}
return &v1.TrafficCutoffConfigRes{CommonTrafficCutoffConfigRes: *output}, nil
}
func trafficCutoffStatusName(status int) string {
switch status {
case 1:
return "已开启"
case 2:
return "已关闭"
default:
return "删除"
}
}
@@ -0,0 +1,5 @@
// =================================================================================
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
// =================================================================================
package old_api
@@ -0,0 +1,13 @@
// =================================================================================
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
// =================================================================================
package old_api
import "git.5iot.com/iotlcm-public/iotlcm-openapi/api/old_api"
type ControllerV1 struct{}
func NewV1() old_api.IOldApiV1 {
return &ControllerV1{}
}
@@ -0,0 +1,69 @@
package old_api
import (
"context"
v1 "git.5iot.com/iotlcm-public/iotlcm-openapi/api/old_api/v1"
"git.5iot.com/iotlcm-public/iotlcm-openapi/internal/service"
)
func (c *ControllerV1) CardInfo(ctx context.Context, req *v1.CardInfoReq) (res *v1.CardInfoRes, err error) {
simCardInfoOutput, err := service.OldApiQuery().QuerySimCard(ctx, &req.SimCardInfoInput)
if err != nil {
return nil, err
}
res = &v1.CardInfoRes{SimCardInfoOutput: *simCardInfoOutput}
return res, nil
}
func (c *ControllerV1) SimDataUsage(ctx context.Context, req *v1.SimDataUsageReq) (res *v1.SimDataUsageRes, err error) {
simDataUsageOutput, err := service.OldApiQuery().QuerySimDataUsage(ctx, &req.SimDataUsageOldInput)
if err != nil {
return nil, err
}
res = &v1.SimDataUsageRes{
SimDataUsageOldOutput: *simDataUsageOutput,
}
return res, nil
}
func (c *ControllerV1) SimDataUsageMonthly(ctx context.Context, req *v1.SimDataUsageMonthlyReq) (res *v1.SimDataUsageMonthlyRes, err error) {
simDataUsageMonthlyOutput, err := service.OldApiQuery().QuerySimDataUsageMonthly(ctx, &req.SimDataUsageMonthlyOldInput)
if err != nil {
return nil, err
}
res = &v1.SimDataUsageMonthlyRes{
SimDataUsageMonthlyOldOutput: *simDataUsageMonthlyOutput,
}
return res, nil
}
func (c *ControllerV1) SimStatus(ctx context.Context, req *v1.SimStatusReq) (res *v1.SimStatusRes, err error) {
simStatusOutput, err := service.OldApiQuery().QuerySimStatus(ctx, &req.SimStatusOldInput)
if err != nil {
return nil, err
}
res = &v1.SimStatusRes{
SimStatusOldOutput: *simStatusOutput,
}
return res, nil
}
func (c *ControllerV1) SimSession(ctx context.Context, req *v1.SimSessionReq) (res *v1.SimSessionRes, err error) {
simSessionOutput, err := service.OldApiQuery().QuerySimSession(ctx, &req.SimStatusOnlineOldInput)
if err != nil {
return nil, err
}
res = &v1.SimSessionRes{
SimStatusOnlineOldOutput: *simSessionOutput,
}
return res, nil
}
func (c *ControllerV1) SimCardInfoList(ctx context.Context, req *v1.SimCardInfoListReq) (res *v1.SimCardInfoListRes, err error) {
simCardInfoListOutput, err := service.OldApiQuery().QueryCardInfoList(ctx, &req.QueryCardInfoListInput)
if err != nil {
return nil, err
}
return &simCardInfoListOutput, nil
}
@@ -0,0 +1,5 @@
// =================================================================================
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
// =================================================================================
package query
@@ -0,0 +1,15 @@
// =================================================================================
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
// =================================================================================
package query
import (
"git.5iot.com/iotlcm-public/iotlcm-openapi/api/query"
)
type ControllerV1 struct{}
func NewV1() query.IQueryV1 {
return &ControllerV1{}
}
+93
View File
@@ -0,0 +1,93 @@
package query
import (
"context"
v1 "git.5iot.com/iotlcm-public/iotlcm-openapi/api/query/v1"
"git.5iot.com/iotlcm-public/iotlcm-openapi/internal/service"
)
func (c *ControllerV1) QuerySimInfo(ctx context.Context, req *v1.QuerySimInfoReq) (res *v1.QuerySimInfoRes, err error) {
output, err := service.QuerySim().QuerySimInfo(ctx, &req.QuerySimInput)
if err != nil {
return nil, err
}
res = &v1.QuerySimInfoRes{QuerySimInfoOutput: *output}
return res, nil
}
func (c *ControllerV1) QuerySimLimit(ctx context.Context, req *v1.QuerySimLimitReq) (res *v1.QuerySimLimitRes, err error) {
output, err := service.QuerySim().QuerySimLimit(ctx, &req.QuerySimInput)
if err != nil {
return res, err
}
res = &v1.QuerySimLimitRes{QuerySimLimitOutput: *output}
return res, nil
}
func (c *ControllerV1) QuerySimImei(ctx context.Context, req *v1.QuerySimImeiReq) (res *v1.QuerySimImeiRes, err error) {
output, err := service.QuerySim().QuerySimImei(ctx, &req.QuerySimInput)
if err != nil {
return nil, err
}
res = &v1.QuerySimImeiRes{QuerySimImeiOutput: *output}
return res, nil
}
func (c *ControllerV1) QuerySimUsage(ctx context.Context, req *v1.QuerySimUsageReq) (res *v1.QuerySimUsageRes, err error) {
output, err := service.QuerySim().QuerySimUsage(ctx, &req.QuerySimInput)
if err != nil {
return nil, err
}
res = &v1.QuerySimUsageRes{QuerySimUsageOutput: *output}
return res, nil
}
func (c *ControllerV1) QuerySimStatus(ctx context.Context, req *v1.QuerySimStatusReq) (res *v1.QuerySimStatusRes, err error) {
output, err := service.QuerySim().QuerySimStatus(ctx, &req.QuerySimInput)
if err != nil {
return nil, err
}
res = &v1.QuerySimStatusRes{QuerySimCardStatusOutput: *output}
return res, nil
}
func (c *ControllerV1) QueryTrafficCutoffConfig(ctx context.Context, req *v1.QueryTrafficCutoffConfigReq) (res *v1.QueryTrafficCutoffConfigRes, err error) {
output, err := service.QuerySim().QueryTrafficCutoffConfig(ctx, &req.QueryTrafficCutoffConfigParam)
if err != nil {
return nil, err
}
return &v1.QueryTrafficCutoffConfigRes{QueryTrafficCutoffConfigOutput: *output}, nil
}
func (c *ControllerV1) QueryBatchStatus(ctx context.Context, req *v1.QueryBatchStatusReq) (res *v1.QueryBatchStatusRes, err error) {
output, err := service.QuerySim().QueryBatchStatus(ctx, &req.QueryBatchStatusParam)
if err != nil {
return nil, err
}
return &v1.QueryBatchStatusRes{QueryBatchStatusOutput: *output}, nil
}
func (c *ControllerV1) QuerySimStatusBatch(ctx context.Context, req *v1.QuerySimStatusBatchReq) (res *v1.QuerySimStatusBatchRes, err error) {
output, err := service.QuerySim().QuerySimStatusBatch(ctx, &req.QuerySimStatusBatchParam)
if err != nil {
return nil, err
}
return &v1.QuerySimStatusBatchRes{QuerySimStatusBatchOutput: *output}, nil
}
func (c *ControllerV1) QuerySimUsageBatch(ctx context.Context, req *v1.QuerySimUsageBatchReq) (res *v1.QuerySimUsageBatchRes, err error) {
output, err := service.QuerySim().QuerySimUsageBatch(ctx, &req.QuerySimUsageBatchParam)
if err != nil {
return nil, err
}
return &v1.QuerySimUsageBatchRes{QuerySimUsageBatchOutput: *output}, nil
}
func (c *ControllerV1) QuerySimImeiBatch(ctx context.Context, req *v1.QuerySimImeiBatchReq) (res *v1.QuerySimImeiBatchRes, err error) {
output, err := service.QuerySim().QuerySimImeiBatch(ctx, &req.QuerySimImeiBatchParam)
if err != nil {
return nil, err
}
return &v1.QuerySimImeiBatchRes{QuerySimImeiBatchOutput: *output}, nil
}
@@ -0,0 +1,26 @@
package query
import (
"context"
v1 "git.5iot.com/iotlcm-public/iotlcm-openapi/api/query/v1"
"git.5iot.com/iotlcm-public/iotlcm-openapi/internal/service"
)
func (c *ControllerV1) Token(ctx context.Context, req *v1.TokenReq) (res *v1.TokenRes, err error) {
out, err := service.QueryToken().Token(ctx, req.TokenInputApi)
if err != nil {
return nil, err
}
res = &v1.TokenRes{TokenOutputApi: out}
return res, nil
}
func (c *ControllerV1) OperatorToken(ctx context.Context, req *v1.OperatorTokenReq) (res *v1.OperatorTokenRes, err error) {
out, err := service.QueryToken().OperatorTokenWithAuth(ctx, req.OperatorTokenInput)
if err != nil {
return nil, err
}
res = &v1.OperatorTokenRes{OperatorTokenOutput: out}
return res, nil
}
+22
View File
@@ -0,0 +1,22 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"git.5iot.com/iotlcm-public/iotlcm-openapi/internal/dao/internal"
)
// batchDetailDao is the data access object for the table batch_detail.
// You can define custom methods on it to extend its functionality as needed.
type batchDetailDao struct {
*internal.BatchDetailDao
}
var (
// BatchDetail is a globally accessible object for table batch_detail operations.
BatchDetail = batchDetailDao{internal.NewBatchDetailDao()}
)
// Add your custom methods and functionality below.
+22
View File
@@ -0,0 +1,22 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"git.5iot.com/iotlcm-public/iotlcm-openapi/internal/dao/internal"
)
// batchMainDao is the data access object for the table batch_main.
// You can define custom methods on it to extend its functionality as needed.
type batchMainDao struct {
*internal.BatchMainDao
}
var (
// BatchMain is a globally accessible object for table batch_main operations.
BatchMain = batchMainDao{internal.NewBatchMainDao()}
)
// Add your custom methods and functionality below.
@@ -0,0 +1,109 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// BatchDetailDao is the data access object for the table batch_detail.
type BatchDetailDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns BatchDetailColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// BatchDetailColumns defines and stores column names for the table batch_detail.
type BatchDetailColumns struct {
Id string // 主键ID
BatchNo string // 批次编号
BatchType string // 批次类型 枚举(与主表一致)
DetailStatus string // 明细异步处理状态 0-待处理 1-处理中 2-成功 3-失败
BlankOutStatus string // 作废状态 0-是 1-否
RowNo string // 行号
ItemId string // 项ID:卡ICCID/设备编码
ErrorCode string // 异常编码
ErrorReason string // 异常原因
Snapshot string // 信息快照
TenantId string // 租户ID
CreatedDept string // 创建部门ID
CreatedBy string // 创建者ID
CreatedAt string // 创建时间
UpdatedBy string // 更新者ID
UpdatedAt string // 更新时间
}
// batchDetailColumns holds the columns for the table batch_detail.
var batchDetailColumns = BatchDetailColumns{
Id: "id",
BatchNo: "batch_no",
BatchType: "batch_type",
DetailStatus: "detail_status",
BlankOutStatus: "blank_out_status",
RowNo: "row_no",
ItemId: "item_id",
ErrorCode: "error_code",
ErrorReason: "error_reason",
Snapshot: "snapshot",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewBatchDetailDao creates and returns a new DAO object for table data access.
func NewBatchDetailDao(handlers ...gdb.ModelHandler) *BatchDetailDao {
return &BatchDetailDao{
group: "default",
table: "batch_detail",
columns: batchDetailColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *BatchDetailDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *BatchDetailDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *BatchDetailDao) Columns() BatchDetailColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *BatchDetailDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *BatchDetailDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *BatchDetailDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
+139
View File
@@ -0,0 +1,139 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// BatchMainDao is the data access object for the table batch_main.
type BatchMainDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns BatchMainColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// BatchMainColumns defines and stores column names for the table batch_main.
type BatchMainColumns struct {
Id string // 主键ID
BatchNo string // 批次编号
OrderSn string // 订单编号
BatchType string // 批次类型 枚举
BatchStatus string // 批次状态 枚举
BatchAsyncStatus string // 异步处理状态
SourceType string // 来源方式 枚举
SourceBatchNo string // 来源批次编号
SourceOssId string // 源文件OSS ID
ResultOssId string // 结果文件OSS ID
IsCrossDept string // 是否跨级操作机构
TargetDeptId string // 目标机构编号
DeptId string // 机构编号
TotalCount string // 总数量
ValidCount string // 有效数量
SuccessCount string // 成功数量
FailCount string // 失败数量
RunResult string // 运行结果
FailReason string // 失败原因
BatchInfo string // 批次信息:入库/出库展示字段
Remark string // 备注扩展字段
StartTime string // 开始时间
EndTime string // 结束时间
TenantId string // 租户ID
CreatedDept string // 创建部门ID
CreatedBy string // 创建者ID
CreatedAt string // 创建时间
UpdatedBy string // 更新者ID
UpdatedAt string // 更新时间
SourceChannel string // 发起渠道:console/mini_program/api/system/legacy
ExecutionMode string // 操作规模:0未知1单卡2批量
}
// batchMainColumns holds the columns for the table batch_main.
var batchMainColumns = BatchMainColumns{
Id: "id",
BatchNo: "batch_no",
OrderSn: "order_sn",
BatchType: "batch_type",
BatchStatus: "batch_status",
BatchAsyncStatus: "batch_async_status",
SourceType: "source_type",
SourceBatchNo: "source_batch_no",
SourceOssId: "source_oss_id",
ResultOssId: "result_oss_id",
IsCrossDept: "is_cross_dept",
TargetDeptId: "target_dept_id",
DeptId: "dept_id",
TotalCount: "total_count",
ValidCount: "valid_count",
SuccessCount: "success_count",
FailCount: "fail_count",
RunResult: "run_result",
FailReason: "fail_reason",
BatchInfo: "batch_info",
Remark: "remark",
StartTime: "start_time",
EndTime: "end_time",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
SourceChannel: "source_channel",
ExecutionMode: "execution_mode",
}
// NewBatchMainDao creates and returns a new DAO object for table data access.
func NewBatchMainDao(handlers ...gdb.ModelHandler) *BatchMainDao {
return &BatchMainDao{
group: "default",
table: "batch_main",
columns: batchMainColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *BatchMainDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *BatchMainDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *BatchMainDao) Columns() BatchMainColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *BatchMainDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *BatchMainDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *BatchMainDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
+109
View File
@@ -0,0 +1,109 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// SysClientDao is the data access object for the table sys_client.
type SysClientDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns SysClientColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// SysClientColumns defines and stores column names for the table sys_client.
type SysClientColumns struct {
Id string // id
ClientId string // 客户端id
ClientKey string // 客户端key
ClientSecret string // 客户端秘钥
GrantType string // 授权类型
DeviceType string // 设备类型
ActiveTimeout string // token活跃超时时间
Timeout string // token固定超时
Status string // 状态(0正常 1停用)
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
DeletedBy string // 删除人
DeletedAt string // 删除时间
}
// sysClientColumns holds the columns for the table sys_client.
var sysClientColumns = SysClientColumns{
Id: "id",
ClientId: "client_id",
ClientKey: "client_key",
ClientSecret: "client_secret",
GrantType: "grant_type",
DeviceType: "device_type",
ActiveTimeout: "active_timeout",
Timeout: "timeout",
Status: "status",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
DeletedBy: "deleted_by",
DeletedAt: "deleted_at",
}
// NewSysClientDao creates and returns a new DAO object for table data access.
func NewSysClientDao(handlers ...gdb.ModelHandler) *SysClientDao {
return &SysClientDao{
group: "default",
table: "sys_client",
columns: sysClientColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *SysClientDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *SysClientDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *SysClientDao) Columns() SysClientColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *SysClientDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *SysClientDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *SysClientDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
+101
View File
@@ -0,0 +1,101 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// SysConfigDao is the data access object for the table sys_config.
type SysConfigDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns SysConfigColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// SysConfigColumns defines and stores column names for the table sys_config.
type SysConfigColumns struct {
ConfigId string // 参数主键
TenantId string // 租户编号
ConfigName string // 参数名称
ConfigKey string // 参数键名
ConfigValue string // 参数键值
ConfigType string // 系统内置(Y是 N否)
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
Remark string // 备注
}
// sysConfigColumns holds the columns for the table sys_config.
var sysConfigColumns = SysConfigColumns{
ConfigId: "config_id",
TenantId: "tenant_id",
ConfigName: "config_name",
ConfigKey: "config_key",
ConfigValue: "config_value",
ConfigType: "config_type",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
Remark: "remark",
}
// NewSysConfigDao creates and returns a new DAO object for table data access.
func NewSysConfigDao(handlers ...gdb.ModelHandler) *SysConfigDao {
return &SysConfigDao{
group: "default",
table: "sys_config",
columns: sysConfigColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *SysConfigDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *SysConfigDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *SysConfigDao) Columns() SysConfigColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *SysConfigDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *SysConfigDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *SysConfigDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
+125
View File
@@ -0,0 +1,125 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// SysDeptDao is the data access object for the table sys_dept.
type SysDeptDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns SysDeptColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// SysDeptColumns defines and stores column names for the table sys_dept.
type SysDeptColumns struct {
DeptId string // 部门id
TenantId string // 租户编号
ParentId string // 父部门id
Ancestors string // 祖级列表
DeptKey string // 机构编号
DeptName string // 部门名称
DeptType string // 部门类型(0:部门 1:公司)
DeptCategory string // 部门类别编码
OrderNum string // 显示顺序
Leader string // 负责人
Phone string // 联系电话
Email string // 邮箱
Status string // 部门状态(0正常 1停用)
CreditCode string // 统一社会信用代码
AreaCode string // 行政区域代码
Address string // 地址
DeptRole string // 机构默认角色ID
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
DeletedBy string // 删除人
DeletedAt string // 删除时间
}
// sysDeptColumns holds the columns for the table sys_dept.
var sysDeptColumns = SysDeptColumns{
DeptId: "dept_id",
TenantId: "tenant_id",
ParentId: "parent_id",
Ancestors: "ancestors",
DeptKey: "dept_key",
DeptName: "dept_name",
DeptType: "dept_type",
DeptCategory: "dept_category",
OrderNum: "order_num",
Leader: "leader",
Phone: "phone",
Email: "email",
Status: "status",
CreditCode: "credit_code",
AreaCode: "area_code",
Address: "address",
DeptRole: "dept_role",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
DeletedBy: "deleted_by",
DeletedAt: "deleted_at",
}
// NewSysDeptDao creates and returns a new DAO object for table data access.
func NewSysDeptDao(handlers ...gdb.ModelHandler) *SysDeptDao {
return &SysDeptDao{
group: "default",
table: "sys_dept",
columns: sysDeptColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *SysDeptDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *SysDeptDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *SysDeptDao) Columns() SysDeptColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *SysDeptDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *SysDeptDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *SysDeptDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,107 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// SysDictDataDao is the data access object for the table sys_dict_data.
type SysDictDataDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns SysDictDataColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// SysDictDataColumns defines and stores column names for the table sys_dict_data.
type SysDictDataColumns struct {
DictCode string // 字典编码
TenantId string // 租户编号
DictSort string // 字典排序
DictLabel string // 字典标签
DictValue string // 字典键值
DictType string // 字典类型
CssClass string // 样式属性(其他样式扩展)
ListClass string // 表格回显样式
IsDefault string // 是否默认(Y是 N否)
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
Remark string // 备注
}
// sysDictDataColumns holds the columns for the table sys_dict_data.
var sysDictDataColumns = SysDictDataColumns{
DictCode: "dict_code",
TenantId: "tenant_id",
DictSort: "dict_sort",
DictLabel: "dict_label",
DictValue: "dict_value",
DictType: "dict_type",
CssClass: "css_class",
ListClass: "list_class",
IsDefault: "is_default",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
Remark: "remark",
}
// NewSysDictDataDao creates and returns a new DAO object for table data access.
func NewSysDictDataDao(handlers ...gdb.ModelHandler) *SysDictDataDao {
return &SysDictDataDao{
group: "default",
table: "sys_dict_data",
columns: sysDictDataColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *SysDictDataDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *SysDictDataDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *SysDictDataDao) Columns() SysDictDataColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *SysDictDataDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *SysDictDataDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *SysDictDataDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,99 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// SysDictTypeDao is the data access object for the table sys_dict_type.
type SysDictTypeDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns SysDictTypeColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// SysDictTypeColumns defines and stores column names for the table sys_dict_type.
type SysDictTypeColumns struct {
DictId string // 字典主键
TenantId string // 租户编号
DictName string // 字典名称
DictType string // 字典类型
IsSys string // 是否系统(0是 1否)
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
Remark string // 备注
}
// sysDictTypeColumns holds the columns for the table sys_dict_type.
var sysDictTypeColumns = SysDictTypeColumns{
DictId: "dict_id",
TenantId: "tenant_id",
DictName: "dict_name",
DictType: "dict_type",
IsSys: "is_sys",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
Remark: "remark",
}
// NewSysDictTypeDao creates and returns a new DAO object for table data access.
func NewSysDictTypeDao(handlers ...gdb.ModelHandler) *SysDictTypeDao {
return &SysDictTypeDao{
group: "default",
table: "sys_dict_type",
columns: sysDictTypeColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *SysDictTypeDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *SysDictTypeDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *SysDictTypeDao) Columns() SysDictTypeColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *SysDictTypeDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *SysDictTypeDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *SysDictTypeDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,111 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// SysGenTableDao is the data access object for the table sys_gen_table.
type SysGenTableDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns SysGenTableColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// SysGenTableColumns defines and stores column names for the table sys_gen_table.
type SysGenTableColumns struct {
TableId string // 生成ID
GenType string // 生成类型
GenTemplate string // 生成模板
VarName string // 实体命名
Options string // 配置选项
DbName string // 数据库名称
TableName string // 主表名称
TableComment string // 主表注释
DaoName string // 主表dao模型
MasterColumns string // 主表字段
AddonName string // 插件名称
Status string // 生成状态(0成功 1未开始)
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
}
// sysGenTableColumns holds the columns for the table sys_gen_table.
var sysGenTableColumns = SysGenTableColumns{
TableId: "table_id",
GenType: "gen_type",
GenTemplate: "gen_template",
VarName: "var_name",
Options: "options",
DbName: "db_name",
TableName: "table_name",
TableComment: "table_comment",
DaoName: "dao_name",
MasterColumns: "master_columns",
AddonName: "addon_name",
Status: "status",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewSysGenTableDao creates and returns a new DAO object for table data access.
func NewSysGenTableDao(handlers ...gdb.ModelHandler) *SysGenTableDao {
return &SysGenTableDao{
group: "default",
table: "sys_gen_table",
columns: sysGenTableColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *SysGenTableDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *SysGenTableDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *SysGenTableDao) Columns() SysGenTableColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *SysGenTableDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *SysGenTableDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *SysGenTableDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
+111
View File
@@ -0,0 +1,111 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// SysJobDao is the data access object for the table sys_job.
type SysJobDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns SysJobColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// SysJobColumns defines and stores column names for the table sys_job.
type SysJobColumns struct {
JobId string // 任务ID
JobName string // 任务名称
JobParams string // 参数
JobGroup string // 任务组名
InvokeTarget string // 调用目标字符串
CronExpression string // cron执行表达式
MisfirePolicy string // 计划执行策略(1多次执行 2执行一次)
Concurrent string // 是否并发执行(0允许 1禁止)
Status string // 状态(0正常 1暂停)
Remark string // 备注信息
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
DeletedBy string // 删除人
DeletedAt string // 删除时间
}
// sysJobColumns holds the columns for the table sys_job.
var sysJobColumns = SysJobColumns{
JobId: "job_id",
JobName: "job_name",
JobParams: "job_params",
JobGroup: "job_group",
InvokeTarget: "invoke_target",
CronExpression: "cron_expression",
MisfirePolicy: "misfire_policy",
Concurrent: "concurrent",
Status: "status",
Remark: "remark",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
DeletedBy: "deleted_by",
DeletedAt: "deleted_at",
}
// NewSysJobDao creates and returns a new DAO object for table data access.
func NewSysJobDao(handlers ...gdb.ModelHandler) *SysJobDao {
return &SysJobDao{
group: "default",
table: "sys_job",
columns: sysJobColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *SysJobDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *SysJobDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *SysJobDao) Columns() SysJobColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *SysJobDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *SysJobDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *SysJobDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,101 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// SysLogininforDao is the data access object for the table sys_logininfor.
type SysLogininforDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns SysLogininforColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// SysLogininforColumns defines and stores column names for the table sys_logininfor.
type SysLogininforColumns struct {
InfoId string // 访问ID
TenantId string // 租户编号
UserName string // 用户账号
ClientKey string // 客户端
DeviceType string // 设备类型
Ipaddr string // 登录IP地址
LoginLocation string // 登录地点
Browser string // 浏览器类型
Os string // 操作系统
Status string // 登录状态(0成功 1失败)
Msg string // 提示消息
LoginTime string // 访问时间
}
// sysLogininforColumns holds the columns for the table sys_logininfor.
var sysLogininforColumns = SysLogininforColumns{
InfoId: "info_id",
TenantId: "tenant_id",
UserName: "user_name",
ClientKey: "client_key",
DeviceType: "device_type",
Ipaddr: "ipaddr",
LoginLocation: "login_location",
Browser: "browser",
Os: "os",
Status: "status",
Msg: "msg",
LoginTime: "login_time",
}
// NewSysLogininforDao creates and returns a new DAO object for table data access.
func NewSysLogininforDao(handlers ...gdb.ModelHandler) *SysLogininforDao {
return &SysLogininforDao{
group: "default",
table: "sys_logininfor",
columns: sysLogininforColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *SysLogininforDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *SysLogininforDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *SysLogininforDao) Columns() SysLogininforColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *SysLogininforDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *SysLogininforDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *SysLogininforDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
+121
View File
@@ -0,0 +1,121 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// SysMenuDao is the data access object for the table sys_menu.
type SysMenuDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns SysMenuColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// SysMenuColumns defines and stores column names for the table sys_menu.
type SysMenuColumns struct {
MenuId string // 菜单ID
MenuName string // 菜单名称
ParentId string // 父菜单ID
Level string // 关系树等级
Tree string // 关系树
OrderNum string // 显示顺序
Path string // 路由地址
Component string // 组件路径
QueryParam string // 路由参数
IsFrame string // 是否为外链(0是 1否)
IsCache string // 是否缓存(0缓存 1不缓存)
MenuType string // 菜单类型(M目录 C菜单 F按钮)
Visible string // 显示状态(0显示 1隐藏)
Status string // 菜单状态(0正常 1停用)
Perms string // 权限标识
Icon string // 菜单图标
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
Remark string // 备注
}
// sysMenuColumns holds the columns for the table sys_menu.
var sysMenuColumns = SysMenuColumns{
MenuId: "menu_id",
MenuName: "menu_name",
ParentId: "parent_id",
Level: "level",
Tree: "tree",
OrderNum: "order_num",
Path: "path",
Component: "component",
QueryParam: "query_param",
IsFrame: "is_frame",
IsCache: "is_cache",
MenuType: "menu_type",
Visible: "visible",
Status: "status",
Perms: "perms",
Icon: "icon",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
Remark: "remark",
}
// NewSysMenuDao creates and returns a new DAO object for table data access.
func NewSysMenuDao(handlers ...gdb.ModelHandler) *SysMenuDao {
return &SysMenuDao{
group: "default",
table: "sys_menu",
columns: sysMenuColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *SysMenuDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *SysMenuDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *SysMenuDao) Columns() SysMenuColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *SysMenuDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *SysMenuDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *SysMenuDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
+107
View File
@@ -0,0 +1,107 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// SysNoticeDao is the data access object for the table sys_notice.
type SysNoticeDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns SysNoticeColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// SysNoticeColumns defines and stores column names for the table sys_notice.
type SysNoticeColumns struct {
NoticeId string // 公告ID
TenantId string // 租户编号
NoticeTitle string // 公告标题
NoticeType string // 公告类型(1通知 2公告)
NoticeContent string // 公告内容
Status string // 公告状态(0正常 1关闭)
NoticeRange string // 通知范围(1全员 2指定机构 3指定用户)
DeptIds string // 通知机构ID列表JSON
UserIds string // 通知用户ID列表JSON
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
Remark string // 备注
}
// sysNoticeColumns holds the columns for the table sys_notice.
var sysNoticeColumns = SysNoticeColumns{
NoticeId: "notice_id",
TenantId: "tenant_id",
NoticeTitle: "notice_title",
NoticeType: "notice_type",
NoticeContent: "notice_content",
Status: "status",
NoticeRange: "notice_range",
DeptIds: "dept_ids",
UserIds: "user_ids",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
Remark: "remark",
}
// NewSysNoticeDao creates and returns a new DAO object for table data access.
func NewSysNoticeDao(handlers ...gdb.ModelHandler) *SysNoticeDao {
return &SysNoticeDao{
group: "default",
table: "sys_notice",
columns: sysNoticeColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *SysNoticeDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *SysNoticeDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *SysNoticeDao) Columns() SysNoticeColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *SysNoticeDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *SysNoticeDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *SysNoticeDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,107 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// SysNoticeUserDao is the data access object for the table sys_notice_user.
type SysNoticeUserDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns SysNoticeUserColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// SysNoticeUserColumns defines and stores column names for the table sys_notice_user.
type SysNoticeUserColumns struct {
Id string // ID
NoticeId string // 公告ID
TenantId string // 租户编号
NoticeTitle string // 公告标题
NoticeType string // 公告类型(1通知 2公告)
NoticeContent string // 公告内容
Status string // 公告状态(0正常 1关闭)
UserId string // 用户ID
IsRead string // 是否已读(0未读 1已读)
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
Remark string // 备注
}
// sysNoticeUserColumns holds the columns for the table sys_notice_user.
var sysNoticeUserColumns = SysNoticeUserColumns{
Id: "id",
NoticeId: "notice_id",
TenantId: "tenant_id",
NoticeTitle: "notice_title",
NoticeType: "notice_type",
NoticeContent: "notice_content",
Status: "status",
UserId: "user_id",
IsRead: "is_read",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
Remark: "remark",
}
// NewSysNoticeUserDao creates and returns a new DAO object for table data access.
func NewSysNoticeUserDao(handlers ...gdb.ModelHandler) *SysNoticeUserDao {
return &SysNoticeUserDao{
group: "default",
table: "sys_notice_user",
columns: sysNoticeUserColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *SysNoticeUserDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *SysNoticeUserDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *SysNoticeUserDao) Columns() SysNoticeUserColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *SysNoticeUserDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *SysNoticeUserDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *SysNoticeUserDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,113 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// SysOperLogDao is the data access object for the table sys_oper_log.
type SysOperLogDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns SysOperLogColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// SysOperLogColumns defines and stores column names for the table sys_oper_log.
type SysOperLogColumns struct {
OperId string // 日志主键
TenantId string // 租户编号
Title string // 模块标题
BusinessType string // 业务类型(0其它 1新增 2修改 3删除)
Method string // 方法名称
RequestMethod string // 请求方式
OperatorType string // 操作类别(0其它 1后台用户 2手机端用户)
OperName string // 操作人员
DeptName string // 部门名称
OperUrl string // 请求URL
OperIp string // 主机地址
OperLocation string // 操作地点
OperParam string // 请求参数
JsonResult string // 返回参数
Status string // 操作状态(0正常 1异常)
ErrorMsg string // 错误消息
OperTime string // 操作时间
CostTime string // 消耗时间
}
// sysOperLogColumns holds the columns for the table sys_oper_log.
var sysOperLogColumns = SysOperLogColumns{
OperId: "oper_id",
TenantId: "tenant_id",
Title: "title",
BusinessType: "business_type",
Method: "method",
RequestMethod: "request_method",
OperatorType: "operator_type",
OperName: "oper_name",
DeptName: "dept_name",
OperUrl: "oper_url",
OperIp: "oper_ip",
OperLocation: "oper_location",
OperParam: "oper_param",
JsonResult: "json_result",
Status: "status",
ErrorMsg: "error_msg",
OperTime: "oper_time",
CostTime: "cost_time",
}
// NewSysOperLogDao creates and returns a new DAO object for table data access.
func NewSysOperLogDao(handlers ...gdb.ModelHandler) *SysOperLogDao {
return &SysOperLogDao{
group: "default",
table: "sys_oper_log",
columns: sysOperLogColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *SysOperLogDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *SysOperLogDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *SysOperLogDao) Columns() SysOperLogColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *SysOperLogDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *SysOperLogDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *SysOperLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
+111
View File
@@ -0,0 +1,111 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// SysOssDao is the data access object for the table sys_oss.
type SysOssDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns SysOssColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// SysOssColumns defines and stores column names for the table sys_oss.
type SysOssColumns struct {
OssId string // 对象存储主键
TenantId string // 租户编号
FileName string // 文件名
OriginalName string // 原名
FileSuffix string // 文件后缀名
Path string // 存储路径
Url string // URL地址
CreatedDept string // 创建部门
CreatedAt string // 创建时间
CreatedBy string // 创建者
UpdatedAt string // 更新时间
UpdatedBy string // 更新者
Service string // 服务商
Md5 string // 文件MD5
FileSize string // 文件大小
FileCrc16 string // 文件Crc16
FileSum string // 文件校验和
}
// sysOssColumns holds the columns for the table sys_oss.
var sysOssColumns = SysOssColumns{
OssId: "oss_id",
TenantId: "tenant_id",
FileName: "file_name",
OriginalName: "original_name",
FileSuffix: "file_suffix",
Path: "path",
Url: "url",
CreatedDept: "created_dept",
CreatedAt: "created_at",
CreatedBy: "created_by",
UpdatedAt: "updated_at",
UpdatedBy: "updated_by",
Service: "service",
Md5: "md5",
FileSize: "file_size",
FileCrc16: "file_crc16",
FileSum: "file_sum",
}
// NewSysOssDao creates and returns a new DAO object for table data access.
func NewSysOssDao(handlers ...gdb.ModelHandler) *SysOssDao {
return &SysOssDao{
group: "default",
table: "sys_oss",
columns: sysOssColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *SysOssDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *SysOssDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *SysOssDao) Columns() SysOssColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *SysOssDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *SysOssDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *SysOssDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,117 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// SysOssConfigDao is the data access object for the table sys_oss_config.
type SysOssConfigDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns SysOssConfigColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// SysOssConfigColumns defines and stores column names for the table sys_oss_config.
type SysOssConfigColumns struct {
OssConfigId string // 主键
TenantId string // 租户编号
ConfigKey string // 配置key
AccessKey string // accessKey
SecretKey string // 秘钥
BucketName string // 桶名称
Prefix string // 前缀
Endpoint string // 访问站点
Domain string // 自定义域名
IsHttps string // 是否https(Y=是,N=否)
Region string // 域
AccessPolicy string // 桶权限类型(0=private 1=public 2=custom)
Status string // 是否默认(0=是,1=否)
Ext1 string // 扩展字段
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
Remark string // 备注
}
// sysOssConfigColumns holds the columns for the table sys_oss_config.
var sysOssConfigColumns = SysOssConfigColumns{
OssConfigId: "oss_config_id",
TenantId: "tenant_id",
ConfigKey: "config_key",
AccessKey: "access_key",
SecretKey: "secret_key",
BucketName: "bucket_name",
Prefix: "prefix",
Endpoint: "endpoint",
Domain: "domain",
IsHttps: "is_https",
Region: "region",
AccessPolicy: "access_policy",
Status: "status",
Ext1: "ext1",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
Remark: "remark",
}
// NewSysOssConfigDao creates and returns a new DAO object for table data access.
func NewSysOssConfigDao(handlers ...gdb.ModelHandler) *SysOssConfigDao {
return &SysOssConfigDao{
group: "default",
table: "sys_oss_config",
columns: sysOssConfigColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *SysOssConfigDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *SysOssConfigDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *SysOssConfigDao) Columns() SysOssConfigColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *SysOssConfigDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *SysOssConfigDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *SysOssConfigDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
+109
View File
@@ -0,0 +1,109 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// SysPostDao is the data access object for the table sys_post.
type SysPostDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns SysPostColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// SysPostColumns defines and stores column names for the table sys_post.
type SysPostColumns struct {
PostId string // 岗位ID
TenantId string // 租户编号
DeptId string // 部门id
PostCode string // 岗位编码
PostCategory string // 岗位类别编码
PostName string // 岗位名称
PostSort string // 显示顺序
Status string // 状态(0正常 1停用)
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
DeletedBy string // 删除人
DeletedAt string // 删除时间
Remark string // 备注
}
// sysPostColumns holds the columns for the table sys_post.
var sysPostColumns = SysPostColumns{
PostId: "post_id",
TenantId: "tenant_id",
DeptId: "dept_id",
PostCode: "post_code",
PostCategory: "post_category",
PostName: "post_name",
PostSort: "post_sort",
Status: "status",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
DeletedBy: "deleted_by",
DeletedAt: "deleted_at",
Remark: "remark",
}
// NewSysPostDao creates and returns a new DAO object for table data access.
func NewSysPostDao(handlers ...gdb.ModelHandler) *SysPostDao {
return &SysPostDao{
group: "default",
table: "sys_post",
columns: sysPostColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *SysPostDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *SysPostDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *SysPostDao) Columns() SysPostColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *SysPostDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *SysPostDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *SysPostDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
+113
View File
@@ -0,0 +1,113 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// SysRoleDao is the data access object for the table sys_role.
type SysRoleDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns SysRoleColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// SysRoleColumns defines and stores column names for the table sys_role.
type SysRoleColumns struct {
RoleId string // 角色ID
TenantId string // 租户编号
DeptId string // 部门机构id
RoleName string // 角色名称
RoleKey string // 角色权限字符串
RoleSort string // 显示顺序
DataScope string // 数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限 5:仅本人数据权限 6:仅本人数据权限 7:本组织及下一级数据权限
MenuCheckStrictly string // 菜单树选择项是否关联显示
DeptCheckStrictly string // 部门树选择项是否关联显示
Status string // 角色状态(0正常 1停用)
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
DeletedBy string // 删除人
DeletedAt string // 删除时间
Remark string // 备注
}
// sysRoleColumns holds the columns for the table sys_role.
var sysRoleColumns = SysRoleColumns{
RoleId: "role_id",
TenantId: "tenant_id",
DeptId: "dept_id",
RoleName: "role_name",
RoleKey: "role_key",
RoleSort: "role_sort",
DataScope: "data_scope",
MenuCheckStrictly: "menu_check_strictly",
DeptCheckStrictly: "dept_check_strictly",
Status: "status",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
DeletedBy: "deleted_by",
DeletedAt: "deleted_at",
Remark: "remark",
}
// NewSysRoleDao creates and returns a new DAO object for table data access.
func NewSysRoleDao(handlers ...gdb.ModelHandler) *SysRoleDao {
return &SysRoleDao{
group: "default",
table: "sys_role",
columns: sysRoleColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *SysRoleDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *SysRoleDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *SysRoleDao) Columns() SysRoleColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *SysRoleDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *SysRoleDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *SysRoleDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,83 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// SysRoleDeptDao is the data access object for the table sys_role_dept.
type SysRoleDeptDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns SysRoleDeptColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// SysRoleDeptColumns defines and stores column names for the table sys_role_dept.
type SysRoleDeptColumns struct {
TenantId string // 租户编号
RoleId string // 角色ID
DeptId string // 部门ID
}
// sysRoleDeptColumns holds the columns for the table sys_role_dept.
var sysRoleDeptColumns = SysRoleDeptColumns{
TenantId: "tenant_id",
RoleId: "role_id",
DeptId: "dept_id",
}
// NewSysRoleDeptDao creates and returns a new DAO object for table data access.
func NewSysRoleDeptDao(handlers ...gdb.ModelHandler) *SysRoleDeptDao {
return &SysRoleDeptDao{
group: "default",
table: "sys_role_dept",
columns: sysRoleDeptColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *SysRoleDeptDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *SysRoleDeptDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *SysRoleDeptDao) Columns() SysRoleDeptColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *SysRoleDeptDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *SysRoleDeptDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *SysRoleDeptDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,85 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// SysRoleMenuDao is the data access object for the table sys_role_menu.
type SysRoleMenuDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns SysRoleMenuColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// SysRoleMenuColumns defines and stores column names for the table sys_role_menu.
type SysRoleMenuColumns struct {
TenantId string // 租户编号
RoleId string // 角色ID
MenuId string // 菜单ID
DataScope string // 数据范围(0按角色数据权限 1全部数据权限 3本部门数据权限 4本部门及以下数据权限 5仅本人数据权限 6本部门及以下或本人数据权限 7本组织及本组织下一级数据权限 8本组织下一级数据权限)
}
// sysRoleMenuColumns holds the columns for the table sys_role_menu.
var sysRoleMenuColumns = SysRoleMenuColumns{
TenantId: "tenant_id",
RoleId: "role_id",
MenuId: "menu_id",
DataScope: "data_scope",
}
// NewSysRoleMenuDao creates and returns a new DAO object for table data access.
func NewSysRoleMenuDao(handlers ...gdb.ModelHandler) *SysRoleMenuDao {
return &SysRoleMenuDao{
group: "default",
table: "sys_role_menu",
columns: sysRoleMenuColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *SysRoleMenuDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *SysRoleMenuDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *SysRoleMenuDao) Columns() SysRoleMenuColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *SysRoleMenuDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *SysRoleMenuDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *SysRoleMenuDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
+137
View File
@@ -0,0 +1,137 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// SysSocialDao is the data access object for the table sys_social.
type SysSocialDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns SysSocialColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// SysSocialColumns defines and stores column names for the table sys_social.
type SysSocialColumns struct {
Id string // 主键
UserId string // 用户ID
TenantId string // 租户id
AuthId string // 平台+平台唯一id
Source string // 用户来源
OpenId string // 平台编号唯一id
UserName string // 登录账号
NickName string // 用户昵称
Email string // 用户邮箱
Avatar string // 头像地址
AccessToken string // 用户的授权令牌
ExpireIn string // 用户的授权令牌的有效期,部分平台可能没有
RefreshToken string // 刷新令牌,部分平台可能没有
AccessCode string // 平台的授权信息,部分平台可能没有
UnionId string // 用户的 unionid
Scope string // 授予的权限,部分平台可能没有
TokenType string // 个别平台的授权信息,部分平台可能没有
IdToken string // id token,部分平台可能没有
MacAlgorithm string // 小米平台用户的附带属性,部分平台可能没有
MacKey string // 小米平台用户的附带属性,部分平台可能没有
Code string // 用户的授权code,部分平台可能没有
OauthToken string // Twitter平台用户的附带属性,部分平台可能没有
OauthTokenSecret string // Twitter平台用户的附带属性,部分平台可能没有
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
DeletedBy string // 删除人
DeletedAt string // 删除时间
}
// sysSocialColumns holds the columns for the table sys_social.
var sysSocialColumns = SysSocialColumns{
Id: "id",
UserId: "user_id",
TenantId: "tenant_id",
AuthId: "auth_id",
Source: "source",
OpenId: "open_id",
UserName: "user_name",
NickName: "nick_name",
Email: "email",
Avatar: "avatar",
AccessToken: "access_token",
ExpireIn: "expire_in",
RefreshToken: "refresh_token",
AccessCode: "access_code",
UnionId: "union_id",
Scope: "scope",
TokenType: "token_type",
IdToken: "id_token",
MacAlgorithm: "mac_algorithm",
MacKey: "mac_key",
Code: "code",
OauthToken: "oauth_token",
OauthTokenSecret: "oauth_token_secret",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
DeletedBy: "deleted_by",
DeletedAt: "deleted_at",
}
// NewSysSocialDao creates and returns a new DAO object for table data access.
func NewSysSocialDao(handlers ...gdb.ModelHandler) *SysSocialDao {
return &SysSocialDao{
group: "default",
table: "sys_social",
columns: sysSocialColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *SysSocialDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *SysSocialDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *SysSocialDao) Columns() SysSocialColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *SysSocialDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *SysSocialDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *SysSocialDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
+125
View File
@@ -0,0 +1,125 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// SysTenantDao is the data access object for the table sys_tenant.
type SysTenantDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns SysTenantColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// SysTenantColumns defines and stores column names for the table sys_tenant.
type SysTenantColumns struct {
Id string // id
TenantId string // 租户编号
ContactUserName string // 联系人
ContactPhone string // 联系电话
CompanyName string // 企业名称
LicenseNumber string // 统一社会信用代码
Address string // 地址
Intro string // 企业简介
Domain string // 域名
Remark string // 备注
PackageId string // 租户套餐编号
AdminRoleId string // 管理员角色ID
AdminDeptId string // 管理员部门ID
AdminUserId string // 管理员用户ID
ExpireTime string // 过期时间
AccountCount string // 用户数量(-1不限制)
Status string // 租户状态(0正常 1停用)
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
DeletedBy string // 删除人
DeletedAt string // 删除时间
}
// sysTenantColumns holds the columns for the table sys_tenant.
var sysTenantColumns = SysTenantColumns{
Id: "id",
TenantId: "tenant_id",
ContactUserName: "contact_user_name",
ContactPhone: "contact_phone",
CompanyName: "company_name",
LicenseNumber: "license_number",
Address: "address",
Intro: "intro",
Domain: "domain",
Remark: "remark",
PackageId: "package_id",
AdminRoleId: "admin_role_id",
AdminDeptId: "admin_dept_id",
AdminUserId: "admin_user_id",
ExpireTime: "expire_time",
AccountCount: "account_count",
Status: "status",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
DeletedBy: "deleted_by",
DeletedAt: "deleted_at",
}
// NewSysTenantDao creates and returns a new DAO object for table data access.
func NewSysTenantDao(handlers ...gdb.ModelHandler) *SysTenantDao {
return &SysTenantDao{
group: "default",
table: "sys_tenant",
columns: sysTenantColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *SysTenantDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *SysTenantDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *SysTenantDao) Columns() SysTenantColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *SysTenantDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *SysTenantDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *SysTenantDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,103 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// SysTenantPackageDao is the data access object for the table sys_tenant_package.
type SysTenantPackageDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns SysTenantPackageColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// SysTenantPackageColumns defines and stores column names for the table sys_tenant_package.
type SysTenantPackageColumns struct {
PackageId string // 租户套餐id
PackageName string // 套餐名称
MenuIds string // 关联菜单id
Remark string // 备注
MenuCheckStrictly string // 菜单树选择项是否关联显示
Status string // 状态(0正常 1停用)
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
DeletedBy string // 删除人
DeletedAt string // 删除时间
}
// sysTenantPackageColumns holds the columns for the table sys_tenant_package.
var sysTenantPackageColumns = SysTenantPackageColumns{
PackageId: "package_id",
PackageName: "package_name",
MenuIds: "menu_ids",
Remark: "remark",
MenuCheckStrictly: "menu_check_strictly",
Status: "status",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
DeletedBy: "deleted_by",
DeletedAt: "deleted_at",
}
// NewSysTenantPackageDao creates and returns a new DAO object for table data access.
func NewSysTenantPackageDao(handlers ...gdb.ModelHandler) *SysTenantPackageDao {
return &SysTenantPackageDao{
group: "default",
table: "sys_tenant_package",
columns: sysTenantPackageColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *SysTenantPackageDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *SysTenantPackageDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *SysTenantPackageDao) Columns() SysTenantPackageColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *SysTenantPackageDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *SysTenantPackageDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *SysTenantPackageDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
+125
View File
@@ -0,0 +1,125 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// SysUserDao is the data access object for the table sys_user.
type SysUserDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns SysUserColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// SysUserColumns defines and stores column names for the table sys_user.
type SysUserColumns struct {
UserId string // 用户ID
TenantId string // 租户编号
DeptId string // 部门ID
UserName string // 用户账号
NickName string // 用户昵称
UserType string // 用户类型(sys_user系统用户)
Email string // 用户邮箱
Phonenumber string // 手机号码
Sex string // 用户性别(0男 1女 2未知)
Avatar string // 头像地址
Salt string // 加密盐
Password string // 密码
Status string // 帐号状态(0正常 1停用)
LoginIp string // 最后登录IP
LoginDate string // 最后登录时间
MfaEnabled string // 是否开启邮箱MFA 0否 1是
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
DeletedBy string // 删除人
DeletedAt string // 删除时间
Remark string // 备注
}
// sysUserColumns holds the columns for the table sys_user.
var sysUserColumns = SysUserColumns{
UserId: "user_id",
TenantId: "tenant_id",
DeptId: "dept_id",
UserName: "user_name",
NickName: "nick_name",
UserType: "user_type",
Email: "email",
Phonenumber: "phonenumber",
Sex: "sex",
Avatar: "avatar",
Salt: "salt",
Password: "password",
Status: "status",
LoginIp: "login_ip",
LoginDate: "login_date",
MfaEnabled: "mfa_enabled",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
DeletedBy: "deleted_by",
DeletedAt: "deleted_at",
Remark: "remark",
}
// NewSysUserDao creates and returns a new DAO object for table data access.
func NewSysUserDao(handlers ...gdb.ModelHandler) *SysUserDao {
return &SysUserDao{
group: "default",
table: "sys_user",
columns: sysUserColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *SysUserDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *SysUserDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *SysUserDao) Columns() SysUserColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *SysUserDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *SysUserDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *SysUserDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,105 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// SysUserOnlineDao is the data access object for the table sys_user_online.
type SysUserOnlineDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns SysUserOnlineColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// SysUserOnlineColumns defines and stores column names for the table sys_user_online.
type SysUserOnlineColumns struct {
OnlineId string // 访问ID
TenantId string // 租户编号
Uuid string // UUID
UserName string // 用户账号
ClientKey string // 客户端
DeviceType string // 设备类型
Ipaddr string // 登录IP地址
LoginLocation string // 登录地点
Browser string // 浏览器类型
Os string // 操作系统
Token string // Token
LoginTime string // 访问时间
ExpireTime string // 过期时间
DeletedAt string // 删除时间
}
// sysUserOnlineColumns holds the columns for the table sys_user_online.
var sysUserOnlineColumns = SysUserOnlineColumns{
OnlineId: "online_id",
TenantId: "tenant_id",
Uuid: "uuid",
UserName: "user_name",
ClientKey: "client_key",
DeviceType: "device_type",
Ipaddr: "ipaddr",
LoginLocation: "login_location",
Browser: "browser",
Os: "os",
Token: "token",
LoginTime: "login_time",
ExpireTime: "expire_time",
DeletedAt: "deleted_at",
}
// NewSysUserOnlineDao creates and returns a new DAO object for table data access.
func NewSysUserOnlineDao(handlers ...gdb.ModelHandler) *SysUserOnlineDao {
return &SysUserOnlineDao{
group: "default",
table: "sys_user_online",
columns: sysUserOnlineColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *SysUserOnlineDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *SysUserOnlineDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *SysUserOnlineDao) Columns() SysUserOnlineColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *SysUserOnlineDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *SysUserOnlineDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *SysUserOnlineDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,83 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// SysUserPostDao is the data access object for the table sys_user_post.
type SysUserPostDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns SysUserPostColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// SysUserPostColumns defines and stores column names for the table sys_user_post.
type SysUserPostColumns struct {
TenantId string // 租户编号
UserId string // 用户ID
PostId string // 岗位ID
}
// sysUserPostColumns holds the columns for the table sys_user_post.
var sysUserPostColumns = SysUserPostColumns{
TenantId: "tenant_id",
UserId: "user_id",
PostId: "post_id",
}
// NewSysUserPostDao creates and returns a new DAO object for table data access.
func NewSysUserPostDao(handlers ...gdb.ModelHandler) *SysUserPostDao {
return &SysUserPostDao{
group: "default",
table: "sys_user_post",
columns: sysUserPostColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *SysUserPostDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *SysUserPostDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *SysUserPostDao) Columns() SysUserPostColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *SysUserPostDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *SysUserPostDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *SysUserPostDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,83 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// SysUserRoleDao is the data access object for the table sys_user_role.
type SysUserRoleDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns SysUserRoleColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// SysUserRoleColumns defines and stores column names for the table sys_user_role.
type SysUserRoleColumns struct {
TenantId string // 租户编号
UserId string // 用户ID
RoleId string // 角色ID
}
// sysUserRoleColumns holds the columns for the table sys_user_role.
var sysUserRoleColumns = SysUserRoleColumns{
TenantId: "tenant_id",
UserId: "user_id",
RoleId: "role_id",
}
// NewSysUserRoleDao creates and returns a new DAO object for table data access.
func NewSysUserRoleDao(handlers ...gdb.ModelHandler) *SysUserRoleDao {
return &SysUserRoleDao{
group: "default",
table: "sys_user_role",
columns: sysUserRoleColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *SysUserRoleDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *SysUserRoleDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *SysUserRoleDao) Columns() SysUserRoleColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *SysUserRoleDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *SysUserRoleDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *SysUserRoleDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,111 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TAgentBalanceDao is the data access object for the table t_agent_balance.
type TAgentBalanceDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns TAgentBalanceColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TAgentBalanceColumns defines and stores column names for the table t_agent_balance.
type TAgentBalanceColumns struct {
Id string // 账户ID
DeptId string // 机构ID
Balance string // 账户余额
WithdrawAmount string // 可提现金额
WithdrawAmountStatus string // 可提现金额状态: 1-正常, 0-冻结
InvoiceAmount string // 已开票金额
CanInvoiceAmount string // 可开票金额
CreditLimit string // 信用额度
UsedCredit string // 已使用信用额度
PendingRepayment string // 待还款金额
Status string // 状态: 0-正常, 1-禁用
TenantId string // 租户ID
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
}
// tAgentBalanceColumns holds the columns for the table t_agent_balance.
var tAgentBalanceColumns = TAgentBalanceColumns{
Id: "id",
DeptId: "dept_id",
Balance: "balance",
WithdrawAmount: "withdraw_amount",
WithdrawAmountStatus: "withdraw_amount_status",
InvoiceAmount: "invoice_amount",
CanInvoiceAmount: "can_invoice_amount",
CreditLimit: "credit_limit",
UsedCredit: "used_credit",
PendingRepayment: "pending_repayment",
Status: "status",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewTAgentBalanceDao creates and returns a new DAO object for table data access.
func NewTAgentBalanceDao(handlers ...gdb.ModelHandler) *TAgentBalanceDao {
return &TAgentBalanceDao{
group: "default",
table: "t_agent_balance",
columns: tAgentBalanceColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TAgentBalanceDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TAgentBalanceDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TAgentBalanceDao) Columns() TAgentBalanceColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TAgentBalanceDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *TAgentBalanceDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TAgentBalanceDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,109 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TAgentEnterpriseDao is the data access object for the table t_agent_enterprise.
type TAgentEnterpriseDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns TAgentEnterpriseColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TAgentEnterpriseColumns defines and stores column names for the table t_agent_enterprise.
type TAgentEnterpriseColumns struct {
Id string // 主键ID
DeptId string // 部门机构id
FullName string // 单位全称
Industry string // 行业
LegalPersonName string // 法人名称
LegalPersonIdCard string // 法人身份证号
CompanyType string // 单位类型
EstablishTime string // 单位成立时间
BankName string // 开户行名称
BankAccount string // 开户行账号
TenantId string // 租户ID
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
}
// tAgentEnterpriseColumns holds the columns for the table t_agent_enterprise.
var tAgentEnterpriseColumns = TAgentEnterpriseColumns{
Id: "id",
DeptId: "dept_id",
FullName: "full_name",
Industry: "industry",
LegalPersonName: "legal_person_name",
LegalPersonIdCard: "legal_person_id_card",
CompanyType: "company_type",
EstablishTime: "establish_time",
BankName: "bank_name",
BankAccount: "bank_account",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewTAgentEnterpriseDao creates and returns a new DAO object for table data access.
func NewTAgentEnterpriseDao(handlers ...gdb.ModelHandler) *TAgentEnterpriseDao {
return &TAgentEnterpriseDao{
group: "default",
table: "t_agent_enterprise",
columns: tAgentEnterpriseColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TAgentEnterpriseDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TAgentEnterpriseDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TAgentEnterpriseDao) Columns() TAgentEnterpriseColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TAgentEnterpriseDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *TAgentEnterpriseDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TAgentEnterpriseDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
+105
View File
@@ -0,0 +1,105 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TApiDao is the data access object for the table t_api.
type TApiDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns TApiColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TApiColumns defines and stores column names for the table t_api.
type TApiColumns struct {
Id string // ID
AppKey string // APPKey
AppSecret string // APPSecret
GroupId string // 权限组ID
Status string // 状态:0启用,1停用
RateLimitPeriod string // 限流周期(秒,0:不限流)
RateLimitCount string // 限流次数
DeptId string // 所属机构
TenantId string // 租户ID
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
}
// tApiColumns holds the columns for the table t_api.
var tApiColumns = TApiColumns{
Id: "id",
AppKey: "app_key",
AppSecret: "app_secret",
GroupId: "group_id",
Status: "status",
RateLimitPeriod: "rate_limit_period",
RateLimitCount: "rate_limit_count",
DeptId: "dept_id",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewTApiDao creates and returns a new DAO object for table data access.
func NewTApiDao(handlers ...gdb.ModelHandler) *TApiDao {
return &TApiDao{
group: "default",
table: "t_api",
columns: tApiColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TApiDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TApiDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TApiDao) Columns() TApiColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TApiDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *TApiDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TApiDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,99 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TApiGroupDao is the data access object for the table t_api_group.
type TApiGroupDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns TApiGroupColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TApiGroupColumns defines and stores column names for the table t_api_group.
type TApiGroupColumns struct {
Id string // 主键ID
GroupName string // 权限组名称
GroupCode string // 权限组编码
Status string // 状态:0启用,1停用
Remark string // 备注
TenantId string // 租户ID
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
}
// tApiGroupColumns holds the columns for the table t_api_group.
var tApiGroupColumns = TApiGroupColumns{
Id: "id",
GroupName: "group_name",
GroupCode: "group_code",
Status: "status",
Remark: "remark",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewTApiGroupDao creates and returns a new DAO object for table data access.
func NewTApiGroupDao(handlers ...gdb.ModelHandler) *TApiGroupDao {
return &TApiGroupDao{
group: "default",
table: "t_api_group",
columns: tApiGroupColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TApiGroupDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TApiGroupDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TApiGroupDao) Columns() TApiGroupColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TApiGroupDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *TApiGroupDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TApiGroupDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,81 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TApiGroupResourceDao is the data access object for the table t_api_group_resource.
type TApiGroupResourceDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns TApiGroupResourceColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TApiGroupResourceColumns defines and stores column names for the table t_api_group_resource.
type TApiGroupResourceColumns struct {
GroupId string // 权限组ID,对应t_api_group.id
ApiId string // 开放接口资源ID,对应t_api_resource.id
}
// tApiGroupResourceColumns holds the columns for the table t_api_group_resource.
var tApiGroupResourceColumns = TApiGroupResourceColumns{
GroupId: "group_id",
ApiId: "api_id",
}
// NewTApiGroupResourceDao creates and returns a new DAO object for table data access.
func NewTApiGroupResourceDao(handlers ...gdb.ModelHandler) *TApiGroupResourceDao {
return &TApiGroupResourceDao{
group: "default",
table: "t_api_group_resource",
columns: tApiGroupResourceColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TApiGroupResourceDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TApiGroupResourceDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TApiGroupResourceDao) Columns() TApiGroupResourceColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TApiGroupResourceDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *TApiGroupResourceDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TApiGroupResourceDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,105 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TApiResourceDao is the data access object for the table t_api_resource.
type TApiResourceDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns TApiResourceColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TApiResourceColumns defines and stores column names for the table t_api_resource.
type TApiResourceColumns struct {
Id string // 主键ID
ApiName string // 接口名称
ApiCode string // 接口权限标识
Method string // 请求方法:GET/POST/PUT/DELETE
Path string // 接口路径
Status string // 状态:0启用,1停用
Version string // 接口版本
Remark string // 备注
TenantId string // 租户ID
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
}
// tApiResourceColumns holds the columns for the table t_api_resource.
var tApiResourceColumns = TApiResourceColumns{
Id: "id",
ApiName: "api_name",
ApiCode: "api_code",
Method: "method",
Path: "path",
Status: "status",
Version: "version",
Remark: "remark",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewTApiResourceDao creates and returns a new DAO object for table data access.
func NewTApiResourceDao(handlers ...gdb.ModelHandler) *TApiResourceDao {
return &TApiResourceDao{
group: "default",
table: "t_api_resource",
columns: tApiResourceColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TApiResourceDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TApiResourceDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TApiResourceDao) Columns() TApiResourceColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TApiResourceDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *TApiResourceDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TApiResourceDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,115 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TBalanceDetailDao is the data access object for the table t_balance_detail.
type TBalanceDetailDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns TBalanceDetailColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TBalanceDetailColumns defines and stores column names for the table t_balance_detail.
type TBalanceDetailColumns struct {
Id string // 明细ID
DeptId string // 账户ID
SerialNo string // 流水号
TransactionTime string // 交易时间
IncomeExpenseType string // 收支类型: 0收入,1支出
TransactionType string // 交易类型:0充值 1消费 2转可提现 3可提现转入 4人工调整
TransactionChannel string // 交易渠道:1支付宝 2微信 3可提现金额
Amount string // 交易金额
BeforeBalance string // 变动前余额
BalanceAfter string // 变动后余额
ChannelSerialNo string // 交易渠道流水号
OrderSn string // 关联订单号
Remark string // 备注
TenantId string // 租户ID
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
}
// tBalanceDetailColumns holds the columns for the table t_balance_detail.
var tBalanceDetailColumns = TBalanceDetailColumns{
Id: "id",
DeptId: "dept_id",
SerialNo: "serial_no",
TransactionTime: "transaction_time",
IncomeExpenseType: "income_expense_type",
TransactionType: "transaction_type",
TransactionChannel: "transaction_channel",
Amount: "amount",
BeforeBalance: "before_balance",
BalanceAfter: "balance_after",
ChannelSerialNo: "channel_serial_no",
OrderSn: "order_sn",
Remark: "remark",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewTBalanceDetailDao creates and returns a new DAO object for table data access.
func NewTBalanceDetailDao(handlers ...gdb.ModelHandler) *TBalanceDetailDao {
return &TBalanceDetailDao{
group: "default",
table: "t_balance_detail",
columns: tBalanceDetailColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TBalanceDetailDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TBalanceDetailDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TBalanceDetailDao) Columns() TBalanceDetailColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TBalanceDetailDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *TBalanceDetailDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TBalanceDetailDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,133 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TConsumeAccountMonthBillDao is the data access object for the table t_consume_account_month_bill.
type TConsumeAccountMonthBillDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns TConsumeAccountMonthBillColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TConsumeAccountMonthBillColumns defines and stores column names for the table t_consume_account_month_bill.
type TConsumeAccountMonthBillColumns struct {
Id string // 账单ID
DeptId string // 机构ID
AccountPeriod string // 账期YYYY-MM
OpeningBalance string // 月初余额
RechargeIncome string // 充值收入
WithdrawableTransferInIncome string // 可提现转入收入
ManualAdjustIncome string // 人工调账收入
RefundIncome string // 退款收入
ConsumeExpense string // 平台消费支出
BalanceTransferOutExpense string // 转可提现支出
ManualAdjustExpense string // 人工调账支出
ConsumeCreditRepayExpense string // 消费账户还款支出
TotalIncome string // 本月收入总额
TotalExpense string // 本月支出总额
ClosingBalance string // 月末余额(月初余额+本月收入-本月支出)
IncomeCount string // 收入笔数
ExpenseCount string // 支出笔数
CreditUsed string // 本月使用信用额度
CreditRepaid string // 本月还款信用额度
BillStatus string // 账单状态:1正常,2已调整,3已作废
SettleTime string // 结算时间
Remark string // 备注
TenantId string // 租户ID
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
}
// tConsumeAccountMonthBillColumns holds the columns for the table t_consume_account_month_bill.
var tConsumeAccountMonthBillColumns = TConsumeAccountMonthBillColumns{
Id: "id",
DeptId: "dept_id",
AccountPeriod: "account_period",
OpeningBalance: "opening_balance",
RechargeIncome: "recharge_income",
WithdrawableTransferInIncome: "withdrawable_transfer_in_income",
ManualAdjustIncome: "manual_adjust_income",
RefundIncome: "refund_income",
ConsumeExpense: "consume_expense",
BalanceTransferOutExpense: "balance_transfer_out_expense",
ManualAdjustExpense: "manual_adjust_expense",
ConsumeCreditRepayExpense: "consume_credit_repay_expense",
TotalIncome: "total_income",
TotalExpense: "total_expense",
ClosingBalance: "closing_balance",
IncomeCount: "income_count",
ExpenseCount: "expense_count",
CreditUsed: "credit_used",
CreditRepaid: "credit_repaid",
BillStatus: "bill_status",
SettleTime: "settle_time",
Remark: "remark",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewTConsumeAccountMonthBillDao creates and returns a new DAO object for table data access.
func NewTConsumeAccountMonthBillDao(handlers ...gdb.ModelHandler) *TConsumeAccountMonthBillDao {
return &TConsumeAccountMonthBillDao{
group: "default",
table: "t_consume_account_month_bill",
columns: tConsumeAccountMonthBillColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TConsumeAccountMonthBillDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TConsumeAccountMonthBillDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TConsumeAccountMonthBillDao) Columns() TConsumeAccountMonthBillColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TConsumeAccountMonthBillDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *TConsumeAccountMonthBillDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TConsumeAccountMonthBillDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,113 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TCreditDetailDao is the data access object for the table t_credit_detail.
type TCreditDetailDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns TCreditDetailColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TCreditDetailColumns defines and stores column names for the table t_credit_detail.
type TCreditDetailColumns struct {
Id string // 明细ID
DeptId string // 组织机构ID
AccountPeriod string // 账期(YYYY-MM)
TransactionType string // 交易类型: 使用/还款
Amount string // 金额
CreditBalanceBefore string // 变动前信用额度余额
CreditBalanceAfter string // 变动后信用额度余额
RelatedOrderSn string // 关联订单号
RepaymentMethod string // 还款方式: 0 余额 1 银行卡 2 支付宝 3 微信
RepaymentChannelSerial string // 交易渠道流水号
TransactionTime string // 交易时间
Remark string // 备注
TenantId string // 租户ID
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
}
// tCreditDetailColumns holds the columns for the table t_credit_detail.
var tCreditDetailColumns = TCreditDetailColumns{
Id: "id",
DeptId: "dept_id",
AccountPeriod: "account_period",
TransactionType: "transaction_type",
Amount: "amount",
CreditBalanceBefore: "credit_balance_before",
CreditBalanceAfter: "credit_balance_after",
RelatedOrderSn: "related_order_sn",
RepaymentMethod: "repayment_method",
RepaymentChannelSerial: "repayment_channel_serial",
TransactionTime: "transaction_time",
Remark: "remark",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewTCreditDetailDao creates and returns a new DAO object for table data access.
func NewTCreditDetailDao(handlers ...gdb.ModelHandler) *TCreditDetailDao {
return &TCreditDetailDao{
group: "default",
table: "t_credit_detail",
columns: tCreditDetailColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TCreditDetailDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TCreditDetailDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TCreditDetailDao) Columns() TCreditDetailColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TCreditDetailDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *TCreditDetailDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TCreditDetailDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,107 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TCustWithdrawAccountDao is the data access object for the table t_cust_withdraw_account.
type TCustWithdrawAccountDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns TCustWithdrawAccountColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TCustWithdrawAccountColumns defines and stores column names for the table t_cust_withdraw_account.
type TCustWithdrawAccountColumns struct {
Id string // 主键ID
DeptId string // 企业客户ID
AccountType string // 提现账号类型,1:支付宝,2:微信
AccountNo string // 账号
AccountName string // 账户名称/真实姓名
Mobile string // 手机号
IsDefault string // 是否默认账号:0-否 1-是
Enabled string // 是否启用:0-未启用 1-启用
Status string // 状态:0-禁用 1-正常
TenantId string // 租户ID
CreatedDept string // 创建部门ID
CreatedBy string // 创建者ID
CreatedAt string // 创建时间
UpdatedBy string // 更新者ID
UpdatedAt string // 更新时间
}
// tCustWithdrawAccountColumns holds the columns for the table t_cust_withdraw_account.
var tCustWithdrawAccountColumns = TCustWithdrawAccountColumns{
Id: "id",
DeptId: "dept_id",
AccountType: "account_type",
AccountNo: "account_no",
AccountName: "account_name",
Mobile: "mobile",
IsDefault: "is_default",
Enabled: "enabled",
Status: "status",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewTCustWithdrawAccountDao creates and returns a new DAO object for table data access.
func NewTCustWithdrawAccountDao(handlers ...gdb.ModelHandler) *TCustWithdrawAccountDao {
return &TCustWithdrawAccountDao{
group: "default",
table: "t_cust_withdraw_account",
columns: tCustWithdrawAccountColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TCustWithdrawAccountDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TCustWithdrawAccountDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TCustWithdrawAccountDao) Columns() TCustWithdrawAccountColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TCustWithdrawAccountDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *TCustWithdrawAccountDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TCustWithdrawAccountDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,103 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TDeptFlowDailyDao is the data access object for the table t_dept_flow_daily.
type TDeptFlowDailyDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns TDeptFlowDailyColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TDeptFlowDailyColumns defines and stores column names for the table t_dept_flow_daily.
type TDeptFlowDailyColumns struct {
Id string // 自增主键
DeptId string // 渠道客户ID
StatDate string // 统计日期
TotalUsedFlowMb string // 当日所有卡总消耗流量MB
TotalSms string // 当日总短信使用条数
TotalVoiceMin string // 当日总语音分钟数
Remark string // 备注,同步失败原因/特殊说明
TenantId string // 租户ID
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
}
// tDeptFlowDailyColumns holds the columns for the table t_dept_flow_daily.
var tDeptFlowDailyColumns = TDeptFlowDailyColumns{
Id: "id",
DeptId: "dept_id",
StatDate: "stat_date",
TotalUsedFlowMb: "total_used_flow_mb",
TotalSms: "total_sms",
TotalVoiceMin: "total_voice_min",
Remark: "remark",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewTDeptFlowDailyDao creates and returns a new DAO object for table data access.
func NewTDeptFlowDailyDao(handlers ...gdb.ModelHandler) *TDeptFlowDailyDao {
return &TDeptFlowDailyDao{
group: "default",
table: "t_dept_flow_daily",
columns: tDeptFlowDailyColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TDeptFlowDailyDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TDeptFlowDailyDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TDeptFlowDailyDao) Columns() TDeptFlowDailyColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TDeptFlowDailyDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *TDeptFlowDailyDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TDeptFlowDailyDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,89 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TDivisionCodeDao is the data access object for the table t_division_code.
type TDivisionCodeDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns TDivisionCodeColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TDivisionCodeColumns defines and stores column names for the table t_division_code.
type TDivisionCodeColumns struct {
RegionId string // ID
RegionCode string // 行政区域代码
RegionName string // 行政区域名称
RegionLevel string // 等级
RegionParent string // 上级代码
RegionType string // 城乡分类代码
}
// tDivisionCodeColumns holds the columns for the table t_division_code.
var tDivisionCodeColumns = TDivisionCodeColumns{
RegionId: "region_id",
RegionCode: "region_code",
RegionName: "region_name",
RegionLevel: "region_level",
RegionParent: "region_parent",
RegionType: "region_type",
}
// NewTDivisionCodeDao creates and returns a new DAO object for table data access.
func NewTDivisionCodeDao(handlers ...gdb.ModelHandler) *TDivisionCodeDao {
return &TDivisionCodeDao{
group: "default",
table: "t_division_code",
columns: tDivisionCodeColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TDivisionCodeDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TDivisionCodeDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TDivisionCodeDao) Columns() TDivisionCodeColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TDivisionCodeDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *TDivisionCodeDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TDivisionCodeDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,115 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TFinCommissionDetailDao is the data access object for the table t_fin_commission_detail.
type TFinCommissionDetailDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns TFinCommissionDetailColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TFinCommissionDetailColumns defines and stores column names for the table t_fin_commission_detail.
type TFinCommissionDetailColumns struct {
Id string // 主键ID
CommissionNo string // 分润明细编号
OrderSn string // 订单编号
OrderType string // 订单类型
ProductId string // 商品ID
PayerDeptId string // 下级机构ID
BenefitDeptId string // 受益机构ID
BenefitDeptLevel string // 受益机构层级
CommissionAmount string // 分润金额
CommissionStatus string // 分润状态:0待结算,1可提现
BenefitSnapshot string // 价格快照(受益机构的成本价+利润+利润悉数=出货单价)
AccountPeriod string // 账期(YYYY-MM)
SettlementTime string // 结算时间
TenantId string // 租户ID
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
}
// tFinCommissionDetailColumns holds the columns for the table t_fin_commission_detail.
var tFinCommissionDetailColumns = TFinCommissionDetailColumns{
Id: "id",
CommissionNo: "commission_no",
OrderSn: "order_sn",
OrderType: "order_type",
ProductId: "product_id",
PayerDeptId: "payer_dept_id",
BenefitDeptId: "benefit_dept_id",
BenefitDeptLevel: "benefit_dept_level",
CommissionAmount: "commission_amount",
CommissionStatus: "commission_status",
BenefitSnapshot: "benefit_snapshot",
AccountPeriod: "account_period",
SettlementTime: "settlement_time",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewTFinCommissionDetailDao creates and returns a new DAO object for table data access.
func NewTFinCommissionDetailDao(handlers ...gdb.ModelHandler) *TFinCommissionDetailDao {
return &TFinCommissionDetailDao{
group: "default",
table: "t_fin_commission_detail",
columns: tFinCommissionDetailColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TFinCommissionDetailDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TFinCommissionDetailDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TFinCommissionDetailDao) Columns() TFinCommissionDetailColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TFinCommissionDetailDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *TFinCommissionDetailDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TFinCommissionDetailDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,119 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TFinWithdrawableChangeDao is the data access object for the table t_fin_withdrawable_change.
type TFinWithdrawableChangeDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns TFinWithdrawableChangeColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TFinWithdrawableChangeColumns defines and stores column names for the table t_fin_withdrawable_change.
type TFinWithdrawableChangeColumns struct {
Id string // 主键ID
DeptId string // 机构ID
ChangeType string // 变动类型:0分润,1提现,2转出(可提现转余额)3转入(余额转可提现)4还款
IncomeExpenseType string // 收支类型: 0收入,1支出
ChangeAmount string // 变动金额
BeforeBalance string // 变动前可提现余额
AfterBalance string // 变动后可提现余额
AccountType string // 提现账号类型,1:银行卡,2:支付宝,3:微信
BankName string // 开户行名称
BankAccount string // 开户行账号或账号
AccountName string // 用户姓名
IdentityCard string // 用户身份证号
SourceNo string // 来源单号
Remark string // 备注
AccountPeriod string // 账期(YYYY-MM)
TenantId string // 租户ID
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
}
// tFinWithdrawableChangeColumns holds the columns for the table t_fin_withdrawable_change.
var tFinWithdrawableChangeColumns = TFinWithdrawableChangeColumns{
Id: "id",
DeptId: "dept_id",
ChangeType: "change_type",
IncomeExpenseType: "income_expense_type",
ChangeAmount: "change_amount",
BeforeBalance: "before_balance",
AfterBalance: "after_balance",
AccountType: "account_type",
BankName: "bank_name",
BankAccount: "bank_account",
AccountName: "account_name",
IdentityCard: "identity_card",
SourceNo: "source_no",
Remark: "remark",
AccountPeriod: "account_period",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewTFinWithdrawableChangeDao creates and returns a new DAO object for table data access.
func NewTFinWithdrawableChangeDao(handlers ...gdb.ModelHandler) *TFinWithdrawableChangeDao {
return &TFinWithdrawableChangeDao{
group: "default",
table: "t_fin_withdrawable_change",
columns: tFinWithdrawableChangeColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TFinWithdrawableChangeDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TFinWithdrawableChangeDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TFinWithdrawableChangeDao) Columns() TFinWithdrawableChangeColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TFinWithdrawableChangeDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *TFinWithdrawableChangeDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TFinWithdrawableChangeDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,125 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TFinanceApplyDao is the data access object for the table t_finance_apply.
type TFinanceApplyDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns TFinanceApplyColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TFinanceApplyColumns defines and stores column names for the table t_finance_apply.
type TFinanceApplyColumns struct {
Id string // 主键ID
ApplyNo string // 申请单号
ApplyType string // 申请类型(1:提现申请,2:余额转提现)
AuditType string // 审核类型:1初审,2复审
ApplyDeptId string // 申请机构ID
AuditDeptId string // 审核方机构ID,通常为直属上级或顶级
AvailableAmountSnapshot string // 申请前可提现余额快照
ApplyAmount string // 申请金额
AccountType string // 提现账号类型,1:银行卡,2:支付宝,3:微信
BankName string // 开户行名称
BankAccount string // 开户行账号或账号
AccountName string // 用户姓名
IdentityCard string // 用户身份证号
ReceiveAccount string // 收款账户信息快照
ApplyStatus string // 状态:0待审核,1已通过,2已驳回,3已打款,4已取消
ApplyTime string // 申请时间
AuditTime string // 最近审核时间
Remark string // 备注
TenantId string // 租户ID
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
}
// tFinanceApplyColumns holds the columns for the table t_finance_apply.
var tFinanceApplyColumns = TFinanceApplyColumns{
Id: "id",
ApplyNo: "apply_no",
ApplyType: "apply_type",
AuditType: "audit_type",
ApplyDeptId: "apply_dept_id",
AuditDeptId: "audit_dept_id",
AvailableAmountSnapshot: "available_amount_snapshot",
ApplyAmount: "apply_amount",
AccountType: "account_type",
BankName: "bank_name",
BankAccount: "bank_account",
AccountName: "account_name",
IdentityCard: "identity_card",
ReceiveAccount: "receive_account",
ApplyStatus: "apply_status",
ApplyTime: "apply_time",
AuditTime: "audit_time",
Remark: "remark",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewTFinanceApplyDao creates and returns a new DAO object for table data access.
func NewTFinanceApplyDao(handlers ...gdb.ModelHandler) *TFinanceApplyDao {
return &TFinanceApplyDao{
group: "default",
table: "t_finance_apply",
columns: tFinanceApplyColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TFinanceApplyDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TFinanceApplyDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TFinanceApplyDao) Columns() TFinanceApplyColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TFinanceApplyDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *TFinanceApplyDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TFinanceApplyDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,105 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TFinanceAuditRecordDao is the data access object for the table t_finance_audit_record.
type TFinanceAuditRecordDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns TFinanceAuditRecordColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TFinanceAuditRecordColumns defines and stores column names for the table t_finance_audit_record.
type TFinanceAuditRecordColumns struct {
Id string // 主键ID
AuditNo string // 审核记录编号
ApplyNo string // 申请单号
AuditDeptId string // 审核方机构ID
AuditorUserId string // 审核人ID
AuditResult string // 审核结果:0通过,1驳回
AuditOpinion string // 审核意见
AuditTime string // 审核时间
TenantId string // 租户ID
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
}
// tFinanceAuditRecordColumns holds the columns for the table t_finance_audit_record.
var tFinanceAuditRecordColumns = TFinanceAuditRecordColumns{
Id: "id",
AuditNo: "audit_no",
ApplyNo: "apply_no",
AuditDeptId: "audit_dept_id",
AuditorUserId: "auditor_user_id",
AuditResult: "audit_result",
AuditOpinion: "audit_opinion",
AuditTime: "audit_time",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewTFinanceAuditRecordDao creates and returns a new DAO object for table data access.
func NewTFinanceAuditRecordDao(handlers ...gdb.ModelHandler) *TFinanceAuditRecordDao {
return &TFinanceAuditRecordDao{
group: "default",
table: "t_finance_audit_record",
columns: tFinanceAuditRecordColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TFinanceAuditRecordDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TFinanceAuditRecordDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TFinanceAuditRecordDao) Columns() TFinanceAuditRecordColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TFinanceAuditRecordDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *TFinanceAuditRecordDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TFinanceAuditRecordDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
+183
View File
@@ -0,0 +1,183 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TOrderDao is the data access object for the table t_order.
type TOrderDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns TOrderColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TOrderColumns defines and stores column names for the table t_order.
type TOrderColumns struct {
Id string // 主键ID
OrderSn string // 订单编号
ParentOrderId string // 父订单ID
ParentOrderSn string // 父订单编号
CustomerType string // 客户类型 枚举
CustomerAgentId string // 渠道编号(购买方)
EndUserId string // 终端客户编号
AgentId string // 渠道编号(销售方)
OrderType string // 订单类型 枚举
OrderStatus string // 订单状态 枚举
ShippingStatus string // 配送状态 枚举
ReturnStatus string // 退货状态 枚举
Consignee string // 收货人姓名
Mobile string // 收货人手机
Email string // 收货人邮箱
Address string // 详细地址
AreaCode string // 行政区域代码
BuyerNote string // 买家备注
AdminNote string // 商家备注
Remark string // 系统备注
ShippingMethod string // 发货方式 枚举
LogisticsId string // 快递公司ID
LogisticsName string // 物流公司名称
ShippingTypeId string // 配送类型ID
ShippingTypeName string // 配送类型名称
TrackingNo string // 物流单号
ShippingTime string // 发货时间
ReceivedTime string // 收货时间
PayType string // 支付类型 枚举
PayStatus string // 支付状态 枚举
PayOrderSn string // 支付订单编号
PayTime string // 支付时间
TotalAmount string // 订单总金额
ProductAmount string // 商品总金额
ShippingFee string // 运费金额
ServiceFee string // 服务费金额
InvoiceFee string // 发票费金额
CouponAmount string // 优惠券抵扣金额
DiscountAmount string // 活动优惠金额
Balance string // 余额抵扣金额
PaidAmount string // 已支付总金额
OnlinePaidAmount string // 线上支付金额
OfflinePaidAmount string // 线下支付金额
UnpaidAmount string // 未支付金额
UnrefundAmount string // 未退款金额
IsNeedCommission string // 是否需要分佣 枚举:yesno_enum
DistributionStatus string // 分销分成状态 枚举
TenantId string // 租户ID
CreatedDept string // 创建部门ID
CreatedBy string // 创建者ID
CreatedAt string // 创建时间
UpdatedBy string // 更新者ID
UpdatedAt string // 更新时间
}
// tOrderColumns holds the columns for the table t_order.
var tOrderColumns = TOrderColumns{
Id: "id",
OrderSn: "order_sn",
ParentOrderId: "parent_order_id",
ParentOrderSn: "parent_order_sn",
CustomerType: "customer_type",
CustomerAgentId: "customer_agent_id",
EndUserId: "end_user_id",
AgentId: "agent_id",
OrderType: "order_type",
OrderStatus: "order_status",
ShippingStatus: "shipping_status",
ReturnStatus: "return_status",
Consignee: "consignee",
Mobile: "mobile",
Email: "email",
Address: "address",
AreaCode: "area_code",
BuyerNote: "buyer_note",
AdminNote: "admin_note",
Remark: "remark",
ShippingMethod: "shipping_method",
LogisticsId: "logistics_id",
LogisticsName: "logistics_name",
ShippingTypeId: "shipping_type_id",
ShippingTypeName: "shipping_type_name",
TrackingNo: "tracking_no",
ShippingTime: "shipping_time",
ReceivedTime: "received_time",
PayType: "pay_type",
PayStatus: "pay_status",
PayOrderSn: "pay_order_sn",
PayTime: "pay_time",
TotalAmount: "total_amount",
ProductAmount: "product_amount",
ShippingFee: "shipping_fee",
ServiceFee: "service_fee",
InvoiceFee: "invoice_fee",
CouponAmount: "coupon_amount",
DiscountAmount: "discount_amount",
Balance: "balance",
PaidAmount: "paid_amount",
OnlinePaidAmount: "online_paid_amount",
OfflinePaidAmount: "offline_paid_amount",
UnpaidAmount: "unpaid_amount",
UnrefundAmount: "unrefund_amount",
IsNeedCommission: "is_need_commission",
DistributionStatus: "distribution_status",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewTOrderDao creates and returns a new DAO object for table data access.
func NewTOrderDao(handlers ...gdb.ModelHandler) *TOrderDao {
return &TOrderDao{
group: "default",
table: "t_order",
columns: tOrderColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TOrderDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TOrderDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TOrderDao) Columns() TOrderColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TOrderDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *TOrderDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TOrderDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,141 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TOrderItemDao is the data access object for the table t_order_item.
type TOrderItemDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns TOrderItemColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TOrderItemColumns defines and stores column names for the table t_order_item.
type TOrderItemColumns struct {
ItemId string // 订单商品信息自增id
OrderId string // 订单ID
OrderSn string // 订单编号
CustomerType string // 客户类型 枚举
CustomerAgentId string // 渠道编号(购买方)
EndUserId string // 客户编号
Price string // 商品最终单价
Quantity string // 商品的购买数量
ProductId string // 商品ID
ProductName string // 商品的名称
ProductSn string // 商品的唯一货号
PicThumb string // 商品缩略图
SkuId string // 规格ID
SkuData string // 【JSON】sku信息[{sku_id,sku_value,sku_name}]
DeliveryQuantity string // 发货数量
ProductType string // 商品类型 枚举
IsGift string // 是否为赠品 枚举:yesno_enum
AgentId string // 渠道编号(销售方)
PrepayPrice string // 预售价格
Commission string // 佣金数据
OriginPrice string // 商品初始价格
PromotionData string // 优惠信息
ExtraSkuData string // 附加属性
PayMode string // 付费方式 枚举
ServiceBeginTime string // 服务开始时间
ServiceEndTime string // 服务结束时间
TenantId string // 租户ID
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
}
// tOrderItemColumns holds the columns for the table t_order_item.
var tOrderItemColumns = TOrderItemColumns{
ItemId: "item_id",
OrderId: "order_id",
OrderSn: "order_sn",
CustomerType: "customer_type",
CustomerAgentId: "customer_agent_id",
EndUserId: "end_user_id",
Price: "price",
Quantity: "quantity",
ProductId: "product_id",
ProductName: "product_name",
ProductSn: "product_sn",
PicThumb: "pic_thumb",
SkuId: "sku_id",
SkuData: "sku_data",
DeliveryQuantity: "delivery_quantity",
ProductType: "product_type",
IsGift: "is_gift",
AgentId: "agent_id",
PrepayPrice: "prepay_price",
Commission: "commission",
OriginPrice: "origin_price",
PromotionData: "promotion_data",
ExtraSkuData: "extra_sku_data",
PayMode: "pay_mode",
ServiceBeginTime: "service_begin_time",
ServiceEndTime: "service_end_time",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewTOrderItemDao creates and returns a new DAO object for table data access.
func NewTOrderItemDao(handlers ...gdb.ModelHandler) *TOrderItemDao {
return &TOrderItemDao{
group: "default",
table: "t_order_item",
columns: tOrderItemColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TOrderItemDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TOrderItemDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TOrderItemDao) Columns() TOrderItemColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TOrderItemDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *TOrderItemDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TOrderItemDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,101 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TPackageCustomerDao is the data access object for the table t_package_customer.
type TPackageCustomerDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns TPackageCustomerColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TPackageCustomerColumns defines and stores column names for the table t_package_customer.
type TPackageCustomerColumns struct {
Id string // 主键ID
PackageCode string // 套餐编码
PackageName string // 套餐名称
DeptId string // 组织客户ID
DeptName string // 组织客户名称
Remark string // 备注
TenantId string // 租户ID
CreatedDept string // 创建部门ID
CreatedBy string // 创建者ID
CreatedAt string // 创建时间
UpdatedBy string // 更新者ID
UpdatedAt string // 更新时间
}
// tPackageCustomerColumns holds the columns for the table t_package_customer.
var tPackageCustomerColumns = TPackageCustomerColumns{
Id: "id",
PackageCode: "package_code",
PackageName: "package_name",
DeptId: "dept_id",
DeptName: "dept_name",
Remark: "remark",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewTPackageCustomerDao creates and returns a new DAO object for table data access.
func NewTPackageCustomerDao(handlers ...gdb.ModelHandler) *TPackageCustomerDao {
return &TPackageCustomerDao{
group: "default",
table: "t_package_customer",
columns: tPackageCustomerColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TPackageCustomerDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TPackageCustomerDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TPackageCustomerDao) Columns() TPackageCustomerColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TPackageCustomerDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *TPackageCustomerDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TPackageCustomerDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,125 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TProfitAccountMonthBillDao is the data access object for the table t_profit_account_month_bill.
type TProfitAccountMonthBillDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns TProfitAccountMonthBillColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TProfitAccountMonthBillColumns defines and stores column names for the table t_profit_account_month_bill.
type TProfitAccountMonthBillColumns struct {
Id string // 账单ID
DeptId string // 机构ID
AccountPeriod string // 账期YYYY-MM
OpeningBalance string // 月初余额
CommissionIncome string // 分润收入
BalanceTransferInIncome string // 余额转提现收入
WithdrawalExpense string // 提现支出
WithdrawableTransferOutExpense string // 可提现转余额支出
ProfitCreditRepayExpense string // 盈利账户还款支出
TotalIncome string // 本月收入总额
TotalExpense string // 本月支出总额
ClosingBalance string // 月末余额(月初余额+本月收入-本月支出)
IncomeCount string // 收入笔数
ExpenseCount string // 支出笔数
BillStatus string // 账单状态:1正常,2已调整,3已作废
SettleTime string // 结算时间
SettleBy string // 结算人ID
Remark string // 备注
TenantId string // 租户ID
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
}
// tProfitAccountMonthBillColumns holds the columns for the table t_profit_account_month_bill.
var tProfitAccountMonthBillColumns = TProfitAccountMonthBillColumns{
Id: "id",
DeptId: "dept_id",
AccountPeriod: "account_period",
OpeningBalance: "opening_balance",
CommissionIncome: "commission_income",
BalanceTransferInIncome: "balance_transfer_in_income",
WithdrawalExpense: "withdrawal_expense",
WithdrawableTransferOutExpense: "withdrawable_transfer_out_expense",
ProfitCreditRepayExpense: "profit_credit_repay_expense",
TotalIncome: "total_income",
TotalExpense: "total_expense",
ClosingBalance: "closing_balance",
IncomeCount: "income_count",
ExpenseCount: "expense_count",
BillStatus: "bill_status",
SettleTime: "settle_time",
SettleBy: "settle_by",
Remark: "remark",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewTProfitAccountMonthBillDao creates and returns a new DAO object for table data access.
func NewTProfitAccountMonthBillDao(handlers ...gdb.ModelHandler) *TProfitAccountMonthBillDao {
return &TProfitAccountMonthBillDao{
group: "default",
table: "t_profit_account_month_bill",
columns: tProfitAccountMonthBillColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TProfitAccountMonthBillDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TProfitAccountMonthBillDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TProfitAccountMonthBillDao) Columns() TProfitAccountMonthBillColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TProfitAccountMonthBillDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *TProfitAccountMonthBillDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TProfitAccountMonthBillDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,141 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TResourceBatchDownloadDao is the data access object for the table t_resource_batch_download.
type TResourceBatchDownloadDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns TResourceBatchDownloadColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TResourceBatchDownloadColumns defines and stores column names for the table t_resource_batch_download.
type TResourceBatchDownloadColumns struct {
Id string // 主键ID
BatchNo string // 批次编号(全局唯一)
TaskName string // 任务名称
ResourceType string // 资源类型 枚举
ExportScene string // 导出场景 枚举
QueryParams string // 导出查询条件快照
TotalCount string // 预计导出总条数
SuccessCount string // 已成功导出条数
FailCount string // 失败条数
DownloadStatus string // 下载状态 枚举
OssId string // OSS文件ID
FileName string // 导出文件名
FileExt string // 文件扩展名
FileUrl string // 文件访问地址
FilePath string // 服务器本地路径
FileSize string // 文件大小(字节)
FileMd5 string // 文件MD5
DownloadCount string // 下载次数
LastDownloadTime string // 最后下载时间
MaxDownloadCount string // 最大下载次数限制
ErrorMessage string // 失败原因
DeptId string // 所属机构ID
StartTime string // 任务开始时间
FinishTime string // 任务完成时间
ExpireTime string // 文件过期时间
Remark string // 备注
TenantId string // 租户ID
CreatedDept string // 创建部门ID
CreatedBy string // 创建者ID
CreatedAt string // 创建时间
UpdatedBy string // 更新者ID
UpdatedAt string // 更新时间
}
// tResourceBatchDownloadColumns holds the columns for the table t_resource_batch_download.
var tResourceBatchDownloadColumns = TResourceBatchDownloadColumns{
Id: "id",
BatchNo: "batch_no",
TaskName: "task_name",
ResourceType: "resource_type",
ExportScene: "export_scene",
QueryParams: "query_params",
TotalCount: "total_count",
SuccessCount: "success_count",
FailCount: "fail_count",
DownloadStatus: "download_status",
OssId: "oss_id",
FileName: "file_name",
FileExt: "file_ext",
FileUrl: "file_url",
FilePath: "file_path",
FileSize: "file_size",
FileMd5: "file_md5",
DownloadCount: "download_count",
LastDownloadTime: "last_download_time",
MaxDownloadCount: "max_download_count",
ErrorMessage: "error_message",
DeptId: "dept_id",
StartTime: "start_time",
FinishTime: "finish_time",
ExpireTime: "expire_time",
Remark: "remark",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewTResourceBatchDownloadDao creates and returns a new DAO object for table data access.
func NewTResourceBatchDownloadDao(handlers ...gdb.ModelHandler) *TResourceBatchDownloadDao {
return &TResourceBatchDownloadDao{
group: "default",
table: "t_resource_batch_download",
columns: tResourceBatchDownloadColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TResourceBatchDownloadDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TResourceBatchDownloadDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TResourceBatchDownloadDao) Columns() TResourceBatchDownloadColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TResourceBatchDownloadDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *TResourceBatchDownloadDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TResourceBatchDownloadDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,127 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TSimBindPackageLogsDao is the data access object for the table t_sim_bind_package_logs.
type TSimBindPackageLogsDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns TSimBindPackageLogsColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TSimBindPackageLogsColumns defines and stores column names for the table t_sim_bind_package_logs.
type TSimBindPackageLogsColumns struct {
Id string // 主键ID
SubscriptionNo string // 订购记录编号
BatchNo string // 批次编号
Iccid string // ICCID
Msisdn string // MSISDN/卡号
DeptId string // 部门机构编号
PackageType string // 套餐类型
PackageCode string // 套餐编号
PreviousPackageCode string // 变更前套餐编号
BusinessType string // 类型 枚举
EffectiveStatus string // 订购状态 枚举
HandleTime string // 办理时间
EffectiveTime string // 生效时间
ExpectedExpireTime string // 预计到期时间
ActualExpireTime string // 实际到期时间
DurationMonths string // 套餐时长(月)
GiftDurationMonths string // 赠送时长(月)
OrderCode string // 订单编号
Remark string // 备注
TenantId string // 租户ID
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
}
// tSimBindPackageLogsColumns holds the columns for the table t_sim_bind_package_logs.
var tSimBindPackageLogsColumns = TSimBindPackageLogsColumns{
Id: "id",
SubscriptionNo: "subscription_no",
BatchNo: "batch_no",
Iccid: "iccid",
Msisdn: "msisdn",
DeptId: "dept_id",
PackageType: "package_type",
PackageCode: "package_code",
PreviousPackageCode: "previous_package_code",
BusinessType: "business_type",
EffectiveStatus: "effective_status",
HandleTime: "handle_time",
EffectiveTime: "effective_time",
ExpectedExpireTime: "expected_expire_time",
ActualExpireTime: "actual_expire_time",
DurationMonths: "duration_months",
GiftDurationMonths: "gift_duration_months",
OrderCode: "order_code",
Remark: "remark",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewTSimBindPackageLogsDao creates and returns a new DAO object for table data access.
func NewTSimBindPackageLogsDao(handlers ...gdb.ModelHandler) *TSimBindPackageLogsDao {
return &TSimBindPackageLogsDao{
group: "default",
table: "t_sim_bind_package_logs",
columns: tSimBindPackageLogsColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TSimBindPackageLogsDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TSimBindPackageLogsDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TSimBindPackageLogsDao) Columns() TSimBindPackageLogsColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TSimBindPackageLogsDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *TSimBindPackageLogsDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TSimBindPackageLogsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,127 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TSimCardBindPkgDao is the data access object for the table t_sim_card_bind_pkg.
type TSimCardBindPkgDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns TSimCardBindPkgColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TSimCardBindPkgColumns defines and stores column names for the table t_sim_card_bind_pkg.
type TSimCardBindPkgColumns struct {
Id string // 主键ID
SubscriptionNo string // 订购记录编号
BatchNo string // 批次编号
Iccid string // ICCID
Msisdn string // MSISDN/卡号
DeptId string // 部门机构编号
PackageType string // 套餐类型
PackageCode string // 套餐编号
PreviousPackageCode string // 变更前套餐编号
BusinessType string // 类型 枚举
EffectiveStatus string // 订购状态 枚举
HandleTime string // 办理时间
EffectiveTime string // 生效时间
ExpectedExpireTime string // 预计到期时间
ActualExpireTime string // 实际到期时间
DurationMonths string // 套餐时长(月)
GiftDurationMonths string // 赠送时长(月)
OrderCode string // 订单编号
Remark string // 备注
TenantId string // 租户ID
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
}
// tSimCardBindPkgColumns holds the columns for the table t_sim_card_bind_pkg.
var tSimCardBindPkgColumns = TSimCardBindPkgColumns{
Id: "id",
SubscriptionNo: "subscription_no",
BatchNo: "batch_no",
Iccid: "iccid",
Msisdn: "msisdn",
DeptId: "dept_id",
PackageType: "package_type",
PackageCode: "package_code",
PreviousPackageCode: "previous_package_code",
BusinessType: "business_type",
EffectiveStatus: "effective_status",
HandleTime: "handle_time",
EffectiveTime: "effective_time",
ExpectedExpireTime: "expected_expire_time",
ActualExpireTime: "actual_expire_time",
DurationMonths: "duration_months",
GiftDurationMonths: "gift_duration_months",
OrderCode: "order_code",
Remark: "remark",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewTSimCardBindPkgDao creates and returns a new DAO object for table data access.
func NewTSimCardBindPkgDao(handlers ...gdb.ModelHandler) *TSimCardBindPkgDao {
return &TSimCardBindPkgDao{
group: "default",
table: "t_sim_card_bind_pkg",
columns: tSimCardBindPkgColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TSimCardBindPkgDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TSimCardBindPkgDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TSimCardBindPkgDao) Columns() TSimCardBindPkgColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TSimCardBindPkgDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *TSimCardBindPkgDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TSimCardBindPkgDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,193 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TSimCardInfoDao is the data access object for the table t_sim_card_info.
type TSimCardInfoDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns TSimCardInfoColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TSimCardInfoColumns defines and stores column names for the table t_sim_card_info.
type TSimCardInfoColumns struct {
Id string // 主键ID
Iccid string // ICCID
Msisdn string // MSISDN/卡号
Imsi string // IMSI
Imei string // IMEI
RegionCode string // 归属地
DeptId string // 渠道客户ID
CurrentPackageCode string // 当前套餐编号
PackageStatus string // 套餐状态:0 无套餐,1待生效,2生效中,3已过期
AccessType string // 接入方式:ipv4、ipv6、ipv4_ipv6
BossCardStatus string // 运营商卡状态 枚举
CardType string // 卡类型 枚举
BossOpenAt string // 运营商开户日期
BossActivateAt string // 运营商激活日期
IsBossActivateEnabled string // 是否按运营商激活减去赠送时长方:1是,0否
InboundBatchNo string // 入库批次
OutboundBatchNo string // 出库批次
AllocationBatchNo string // 划拨批次
IsFlowPool string // 是否为池卡:1是,0否
FlowPoolCode string // 流量池编号
OutStockTime string // 出库时间
FlowPkgBeginAt string // 当前套餐生效时间
FlowPkgPresentAt string // 套餐赠送结束时间
FlowPkgRealPresentAt string // 实际赠送结束时间
FlowPkgEndAt string // 当前套餐预计到期时间
DataServiceStatus string // 数据服务状态:1启用、0禁用
PackageTotalFlowMb string // 套餐总流量MB
UsedFlowMb string // 已用流量MB
TrafficCutoffStatus string // 达量断网配置状态:0未配置,1已开启,2已关闭
TrafficCutoffThreshold string // 达量断网阈值
SmsServiceStatus string // 短信服务状态:1启用、0禁用
PackageTotalSms string // 套餐短信总条数
UsedSms string // 已用短信条数
VoiceServiceStatus string // 语音服务状态:1启用、0禁用
PackageTotalVoice string // 套餐语音总分钟数
UsedVoice string // 已用语音分钟数
RoamServiceStatus string // 国漫服务状态:1启用、0禁用
PackageTotalRoamFlowMb string // 套餐国际流量MB
UsedRoamFlowMb string // 已用国际流量MB
StatusSyncTime string // 状态最后一次同步时间
FlowSyncTime string // 流量最后一次同步时间
SmsSyncTime string // 短信最后一次同步时间
VoiceSyncTime string // 语音最后一次同步时间
RoamSyncTime string // 国漫最后一次同步时间
ImeiSyncTime string // IMEI 最后一次轮询同步时间
ImeiUpdateTime string // IMEI 值最后一次实际变更时间
ExtraFeeEnabled string // 是否收取附加费:1是,0否
ExtraFeeMultiple string // 附加费用倍数
ExtraFee string // 附加金额
ChanKey string // 通道编号
NetModel string // 网络类型:4G、5G、NB-IoT
Remark string // 备注
TenantId string // 租户ID
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
}
// tSimCardInfoColumns holds the columns for the table t_sim_card_info.
var tSimCardInfoColumns = TSimCardInfoColumns{
Id: "id",
Iccid: "iccid",
Msisdn: "msisdn",
Imsi: "imsi",
Imei: "imei",
RegionCode: "region_code",
DeptId: "dept_id",
CurrentPackageCode: "current_package_code",
PackageStatus: "package_status",
AccessType: "access_type",
BossCardStatus: "boss_card_status",
CardType: "card_type",
BossOpenAt: "boss_open_at",
BossActivateAt: "boss_activate_at",
IsBossActivateEnabled: "is_boss_activate_enabled",
InboundBatchNo: "inbound_batch_no",
OutboundBatchNo: "outbound_batch_no",
AllocationBatchNo: "allocation_batch_no",
IsFlowPool: "is_flow_pool",
FlowPoolCode: "flow_pool_code",
OutStockTime: "out_stock_time",
FlowPkgBeginAt: "flow_pkg_begin_at",
FlowPkgPresentAt: "flow_pkg_present_at",
FlowPkgRealPresentAt: "flow_pkg_real_present_at",
FlowPkgEndAt: "flow_pkg_end_at",
DataServiceStatus: "data_service_status",
PackageTotalFlowMb: "package_total_flow_mb",
UsedFlowMb: "used_flow_mb",
TrafficCutoffStatus: "traffic_cutoff_status",
TrafficCutoffThreshold: "traffic_cutoff_threshold",
SmsServiceStatus: "sms_service_status",
PackageTotalSms: "package_total_sms",
UsedSms: "used_sms",
VoiceServiceStatus: "voice_service_status",
PackageTotalVoice: "package_total_voice",
UsedVoice: "used_voice",
RoamServiceStatus: "roam_service_status",
PackageTotalRoamFlowMb: "package_total_roam_flow_mb",
UsedRoamFlowMb: "used_roam_flow_mb",
StatusSyncTime: "status_sync_time",
FlowSyncTime: "flow_sync_time",
SmsSyncTime: "sms_sync_time",
VoiceSyncTime: "voice_sync_time",
RoamSyncTime: "roam_sync_time",
ImeiSyncTime: "imei_sync_time",
ImeiUpdateTime: "imei_update_time",
ExtraFeeEnabled: "extra_fee_enabled",
ExtraFeeMultiple: "extra_fee_multiple",
ExtraFee: "extra_fee",
ChanKey: "chan_key",
NetModel: "net_model",
Remark: "remark",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewTSimCardInfoDao creates and returns a new DAO object for table data access.
func NewTSimCardInfoDao(handlers ...gdb.ModelHandler) *TSimCardInfoDao {
return &TSimCardInfoDao{
group: "default",
table: "t_sim_card_info",
columns: tSimCardInfoColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TSimCardInfoDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TSimCardInfoDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TSimCardInfoDao) Columns() TSimCardInfoColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TSimCardInfoDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *TSimCardInfoDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TSimCardInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,103 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TSimCardStockDao is the data access object for the table t_sim_card_stock.
type TSimCardStockDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns TSimCardStockColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TSimCardStockColumns defines and stores column names for the table t_sim_card_stock.
type TSimCardStockColumns struct {
Id string // 主键ID
BatchNo string //
Iccid string // ICCID
Msisdn string // MSISDN
Imsi string // IMSI
Imei string // IMEI
ChanKey string // 通道编号
TenantId string // 租户ID
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
}
// tSimCardStockColumns holds the columns for the table t_sim_card_stock.
var tSimCardStockColumns = TSimCardStockColumns{
Id: "id",
BatchNo: "batch_no",
Iccid: "iccid",
Msisdn: "msisdn",
Imsi: "imsi",
Imei: "imei",
ChanKey: "chan_key",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewTSimCardStockDao creates and returns a new DAO object for table data access.
func NewTSimCardStockDao(handlers ...gdb.ModelHandler) *TSimCardStockDao {
return &TSimCardStockDao{
group: "default",
table: "t_sim_card_stock",
columns: tSimCardStockColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TSimCardStockDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TSimCardStockDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TSimCardStockDao) Columns() TSimCardStockColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TSimCardStockDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *TSimCardStockDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TSimCardStockDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}
@@ -0,0 +1,103 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TSimChannelTemplateDao is the data access object for the table t_sim_channel_template.
type TSimChannelTemplateDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns TSimChannelTemplateColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TSimChannelTemplateColumns defines and stores column names for the table t_sim_channel_template.
type TSimChannelTemplateColumns struct {
Id string // ID
TempKey string // 模板标识
TempName string // 模板名称
TempModel string // 模板模型
TempConfig string // 模板配置
TempStatus string // 模板状态(0未启用,1启用)
Remark string // 备注
TenantId string // 租户ID
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
}
// tSimChannelTemplateColumns holds the columns for the table t_sim_channel_template.
var tSimChannelTemplateColumns = TSimChannelTemplateColumns{
Id: "id",
TempKey: "temp_key",
TempName: "temp_name",
TempModel: "temp_model",
TempConfig: "temp_config",
TempStatus: "temp_status",
Remark: "remark",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewTSimChannelTemplateDao creates and returns a new DAO object for table data access.
func NewTSimChannelTemplateDao(handlers ...gdb.ModelHandler) *TSimChannelTemplateDao {
return &TSimChannelTemplateDao{
group: "default",
table: "t_sim_channel_template",
columns: tSimChannelTemplateColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TSimChannelTemplateDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TSimChannelTemplateDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TSimChannelTemplateDao) Columns() TSimChannelTemplateColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TSimChannelTemplateDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *TSimChannelTemplateDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TSimChannelTemplateDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}

Some files were not shown because too many files have changed in this diff Show More