mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-27 11:09:24 +08:00
Compare commits
105 Commits
v2.0-sqlit
...
5efae235e4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5efae235e4 | ||
|
|
ef05cc946f | ||
|
|
1017a92c29 | ||
|
|
1a5f77ffb4 | ||
|
|
9f2038cc4b | ||
|
|
be6c13e781 | ||
|
|
6da8cafb6f | ||
|
|
d79138d278 | ||
|
|
3146dc13ed | ||
|
|
6f8761756a | ||
|
|
c9af5ae093 | ||
|
|
6fcfa61dff | ||
|
|
1564e8605d | ||
|
|
cce0476bb9 | ||
|
|
4d5ae6907a | ||
|
|
ae3ad53806 | ||
|
|
d807084d55 | ||
|
|
99967d35e5 | ||
|
|
6cb0fcfd93 | ||
|
|
c377b6b92d | ||
|
|
56efd5d206 | ||
|
|
9da8eb264d | ||
|
|
416ae4c27f | ||
|
|
19c0c0c1bc | ||
|
|
0c5b27d864 | ||
|
|
62af998991 | ||
|
|
5301bedff2 | ||
|
|
b48079bbdc | ||
|
|
2fd3854aeb | ||
|
|
6254505a7d | ||
|
|
07df5a20e1 | ||
|
|
8e7992d7f4 | ||
|
|
86805ba047 | ||
|
|
abfd6a056f | ||
|
|
e364aa4a4f | ||
|
|
52c2538a66 | ||
|
|
f010ef07ac | ||
|
|
dbdfdaae93 | ||
|
|
a2c6a8ac16 | ||
|
|
1055e44b2b | ||
|
|
01f194d7ef | ||
|
|
52263c608f | ||
|
|
ffce905371 | ||
|
|
ef8d0bde5b | ||
|
|
98233d7deb | ||
|
|
1c8dd5e6d2 | ||
|
|
0cba31c885 | ||
|
|
f497fb7a1a | ||
|
|
f5e448a999 | ||
|
|
a94c6745ea | ||
|
|
6caa644259 | ||
|
|
37b2b82130 | ||
|
|
33e5252516 | ||
|
|
6cf80ed0fe | ||
|
|
fa87584316 | ||
|
|
194e86ea05 | ||
|
|
cc13a16e90 | ||
|
|
d9b57e6c62 | ||
|
|
09026a606b | ||
|
|
950637a976 | ||
|
|
06fed9025f | ||
|
|
7eb32efa92 | ||
|
|
2e322e2606 | ||
|
|
804d5d5e59 | ||
|
|
a37d088360 | ||
|
|
7d8330f72f | ||
|
|
b33591e8bd | ||
|
|
71e2176a35 | ||
|
|
733313d309 | ||
|
|
9feb4c2022 | ||
|
|
f33e36803a | ||
|
|
e914f1db33 | ||
|
|
1b563e0957 | ||
|
|
9133afb864 | ||
|
|
5c3bcaf6cc | ||
|
|
e501a33163 | ||
|
|
491e6cef09 | ||
|
|
b005c80ba6 | ||
|
|
7bf0efe667 | ||
|
|
f78f44e00f | ||
|
|
93395df7fa | ||
|
|
ea7cc97ed4 | ||
|
|
1292a15385 | ||
|
|
bbca0e8db8 | ||
|
|
9ff6e2d690 | ||
|
|
69b8f42092 | ||
|
|
e672f54fbb | ||
|
|
67520c9e38 | ||
|
|
a642c322e3 | ||
|
|
b2440e8ddc | ||
|
|
59beb07e98 | ||
|
|
7180157259 | ||
|
|
b97410738e | ||
|
|
ba2fa86767 | ||
|
|
406e3ef168 | ||
|
|
817482bedb | ||
|
|
dc20a86b33 | ||
|
|
269b2f9e43 | ||
|
|
211d3872e4 | ||
|
|
6d0c22f98c | ||
|
|
90ea29051f | ||
|
|
50a32db1d9 | ||
|
|
0dddbcd50c | ||
|
|
ac46200a23 | ||
|
|
ce4629e082 |
12
README.md
12
README.md
@@ -6,19 +6,19 @@
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://goframe.org/pages/viewpage.action?pageId=1114119" target="_blank">
|
||||
<img src="https://img.shields.io/badge/goframe-2.7-green" alt="goframe">
|
||||
<img src="https://img.shields.io/badge/goframe-2.9.0-green" alt="goframe">
|
||||
</a>
|
||||
<a href="https://v3.vuejs.org/" target="_blank">
|
||||
<img src="https://img.shields.io/badge/vue.js-vue3.4-green" alt="vue">
|
||||
</a>
|
||||
<a href="https://www.naiveui.com" target="_blank">
|
||||
<img src="https://img.shields.io/badge/naiveui-%3E2.38.0-blue" alt="naiveui">
|
||||
<img src="https://img.shields.io/badge/naiveui-%3E2.41.0-blue" alt="naiveui">
|
||||
</a>
|
||||
<a href="https://www.tslang.cn/" target="_blank">
|
||||
<img src="https://img.shields.io/badge/typescript-%3E4.0.0-blue" alt="typescript">
|
||||
</a>
|
||||
<a href="https://vitejs.dev/" target="_blank">
|
||||
<img src="https://img.shields.io/badge/vite-%3E4.0.0-yellow" alt="vite">
|
||||
<img src="https://img.shields.io/badge/vite-%3E5.4.2-yellow" alt="vite">
|
||||
</a>
|
||||
<a href="https://github.com/bufanyun/hotgo/blob/v2.0/LICENSE" target="_blank">
|
||||
<img src="https://img.shields.io/badge/license-MIT-success" alt="license">
|
||||
@@ -136,7 +136,7 @@
|
||||
|
||||
* 本项目包含的第三方源码和二进制文件之版权信息另行标注。
|
||||
|
||||
* 版权所有Copyright © 2020-2024 by Ms (https://github.com/bufanyun/hotgo)
|
||||
* 版权所有Copyright © 2020-2025 by Ms (https://github.com/bufanyun/hotgo)
|
||||
|
||||
* All rights reserved。
|
||||
|
||||
@@ -154,11 +154,11 @@
|
||||
|
||||
|
||||
## [感谢JetBrains提供的免费GoLand](https://jb.gg/OpenSource)
|
||||
[](https://jb.gg/OpenSource)
|
||||
[](https://jb.gg/OpenSource)
|
||||
|
||||
|
||||
## License
|
||||
[MIT © HotGo-2024](./LICENSE)
|
||||
[MIT © HotGo-2025](./LICENSE)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ gf run main.go
|
||||
|
||||
# web端
|
||||
cd web
|
||||
yarn dev
|
||||
pnpm run dev 或 npm run dev
|
||||
```
|
||||
|
||||
以下是一个关联表的CURD生成流程
|
||||
|
||||
@@ -10,7 +10,7 @@ gf run main.go
|
||||
|
||||
# web端
|
||||
cd web
|
||||
yarn dev
|
||||
pnpm run dev 或 npm run dev
|
||||
```
|
||||
|
||||
以下是一个基本的CURD生成流程
|
||||
|
||||
@@ -10,7 +10,7 @@ gf run main.go
|
||||
|
||||
# web端
|
||||
cd web
|
||||
yarn dev
|
||||
pnpm run dev 或 npm run dev
|
||||
```
|
||||
|
||||
以下是一个基本的树形CURD生成流程
|
||||
|
||||
@@ -41,8 +41,9 @@ cd server && make build
|
||||
cd server # 切换到服务端目录下
|
||||
rm -rf ./resource/public/admin/ # 删除之前的web资源
|
||||
mkdir ./resource/public/admin/ # 重新创建web资源存放目录,除首次编译后续可以跳过执行此步骤
|
||||
cd ../web && yarn build # 切换到web项目下,编译web项目
|
||||
cd ../web && pnpm run build # 切换到web项目下,编译web项目
|
||||
\cp -rf ./dist/* ../server/resource/public/admin/ # 将编译好的web资源复制到server对应的资源存放路径下
|
||||
cd ../server # 切换回服务端目录下
|
||||
echo "y" | gf build # 编译hotgo服务端
|
||||
|
||||
# 不出意外你已经编译好了hotgo可执行文件!
|
||||
@@ -57,7 +58,7 @@ echo "y" | gf build # 编译hotgo服务端
|
||||
|
||||
# 编译web端
|
||||
cd web
|
||||
yarn build
|
||||
pnpm run build 或 npm run build
|
||||
|
||||
# web端编译完成后,将web/dist/*中的文件上传到`server`端线上运行目录:/resource/public/admin即可
|
||||
# 至此,web端和server端都可以独立覆盖更新
|
||||
@@ -102,4 +103,4 @@ yarn build
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection upgrade;
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
@@ -11,21 +11,21 @@
|
||||
1. 前往https://nodejs.org/zh-cn/下载当前版本node
|
||||
2. 命令行运行 `node -v` 若控制台输出版本号则node安装成功
|
||||
3. node 版本需大于等于 `16.0`
|
||||
4. 安装yarn:`npm install -g yarn`
|
||||
5. 命令行运行 `yarn -v` 若控制台输出版本号则前端环境搭建成功
|
||||
4. 安装pnpm:`npm install -g pnpm`
|
||||
5. 命令行运行 `pnpm -v` 若控制台输出版本号则前端环境搭建成功
|
||||
|
||||
### 后端环境
|
||||
1. 下载golang安装 版本号需>=1.21
|
||||
1. 下载golang安装 版本号需>=1.23
|
||||
2. 国际: https://golang.org/dl/
|
||||
3. 国内: https://golang.google.cn/dl/
|
||||
4. 命令行运行 go 若控制台输出各类提示命令 则安装成功 输入 `go version` 确认版本大于1.19
|
||||
4. 命令行运行 go 若控制台输出各类提示命令 则安装成功 输入 `go version` 确认版本大于1.23
|
||||
5. 开发工具推荐 [Goland](https://www.jetbrains.com/go/)
|
||||
|
||||
### 使用说明
|
||||
|
||||
> 需要本地具有 git node golang 环境
|
||||
|
||||
- node版本 >= 16.0.0
|
||||
- golang版本 >= 1.21
|
||||
- node版本 >= 20.0.0
|
||||
- golang版本 >= 1.23
|
||||
- mysql版本 >= 5.7,引擎需要是 innoDB
|
||||
- IDE推荐:Goland
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
### 环境要求
|
||||
|
||||
- node版本 >= v16.0.0
|
||||
- golang版本 >= v1.21
|
||||
- node版本 >= v20.0.0
|
||||
- golang版本 >= v1.23
|
||||
- goframe版本 >=v2.7.0
|
||||
- mysql版本 >=5.7
|
||||
|
||||
@@ -88,13 +88,13 @@ gfcli:
|
||||
2、web前端:
|
||||
```shell script
|
||||
cd web
|
||||
# 首先确定你以安装node16.0以上版本并安装了包[npm、yarn],否则可能会出现一些未知报错
|
||||
# 首先确定你以安装node16.0以上版本并安装了包[npm、pnpm],否则可能会出现一些未知报错
|
||||
|
||||
# 安装依赖
|
||||
yarn install
|
||||
pnpm install
|
||||
|
||||
# 启动web项目
|
||||
yarn dev
|
||||
pnpm run dev
|
||||
|
||||
# 如果顺利,至此到浏览器打开:http://你的IP:8001/admin
|
||||
# 登录账号:admin, 密码:123456
|
||||
|
||||
@@ -11,6 +11,40 @@
|
||||
|
||||
> 如果升级(覆盖)代码后打开会出现 sql 报错, 请检查更新的数据库格式或自行调整
|
||||
|
||||
### v2.16.10
|
||||
updated 2025.3.22
|
||||
|
||||
- 增加:增加组合下拉用户筛选组件
|
||||
- 优化:文件上传类型限制改为统一由后台配置控制
|
||||
- 优化:websocket重连时间调整为10秒,初始化数据库中的网站地址调整为`127.0.0.1`
|
||||
- 优化:优化访问日志字段展示方式
|
||||
- 优化:系统公告发送编辑模态框调整为抽屉
|
||||
- 优化:gf版本升级到v2.9.0
|
||||
- 优化:naive-ui版本升级到2.41.0
|
||||
- 修复:修复vue路由`Redirect`命名重复问题
|
||||
- 修复:优化代码生成在插件中`使用生成字典选项`时model包名重复问题
|
||||
|
||||
|
||||
### v2.15.11
|
||||
updated 2024.11.27
|
||||
|
||||
- 增加:增加配置管理子页面选项参数记忆
|
||||
- 修复:修复定时任务中日志配置的读取并发读问题
|
||||
- 优化:gf版本升级到v2.8.2
|
||||
- 优化:优化数据卡片展示
|
||||
|
||||
|
||||
### v2.15.7
|
||||
updated 2024.7.21
|
||||
|
||||
- 增加:访问日志、服务日志增加关键词搜索
|
||||
- 增加:web端增加字典状态管理,重构字典选项使用方式,大幅减少冗余代码
|
||||
- 修复:修复生成代码选项式树表已知的一些小bug
|
||||
- 优化:gf版本升级到v2.7.2
|
||||
- 优化:naive-ui版本升级到2.39.0
|
||||
- 优化:访问日志不再记录过大的请求头参数,减少日志大小
|
||||
|
||||
|
||||
### v2.15.1
|
||||
updated 2024.4.22
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ gfcli:
|
||||
### 生成CRUD表格
|
||||
|
||||
- 推荐使用热编译方式启动HotGo,这样生成完成页面自动刷新即可看到新生成内容,无需手动重启
|
||||
- 服务端热编译启动:`gf run main.go`, web前端启动:`yarn dev`
|
||||
- 服务端热编译启动:`gf run main.go`, web前端启动:`pnpm run dev` 或 `npm run dev`
|
||||
|
||||
1、创建数据表
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
项目开发完成之后,执行以下命令进行构建
|
||||
```shell
|
||||
yarn build
|
||||
pnpm run build 或 npm run build
|
||||
```
|
||||
构建打包成功之后,会在根目录生成 dist 文件夹,里面就是构建打包好的文件
|
||||
|
||||
@@ -40,15 +40,15 @@ VITE_LEGACY = true
|
||||
使用项目自定的命令进行预览(推荐)
|
||||
```shell
|
||||
# 先打包在进行预览
|
||||
yarn preview
|
||||
pnpm run preview 或 npm run preview
|
||||
# 直接预览本地 dist 文件目录
|
||||
yarn preview:dist
|
||||
pnpm run preview:dist 或 npm run preview:dist
|
||||
```
|
||||
|
||||
- 本地服务器预览(通过 live-server)
|
||||
```shell
|
||||
# 1.全局安装live-server
|
||||
yarn global add live-server
|
||||
npm -g install live-server
|
||||
# 2. 进入打包的后目录
|
||||
cd ./dist
|
||||
# 本地预览,默认端口8080
|
||||
@@ -60,7 +60,7 @@ live-server --port 9000
|
||||
### 分析构建文件体积
|
||||
如果你的构建文件很大,可以通过项目内置 [rollup-plugin-analyzer](https://github.com/doesdev/rollup-plugin-analyzer) 插件进行代码体积分析,从而优化你的代码。
|
||||
```shell
|
||||
yarn report
|
||||
pnpm run report 或 npm run report
|
||||
```
|
||||
运行之后,在自动打开的页面可以看到具体的体积分布,以分析哪些依赖有问题。
|
||||
|
||||
|
||||
172
index.html
Normal file
172
index.html
Normal file
@@ -0,0 +1,172 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1, minimum-scale=1.0, shrink-to-fit=no, viewport-fit=cover">
|
||||
|
||||
<!-- Replace with your own title and description. -->
|
||||
<title>HotGo-V2</title>
|
||||
<meta name="description" content="基于全新GoFrame2+Vue3+NaiveUI+uniapp开发的全栖框架,为二次开发而生,适合中小型完整应用开发。">
|
||||
|
||||
<!-- Default Theme (see https://docsify.js.org/#/themes) -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
<script>
|
||||
// Docsify Configuration (see https://docsify.js.org/#/configuration)
|
||||
window.$docsify = {
|
||||
name: "HotGo-V2",
|
||||
nameLink: {
|
||||
'/': '/hotgo/',
|
||||
},
|
||||
relativePath: true,
|
||||
// alias: {
|
||||
// "/.*/_navbar.md": "/_navbar.md",
|
||||
// },
|
||||
// themeColor: "#42b983",
|
||||
// logo: "https://bufanyun.cn-bj.ufileos.com/hotgo/logo.sig.png",
|
||||
// coverpage: true,
|
||||
// homepage: "README.md",
|
||||
|
||||
// Sidebar Configuration
|
||||
auto2top: true,
|
||||
loadSidebar: "sidebar.md",
|
||||
// maxLevel: 2,
|
||||
// Set subMaxLevel to 0 to remove automatic display of page table of contents (TOC) in Sidebar
|
||||
// subMaxLevel: 3,
|
||||
|
||||
// Navbar Configuration
|
||||
// loadNavbar: true,
|
||||
|
||||
// Search Plugin Configuration
|
||||
search: {
|
||||
placeholder: {
|
||||
"/": "搜索",
|
||||
// "/": "Type to search"
|
||||
},
|
||||
noData: {
|
||||
"/": "找不到结果",
|
||||
// "/": "No Results"
|
||||
},
|
||||
// Headline depth, 1 - 6
|
||||
// depth: 2,
|
||||
},
|
||||
|
||||
// Flexible-alerts Plugin Configuration
|
||||
"flexible-alerts": {
|
||||
important: {
|
||||
label: "Important",
|
||||
|
||||
// localization
|
||||
label: {
|
||||
// "/zh-cn": "重要",
|
||||
"/": "Important"
|
||||
},
|
||||
|
||||
// Assuming that we use Font Awesome
|
||||
icon: "far fa-message",
|
||||
className: "important"
|
||||
},
|
||||
warning: {
|
||||
label: "Warning",
|
||||
|
||||
// localization
|
||||
label: {
|
||||
// "/zh-cn": "警告",
|
||||
"/": "Warning"
|
||||
},
|
||||
|
||||
// Assuming that we use Font Awesome
|
||||
icon: "fas fa-triangle-exclamation",
|
||||
className: "warning"
|
||||
},
|
||||
caution: {
|
||||
label: "Caution",
|
||||
|
||||
// localization
|
||||
label: {
|
||||
// "/zh-cn": "注意",
|
||||
"/": "Caution"
|
||||
},
|
||||
|
||||
// Assuming that we use Font Awesome
|
||||
icon: "fas fa-circle-exclamation",
|
||||
className: "attention"
|
||||
},
|
||||
},
|
||||
|
||||
// Hide-code Plugin Configuration
|
||||
hideCode: {
|
||||
// scroll: false, // Enable scrolling
|
||||
height: 300 // Max height
|
||||
},
|
||||
|
||||
// Versioned Plugin Configuration
|
||||
// versions: [
|
||||
// { folder: "/", label: "v2", default: true },
|
||||
// ],
|
||||
// versionSelectorLabel: "Version",
|
||||
|
||||
// Progress Plugin Configuration
|
||||
progress: {
|
||||
position: "top",
|
||||
// color: "var(--theme-color,#42b983)",
|
||||
height: "3px",
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<!-- Required -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/docsify@4/lib/docsify.min.js"></script>
|
||||
|
||||
<!-- Recommended -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/docsify@4/lib/plugins/zoom-image.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/docsify@4/lib/plugins/search.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/docsify-copy-code/dist/docsify-copy-code.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/docsify-pagination/dist/docsify-pagination.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/docsify-hide-code/dist/docsify-hide-code.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/docsify-progress@latest/dist/progress.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/docsify-example-panels"></script>
|
||||
|
||||
<!-- Prism code highlight -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/prismjs@1/components/prism-bash.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/prismjs@1/components/prism-matlab.min.js"></script>
|
||||
|
||||
<!-- docsify-dark-switcher -->
|
||||
<script src="https://cdn.jsdelivr.net/gh/LIGMATV/docsify-dark-switcher@latest/docsify-dark-switcher.js"></script>
|
||||
<style>
|
||||
:root {
|
||||
--dark-base-background: #222;
|
||||
--dark-base-color: #bbc0c4;
|
||||
--dark-theme-color: var(--theme-color, #42b983);
|
||||
--dark-code-color: var(--dark-color);
|
||||
--dark-heading-color: var(--dark-theme-color);
|
||||
--dark-cover-background: #000000a8;
|
||||
--dark-code-background: #303030;
|
||||
--dark-tip-background: #2c0000;
|
||||
--dark-warn-background: #005842;
|
||||
--dark-icon-size: 25px;
|
||||
--dark-icon-transition: .1s ease-in-out .1s;
|
||||
--dark-moon-color: #000000;
|
||||
--dark-sun-color: #ffffff;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- docsify-plugin-flexible-alerts -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/docsify-plugin-flexible-alerts/dist/docsify-plugin-flexible-alerts.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/js/all.min.js"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/fontawesome.min.css">
|
||||
|
||||
<!-- docsify-versioned-plugin -->
|
||||
<!-- <script src="https://cdn.jsdelivr.net/npm/docsify-versioned-plugin@0.0.1/index.js"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsify-versioned-plugin@0.0.1/styles.css"> -->
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -13,14 +13,15 @@ run:
|
||||
# Include test files or not.
|
||||
# Default: true
|
||||
tests: false
|
||||
go: "1.20"
|
||||
|
||||
# Which dirs to skip: issues from them won't be reported.
|
||||
# Can use regexp here: `generated.*`, regexp is applied on full path.
|
||||
# Default value is empty list,
|
||||
# but default dirs are skipped independently of this option's value (see skip-dirs-use-default).
|
||||
# "/" will be replaced by current OS file path separator to properly work on Windows.
|
||||
skip-dirs:
|
||||
- internal/library/hggen/internal
|
||||
# skip-dirs:
|
||||
# - internal/library/hggen/internal
|
||||
|
||||
# Which files to skip: they will be analyzed, but issues from them won't be reported.
|
||||
# Default value is empty list,
|
||||
@@ -28,7 +29,7 @@ run:
|
||||
# we confidently recognize autogenerated files.
|
||||
# If it's not please let us know.
|
||||
# "/" will be replaced by current OS file path separator to properly work on Windows.
|
||||
skip-files: []
|
||||
# skip-files: []
|
||||
|
||||
|
||||
# Main linters configurations.
|
||||
@@ -71,7 +72,10 @@ issues:
|
||||
- linters:
|
||||
- gocritic
|
||||
text: "unnecessaryDefer:"
|
||||
|
||||
exclude-dirs:
|
||||
- internal/library/hggen/internal
|
||||
exclude-files: []
|
||||
|
||||
|
||||
# https://golangci-lint.run/usage/linters
|
||||
linters-settings:
|
||||
@@ -176,7 +180,7 @@ linters-settings:
|
||||
# Select the Go version to target.
|
||||
# Default: 1.13
|
||||
# Deprecated: use the global `run.go` instead.
|
||||
go: "1.15"
|
||||
# go: "1.15"
|
||||
# Sxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
|
||||
# Default: ["*"]
|
||||
checks: [
|
||||
@@ -187,7 +191,7 @@ linters-settings:
|
||||
govet:
|
||||
# Report about shadowed variables.
|
||||
# Default: false
|
||||
check-shadowing: true
|
||||
# check-shadowing: true
|
||||
# Settings per analyzer.
|
||||
settings:
|
||||
# Analyzer name, run `go tool vet help` to see all analyzers.
|
||||
@@ -263,7 +267,7 @@ linters-settings:
|
||||
# Select the Go version to target.
|
||||
# Default: "1.13"
|
||||
# Deprecated: use the global `run.go` instead.
|
||||
go: "1.15"
|
||||
# go: "1.15"
|
||||
# SAxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
|
||||
# Default: ["*"]
|
||||
checks: [ "all","-SA1019","-SA4015","-SA1029","-SA1016","-SA9003","-SA4006","-SA6003" ]
|
||||
|
||||
@@ -9,7 +9,8 @@ ADMIN_RESOURCE_PATH = "/resource/public/admin/"
|
||||
build:
|
||||
@rm -rf ./$(ADMIN_RESOURCE_PATH)
|
||||
@mkdir ./$(ADMIN_RESOURCE_PATH)
|
||||
@cd ../web && yarn build && \cp -rf ./dist/* ../server$(ADMIN_RESOURCE_PATH)
|
||||
@cd ../web && pnpm run build && \cp -rf ./dist/* ../server$(ADMIN_RESOURCE_PATH)
|
||||
@cd ../server
|
||||
@echo "y" | gf build
|
||||
|
||||
# 通过热编译启动所有服务
|
||||
@@ -36,7 +37,7 @@ auth:
|
||||
# 启动web服务
|
||||
.PHONY: web
|
||||
web:
|
||||
@cd ../web && yarn dev
|
||||
@cd ../web && pnpm run dev
|
||||
|
||||
# 刷新casbin权限
|
||||
.PHONY: refresh
|
||||
|
||||
@@ -153,7 +153,7 @@ func (s *sSysTable) Edit(ctx context.Context, in *sysin.TableEditInp) (err error
|
||||
|
||||
// 新增
|
||||
in.CreatedBy = contexts.GetUserId(ctx)
|
||||
if _, err = s.Model(ctx, &handler.Option{FilterAuth: false}).Data(in).Insert(); err != nil {
|
||||
if _, err = s.Model(ctx, &handler.Option{FilterAuth: false}).Data(in).OmitEmptyData().Insert(); err != nil {
|
||||
err = gerror.Wrap(err, "新增表格失败,请稍后重试!")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -133,7 +133,6 @@ func (s *sSysTenantOrder) Export(ctx context.Context, in *sysin.TenantOrderListI
|
||||
// Edit 修改/新增多租户功能演示
|
||||
func (s *sSysTenantOrder) Edit(ctx context.Context, in *sysin.TenantOrderEditInp) (err error) {
|
||||
return g.DB().Transaction(ctx, func(ctx context.Context, tx gdb.TX) (err error) {
|
||||
|
||||
// 修改
|
||||
if in.Id > 0 {
|
||||
if _, err = s.Model(ctx).
|
||||
@@ -158,7 +157,6 @@ func (s *sSysTenantOrder) Edit(ctx context.Context, in *sysin.TenantOrderEditInp
|
||||
|
||||
// Delete 删除多租户功能演示
|
||||
func (s *sSysTenantOrder) Delete(ctx context.Context, in *sysin.TenantOrderDeleteInp) (err error) {
|
||||
|
||||
if _, err = s.Model(ctx).WherePri(in.Id).Delete(); err != nil {
|
||||
err = gerror.Wrap(err, "删除多租户功能演示失败,请稍后重试!")
|
||||
return
|
||||
|
||||
@@ -125,7 +125,7 @@ func (s *sSysTreeTable) Edit(ctx context.Context, in *sysin.TableEditInp) (err e
|
||||
}
|
||||
} else {
|
||||
in.CreatedBy = contexts.GetUserId(ctx)
|
||||
if _, err = s.Model(ctx, &handler.Option{FilterAuth: false}).Data(in).Insert(); err != nil {
|
||||
if _, err = s.Model(ctx, &handler.Option{FilterAuth: false}).Data(in).OmitEmptyData().Insert(); err != nil {
|
||||
err = gerror.Wrap(err, "新增表格失败,请稍后重试!")
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -47,21 +47,3 @@ type ClearKindReq struct {
|
||||
}
|
||||
|
||||
type ClearKindRes struct{}
|
||||
|
||||
// ChooserOptionReq 获取选择器选项
|
||||
type ChooserOptionReq struct {
|
||||
g.Meta `path:"/attachment/chooserOption" method:"get" tags:"附件" summary:"获取选择器选项"`
|
||||
}
|
||||
|
||||
type ChooserOptionRes struct {
|
||||
Drive sysin.DataSelectModel `json:"drive" dc:"驱动"`
|
||||
Kind []KindSelect `json:"kind" dc:"上传类型"`
|
||||
}
|
||||
|
||||
type KindSelect struct {
|
||||
Key string `json:"key"`
|
||||
Value string `json:"value"`
|
||||
Tag string `json:"listClass"`
|
||||
Label string `json:"label"`
|
||||
Icon string `json:"icon"`
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// @Copyright Copyright (c) 2024 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
// @AutoGenerate Version 2.13.1
|
||||
// @AutoGenerate Version 2.15.7
|
||||
package curddemo
|
||||
|
||||
import (
|
||||
@@ -68,6 +68,14 @@ type MaxSortRes struct {
|
||||
*sysin.CurdDemoMaxSortModel
|
||||
}
|
||||
|
||||
// StatusReq 更新CURD列表状态
|
||||
type StatusReq struct {
|
||||
g.Meta `path:"/curdDemo/status" method:"post" tags:"CURD列表" summary:"更新CURD列表状态"`
|
||||
sysin.CurdDemoStatusInp
|
||||
}
|
||||
|
||||
type StatusRes struct{}
|
||||
|
||||
// SwitchReq 更新CURD列表开关状态
|
||||
type SwitchReq struct {
|
||||
g.Meta `path:"/curdDemo/switch" method:"post" tags:"CURD列表" summary:"更新CURD列表状态"`
|
||||
|
||||
@@ -30,16 +30,6 @@ type ExportReq struct {
|
||||
|
||||
type ExportRes struct{}
|
||||
|
||||
// ViewReq 获取登录日志指定信息
|
||||
type ViewReq struct {
|
||||
g.Meta `path:"/loginLog/view" method:"get" tags:"登录日志" summary:"获取登录日志指定信息"`
|
||||
sysin.LoginLogViewInp
|
||||
}
|
||||
|
||||
type ViewRes struct {
|
||||
*sysin.LoginLogViewModel
|
||||
}
|
||||
|
||||
// DeleteReq 删除登录日志
|
||||
type DeleteReq struct {
|
||||
g.Meta `path:"/loginLog/delete" method:"post" tags:"登录日志" summary:"删除登录日志"`
|
||||
|
||||
@@ -87,8 +87,7 @@ type NetOptionReq struct {
|
||||
}
|
||||
|
||||
type NetOptionRes struct {
|
||||
LicenseGroup form.Selects `json:"licenseGroup" dc:"授权分组"`
|
||||
Routes []*RouteSelect `json:"routes" dc:"路由选项"`
|
||||
Routes []*RouteSelect `json:"routes" dc:"路由选项"`
|
||||
}
|
||||
|
||||
type RouteSelect struct {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// @Copyright Copyright (c) 2024 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
// @AutoGenerate Version 2.13.1
|
||||
// @AutoGenerate Version 2.15.7
|
||||
package normaltreedemo
|
||||
|
||||
import (
|
||||
@@ -66,4 +66,4 @@ type TreeOptionReq struct {
|
||||
g.Meta `path:"/normalTreeDemo/treeOption" method:"get" tags:"普通树表" summary:"获取普通树表关系树选项"`
|
||||
}
|
||||
|
||||
type TreeOptionRes []tree.Node
|
||||
type TreeOptionRes []tree.Node
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// @Copyright Copyright (c) 2024 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
// @AutoGenerate Version 2.13.1
|
||||
// @AutoGenerate Version 2.15.7
|
||||
package optiontreedemo
|
||||
|
||||
import (
|
||||
@@ -66,4 +66,4 @@ type TreeOptionReq struct {
|
||||
g.Meta `path:"/optionTreeDemo/treeOption" method:"get" tags:"选项树表" summary:"获取选项树表关系树选项"`
|
||||
}
|
||||
|
||||
type TreeOptionRes []tree.Node
|
||||
type TreeOptionRes []tree.Node
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// @Copyright Copyright (c) 2024 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
// @AutoGenerate Version 2.13.1
|
||||
// @AutoGenerate Version 2.15.7
|
||||
package testcategory
|
||||
|
||||
import (
|
||||
@@ -66,4 +66,4 @@ type StatusReq struct {
|
||||
sysin.TestCategoryStatusInp
|
||||
}
|
||||
|
||||
type StatusRes struct{}
|
||||
type StatusRes struct{}
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
// Package member
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package member
|
||||
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
import (
|
||||
"context"
|
||||
|
||||
// GetIdByCodeReq 通过邀请码获取用户ID
|
||||
type GetIdByCodeReq struct {
|
||||
g.Meta `path:"/member/getIdByCode" method:"post" tags:"用户" summary:"通过邀请码获取用户ID"`
|
||||
Code string `json:"code" dc:"邀请码"`
|
||||
"hotgo/api/api/member/v1"
|
||||
)
|
||||
|
||||
type IMemberV1 interface {
|
||||
GetIdByCode(ctx context.Context, req *v1.GetIdByCodeReq) (res *v1.GetIdByCodeRes, err error)
|
||||
}
|
||||
|
||||
type GetIdByCodeRes struct{}
|
||||
|
||||
16
server/api/api/member/v1/member.go
Normal file
16
server/api/api/member/v1/member.go
Normal file
@@ -0,0 +1,16 @@
|
||||
// Package member
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package v1
|
||||
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
// GetIdByCodeReq 通过邀请码获取用户ID
|
||||
type GetIdByCodeReq struct {
|
||||
g.Meta `path:"/member/getIdByCode" method:"post" tags:"用户" summary:"通过邀请码获取用户ID"`
|
||||
Code string `json:"code" dc:"邀请码"`
|
||||
}
|
||||
|
||||
type GetIdByCodeRes struct{}
|
||||
17
server/api/api/pay/pay.go
Normal file
17
server/api/api/pay/pay.go
Normal file
@@ -0,0 +1,17 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package pay
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"hotgo/api/api/pay/v1"
|
||||
)
|
||||
|
||||
type IPayV1 interface {
|
||||
NotifyAliPay(ctx context.Context, req *v1.NotifyAliPayReq) (res *v1.NotifyAliPayRes, err error)
|
||||
NotifyWxPay(ctx context.Context, req *v1.NotifyWxPayReq) (res *v1.NotifyWxPayRes, err error)
|
||||
NotifyQQPay(ctx context.Context, req *v1.NotifyQQPayReq) (res *v1.NotifyQQPayRes, err error)
|
||||
}
|
||||
@@ -3,11 +3,12 @@
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package pay
|
||||
package v1
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"hotgo/internal/model/input/payin"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// NotifyAliPayReq 支付宝回调
|
||||
180
server/go.mod
180
server/go.mod
@@ -1,141 +1,159 @@
|
||||
module hotgo
|
||||
|
||||
go 1.21
|
||||
|
||||
toolchain go1.22.1
|
||||
go 1.24.4
|
||||
|
||||
require (
|
||||
github.com/Shopify/sarama v1.34.1
|
||||
github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.2
|
||||
github.com/alibabacloud-go/dysmsapi-20170525/v3 v3.0.5
|
||||
github.com/alibabacloud-go/tea v1.1.20
|
||||
github.com/alibabacloud-go/tea-utils/v2 v2.0.1
|
||||
github.com/aliyun/aliyun-oss-go-sdk v2.2.6+incompatible
|
||||
github.com/IBM/sarama v1.45.2
|
||||
github.com/alibabacloud-go/darabonba-openapi/v2 v2.1.7
|
||||
github.com/alibabacloud-go/dysmsapi-20170525/v3 v3.0.6
|
||||
github.com/alibabacloud-go/tea v1.3.9
|
||||
github.com/alibabacloud-go/tea-utils/v2 v2.0.7
|
||||
github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible
|
||||
github.com/apache/rocketmq-client-go/v2 v2.1.2
|
||||
github.com/casbin/casbin/v2 v2.55.0
|
||||
github.com/forgoer/openssl v1.4.0
|
||||
github.com/go-pay/gopay v1.5.91
|
||||
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.7.0
|
||||
github.com/gogf/gf/contrib/nosql/redis/v2 v2.7.0
|
||||
github.com/gogf/gf/contrib/trace/jaeger/v2 v2.7.0
|
||||
github.com/gogf/gf/v2 v2.7.0
|
||||
github.com/casbin/casbin/v2 v2.108.0
|
||||
github.com/forgoer/openssl v1.6.1
|
||||
github.com/go-pay/crypto v0.0.1
|
||||
github.com/go-pay/gopay v1.5.114
|
||||
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.9.0
|
||||
github.com/gogf/gf/contrib/nosql/redis/v2 v2.9.0
|
||||
github.com/gogf/gf/contrib/trace/jaeger/v2 v2.7.4
|
||||
github.com/gogf/gf/v2 v2.9.1-0.20250624075347-5fa656d1cc92
|
||||
github.com/gogf/selfupdate v0.0.0-20231215043001-5c48c528462f
|
||||
github.com/golang-jwt/jwt/v5 v5.0.0
|
||||
github.com/gorilla/websocket v1.5.1
|
||||
github.com/golang-jwt/jwt/v5 v5.2.2
|
||||
github.com/gorilla/websocket v1.5.3
|
||||
github.com/kayon/iploc v0.0.0-20200312105652-bda3e968a794
|
||||
github.com/minio/minio-go/v7 v7.0.63
|
||||
github.com/mojocn/base64Captcha v1.3.6
|
||||
github.com/minio/minio-go/v7 v7.0.94
|
||||
github.com/mojocn/base64Captcha v1.3.8
|
||||
github.com/olekukonko/tablewriter v0.0.5
|
||||
github.com/qiniu/go-sdk/v7 v7.14.0
|
||||
github.com/shirou/gopsutil/v3 v3.23.3
|
||||
github.com/silenceper/wechat/v2 v2.1.4
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.633
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sms v1.0.633
|
||||
github.com/tencentyun/cos-go-sdk-v5 v0.7.45
|
||||
github.com/ufilesdk-dev/ufile-gosdk v1.0.3
|
||||
github.com/xuri/excelize/v2 v2.6.0
|
||||
go.opentelemetry.io/otel v1.25.0
|
||||
golang.org/x/mod v0.9.0
|
||||
golang.org/x/net v0.24.0
|
||||
golang.org/x/tools v0.7.0
|
||||
github.com/qiniu/go-sdk/v7 v7.25.4
|
||||
github.com/schollz/progressbar/v3 v3.18.0
|
||||
github.com/shirou/gopsutil/v3 v3.24.5
|
||||
github.com/silenceper/wechat/v2 v2.1.9
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1202
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sms v1.0.1200
|
||||
github.com/tencentyun/cos-go-sdk-v5 v0.7.66
|
||||
github.com/ufilesdk-dev/ufile-gosdk v1.0.6
|
||||
github.com/xuri/excelize/v2 v2.9.1
|
||||
go.opentelemetry.io/otel v1.37.0
|
||||
golang.org/x/mod v0.25.0
|
||||
golang.org/x/net v0.41.0
|
||||
golang.org/x/tools v0.34.0
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
)
|
||||
|
||||
require (
|
||||
aead.dev/minisign v0.2.0 // indirect
|
||||
filippo.io/edwards25519 v1.1.0 // indirect
|
||||
github.com/BurntSushi/toml v1.3.2 // indirect
|
||||
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible // indirect
|
||||
github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4 // indirect
|
||||
github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68 // indirect
|
||||
github.com/BurntSushi/toml v1.4.0 // indirect
|
||||
github.com/alex-ant/gomath v0.0.0-20160516115720-89013a210a82 // indirect
|
||||
github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.5 // indirect
|
||||
github.com/alibabacloud-go/debug v1.0.1 // indirect
|
||||
github.com/alibabacloud-go/endpoint-util v1.1.0 // indirect
|
||||
github.com/alibabacloud-go/openapi-util v0.1.0 // indirect
|
||||
github.com/alibabacloud-go/tea-utils v1.3.1 // indirect
|
||||
github.com/alibabacloud-go/tea-xml v1.1.2 // indirect
|
||||
github.com/aliyun/credentials-go v1.1.2 // indirect
|
||||
github.com/aliyun/credentials-go v1.4.5 // indirect
|
||||
github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect
|
||||
github.com/bradfitz/gomemcache v0.0.0-20220106215444-fb4bf637b56d // indirect
|
||||
github.com/casbin/govaluate v1.3.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/clbanning/mxj v1.8.4 // indirect
|
||||
github.com/clbanning/mxj/v2 v2.7.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||
github.com/eapache/go-resiliency v1.2.0 // indirect
|
||||
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect
|
||||
github.com/eapache/go-resiliency v1.7.0 // indirect
|
||||
github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect
|
||||
github.com/eapache/queue v1.1.0 // indirect
|
||||
github.com/emirpasic/gods v1.12.0 // indirect
|
||||
github.com/fatih/color v1.16.0 // indirect
|
||||
github.com/emirpasic/gods v1.18.1 // indirect
|
||||
github.com/fatih/color v1.18.0 // indirect
|
||||
github.com/fatih/structs v1.1.0 // indirect
|
||||
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
||||
github.com/go-logr/logr v1.4.1 // indirect
|
||||
github.com/gammazero/toposort v0.1.1 // indirect
|
||||
github.com/go-ini/ini v1.67.0 // indirect
|
||||
github.com/go-logr/logr v1.4.3 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/go-ole/go-ole v1.2.6 // indirect
|
||||
github.com/go-pay/errgroup v0.0.3 // indirect
|
||||
github.com/go-pay/smap v0.0.2 // indirect
|
||||
github.com/go-pay/util v0.0.4 // indirect
|
||||
github.com/go-pay/xlog v0.0.3 // indirect
|
||||
github.com/go-pay/xtime v0.0.2 // indirect
|
||||
github.com/go-redis/redis/v8 v8.11.5 // indirect
|
||||
github.com/go-sql-driver/mysql v1.8.1 // indirect
|
||||
github.com/go-sql-driver/mysql v1.7.1 // indirect
|
||||
github.com/goccy/go-json v0.10.5 // indirect
|
||||
github.com/gofrs/flock v0.8.1 // indirect
|
||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
|
||||
github.com/golang/mock v1.6.0 // indirect
|
||||
github.com/golang/mock v1.4.4 // indirect
|
||||
github.com/golang/snappy v0.0.4 // indirect
|
||||
github.com/google/btree v1.1.2 // indirect
|
||||
github.com/google/btree v1.1.3 // indirect
|
||||
github.com/google/go-querystring v1.0.0 // indirect
|
||||
github.com/google/uuid v1.3.0 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
|
||||
github.com/hashicorp/errwrap v1.0.0 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/hashicorp/go-uuid v1.0.2 // indirect
|
||||
github.com/hashicorp/go-uuid v1.0.3 // indirect
|
||||
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
|
||||
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
|
||||
github.com/jcmturner/gofork v1.0.0 // indirect
|
||||
github.com/jcmturner/gokrb5/v8 v8.4.2 // indirect
|
||||
github.com/jcmturner/gofork v1.7.6 // indirect
|
||||
github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect
|
||||
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/klauspost/compress v1.17.2 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
|
||||
github.com/klauspost/compress v1.18.0 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.10 // indirect
|
||||
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
|
||||
github.com/magiconair/properties v1.8.7 // indirect
|
||||
github.com/magiconair/properties v1.8.9 // 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.15 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.16 // indirect
|
||||
github.com/minio/crc64nvme v1.0.1 // indirect
|
||||
github.com/minio/md5-simd v1.1.2 // indirect
|
||||
github.com/minio/sha256-simd v1.0.1 // indirect
|
||||
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
|
||||
github.com/mitchellh/mapstructure v1.4.3 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
|
||||
github.com/mozillazg/go-httpheader v0.2.1 // indirect
|
||||
github.com/olekukonko/errors v0.0.0-20250405072817-4e6d85265da6 // indirect
|
||||
github.com/olekukonko/ll v0.0.8 // indirect
|
||||
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.18 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.22 // indirect
|
||||
github.com/pkg/errors v0.8.1 // indirect
|
||||
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
|
||||
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
|
||||
github.com/redis/go-redis/v9 v9.5.1 // indirect
|
||||
github.com/redis/go-redis/v9 v9.7.0 // indirect
|
||||
github.com/richardlehane/mscfb v1.0.4 // indirect
|
||||
github.com/richardlehane/msoleps v1.0.1 // indirect
|
||||
github.com/richardlehane/msoleps v1.0.4 // indirect
|
||||
github.com/rivo/uniseg v0.4.7 // indirect
|
||||
github.com/rs/xid v1.5.0 // indirect
|
||||
github.com/shoenig/go-m1cpu v0.1.4 // indirect
|
||||
github.com/sirupsen/logrus v1.9.3 // indirect
|
||||
github.com/rs/xid v1.6.0 // indirect
|
||||
github.com/shoenig/go-m1cpu v0.1.6 // indirect
|
||||
github.com/sirupsen/logrus v1.9.0 // indirect
|
||||
github.com/spf13/cast v1.4.1 // indirect
|
||||
github.com/tidwall/gjson v1.14.1 // indirect
|
||||
github.com/tidwall/match v1.1.1 // indirect
|
||||
github.com/tidwall/pretty v1.2.0 // indirect
|
||||
github.com/tjfoc/gmsm v1.3.2 // indirect
|
||||
github.com/tklauser/go-sysconf v0.3.11 // indirect
|
||||
github.com/tklauser/numcpus v0.6.0 // indirect
|
||||
github.com/xuri/efp v0.0.0-20220407160117-ad0f7a785be8 // indirect
|
||||
github.com/xuri/nfp v0.0.0-20220409054826-5e722a1d9e22 // indirect
|
||||
github.com/yusufpapurcu/wmi v1.2.2 // indirect
|
||||
go.opentelemetry.io/otel/exporters/jaeger v1.17.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.25.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.25.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.25.0 // indirect
|
||||
go.uber.org/atomic v1.7.0 // indirect
|
||||
golang.org/x/crypto v0.22.0 // indirect
|
||||
golang.org/x/image v0.13.0 // indirect
|
||||
golang.org/x/sync v0.1.0 // indirect
|
||||
golang.org/x/sys v0.19.0 // indirect
|
||||
golang.org/x/text v0.14.0 // indirect
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
|
||||
github.com/tiendc/go-deepcopy v1.6.0 // indirect
|
||||
github.com/tinylib/msgp v1.3.0 // indirect
|
||||
github.com/tjfoc/gmsm v1.4.1 // indirect
|
||||
github.com/tklauser/go-sysconf v0.3.12 // indirect
|
||||
github.com/tklauser/numcpus v0.6.1 // indirect
|
||||
github.com/xuri/efp v0.0.1 // indirect
|
||||
github.com/xuri/nfp v0.0.1 // indirect
|
||||
github.com/yusufpapurcu/wmi v1.2.4 // indirect
|
||||
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/jaeger v1.14.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.37.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.37.0 // indirect
|
||||
go.uber.org/atomic v1.5.1 // indirect
|
||||
golang.org/x/crypto v0.39.0 // indirect
|
||||
golang.org/x/image v0.25.0 // indirect
|
||||
golang.org/x/lint v0.0.0-20190930215403-16217165b5de // indirect
|
||||
golang.org/x/sync v0.15.0 // indirect
|
||||
golang.org/x/sys v0.33.0 // indirect
|
||||
golang.org/x/term v0.32.0 // indirect
|
||||
golang.org/x/text v0.26.0 // indirect
|
||||
golang.org/x/time v0.12.0 // indirect
|
||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
|
||||
modernc.org/fileutil v1.0.0 // indirect
|
||||
stathat.com/c/consistent v1.0.0 // indirect
|
||||
)
|
||||
|
||||
798
server/go.sum
798
server/go.sum
File diff suppressed because it is too large
Load Diff
@@ -38,4 +38,10 @@ gfcli:
|
||||
# srcFolder: "internal/logic"
|
||||
# dstFolder: "internal/service"
|
||||
# dstFileNameCase: "CamelLower"
|
||||
# clear: true
|
||||
# clear: true
|
||||
ctrl:
|
||||
# api/api下的接口可以使用gf gen ctrl自动生成控制器相关代码
|
||||
srcFolder: "api/api"
|
||||
dstFolder: "internal/controller/api"
|
||||
clear: true
|
||||
merge: false
|
||||
|
||||
6
server/internal/consts/captcha.go
Normal file
6
server/internal/consts/captcha.go
Normal file
@@ -0,0 +1,6 @@
|
||||
package consts
|
||||
|
||||
const (
|
||||
CaptchaTypeString = iota + 1 // 字符串
|
||||
CaptchaTypeMath // 数字计算
|
||||
)
|
||||
@@ -18,12 +18,6 @@ const (
|
||||
EmsTemplateCash = "cash" // 申请提现
|
||||
)
|
||||
|
||||
// 验证码状态
|
||||
const (
|
||||
EmsStatusNotUsed = 1 // 未使用
|
||||
EmsStatusUsed = 2 // 已使用
|
||||
)
|
||||
|
||||
var EmsSubjectMap = g.MapStrStr{
|
||||
EmsTemplateText: "这是一封来自HotGo的邮件",
|
||||
EmsTemplateCode: "验证码",
|
||||
|
||||
@@ -5,9 +5,56 @@
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package consts
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"hotgo/internal/library/dict"
|
||||
"hotgo/internal/model"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func init() {
|
||||
dict.RegisterEnums("HTTPMethod", "HTTP请求方式选项", HTTPMethodOptions)
|
||||
dict.RegisterEnums("HTTPHandlerTime", "HTTP处理耗时选项", HTTPHandlerTimeOptions)
|
||||
dict.RegisterEnums("HTTPApiCode", "HTTP接口状态码选项", HTTPApiCodeOptions)
|
||||
}
|
||||
|
||||
const (
|
||||
HTTPContentTypeXml = "text/xml"
|
||||
HTTPContentTypeHtml = "text/html"
|
||||
HTTPContentTypeStream = "text/event-stream"
|
||||
HTTPContentTypeJson = "application/json"
|
||||
)
|
||||
|
||||
// HTTPMethodOptions HTTP请求方式选项
|
||||
var HTTPMethodOptions = []*model.Option{
|
||||
dict.GenSuccessOption(http.MethodGet, "GET"),
|
||||
dict.GenInfoOption(http.MethodPost, "POST"),
|
||||
dict.GenSuccessOption(http.MethodPut, "PUT"),
|
||||
dict.GenInfoOption(http.MethodDelete, "DELETE"),
|
||||
}
|
||||
|
||||
const (
|
||||
HTTPHandlerTime50 = "< 50"
|
||||
HTTPHandlerTime200 = "< 200"
|
||||
HTTPHandlerTime200To500 = "BETWEEN 200 AND 500"
|
||||
HTTPHandlerTime500To1000 = "BETWEEN 500 AND 1000"
|
||||
HTTPHandlerTime1000To10000 = "BETWEEN 1000 AND 10000"
|
||||
HTTPHandlerTime10000UP = "> 10000"
|
||||
)
|
||||
|
||||
// HTTPHandlerTimeOptions HTTP处理耗时选项
|
||||
var HTTPHandlerTimeOptions = []*model.Option{
|
||||
dict.GenSuccessOption(HTTPHandlerTime50, "50ms以内"),
|
||||
dict.GenInfoOption(HTTPHandlerTime200, "200ms以内"),
|
||||
dict.GenSuccessOption(HTTPHandlerTime200To500, "200~500ms"),
|
||||
dict.GenSuccessOption(HTTPHandlerTime500To1000, "500~1000ms"),
|
||||
dict.GenInfoOption(HTTPHandlerTime1000To10000, "1000~10000ms"),
|
||||
dict.GenInfoOption(HTTPHandlerTime10000UP, "10000ms以上"),
|
||||
}
|
||||
|
||||
// HTTPApiCodeOptions HTTP接口状态码选项
|
||||
var HTTPApiCodeOptions = []*model.Option{
|
||||
dict.GenSuccessOption(gcode.CodeOK.Code(), fmt.Sprintf("%v %v", gcode.CodeOK.Code(), "成功")),
|
||||
dict.GenWarningOption(gcode.CodeNil.Code(), fmt.Sprintf("%v %v", gcode.CodeNil.Code(), "失败")),
|
||||
}
|
||||
|
||||
@@ -5,6 +5,15 @@
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package consts
|
||||
|
||||
import (
|
||||
"hotgo/internal/library/dict"
|
||||
"hotgo/internal/model"
|
||||
)
|
||||
|
||||
func init() {
|
||||
dict.RegisterEnums("ServerLicenseGroupOptions", "服务授权分组选项", ServerLicenseGroupOptions)
|
||||
}
|
||||
|
||||
// 授权分组
|
||||
const (
|
||||
LicenseGroupDefault = "default" // 默认组
|
||||
@@ -12,8 +21,9 @@ const (
|
||||
LicenseGroupAuth = "auth" // 服务授权
|
||||
)
|
||||
|
||||
var LicenseGroupNameMap = map[string]string{
|
||||
LicenseGroupDefault: "默认组",
|
||||
LicenseGroupCron: "定时任务",
|
||||
LicenseGroupAuth: "服务授权",
|
||||
// ServerLicenseGroupOptions 服务授权分组选项
|
||||
var ServerLicenseGroupOptions = []*model.Option{
|
||||
dict.GenWarningOption(LicenseGroupDefault, "默认组"),
|
||||
dict.GenSuccessOption(LicenseGroupCron, "定时任务"),
|
||||
dict.GenSuccessOption(LicenseGroupAuth, "服务授权"),
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
package consts
|
||||
|
||||
// 短信驱动
|
||||
|
||||
const (
|
||||
SmsDriveAliYun = "aliyun" // 阿里云
|
||||
SmsDriveTencent = "tencent" // 腾讯云
|
||||
@@ -32,9 +31,3 @@ var (
|
||||
SmsTemplateCash: "申请提现",
|
||||
}
|
||||
)
|
||||
|
||||
// 验证码状态
|
||||
const (
|
||||
SmsStatusNotUsed = 1 // 未使用
|
||||
SmsStatusUsed = 2 // 已使用
|
||||
)
|
||||
|
||||
@@ -5,6 +5,16 @@
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package consts
|
||||
|
||||
import (
|
||||
"hotgo/internal/library/dict"
|
||||
"hotgo/internal/model"
|
||||
)
|
||||
|
||||
func init() {
|
||||
dict.RegisterEnums("CodeStatusOptions", "验证码状态选项", CodeStatusOptions)
|
||||
dict.RegisterEnums("BlacklistStatusOptions", "黑名单拉黑状态选项", BlacklistStatusOptions)
|
||||
}
|
||||
|
||||
// 状态码
|
||||
const (
|
||||
StatusALL int = -1 // 全部状态
|
||||
@@ -14,3 +24,26 @@ const (
|
||||
)
|
||||
|
||||
var StatusSlice = []int{StatusALL, StatusEnabled, StatusDisable, StatusDelete}
|
||||
|
||||
// 验证码状态
|
||||
const (
|
||||
CodeStatusNotUsed = 1 // 未使用
|
||||
CodeStatusUsed = 2 // 已使用
|
||||
)
|
||||
|
||||
// CodeStatusOptions 验证码状态选项
|
||||
var CodeStatusOptions = []*model.Option{
|
||||
dict.GenWarningOption(CodeStatusNotUsed, "未使用"),
|
||||
dict.GenSuccessOption(CodeStatusUsed, "已使用"),
|
||||
}
|
||||
|
||||
const (
|
||||
BlacklistStatusDisable = 1 // 封禁中
|
||||
BlacklistStatusEnabled = 2 // 已解封
|
||||
)
|
||||
|
||||
// BlacklistStatusOptions 黑名单拉黑状态选项
|
||||
var BlacklistStatusOptions = []*model.Option{
|
||||
dict.GenWarningOption(BlacklistStatusDisable, "封禁中"),
|
||||
dict.GenSuccessOption(BlacklistStatusEnabled, "已解封"),
|
||||
}
|
||||
|
||||
@@ -7,5 +7,5 @@ package consts
|
||||
|
||||
// VersionApp HotGo版本
|
||||
const (
|
||||
VersionApp = "2.15.1"
|
||||
VersionApp = "2.16.10"
|
||||
)
|
||||
|
||||
@@ -204,16 +204,6 @@ func (c *cMonitor) NetOnlineList(ctx context.Context, req *monitor.NetOnlineList
|
||||
func (c *cMonitor) NetOption(ctx context.Context, req *monitor.NetOptionReq) (res *monitor.NetOptionRes, err error) {
|
||||
res = new(monitor.NetOptionRes)
|
||||
|
||||
// 授权分组
|
||||
for k, v := range consts.LicenseGroupNameMap {
|
||||
res.LicenseGroup = append(res.LicenseGroup, &form.Select{
|
||||
Value: k,
|
||||
Name: v,
|
||||
Label: v,
|
||||
})
|
||||
}
|
||||
sort.Sort(res.LicenseGroup)
|
||||
|
||||
for _, v := range service.TCPServer().Instance().GetRoutes() {
|
||||
// 无需勾选的路由
|
||||
disabled := false
|
||||
|
||||
@@ -8,9 +8,9 @@ package common
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"hotgo/api/admin/common"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/dao"
|
||||
"hotgo/internal/library/contexts"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
@@ -53,7 +53,7 @@ func (c *cEms) SendBindEms(ctx context.Context, _ *common.SendBindEmsReq) (res *
|
||||
return
|
||||
}
|
||||
|
||||
if err = g.Model("admin_member").Fields("email").Where("id", memberId).Scan(&models); err != nil {
|
||||
if err = dao.AdminMember.Ctx(ctx).Fields(dao.AdminMember.Columns().Email).Where(dao.AdminMember.Columns().Id, memberId).Scan(&models); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -7,18 +7,19 @@ package common
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v2/util/gmode"
|
||||
"hotgo/api/admin/common"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/library/captcha"
|
||||
"hotgo/internal/library/token"
|
||||
"hotgo/internal/service"
|
||||
"hotgo/utility/validate"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v2/util/gmode"
|
||||
)
|
||||
|
||||
var Site = cSite{}
|
||||
@@ -44,7 +45,12 @@ func (c *cSite) Config(ctx context.Context, _ *common.SiteConfigReq) (res *commo
|
||||
|
||||
func (c *cSite) getWsAddr(ctx context.Context, request *ghttp.Request) string {
|
||||
// 如果是本地IP访问,则认为是调试模式,走实际请求地址,否则走配置中的地址
|
||||
// 尝试读取hostname,兼容本地运行模式
|
||||
ip := ghttp.RequestFromCtx(ctx).GetHeader("hostname")
|
||||
if len(ip) == 0 {
|
||||
ip = ghttp.RequestFromCtx(ctx).GetHost()
|
||||
}
|
||||
|
||||
if validate.IsLocalIPAddr(ip) {
|
||||
return "ws://" + ip + ":" + gstr.StrEx(request.Host, ":") + g.Cfg().MustGet(ctx, "router.websocket.prefix").String()
|
||||
}
|
||||
@@ -58,7 +64,12 @@ func (c *cSite) getWsAddr(ctx context.Context, request *ghttp.Request) string {
|
||||
|
||||
func (c *cSite) getDomain(ctx context.Context, request *ghttp.Request) string {
|
||||
// 如果是本地IP访问,则认为是调试模式,走实际请求地址,否则走配置中的地址
|
||||
ip := request.GetHeader("hostname")
|
||||
// 尝试读取hostname,兼容本地运行模式
|
||||
ip := ghttp.RequestFromCtx(ctx).GetHeader("hostname")
|
||||
if len(ip) == 0 {
|
||||
ip = ghttp.RequestFromCtx(ctx).GetHost()
|
||||
}
|
||||
|
||||
if validate.IsLocalIPAddr(ip) {
|
||||
return "http://" + ip + ":" + gstr.StrEx(request.Host, ":")
|
||||
}
|
||||
@@ -84,7 +95,11 @@ func (c *cSite) LoginConfig(ctx context.Context, _ *common.SiteLoginConfigReq) (
|
||||
|
||||
// Captcha 登录验证码
|
||||
func (c *cSite) Captcha(ctx context.Context, _ *common.LoginCaptchaReq) (res *common.LoginCaptchaRes, err error) {
|
||||
cid, base64 := captcha.Generate(ctx)
|
||||
loginConf, err := service.SysConfig().GetLogin(ctx)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
cid, base64 := captcha.Generate(ctx, loginConf.CaptchaType)
|
||||
res = &common.LoginCaptchaRes{Cid: cid, Base64: base64}
|
||||
return
|
||||
}
|
||||
@@ -102,7 +117,7 @@ func (c *cSite) AccountLogin(ctx context.Context, req *common.AccountLoginReq) (
|
||||
return
|
||||
}
|
||||
|
||||
if !req.IsLock && login.CaptchaSwitch == 1 {
|
||||
if !req.IsLock && login.CaptchaSwitch == consts.StatusEnabled {
|
||||
// 校验 验证码
|
||||
if !captcha.Verify(req.Cid, req.Code) {
|
||||
err = gerror.New("验证码错误")
|
||||
|
||||
@@ -8,9 +8,9 @@ package common
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"hotgo/api/admin/common"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/dao"
|
||||
"hotgo/internal/library/contexts"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
@@ -39,7 +39,7 @@ func (c *cSms) SendBindSms(ctx context.Context, _ *common.SendBindSmsReq) (res *
|
||||
return
|
||||
}
|
||||
|
||||
if err = g.Model("admin_member").Fields("mobile").Where("id", memberId).Scan(&models); err != nil {
|
||||
if err = dao.AdminMember.Ctx(ctx).Fields(dao.AdminMember.Columns().Mobile).Where(dao.AdminMember.Columns().Id, memberId).Scan(&models); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@ package sys
|
||||
import (
|
||||
"context"
|
||||
"hotgo/api/admin/attachment"
|
||||
"hotgo/internal/library/storager"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
)
|
||||
|
||||
@@ -50,42 +48,6 @@ func (c *cAttachment) List(ctx context.Context, req *attachment.ListReq) (res *a
|
||||
return
|
||||
}
|
||||
|
||||
// ChooserOption 获取选择器选项
|
||||
func (c *cAttachment) ChooserOption(ctx context.Context, req *attachment.ChooserOptionReq) (res *attachment.ChooserOptionRes, err error) {
|
||||
res = new(attachment.ChooserOptionRes)
|
||||
|
||||
res.Drive, err = service.SysDictData().Select(ctx, &sysin.DataSelectInp{Type: "config_upload_drive"})
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
var kinds = []attachment.KindSelect{
|
||||
{
|
||||
Label: "全部", Key: "", Value: "",
|
||||
},
|
||||
{
|
||||
Label: "图片", Key: storager.KindImg, Value: storager.KindImg, Icon: "PictureOutlined", Tag: "success",
|
||||
},
|
||||
{
|
||||
Label: "文档", Key: storager.KindDoc, Value: storager.KindDoc, Icon: "FileWordOutlined", Tag: "primary",
|
||||
},
|
||||
{
|
||||
Label: "音频", Key: storager.KindAudio, Value: storager.KindAudio, Icon: "CustomerServiceOutlined", Tag: "info",
|
||||
},
|
||||
{
|
||||
Label: "视频", Key: storager.KindVideo, Value: storager.KindVideo, Icon: "PlaySquareOutlined", Tag: "warning",
|
||||
},
|
||||
{
|
||||
Label: "压缩包", Key: storager.KindZip, Value: storager.KindZip, Icon: "FileZipOutlined", Tag: "error",
|
||||
},
|
||||
{
|
||||
Label: "其他", Key: storager.KindOther, Value: storager.KindOther, Icon: "PlusOutlined", Tag: "default",
|
||||
},
|
||||
}
|
||||
res.Kind = append(res.Kind, kinds...)
|
||||
return
|
||||
}
|
||||
|
||||
// ClearKind 清空上传类型
|
||||
func (c *cAttachment) ClearKind(ctx context.Context, req *attachment.ClearKindReq) (res *attachment.ClearKindRes, err error) {
|
||||
err = service.SysAttachment().ClearKind(ctx, &req.AttachmentClearKindInp)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// @Copyright Copyright (c) 2024 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
// @AutoGenerate Version 2.13.1
|
||||
// @AutoGenerate Version 2.15.7
|
||||
package sys
|
||||
|
||||
import (
|
||||
@@ -78,6 +78,12 @@ func (c *cCurdDemo) Delete(ctx context.Context, req *curddemo.DeleteReq) (res *c
|
||||
return
|
||||
}
|
||||
|
||||
// Status 更新CURD列表状态
|
||||
func (c *cCurdDemo) Status(ctx context.Context, req *curddemo.StatusReq) (res *curddemo.StatusRes, err error) {
|
||||
err = service.SysCurdDemo().Status(ctx, &req.CurdDemoStatusInp)
|
||||
return
|
||||
}
|
||||
|
||||
// Switch 更新CURD列表开关状态
|
||||
func (c *cCurdDemo) Switch(ctx context.Context, req *curddemo.SwitchReq) (res *curddemo.SwitchRes, err error) {
|
||||
err = service.SysCurdDemo().Switch(ctx, &req.CurdDemoSwitchInp)
|
||||
|
||||
@@ -38,18 +38,6 @@ func (c *cLoginLog) Export(ctx context.Context, req *loginlog.ExportReq) (res *l
|
||||
return
|
||||
}
|
||||
|
||||
// View 获取指定登录日志信息
|
||||
func (c *cLoginLog) View(ctx context.Context, req *loginlog.ViewReq) (res *loginlog.ViewRes, err error) {
|
||||
data, err := service.SysLoginLog().View(ctx, &req.LoginLogViewInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(loginlog.ViewRes)
|
||||
res.LoginLogViewModel = data
|
||||
return
|
||||
}
|
||||
|
||||
// Delete 删除登录日志
|
||||
func (c *cLoginLog) Delete(ctx context.Context, req *loginlog.DeleteReq) (res *loginlog.DeleteRes, err error) {
|
||||
err = service.SysLoginLog().Delete(ctx, &req.LoginLogDeleteInp)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// @Copyright Copyright (c) 2024 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
// @AutoGenerate Version 2.13.1
|
||||
// @AutoGenerate Version 2.15.7
|
||||
package sys
|
||||
|
||||
import (
|
||||
@@ -75,6 +75,15 @@ func (c *cNormalTreeDemo) Delete(ctx context.Context, req *normaltreedemo.Delete
|
||||
// TreeOption 获取普通树表关系树选项
|
||||
func (c *cNormalTreeDemo) TreeOption(ctx context.Context, req *normaltreedemo.TreeOptionReq) (res *normaltreedemo.TreeOptionRes, err error) {
|
||||
data, err := service.SysNormalTreeDemo().TreeOption(ctx)
|
||||
res = (*normaltreedemo.TreeOptionRes)(&data)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if len(data) > 0 {
|
||||
res = (*normaltreedemo.TreeOptionRes)(&data)
|
||||
} else {
|
||||
temp := make(normaltreedemo.TreeOptionRes, 0)
|
||||
res = &temp
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// @Copyright Copyright (c) 2024 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
// @AutoGenerate Version 2.13.1
|
||||
// @AutoGenerate Version 2.15.7
|
||||
package sys
|
||||
|
||||
import (
|
||||
@@ -75,6 +75,15 @@ func (c *cOptionTreeDemo) Delete(ctx context.Context, req *optiontreedemo.Delete
|
||||
// TreeOption 获取选项树表关系树选项
|
||||
func (c *cOptionTreeDemo) TreeOption(ctx context.Context, req *optiontreedemo.TreeOptionReq) (res *optiontreedemo.TreeOptionRes, err error) {
|
||||
data, err := service.SysOptionTreeDemo().TreeOption(ctx)
|
||||
res = (*optiontreedemo.TreeOptionRes)(&data)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if len(data) > 0 {
|
||||
res = (*optiontreedemo.TreeOptionRes)(&data)
|
||||
} else {
|
||||
temp := make(optiontreedemo.TreeOptionRes, 0)
|
||||
res = &temp
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// @Copyright Copyright (c) 2024 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
// @AutoGenerate Version 2.13.1
|
||||
// @AutoGenerate Version 2.15.7
|
||||
package sys
|
||||
|
||||
import (
|
||||
@@ -76,4 +76,4 @@ func (c *cTestCategory) Delete(ctx context.Context, req *testcategory.DeleteReq)
|
||||
func (c *cTestCategory) Status(ctx context.Context, req *testcategory.StatusReq) (res *testcategory.StatusRes, err error) {
|
||||
err = service.SysTestCategory().Status(ctx, &req.TestCategoryStatusInp)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,5 @@
|
||||
// Package member
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
// =================================================================================
|
||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
||||
// =================================================================================
|
||||
|
||||
package member
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"hotgo/api/api/member"
|
||||
)
|
||||
|
||||
var (
|
||||
Member = cMember{}
|
||||
)
|
||||
|
||||
type cMember struct{}
|
||||
|
||||
func (c *cMember) GetIdByCode(ctx context.Context, _ *member.GetIdByCodeReq) (res *member.GetIdByCodeRes, err error) {
|
||||
g.RequestFromCtx(ctx).Response.Writeln("Hello World api member!")
|
||||
return
|
||||
}
|
||||
|
||||
15
server/internal/controller/api/member/member_new.go
Normal file
15
server/internal/controller/api/member/member_new.go
Normal file
@@ -0,0 +1,15 @@
|
||||
// =================================================================================
|
||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
||||
// =================================================================================
|
||||
|
||||
package member
|
||||
|
||||
import (
|
||||
"hotgo/api/api/member"
|
||||
)
|
||||
|
||||
type ControllerV1 struct{}
|
||||
|
||||
func NewV1() member.IMemberV1 {
|
||||
return &ControllerV1{}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package member
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1 "hotgo/api/api/member/v1"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) GetIdByCode(ctx context.Context, req *v1.GetIdByCodeReq) (res *v1.GetIdByCodeRes, err error) {
|
||||
g.RequestFromCtx(ctx).Response.Writeln("Hello World api member!")
|
||||
return
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
// Package pay
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package pay
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"hotgo/api/api/pay"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/library/response"
|
||||
"hotgo/internal/model/input/payin"
|
||||
"hotgo/internal/service"
|
||||
)
|
||||
|
||||
var (
|
||||
Notify = cNotify{}
|
||||
)
|
||||
|
||||
type cNotify struct{}
|
||||
|
||||
// AliPay 支付宝回调
|
||||
func (c *cNotify) AliPay(ctx context.Context, _ *pay.NotifyAliPayReq) (res *pay.NotifyAliPayRes, err error) {
|
||||
if _, err = service.Pay().Notify(ctx, &payin.PayNotifyInp{PayType: consts.PayTypeAliPay}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
response.RText(g.RequestFromCtx(ctx), "success")
|
||||
return
|
||||
}
|
||||
|
||||
// WxPay 微信支付回调
|
||||
func (c *cNotify) WxPay(ctx context.Context, _ *pay.NotifyWxPayReq) (res *pay.NotifyWxPayRes, err error) {
|
||||
if _, err = service.Pay().Notify(ctx, &payin.PayNotifyInp{PayType: consts.PayTypeWxPay}); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
response.CustomJson(g.RequestFromCtx(ctx), `{"code": "SUCCESS","message": "收单成功"}`)
|
||||
return
|
||||
}
|
||||
|
||||
// QQPay QQ支付回调
|
||||
func (c *cNotify) QQPay(ctx context.Context, _ *pay.NotifyQQPayReq) (res *pay.NotifyQQPayRes, err error) {
|
||||
if _, err = service.Pay().Notify(ctx, &payin.PayNotifyInp{PayType: consts.PayTypeQQPay}); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
r := g.RequestFromCtx(ctx)
|
||||
r.Response.ClearBuffer()
|
||||
r.Response.Write(`<?xml version="1.0" encoding="UTF-8"?>`)
|
||||
r.Response.WriteXml(g.Map{
|
||||
"return_code": "SUCCESS",
|
||||
})
|
||||
return
|
||||
}
|
||||
5
server/internal/controller/api/pay/pay.go
Normal file
5
server/internal/controller/api/pay/pay.go
Normal file
@@ -0,0 +1,5 @@
|
||||
// =================================================================================
|
||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
||||
// =================================================================================
|
||||
|
||||
package pay
|
||||
15
server/internal/controller/api/pay/pay_new.go
Normal file
15
server/internal/controller/api/pay/pay_new.go
Normal file
@@ -0,0 +1,15 @@
|
||||
// =================================================================================
|
||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
||||
// =================================================================================
|
||||
|
||||
package pay
|
||||
|
||||
import (
|
||||
"hotgo/api/api/pay"
|
||||
)
|
||||
|
||||
type ControllerV1 struct{}
|
||||
|
||||
func NewV1() pay.IPayV1 {
|
||||
return &ControllerV1{}
|
||||
}
|
||||
22
server/internal/controller/api/pay/pay_v1_notify_ali_pay.go
Normal file
22
server/internal/controller/api/pay/pay_v1_notify_ali_pay.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package pay
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1 "hotgo/api/api/pay/v1"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/library/response"
|
||||
"hotgo/internal/model/input/payin"
|
||||
"hotgo/internal/service"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) NotifyAliPay(ctx context.Context, req *v1.NotifyAliPayReq) (res *v1.NotifyAliPayRes, err error) {
|
||||
if _, err = service.Pay().Notify(ctx, &payin.PayNotifyInp{PayType: consts.PayTypeAliPay}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
response.RText(g.RequestFromCtx(ctx), "success")
|
||||
return
|
||||
}
|
||||
26
server/internal/controller/api/pay/pay_v1_notify_qq_pay.go
Normal file
26
server/internal/controller/api/pay/pay_v1_notify_qq_pay.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package pay
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1 "hotgo/api/api/pay/v1"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/model/input/payin"
|
||||
"hotgo/internal/service"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) NotifyQQPay(ctx context.Context, req *v1.NotifyQQPayReq) (res *v1.NotifyQQPayRes, err error) {
|
||||
if _, err = service.Pay().Notify(ctx, &payin.PayNotifyInp{PayType: consts.PayTypeQQPay}); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
r := g.RequestFromCtx(ctx)
|
||||
r.Response.ClearBuffer()
|
||||
r.Response.Write(`<?xml version="1.0" encoding="UTF-8"?>`)
|
||||
r.Response.WriteXml(g.Map{
|
||||
"return_code": "SUCCESS",
|
||||
})
|
||||
return
|
||||
}
|
||||
22
server/internal/controller/api/pay/pay_v1_notify_wx_pay.go
Normal file
22
server/internal/controller/api/pay/pay_v1_notify_wx_pay.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package pay
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1 "hotgo/api/api/pay/v1"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/library/response"
|
||||
"hotgo/internal/model/input/payin"
|
||||
"hotgo/internal/service"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) NotifyWxPay(ctx context.Context, req *v1.NotifyWxPayReq) (res *v1.NotifyWxPayRes, err error) {
|
||||
if _, err = service.Pay().Notify(ctx, &payin.PayNotifyInp{PayType: consts.PayTypeWxPay}); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
response.CustomJson(g.RequestFromCtx(ctx), `{"code": "SUCCESS","message": "收单成功"}`)
|
||||
return
|
||||
}
|
||||
0
server/internal/dao/addon_hgexample_table.go
Normal file → Executable file
0
server/internal/dao/addon_hgexample_table.go
Normal file → Executable file
0
server/internal/dao/addon_hgexample_tenant_order.go
Normal file → Executable file
0
server/internal/dao/addon_hgexample_tenant_order.go
Normal file → Executable file
0
server/internal/dao/admin_cash.go
Normal file → Executable file
0
server/internal/dao/admin_cash.go
Normal file → Executable file
0
server/internal/dao/admin_credits_log.go
Normal file → Executable file
0
server/internal/dao/admin_credits_log.go
Normal file → Executable file
0
server/internal/dao/admin_dept.go
Normal file → Executable file
0
server/internal/dao/admin_dept.go
Normal file → Executable file
0
server/internal/dao/admin_member.go
Normal file → Executable file
0
server/internal/dao/admin_member.go
Normal file → Executable file
0
server/internal/dao/admin_member_post.go
Normal file → Executable file
0
server/internal/dao/admin_member_post.go
Normal file → Executable file
0
server/internal/dao/admin_member_role.go
Normal file → Executable file
0
server/internal/dao/admin_member_role.go
Normal file → Executable file
0
server/internal/dao/admin_menu.go
Normal file → Executable file
0
server/internal/dao/admin_menu.go
Normal file → Executable file
0
server/internal/dao/admin_notice.go
Normal file → Executable file
0
server/internal/dao/admin_notice.go
Normal file → Executable file
0
server/internal/dao/admin_notice_read.go
Normal file → Executable file
0
server/internal/dao/admin_notice_read.go
Normal file → Executable file
0
server/internal/dao/admin_oauth.go
Normal file → Executable file
0
server/internal/dao/admin_oauth.go
Normal file → Executable file
0
server/internal/dao/admin_order.go
Normal file → Executable file
0
server/internal/dao/admin_order.go
Normal file → Executable file
0
server/internal/dao/admin_post.go
Normal file → Executable file
0
server/internal/dao/admin_post.go
Normal file → Executable file
0
server/internal/dao/admin_role.go
Normal file → Executable file
0
server/internal/dao/admin_role.go
Normal file → Executable file
0
server/internal/dao/admin_role_casbin.go
Normal file → Executable file
0
server/internal/dao/admin_role_casbin.go
Normal file → Executable file
0
server/internal/dao/admin_role_menu.go
Normal file → Executable file
0
server/internal/dao/admin_role_menu.go
Normal file → Executable file
42
server/internal/dao/internal/addon_hgexample_table.go
Normal file → Executable file
42
server/internal/dao/internal/addon_hgexample_table.go
Normal file → Executable file
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// AddonHgexampleTableDao is the data access object for table hg_addon_hgexample_table.
|
||||
// AddonHgexampleTableDao is the data access object for the table hg_addon_hgexample_table.
|
||||
type AddonHgexampleTableDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns AddonHgexampleTableColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 AddonHgexampleTableColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// AddonHgexampleTableColumns defines and stores column names for table hg_addon_hgexample_table.
|
||||
// AddonHgexampleTableColumns defines and stores column names for the table hg_addon_hgexample_table.
|
||||
type AddonHgexampleTableColumns struct {
|
||||
Id string // ID
|
||||
Pid string // 上级ID
|
||||
@@ -59,7 +60,7 @@ type AddonHgexampleTableColumns struct {
|
||||
DeletedAt string // 删除时间
|
||||
}
|
||||
|
||||
// addonHgexampleTableColumns holds the columns for table hg_addon_hgexample_table.
|
||||
// addonHgexampleTableColumns holds the columns for the table hg_addon_hgexample_table.
|
||||
var addonHgexampleTableColumns = AddonHgexampleTableColumns{
|
||||
Id: "id",
|
||||
Pid: "pid",
|
||||
@@ -101,44 +102,49 @@ var addonHgexampleTableColumns = AddonHgexampleTableColumns{
|
||||
}
|
||||
|
||||
// NewAddonHgexampleTableDao creates and returns a new DAO object for table data access.
|
||||
func NewAddonHgexampleTableDao() *AddonHgexampleTableDao {
|
||||
func NewAddonHgexampleTableDao(handlers ...gdb.ModelHandler) *AddonHgexampleTableDao {
|
||||
return &AddonHgexampleTableDao{
|
||||
group: "default",
|
||||
table: "hg_addon_hgexample_table",
|
||||
columns: addonHgexampleTableColumns,
|
||||
group: "default",
|
||||
table: "hg_addon_hgexample_table",
|
||||
columns: addonHgexampleTableColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *AddonHgexampleTableDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *AddonHgexampleTableDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *AddonHgexampleTableDao) Columns() AddonHgexampleTableColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *AddonHgexampleTableDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *AddonHgexampleTableDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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 rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// 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 that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *AddonHgexampleTableDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
|
||||
42
server/internal/dao/internal/addon_hgexample_tenant_order.go
Normal file → Executable file
42
server/internal/dao/internal/addon_hgexample_tenant_order.go
Normal file → Executable file
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// AddonHgexampleTenantOrderDao is the data access object for table hg_addon_hgexample_tenant_order.
|
||||
// AddonHgexampleTenantOrderDao is the data access object for the table hg_addon_hgexample_tenant_order.
|
||||
type AddonHgexampleTenantOrderDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns AddonHgexampleTenantOrderColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 AddonHgexampleTenantOrderColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// AddonHgexampleTenantOrderColumns defines and stores column names for table hg_addon_hgexample_tenant_order.
|
||||
// AddonHgexampleTenantOrderColumns defines and stores column names for the table hg_addon_hgexample_tenant_order.
|
||||
type AddonHgexampleTenantOrderColumns struct {
|
||||
Id string // 主键
|
||||
TenantId string // 租户ID
|
||||
@@ -33,7 +34,7 @@ type AddonHgexampleTenantOrderColumns struct {
|
||||
UpdatedAt string // 修改时间
|
||||
}
|
||||
|
||||
// addonHgexampleTenantOrderColumns holds the columns for table hg_addon_hgexample_tenant_order.
|
||||
// addonHgexampleTenantOrderColumns holds the columns for the table hg_addon_hgexample_tenant_order.
|
||||
var addonHgexampleTenantOrderColumns = AddonHgexampleTenantOrderColumns{
|
||||
Id: "id",
|
||||
TenantId: "tenant_id",
|
||||
@@ -49,44 +50,49 @@ var addonHgexampleTenantOrderColumns = AddonHgexampleTenantOrderColumns{
|
||||
}
|
||||
|
||||
// NewAddonHgexampleTenantOrderDao creates and returns a new DAO object for table data access.
|
||||
func NewAddonHgexampleTenantOrderDao() *AddonHgexampleTenantOrderDao {
|
||||
func NewAddonHgexampleTenantOrderDao(handlers ...gdb.ModelHandler) *AddonHgexampleTenantOrderDao {
|
||||
return &AddonHgexampleTenantOrderDao{
|
||||
group: "default",
|
||||
table: "hg_addon_hgexample_tenant_order",
|
||||
columns: addonHgexampleTenantOrderColumns,
|
||||
group: "default",
|
||||
table: "hg_addon_hgexample_tenant_order",
|
||||
columns: addonHgexampleTenantOrderColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *AddonHgexampleTenantOrderDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *AddonHgexampleTenantOrderDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *AddonHgexampleTenantOrderDao) Columns() AddonHgexampleTenantOrderColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *AddonHgexampleTenantOrderDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *AddonHgexampleTenantOrderDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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 rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// 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 that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *AddonHgexampleTenantOrderDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
|
||||
42
server/internal/dao/internal/admin_cash.go
Normal file → Executable file
42
server/internal/dao/internal/admin_cash.go
Normal file → Executable file
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// AdminCashDao is the data access object for table hg_admin_cash.
|
||||
// AdminCashDao is the data access object for the table hg_admin_cash.
|
||||
type AdminCashDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns AdminCashColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 AdminCashColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// AdminCashColumns defines and stores column names for table hg_admin_cash.
|
||||
// AdminCashColumns defines and stores column names for the table hg_admin_cash.
|
||||
type AdminCashColumns struct {
|
||||
Id string // ID
|
||||
MemberId string // 管理员ID
|
||||
@@ -32,7 +33,7 @@ type AdminCashColumns struct {
|
||||
CreatedAt string // 申请时间
|
||||
}
|
||||
|
||||
// adminCashColumns holds the columns for table hg_admin_cash.
|
||||
// adminCashColumns holds the columns for the table hg_admin_cash.
|
||||
var adminCashColumns = AdminCashColumns{
|
||||
Id: "id",
|
||||
MemberId: "member_id",
|
||||
@@ -47,44 +48,49 @@ var adminCashColumns = AdminCashColumns{
|
||||
}
|
||||
|
||||
// NewAdminCashDao creates and returns a new DAO object for table data access.
|
||||
func NewAdminCashDao() *AdminCashDao {
|
||||
func NewAdminCashDao(handlers ...gdb.ModelHandler) *AdminCashDao {
|
||||
return &AdminCashDao{
|
||||
group: "default",
|
||||
table: "hg_admin_cash",
|
||||
columns: adminCashColumns,
|
||||
group: "default",
|
||||
table: "hg_admin_cash",
|
||||
columns: adminCashColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *AdminCashDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *AdminCashDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *AdminCashDao) Columns() AdminCashColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *AdminCashDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *AdminCashDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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 rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// 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 that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *AdminCashDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
|
||||
42
server/internal/dao/internal/admin_credits_log.go
Normal file → Executable file
42
server/internal/dao/internal/admin_credits_log.go
Normal file → Executable file
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// AdminCreditsLogDao is the data access object for table hg_admin_credits_log.
|
||||
// AdminCreditsLogDao is the data access object for the table hg_admin_credits_log.
|
||||
type AdminCreditsLogDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns AdminCreditsLogColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 AdminCreditsLogColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// AdminCreditsLogColumns defines and stores column names for table hg_admin_credits_log.
|
||||
// AdminCreditsLogColumns defines and stores column names for the table hg_admin_credits_log.
|
||||
type AdminCreditsLogColumns struct {
|
||||
Id string // 变动ID
|
||||
MemberId string // 管理员ID
|
||||
@@ -37,7 +38,7 @@ type AdminCreditsLogColumns struct {
|
||||
UpdatedAt string // 修改时间
|
||||
}
|
||||
|
||||
// adminCreditsLogColumns holds the columns for table hg_admin_credits_log.
|
||||
// adminCreditsLogColumns holds the columns for the table hg_admin_credits_log.
|
||||
var adminCreditsLogColumns = AdminCreditsLogColumns{
|
||||
Id: "id",
|
||||
MemberId: "member_id",
|
||||
@@ -57,44 +58,49 @@ var adminCreditsLogColumns = AdminCreditsLogColumns{
|
||||
}
|
||||
|
||||
// NewAdminCreditsLogDao creates and returns a new DAO object for table data access.
|
||||
func NewAdminCreditsLogDao() *AdminCreditsLogDao {
|
||||
func NewAdminCreditsLogDao(handlers ...gdb.ModelHandler) *AdminCreditsLogDao {
|
||||
return &AdminCreditsLogDao{
|
||||
group: "default",
|
||||
table: "hg_admin_credits_log",
|
||||
columns: adminCreditsLogColumns,
|
||||
group: "default",
|
||||
table: "hg_admin_credits_log",
|
||||
columns: adminCreditsLogColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *AdminCreditsLogDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *AdminCreditsLogDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *AdminCreditsLogDao) Columns() AdminCreditsLogColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *AdminCreditsLogDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *AdminCreditsLogDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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 rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// 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 that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *AdminCreditsLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
|
||||
42
server/internal/dao/internal/admin_dept.go
Normal file → Executable file
42
server/internal/dao/internal/admin_dept.go
Normal file → Executable file
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// AdminDeptDao is the data access object for table hg_admin_dept.
|
||||
// AdminDeptDao is the data access object for the table hg_admin_dept.
|
||||
type AdminDeptDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns AdminDeptColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 AdminDeptColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// AdminDeptColumns defines and stores column names for table hg_admin_dept.
|
||||
// AdminDeptColumns defines and stores column names for the table hg_admin_dept.
|
||||
type AdminDeptColumns struct {
|
||||
Id string // 部门ID
|
||||
Pid string // 父部门ID
|
||||
@@ -36,7 +37,7 @@ type AdminDeptColumns struct {
|
||||
UpdatedAt string // 更新时间
|
||||
}
|
||||
|
||||
// adminDeptColumns holds the columns for table hg_admin_dept.
|
||||
// adminDeptColumns holds the columns for the table hg_admin_dept.
|
||||
var adminDeptColumns = AdminDeptColumns{
|
||||
Id: "id",
|
||||
Pid: "pid",
|
||||
@@ -55,44 +56,49 @@ var adminDeptColumns = AdminDeptColumns{
|
||||
}
|
||||
|
||||
// NewAdminDeptDao creates and returns a new DAO object for table data access.
|
||||
func NewAdminDeptDao() *AdminDeptDao {
|
||||
func NewAdminDeptDao(handlers ...gdb.ModelHandler) *AdminDeptDao {
|
||||
return &AdminDeptDao{
|
||||
group: "default",
|
||||
table: "hg_admin_dept",
|
||||
columns: adminDeptColumns,
|
||||
group: "default",
|
||||
table: "hg_admin_dept",
|
||||
columns: adminDeptColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *AdminDeptDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *AdminDeptDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *AdminDeptDao) Columns() AdminDeptColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *AdminDeptDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *AdminDeptDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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 rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// 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 that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *AdminDeptDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
|
||||
42
server/internal/dao/internal/admin_member.go
Normal file → Executable file
42
server/internal/dao/internal/admin_member.go
Normal file → Executable file
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// AdminMemberDao is the data access object for table hg_admin_member.
|
||||
// AdminMemberDao is the data access object for the table hg_admin_member.
|
||||
type AdminMemberDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns AdminMemberColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 AdminMemberColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// AdminMemberColumns defines and stores column names for table hg_admin_member.
|
||||
// AdminMemberColumns defines and stores column names for the table hg_admin_member.
|
||||
type AdminMemberColumns struct {
|
||||
Id string // 管理员ID
|
||||
DeptId string // 部门ID
|
||||
@@ -50,7 +51,7 @@ type AdminMemberColumns struct {
|
||||
UpdatedAt string // 修改时间
|
||||
}
|
||||
|
||||
// adminMemberColumns holds the columns for table hg_admin_member.
|
||||
// adminMemberColumns holds the columns for the table hg_admin_member.
|
||||
var adminMemberColumns = AdminMemberColumns{
|
||||
Id: "id",
|
||||
DeptId: "dept_id",
|
||||
@@ -83,44 +84,49 @@ var adminMemberColumns = AdminMemberColumns{
|
||||
}
|
||||
|
||||
// NewAdminMemberDao creates and returns a new DAO object for table data access.
|
||||
func NewAdminMemberDao() *AdminMemberDao {
|
||||
func NewAdminMemberDao(handlers ...gdb.ModelHandler) *AdminMemberDao {
|
||||
return &AdminMemberDao{
|
||||
group: "default",
|
||||
table: "hg_admin_member",
|
||||
columns: adminMemberColumns,
|
||||
group: "default",
|
||||
table: "hg_admin_member",
|
||||
columns: adminMemberColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *AdminMemberDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *AdminMemberDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *AdminMemberDao) Columns() AdminMemberColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *AdminMemberDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *AdminMemberDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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 rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// 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 that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *AdminMemberDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
|
||||
42
server/internal/dao/internal/admin_member_post.go
Normal file → Executable file
42
server/internal/dao/internal/admin_member_post.go
Normal file → Executable file
@@ -11,64 +11,70 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// AdminMemberPostDao is the data access object for table hg_admin_member_post.
|
||||
// AdminMemberPostDao is the data access object for the table hg_admin_member_post.
|
||||
type AdminMemberPostDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns AdminMemberPostColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 AdminMemberPostColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// AdminMemberPostColumns defines and stores column names for table hg_admin_member_post.
|
||||
// AdminMemberPostColumns defines and stores column names for the table hg_admin_member_post.
|
||||
type AdminMemberPostColumns struct {
|
||||
MemberId string // 管理员ID
|
||||
PostId string // 岗位ID
|
||||
}
|
||||
|
||||
// adminMemberPostColumns holds the columns for table hg_admin_member_post.
|
||||
// adminMemberPostColumns holds the columns for the table hg_admin_member_post.
|
||||
var adminMemberPostColumns = AdminMemberPostColumns{
|
||||
MemberId: "member_id",
|
||||
PostId: "post_id",
|
||||
}
|
||||
|
||||
// NewAdminMemberPostDao creates and returns a new DAO object for table data access.
|
||||
func NewAdminMemberPostDao() *AdminMemberPostDao {
|
||||
func NewAdminMemberPostDao(handlers ...gdb.ModelHandler) *AdminMemberPostDao {
|
||||
return &AdminMemberPostDao{
|
||||
group: "default",
|
||||
table: "hg_admin_member_post",
|
||||
columns: adminMemberPostColumns,
|
||||
group: "default",
|
||||
table: "hg_admin_member_post",
|
||||
columns: adminMemberPostColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *AdminMemberPostDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *AdminMemberPostDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *AdminMemberPostDao) Columns() AdminMemberPostColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *AdminMemberPostDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *AdminMemberPostDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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 rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// 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 that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *AdminMemberPostDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
|
||||
42
server/internal/dao/internal/admin_member_role.go
Normal file → Executable file
42
server/internal/dao/internal/admin_member_role.go
Normal file → Executable file
@@ -11,64 +11,70 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// AdminMemberRoleDao is the data access object for table hg_admin_member_role.
|
||||
// AdminMemberRoleDao is the data access object for the table hg_admin_member_role.
|
||||
type AdminMemberRoleDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns AdminMemberRoleColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 AdminMemberRoleColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// AdminMemberRoleColumns defines and stores column names for table hg_admin_member_role.
|
||||
// AdminMemberRoleColumns defines and stores column names for the table hg_admin_member_role.
|
||||
type AdminMemberRoleColumns struct {
|
||||
MemberId string // 管理员ID
|
||||
RoleId string // 角色ID
|
||||
}
|
||||
|
||||
// adminMemberRoleColumns holds the columns for table hg_admin_member_role.
|
||||
// adminMemberRoleColumns holds the columns for the table hg_admin_member_role.
|
||||
var adminMemberRoleColumns = AdminMemberRoleColumns{
|
||||
MemberId: "member_id",
|
||||
RoleId: "role_id",
|
||||
}
|
||||
|
||||
// NewAdminMemberRoleDao creates and returns a new DAO object for table data access.
|
||||
func NewAdminMemberRoleDao() *AdminMemberRoleDao {
|
||||
func NewAdminMemberRoleDao(handlers ...gdb.ModelHandler) *AdminMemberRoleDao {
|
||||
return &AdminMemberRoleDao{
|
||||
group: "default",
|
||||
table: "hg_admin_member_role",
|
||||
columns: adminMemberRoleColumns,
|
||||
group: "default",
|
||||
table: "hg_admin_member_role",
|
||||
columns: adminMemberRoleColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *AdminMemberRoleDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *AdminMemberRoleDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *AdminMemberRoleDao) Columns() AdminMemberRoleColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *AdminMemberRoleDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *AdminMemberRoleDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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 rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// 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 that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *AdminMemberRoleDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
|
||||
42
server/internal/dao/internal/admin_menu.go
Normal file → Executable file
42
server/internal/dao/internal/admin_menu.go
Normal file → Executable file
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// AdminMenuDao is the data access object for table hg_admin_menu.
|
||||
// AdminMenuDao is the data access object for the table hg_admin_menu.
|
||||
type AdminMenuDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns AdminMenuColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 AdminMenuColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// AdminMenuColumns defines and stores column names for table hg_admin_menu.
|
||||
// AdminMenuColumns defines and stores column names for the table hg_admin_menu.
|
||||
type AdminMenuColumns struct {
|
||||
Id string // 菜单ID
|
||||
Pid string // 父菜单ID
|
||||
@@ -48,7 +49,7 @@ type AdminMenuColumns struct {
|
||||
CreatedAt string // 创建时间
|
||||
}
|
||||
|
||||
// adminMenuColumns holds the columns for table hg_admin_menu.
|
||||
// adminMenuColumns holds the columns for the table hg_admin_menu.
|
||||
var adminMenuColumns = AdminMenuColumns{
|
||||
Id: "id",
|
||||
Pid: "pid",
|
||||
@@ -79,44 +80,49 @@ var adminMenuColumns = AdminMenuColumns{
|
||||
}
|
||||
|
||||
// NewAdminMenuDao creates and returns a new DAO object for table data access.
|
||||
func NewAdminMenuDao() *AdminMenuDao {
|
||||
func NewAdminMenuDao(handlers ...gdb.ModelHandler) *AdminMenuDao {
|
||||
return &AdminMenuDao{
|
||||
group: "default",
|
||||
table: "hg_admin_menu",
|
||||
columns: adminMenuColumns,
|
||||
group: "default",
|
||||
table: "hg_admin_menu",
|
||||
columns: adminMenuColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *AdminMenuDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *AdminMenuDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *AdminMenuDao) Columns() AdminMenuColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *AdminMenuDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *AdminMenuDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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 rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// 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 that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *AdminMenuDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
|
||||
42
server/internal/dao/internal/admin_notice.go
Normal file → Executable file
42
server/internal/dao/internal/admin_notice.go
Normal file → Executable file
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// AdminNoticeDao is the data access object for table hg_admin_notice.
|
||||
// AdminNoticeDao is the data access object for the table hg_admin_notice.
|
||||
type AdminNoticeDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns AdminNoticeColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 AdminNoticeColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// AdminNoticeColumns defines and stores column names for table hg_admin_notice.
|
||||
// AdminNoticeColumns defines and stores column names for the table hg_admin_notice.
|
||||
type AdminNoticeColumns struct {
|
||||
Id string // 公告ID
|
||||
Title string // 公告标题
|
||||
@@ -36,7 +37,7 @@ type AdminNoticeColumns struct {
|
||||
DeletedAt string // 删除时间
|
||||
}
|
||||
|
||||
// adminNoticeColumns holds the columns for table hg_admin_notice.
|
||||
// adminNoticeColumns holds the columns for the table hg_admin_notice.
|
||||
var adminNoticeColumns = AdminNoticeColumns{
|
||||
Id: "id",
|
||||
Title: "title",
|
||||
@@ -55,44 +56,49 @@ var adminNoticeColumns = AdminNoticeColumns{
|
||||
}
|
||||
|
||||
// NewAdminNoticeDao creates and returns a new DAO object for table data access.
|
||||
func NewAdminNoticeDao() *AdminNoticeDao {
|
||||
func NewAdminNoticeDao(handlers ...gdb.ModelHandler) *AdminNoticeDao {
|
||||
return &AdminNoticeDao{
|
||||
group: "default",
|
||||
table: "hg_admin_notice",
|
||||
columns: adminNoticeColumns,
|
||||
group: "default",
|
||||
table: "hg_admin_notice",
|
||||
columns: adminNoticeColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *AdminNoticeDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *AdminNoticeDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *AdminNoticeDao) Columns() AdminNoticeColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *AdminNoticeDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *AdminNoticeDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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 rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// 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 that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *AdminNoticeDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
|
||||
42
server/internal/dao/internal/admin_notice_read.go
Normal file → Executable file
42
server/internal/dao/internal/admin_notice_read.go
Normal file → Executable file
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// AdminNoticeReadDao is the data access object for table hg_admin_notice_read.
|
||||
// AdminNoticeReadDao is the data access object for the table hg_admin_notice_read.
|
||||
type AdminNoticeReadDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns AdminNoticeReadColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 AdminNoticeReadColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// AdminNoticeReadColumns defines and stores column names for table hg_admin_notice_read.
|
||||
// AdminNoticeReadColumns defines and stores column names for the table hg_admin_notice_read.
|
||||
type AdminNoticeReadColumns struct {
|
||||
Id string // 记录ID
|
||||
NoticeId string // 公告ID
|
||||
@@ -28,7 +29,7 @@ type AdminNoticeReadColumns struct {
|
||||
CreatedAt string // 阅读时间
|
||||
}
|
||||
|
||||
// adminNoticeReadColumns holds the columns for table hg_admin_notice_read.
|
||||
// adminNoticeReadColumns holds the columns for the table hg_admin_notice_read.
|
||||
var adminNoticeReadColumns = AdminNoticeReadColumns{
|
||||
Id: "id",
|
||||
NoticeId: "notice_id",
|
||||
@@ -39,44 +40,49 @@ var adminNoticeReadColumns = AdminNoticeReadColumns{
|
||||
}
|
||||
|
||||
// NewAdminNoticeReadDao creates and returns a new DAO object for table data access.
|
||||
func NewAdminNoticeReadDao() *AdminNoticeReadDao {
|
||||
func NewAdminNoticeReadDao(handlers ...gdb.ModelHandler) *AdminNoticeReadDao {
|
||||
return &AdminNoticeReadDao{
|
||||
group: "default",
|
||||
table: "hg_admin_notice_read",
|
||||
columns: adminNoticeReadColumns,
|
||||
group: "default",
|
||||
table: "hg_admin_notice_read",
|
||||
columns: adminNoticeReadColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *AdminNoticeReadDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *AdminNoticeReadDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *AdminNoticeReadDao) Columns() AdminNoticeReadColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *AdminNoticeReadDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *AdminNoticeReadDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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 rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// 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 that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *AdminNoticeReadDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
|
||||
42
server/internal/dao/internal/admin_oauth.go
Normal file → Executable file
42
server/internal/dao/internal/admin_oauth.go
Normal file → Executable file
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// AdminOauthDao is the data access object for table hg_admin_oauth.
|
||||
// AdminOauthDao is the data access object for the table hg_admin_oauth.
|
||||
type AdminOauthDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns AdminOauthColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 AdminOauthColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// AdminOauthColumns defines and stores column names for table hg_admin_oauth.
|
||||
// AdminOauthColumns defines and stores column names for the table hg_admin_oauth.
|
||||
type AdminOauthColumns struct {
|
||||
Id string // 主键
|
||||
MemberId string // 用户ID
|
||||
@@ -37,7 +38,7 @@ type AdminOauthColumns struct {
|
||||
UpdatedAt string // 修改时间
|
||||
}
|
||||
|
||||
// adminOauthColumns holds the columns for table hg_admin_oauth.
|
||||
// adminOauthColumns holds the columns for the table hg_admin_oauth.
|
||||
var adminOauthColumns = AdminOauthColumns{
|
||||
Id: "id",
|
||||
MemberId: "member_id",
|
||||
@@ -57,44 +58,49 @@ var adminOauthColumns = AdminOauthColumns{
|
||||
}
|
||||
|
||||
// NewAdminOauthDao creates and returns a new DAO object for table data access.
|
||||
func NewAdminOauthDao() *AdminOauthDao {
|
||||
func NewAdminOauthDao(handlers ...gdb.ModelHandler) *AdminOauthDao {
|
||||
return &AdminOauthDao{
|
||||
group: "default",
|
||||
table: "hg_admin_oauth",
|
||||
columns: adminOauthColumns,
|
||||
group: "default",
|
||||
table: "hg_admin_oauth",
|
||||
columns: adminOauthColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *AdminOauthDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *AdminOauthDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *AdminOauthDao) Columns() AdminOauthColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *AdminOauthDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *AdminOauthDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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 rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// 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 that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *AdminOauthDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
|
||||
42
server/internal/dao/internal/admin_order.go
Normal file → Executable file
42
server/internal/dao/internal/admin_order.go
Normal file → Executable file
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// AdminOrderDao is the data access object for table hg_admin_order.
|
||||
// AdminOrderDao is the data access object for the table hg_admin_order.
|
||||
type AdminOrderDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns AdminOrderColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 AdminOrderColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// AdminOrderColumns defines and stores column names for table hg_admin_order.
|
||||
// AdminOrderColumns defines and stores column names for the table hg_admin_order.
|
||||
type AdminOrderColumns struct {
|
||||
Id string // 主键
|
||||
MemberId string // 管理员id
|
||||
@@ -34,7 +35,7 @@ type AdminOrderColumns struct {
|
||||
UpdatedAt string // 修改时间
|
||||
}
|
||||
|
||||
// adminOrderColumns holds the columns for table hg_admin_order.
|
||||
// adminOrderColumns holds the columns for the table hg_admin_order.
|
||||
var adminOrderColumns = AdminOrderColumns{
|
||||
Id: "id",
|
||||
MemberId: "member_id",
|
||||
@@ -51,44 +52,49 @@ var adminOrderColumns = AdminOrderColumns{
|
||||
}
|
||||
|
||||
// NewAdminOrderDao creates and returns a new DAO object for table data access.
|
||||
func NewAdminOrderDao() *AdminOrderDao {
|
||||
func NewAdminOrderDao(handlers ...gdb.ModelHandler) *AdminOrderDao {
|
||||
return &AdminOrderDao{
|
||||
group: "default",
|
||||
table: "hg_admin_order",
|
||||
columns: adminOrderColumns,
|
||||
group: "default",
|
||||
table: "hg_admin_order",
|
||||
columns: adminOrderColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *AdminOrderDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *AdminOrderDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *AdminOrderDao) Columns() AdminOrderColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *AdminOrderDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *AdminOrderDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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 rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// 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 that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *AdminOrderDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
|
||||
42
server/internal/dao/internal/admin_post.go
Normal file → Executable file
42
server/internal/dao/internal/admin_post.go
Normal file → Executable file
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// AdminPostDao is the data access object for table hg_admin_post.
|
||||
// AdminPostDao is the data access object for the table hg_admin_post.
|
||||
type AdminPostDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns AdminPostColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 AdminPostColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// AdminPostColumns defines and stores column names for table hg_admin_post.
|
||||
// AdminPostColumns defines and stores column names for the table hg_admin_post.
|
||||
type AdminPostColumns struct {
|
||||
Id string // 岗位ID
|
||||
Code string // 岗位编码
|
||||
@@ -30,7 +31,7 @@ type AdminPostColumns struct {
|
||||
UpdatedAt string // 更新时间
|
||||
}
|
||||
|
||||
// adminPostColumns holds the columns for table hg_admin_post.
|
||||
// adminPostColumns holds the columns for the table hg_admin_post.
|
||||
var adminPostColumns = AdminPostColumns{
|
||||
Id: "id",
|
||||
Code: "code",
|
||||
@@ -43,44 +44,49 @@ var adminPostColumns = AdminPostColumns{
|
||||
}
|
||||
|
||||
// NewAdminPostDao creates and returns a new DAO object for table data access.
|
||||
func NewAdminPostDao() *AdminPostDao {
|
||||
func NewAdminPostDao(handlers ...gdb.ModelHandler) *AdminPostDao {
|
||||
return &AdminPostDao{
|
||||
group: "default",
|
||||
table: "hg_admin_post",
|
||||
columns: adminPostColumns,
|
||||
group: "default",
|
||||
table: "hg_admin_post",
|
||||
columns: adminPostColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *AdminPostDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *AdminPostDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *AdminPostDao) Columns() AdminPostColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *AdminPostDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *AdminPostDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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 rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// 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 that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *AdminPostDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
|
||||
42
server/internal/dao/internal/admin_role.go
Normal file → Executable file
42
server/internal/dao/internal/admin_role.go
Normal file → Executable file
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// AdminRoleDao is the data access object for table hg_admin_role.
|
||||
// AdminRoleDao is the data access object for the table hg_admin_role.
|
||||
type AdminRoleDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns AdminRoleColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 AdminRoleColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// AdminRoleColumns defines and stores column names for table hg_admin_role.
|
||||
// AdminRoleColumns defines and stores column names for the table hg_admin_role.
|
||||
type AdminRoleColumns struct {
|
||||
Id string // 角色ID
|
||||
Name string // 角色名称
|
||||
@@ -35,7 +36,7 @@ type AdminRoleColumns struct {
|
||||
UpdatedAt string // 更新时间
|
||||
}
|
||||
|
||||
// adminRoleColumns holds the columns for table hg_admin_role.
|
||||
// adminRoleColumns holds the columns for the table hg_admin_role.
|
||||
var adminRoleColumns = AdminRoleColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
@@ -53,44 +54,49 @@ var adminRoleColumns = AdminRoleColumns{
|
||||
}
|
||||
|
||||
// NewAdminRoleDao creates and returns a new DAO object for table data access.
|
||||
func NewAdminRoleDao() *AdminRoleDao {
|
||||
func NewAdminRoleDao(handlers ...gdb.ModelHandler) *AdminRoleDao {
|
||||
return &AdminRoleDao{
|
||||
group: "default",
|
||||
table: "hg_admin_role",
|
||||
columns: adminRoleColumns,
|
||||
group: "default",
|
||||
table: "hg_admin_role",
|
||||
columns: adminRoleColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *AdminRoleDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *AdminRoleDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *AdminRoleDao) Columns() AdminRoleColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *AdminRoleDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *AdminRoleDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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 rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// 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 that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *AdminRoleDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
|
||||
42
server/internal/dao/internal/admin_role_casbin.go
Normal file → Executable file
42
server/internal/dao/internal/admin_role_casbin.go
Normal file → Executable file
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// AdminRoleCasbinDao is the data access object for table hg_admin_role_casbin.
|
||||
// AdminRoleCasbinDao is the data access object for the table hg_admin_role_casbin.
|
||||
type AdminRoleCasbinDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns AdminRoleCasbinColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 AdminRoleCasbinColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// AdminRoleCasbinColumns defines and stores column names for table hg_admin_role_casbin.
|
||||
// AdminRoleCasbinColumns defines and stores column names for the table hg_admin_role_casbin.
|
||||
type AdminRoleCasbinColumns struct {
|
||||
Id string //
|
||||
PType string //
|
||||
@@ -30,7 +31,7 @@ type AdminRoleCasbinColumns struct {
|
||||
V5 string //
|
||||
}
|
||||
|
||||
// adminRoleCasbinColumns holds the columns for table hg_admin_role_casbin.
|
||||
// adminRoleCasbinColumns holds the columns for the table hg_admin_role_casbin.
|
||||
var adminRoleCasbinColumns = AdminRoleCasbinColumns{
|
||||
Id: "id",
|
||||
PType: "p_type",
|
||||
@@ -43,44 +44,49 @@ var adminRoleCasbinColumns = AdminRoleCasbinColumns{
|
||||
}
|
||||
|
||||
// NewAdminRoleCasbinDao creates and returns a new DAO object for table data access.
|
||||
func NewAdminRoleCasbinDao() *AdminRoleCasbinDao {
|
||||
func NewAdminRoleCasbinDao(handlers ...gdb.ModelHandler) *AdminRoleCasbinDao {
|
||||
return &AdminRoleCasbinDao{
|
||||
group: "default",
|
||||
table: "hg_admin_role_casbin",
|
||||
columns: adminRoleCasbinColumns,
|
||||
group: "default",
|
||||
table: "hg_admin_role_casbin",
|
||||
columns: adminRoleCasbinColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *AdminRoleCasbinDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *AdminRoleCasbinDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *AdminRoleCasbinDao) Columns() AdminRoleCasbinColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *AdminRoleCasbinDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *AdminRoleCasbinDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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 rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// 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 that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *AdminRoleCasbinDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
|
||||
42
server/internal/dao/internal/admin_role_menu.go
Normal file → Executable file
42
server/internal/dao/internal/admin_role_menu.go
Normal file → Executable file
@@ -11,64 +11,70 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// AdminRoleMenuDao is the data access object for table hg_admin_role_menu.
|
||||
// AdminRoleMenuDao is the data access object for the table hg_admin_role_menu.
|
||||
type AdminRoleMenuDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns AdminRoleMenuColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 AdminRoleMenuColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// AdminRoleMenuColumns defines and stores column names for table hg_admin_role_menu.
|
||||
// AdminRoleMenuColumns defines and stores column names for the table hg_admin_role_menu.
|
||||
type AdminRoleMenuColumns struct {
|
||||
RoleId string // 角色ID
|
||||
MenuId string // 菜单ID
|
||||
}
|
||||
|
||||
// adminRoleMenuColumns holds the columns for table hg_admin_role_menu.
|
||||
// adminRoleMenuColumns holds the columns for the table hg_admin_role_menu.
|
||||
var adminRoleMenuColumns = AdminRoleMenuColumns{
|
||||
RoleId: "role_id",
|
||||
MenuId: "menu_id",
|
||||
}
|
||||
|
||||
// NewAdminRoleMenuDao creates and returns a new DAO object for table data access.
|
||||
func NewAdminRoleMenuDao() *AdminRoleMenuDao {
|
||||
func NewAdminRoleMenuDao(handlers ...gdb.ModelHandler) *AdminRoleMenuDao {
|
||||
return &AdminRoleMenuDao{
|
||||
group: "default",
|
||||
table: "hg_admin_role_menu",
|
||||
columns: adminRoleMenuColumns,
|
||||
group: "default",
|
||||
table: "hg_admin_role_menu",
|
||||
columns: adminRoleMenuColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *AdminRoleMenuDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *AdminRoleMenuDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *AdminRoleMenuDao) Columns() AdminRoleMenuColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *AdminRoleMenuDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *AdminRoleMenuDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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 rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// 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 that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *AdminRoleMenuDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
|
||||
42
server/internal/dao/internal/pay_log.go
Normal file → Executable file
42
server/internal/dao/internal/pay_log.go
Normal file → Executable file
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// PayLogDao is the data access object for table hg_pay_log.
|
||||
// PayLogDao is the data access object for the table hg_pay_log.
|
||||
type PayLogDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns PayLogColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 PayLogColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// PayLogColumns defines and stores column names for table hg_pay_log.
|
||||
// PayLogColumns defines and stores column names for the table hg_pay_log.
|
||||
type PayLogColumns struct {
|
||||
Id string // 主键
|
||||
MemberId string // 会员ID
|
||||
@@ -52,7 +53,7 @@ type PayLogColumns struct {
|
||||
UpdatedAt string // 修改时间
|
||||
}
|
||||
|
||||
// payLogColumns holds the columns for table hg_pay_log.
|
||||
// payLogColumns holds the columns for the table hg_pay_log.
|
||||
var payLogColumns = PayLogColumns{
|
||||
Id: "id",
|
||||
MemberId: "member_id",
|
||||
@@ -87,44 +88,49 @@ var payLogColumns = PayLogColumns{
|
||||
}
|
||||
|
||||
// NewPayLogDao creates and returns a new DAO object for table data access.
|
||||
func NewPayLogDao() *PayLogDao {
|
||||
func NewPayLogDao(handlers ...gdb.ModelHandler) *PayLogDao {
|
||||
return &PayLogDao{
|
||||
group: "default",
|
||||
table: "hg_pay_log",
|
||||
columns: payLogColumns,
|
||||
group: "default",
|
||||
table: "hg_pay_log",
|
||||
columns: payLogColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *PayLogDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *PayLogDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *PayLogDao) Columns() PayLogColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *PayLogDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *PayLogDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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 rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// 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 that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *PayLogDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
|
||||
42
server/internal/dao/internal/pay_refund.go
Normal file → Executable file
42
server/internal/dao/internal/pay_refund.go
Normal file → Executable file
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// PayRefundDao is the data access object for table hg_pay_refund.
|
||||
// PayRefundDao is the data access object for the table hg_pay_refund.
|
||||
type PayRefundDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns PayRefundColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 PayRefundColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// PayRefundColumns defines and stores column names for table hg_pay_refund.
|
||||
// PayRefundColumns defines and stores column names for the table hg_pay_refund.
|
||||
type PayRefundColumns struct {
|
||||
Id string // 主键ID
|
||||
MemberId string // 会员ID
|
||||
@@ -35,7 +36,7 @@ type PayRefundColumns struct {
|
||||
UpdatedAt string // 更新时间
|
||||
}
|
||||
|
||||
// payRefundColumns holds the columns for table hg_pay_refund.
|
||||
// payRefundColumns holds the columns for the table hg_pay_refund.
|
||||
var payRefundColumns = PayRefundColumns{
|
||||
Id: "id",
|
||||
MemberId: "member_id",
|
||||
@@ -53,44 +54,49 @@ var payRefundColumns = PayRefundColumns{
|
||||
}
|
||||
|
||||
// NewPayRefundDao creates and returns a new DAO object for table data access.
|
||||
func NewPayRefundDao() *PayRefundDao {
|
||||
func NewPayRefundDao(handlers ...gdb.ModelHandler) *PayRefundDao {
|
||||
return &PayRefundDao{
|
||||
group: "default",
|
||||
table: "hg_pay_refund",
|
||||
columns: payRefundColumns,
|
||||
group: "default",
|
||||
table: "hg_pay_refund",
|
||||
columns: payRefundColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *PayRefundDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *PayRefundDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *PayRefundDao) Columns() PayRefundColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *PayRefundDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *PayRefundDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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 rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// 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 that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *PayRefundDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
|
||||
42
server/internal/dao/internal/sys_addons_config.go
Normal file → Executable file
42
server/internal/dao/internal/sys_addons_config.go
Normal file → Executable file
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SysAddonsConfigDao is the data access object for table hg_sys_addons_config.
|
||||
// SysAddonsConfigDao is the data access object for the table hg_sys_addons_config.
|
||||
type SysAddonsConfigDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns SysAddonsConfigColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 SysAddonsConfigColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// SysAddonsConfigColumns defines and stores column names for table hg_sys_addons_config.
|
||||
// SysAddonsConfigColumns defines and stores column names for the table hg_sys_addons_config.
|
||||
type SysAddonsConfigColumns struct {
|
||||
Id string // 配置ID
|
||||
AddonName string // 插件名称
|
||||
@@ -36,7 +37,7 @@ type SysAddonsConfigColumns struct {
|
||||
UpdatedAt string // 更新时间
|
||||
}
|
||||
|
||||
// sysAddonsConfigColumns holds the columns for table hg_sys_addons_config.
|
||||
// sysAddonsConfigColumns holds the columns for the table hg_sys_addons_config.
|
||||
var sysAddonsConfigColumns = SysAddonsConfigColumns{
|
||||
Id: "id",
|
||||
AddonName: "addon_name",
|
||||
@@ -55,44 +56,49 @@ var sysAddonsConfigColumns = SysAddonsConfigColumns{
|
||||
}
|
||||
|
||||
// NewSysAddonsConfigDao creates and returns a new DAO object for table data access.
|
||||
func NewSysAddonsConfigDao() *SysAddonsConfigDao {
|
||||
func NewSysAddonsConfigDao(handlers ...gdb.ModelHandler) *SysAddonsConfigDao {
|
||||
return &SysAddonsConfigDao{
|
||||
group: "default",
|
||||
table: "hg_sys_addons_config",
|
||||
columns: sysAddonsConfigColumns,
|
||||
group: "default",
|
||||
table: "hg_sys_addons_config",
|
||||
columns: sysAddonsConfigColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SysAddonsConfigDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SysAddonsConfigDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SysAddonsConfigDao) Columns() SysAddonsConfigColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SysAddonsConfigDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SysAddonsConfigDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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 rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// 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 that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *SysAddonsConfigDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
|
||||
89
server/internal/dao/internal/sys_addons_install.go
Normal file
89
server/internal/dao/internal/sys_addons_install.go
Normal file
@@ -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"
|
||||
)
|
||||
|
||||
// SysAddonsInstallDao is the data access object for the table hg_sys_addons_install.
|
||||
type SysAddonsInstallDao 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 SysAddonsInstallColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// SysAddonsInstallColumns defines and stores column names for the table hg_sys_addons_install.
|
||||
type SysAddonsInstallColumns struct {
|
||||
Id string // 主键
|
||||
Name string // 插件名称
|
||||
Version string // 版本号
|
||||
Status string // 状态
|
||||
CreatedAt string // 创建时间
|
||||
UpdatedAt string // 更新时间
|
||||
}
|
||||
|
||||
// sysAddonsInstallColumns holds the columns for the table hg_sys_addons_install.
|
||||
var sysAddonsInstallColumns = SysAddonsInstallColumns{
|
||||
Id: "id",
|
||||
Name: "name",
|
||||
Version: "version",
|
||||
Status: "status",
|
||||
CreatedAt: "created_at",
|
||||
UpdatedAt: "updated_at",
|
||||
}
|
||||
|
||||
// NewSysAddonsInstallDao creates and returns a new DAO object for table data access.
|
||||
func NewSysAddonsInstallDao(handlers ...gdb.ModelHandler) *SysAddonsInstallDao {
|
||||
return &SysAddonsInstallDao{
|
||||
group: "default",
|
||||
table: "hg_sys_addons_install",
|
||||
columns: sysAddonsInstallColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SysAddonsInstallDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SysAddonsInstallDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SysAddonsInstallDao) Columns() SysAddonsInstallColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SysAddonsInstallDao) 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 *SysAddonsInstallDao) 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 *SysAddonsInstallDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
42
server/internal/dao/internal/sys_attachment.go
Normal file → Executable file
42
server/internal/dao/internal/sys_attachment.go
Normal file → Executable file
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SysAttachmentDao is the data access object for table hg_sys_attachment.
|
||||
// SysAttachmentDao is the data access object for the table hg_sys_attachment.
|
||||
type SysAttachmentDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns SysAttachmentColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 SysAttachmentColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// SysAttachmentColumns defines and stores column names for table hg_sys_attachment.
|
||||
// SysAttachmentColumns defines and stores column names for the table hg_sys_attachment.
|
||||
type SysAttachmentColumns struct {
|
||||
Id string // 文件ID
|
||||
AppId string // 应用ID
|
||||
@@ -39,7 +40,7 @@ type SysAttachmentColumns struct {
|
||||
UpdatedAt string // 修改时间
|
||||
}
|
||||
|
||||
// sysAttachmentColumns holds the columns for table hg_sys_attachment.
|
||||
// sysAttachmentColumns holds the columns for the table hg_sys_attachment.
|
||||
var sysAttachmentColumns = SysAttachmentColumns{
|
||||
Id: "id",
|
||||
AppId: "app_id",
|
||||
@@ -61,44 +62,49 @@ var sysAttachmentColumns = SysAttachmentColumns{
|
||||
}
|
||||
|
||||
// NewSysAttachmentDao creates and returns a new DAO object for table data access.
|
||||
func NewSysAttachmentDao() *SysAttachmentDao {
|
||||
func NewSysAttachmentDao(handlers ...gdb.ModelHandler) *SysAttachmentDao {
|
||||
return &SysAttachmentDao{
|
||||
group: "default",
|
||||
table: "hg_sys_attachment",
|
||||
columns: sysAttachmentColumns,
|
||||
group: "default",
|
||||
table: "hg_sys_attachment",
|
||||
columns: sysAttachmentColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SysAttachmentDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SysAttachmentDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SysAttachmentDao) Columns() SysAttachmentColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SysAttachmentDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SysAttachmentDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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 rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// 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 that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *SysAttachmentDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
|
||||
42
server/internal/dao/internal/sys_blacklist.go
Normal file → Executable file
42
server/internal/dao/internal/sys_blacklist.go
Normal file → Executable file
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SysBlacklistDao is the data access object for table hg_sys_blacklist.
|
||||
// SysBlacklistDao is the data access object for the table hg_sys_blacklist.
|
||||
type SysBlacklistDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns SysBlacklistColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 SysBlacklistColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// SysBlacklistColumns defines and stores column names for table hg_sys_blacklist.
|
||||
// SysBlacklistColumns defines and stores column names for the table hg_sys_blacklist.
|
||||
type SysBlacklistColumns struct {
|
||||
Id string // 黑名单ID
|
||||
Ip string // IP地址
|
||||
@@ -28,7 +29,7 @@ type SysBlacklistColumns struct {
|
||||
UpdatedAt string // 更新时间
|
||||
}
|
||||
|
||||
// sysBlacklistColumns holds the columns for table hg_sys_blacklist.
|
||||
// sysBlacklistColumns holds the columns for the table hg_sys_blacklist.
|
||||
var sysBlacklistColumns = SysBlacklistColumns{
|
||||
Id: "id",
|
||||
Ip: "ip",
|
||||
@@ -39,44 +40,49 @@ var sysBlacklistColumns = SysBlacklistColumns{
|
||||
}
|
||||
|
||||
// NewSysBlacklistDao creates and returns a new DAO object for table data access.
|
||||
func NewSysBlacklistDao() *SysBlacklistDao {
|
||||
func NewSysBlacklistDao(handlers ...gdb.ModelHandler) *SysBlacklistDao {
|
||||
return &SysBlacklistDao{
|
||||
group: "default",
|
||||
table: "hg_sys_blacklist",
|
||||
columns: sysBlacklistColumns,
|
||||
group: "default",
|
||||
table: "hg_sys_blacklist",
|
||||
columns: sysBlacklistColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SysBlacklistDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SysBlacklistDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SysBlacklistDao) Columns() SysBlacklistColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SysBlacklistDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SysBlacklistDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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 rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// 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 that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *SysBlacklistDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
|
||||
42
server/internal/dao/internal/sys_config.go
Normal file → Executable file
42
server/internal/dao/internal/sys_config.go
Normal file → Executable file
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SysConfigDao is the data access object for table hg_sys_config.
|
||||
// SysConfigDao is the data access object for the table hg_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 current DAO.
|
||||
columns SysConfigColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 table hg_sys_config.
|
||||
// SysConfigColumns defines and stores column names for the table hg_sys_config.
|
||||
type SysConfigColumns struct {
|
||||
Id string // 配置ID
|
||||
Group string // 配置分组
|
||||
@@ -35,7 +36,7 @@ type SysConfigColumns struct {
|
||||
UpdatedAt string // 更新时间
|
||||
}
|
||||
|
||||
// sysConfigColumns holds the columns for table hg_sys_config.
|
||||
// sysConfigColumns holds the columns for the table hg_sys_config.
|
||||
var sysConfigColumns = SysConfigColumns{
|
||||
Id: "id",
|
||||
Group: "group",
|
||||
@@ -53,44 +54,49 @@ var sysConfigColumns = SysConfigColumns{
|
||||
}
|
||||
|
||||
// NewSysConfigDao creates and returns a new DAO object for table data access.
|
||||
func NewSysConfigDao() *SysConfigDao {
|
||||
func NewSysConfigDao(handlers ...gdb.ModelHandler) *SysConfigDao {
|
||||
return &SysConfigDao{
|
||||
group: "default",
|
||||
table: "hg_sys_config",
|
||||
columns: sysConfigColumns,
|
||||
group: "default",
|
||||
table: "hg_sys_config",
|
||||
columns: sysConfigColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// 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 current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SysConfigDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SysConfigDao) Columns() SysConfigColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SysConfigDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// 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 {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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 rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// 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 that, you should not Commit or Rollback the transaction in function f
|
||||
// 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)
|
||||
|
||||
42
server/internal/dao/internal/sys_cron.go
Normal file → Executable file
42
server/internal/dao/internal/sys_cron.go
Normal file → Executable file
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SysCronDao is the data access object for table hg_sys_cron.
|
||||
// SysCronDao is the data access object for the table hg_sys_cron.
|
||||
type SysCronDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns SysCronColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 SysCronColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// SysCronColumns defines and stores column names for table hg_sys_cron.
|
||||
// SysCronColumns defines and stores column names for the table hg_sys_cron.
|
||||
type SysCronColumns struct {
|
||||
Id string // 任务ID
|
||||
GroupId string // 分组ID
|
||||
@@ -35,7 +36,7 @@ type SysCronColumns struct {
|
||||
UpdatedAt string // 更新时间
|
||||
}
|
||||
|
||||
// sysCronColumns holds the columns for table hg_sys_cron.
|
||||
// sysCronColumns holds the columns for the table hg_sys_cron.
|
||||
var sysCronColumns = SysCronColumns{
|
||||
Id: "id",
|
||||
GroupId: "group_id",
|
||||
@@ -53,44 +54,49 @@ var sysCronColumns = SysCronColumns{
|
||||
}
|
||||
|
||||
// NewSysCronDao creates and returns a new DAO object for table data access.
|
||||
func NewSysCronDao() *SysCronDao {
|
||||
func NewSysCronDao(handlers ...gdb.ModelHandler) *SysCronDao {
|
||||
return &SysCronDao{
|
||||
group: "default",
|
||||
table: "hg_sys_cron",
|
||||
columns: sysCronColumns,
|
||||
group: "default",
|
||||
table: "hg_sys_cron",
|
||||
columns: sysCronColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SysCronDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SysCronDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SysCronDao) Columns() SysCronColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SysCronDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SysCronDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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 rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// 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 that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *SysCronDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
|
||||
42
server/internal/dao/internal/sys_cron_group.go
Normal file → Executable file
42
server/internal/dao/internal/sys_cron_group.go
Normal file → Executable file
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SysCronGroupDao is the data access object for table hg_sys_cron_group.
|
||||
// SysCronGroupDao is the data access object for the table hg_sys_cron_group.
|
||||
type SysCronGroupDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of current DAO.
|
||||
columns SysCronGroupColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 SysCronGroupColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// SysCronGroupColumns defines and stores column names for table hg_sys_cron_group.
|
||||
// SysCronGroupColumns defines and stores column names for the table hg_sys_cron_group.
|
||||
type SysCronGroupColumns struct {
|
||||
Id string // 任务分组ID
|
||||
Pid string // 父类任务分组ID
|
||||
@@ -31,7 +32,7 @@ type SysCronGroupColumns struct {
|
||||
UpdatedAt string // 更新时间
|
||||
}
|
||||
|
||||
// sysCronGroupColumns holds the columns for table hg_sys_cron_group.
|
||||
// sysCronGroupColumns holds the columns for the table hg_sys_cron_group.
|
||||
var sysCronGroupColumns = SysCronGroupColumns{
|
||||
Id: "id",
|
||||
Pid: "pid",
|
||||
@@ -45,44 +46,49 @@ var sysCronGroupColumns = SysCronGroupColumns{
|
||||
}
|
||||
|
||||
// NewSysCronGroupDao creates and returns a new DAO object for table data access.
|
||||
func NewSysCronGroupDao() *SysCronGroupDao {
|
||||
func NewSysCronGroupDao(handlers ...gdb.ModelHandler) *SysCronGroupDao {
|
||||
return &SysCronGroupDao{
|
||||
group: "default",
|
||||
table: "hg_sys_cron_group",
|
||||
columns: sysCronGroupColumns,
|
||||
group: "default",
|
||||
table: "hg_sys_cron_group",
|
||||
columns: sysCronGroupColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *SysCronGroupDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SysCronGroupDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SysCronGroupDao) Columns() SysCronGroupColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SysCronGroupDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *SysCronGroupDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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 rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// 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 that, you should not Commit or Rollback the transaction in function f
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *SysCronGroupDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
|
||||
42
server/internal/dao/internal/sys_dict_data.go
Normal file → Executable file
42
server/internal/dao/internal/sys_dict_data.go
Normal file → Executable file
@@ -11,14 +11,15 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// SysDictDataDao is the data access object for table hg_sys_dict_data.
|
||||
// SysDictDataDao is the data access object for the table hg_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 current DAO.
|
||||
columns SysDictDataColumns // columns contains all the column names of Table for convenient usage.
|
||||
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 table hg_sys_dict_data.
|
||||
// SysDictDataColumns defines and stores column names for the table hg_sys_dict_data.
|
||||
type SysDictDataColumns struct {
|
||||
Id string // 字典数据ID
|
||||
Label string // 字典标签
|
||||
@@ -34,7 +35,7 @@ type SysDictDataColumns struct {
|
||||
UpdatedAt string // 更新时间
|
||||
}
|
||||
|
||||
// sysDictDataColumns holds the columns for table hg_sys_dict_data.
|
||||
// sysDictDataColumns holds the columns for the table hg_sys_dict_data.
|
||||
var sysDictDataColumns = SysDictDataColumns{
|
||||
Id: "id",
|
||||
Label: "label",
|
||||
@@ -51,44 +52,49 @@ var sysDictDataColumns = SysDictDataColumns{
|
||||
}
|
||||
|
||||
// NewSysDictDataDao creates and returns a new DAO object for table data access.
|
||||
func NewSysDictDataDao() *SysDictDataDao {
|
||||
func NewSysDictDataDao(handlers ...gdb.ModelHandler) *SysDictDataDao {
|
||||
return &SysDictDataDao{
|
||||
group: "default",
|
||||
table: "hg_sys_dict_data",
|
||||
columns: sysDictDataColumns,
|
||||
group: "default",
|
||||
table: "hg_sys_dict_data",
|
||||
columns: sysDictDataColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
||||
// 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 current dao.
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *SysDictDataDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of current dao.
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *SysDictDataDao) Columns() SysDictDataColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the configuration group name of database of current dao.
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *SysDictDataDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
||||
// 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 {
|
||||
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
|
||||
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 rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
||||
// 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 that, you should not Commit or Rollback the transaction in function f
|
||||
// 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)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user