mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-10-27 20:33:43 +08:00
Compare commits
131 Commits
v2.0-sqlit
...
v2.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7313d22cdb | ||
|
|
5ebc33f28b | ||
|
|
70076c90fd | ||
|
|
e8c94f1c98 | ||
|
|
5fa7b471f5 | ||
|
|
4b0f5066b7 | ||
|
|
36ddd091c8 | ||
|
|
f85d21a124 | ||
|
|
0f6f74214a | ||
|
|
334f9a7888 | ||
|
|
58213e83db | ||
|
|
f2454ce09b | ||
|
|
31f8102cc1 | ||
|
|
edb673ee34 | ||
|
|
776307e65b | ||
|
|
a98a25ea12 | ||
|
|
e3eb4bd728 | ||
|
|
1688aaf371 | ||
|
|
ae540c6bfe | ||
|
|
9f1c1ce031 | ||
|
|
dd5b2b660e | ||
|
|
207bba186e | ||
|
|
42d5500941 | ||
|
|
20a9e38fa8 | ||
|
|
35c6387b4b | ||
|
|
17daeb9121 | ||
|
|
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 |
18
README.md
18
README.md
@@ -1,24 +1,24 @@
|
|||||||
# HotGo-V2
|
# HotGo-V2
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<img width="140px" src="https://bufanyun.cn-bj.ufileos.com/hotgo/logo.sig.png">
|
<img width="140px" src="https://gmycos.facms.cn/hotgo/logo.sig.png">
|
||||||
<p>
|
<p>
|
||||||
<h1>HotGo V2</h1>
|
<h1>HotGo V2</h1>
|
||||||
</p>
|
</p>
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://goframe.org/pages/viewpage.action?pageId=1114119" target="_blank">
|
<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.4-green" alt="goframe">
|
||||||
</a>
|
</a>
|
||||||
<a href="https://v3.vuejs.org/" target="_blank">
|
<a href="https://v3.vuejs.org/" target="_blank">
|
||||||
<img src="https://img.shields.io/badge/vue.js-vue3.4-green" alt="vue">
|
<img src="https://img.shields.io/badge/vue.js-vue3.4-green" alt="vue">
|
||||||
</a>
|
</a>
|
||||||
<a href="https://www.naiveui.com" target="_blank">
|
<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.43.1-blue" alt="naiveui">
|
||||||
</a>
|
</a>
|
||||||
<a href="https://www.tslang.cn/" target="_blank">
|
<a href="https://www.tslang.cn/" target="_blank">
|
||||||
<img src="https://img.shields.io/badge/typescript-%3E4.0.0-blue" alt="typescript">
|
<img src="https://img.shields.io/badge/typescript-%3E4.0.0-blue" alt="typescript">
|
||||||
</a>
|
</a>
|
||||||
<a href="https://vitejs.dev/" target="_blank">
|
<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>
|
||||||
<a href="https://github.com/bufanyun/hotgo/blob/v2.0/LICENSE" target="_blank">
|
<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">
|
<img src="https://img.shields.io/badge/license-MIT-success" alt="license">
|
||||||
@@ -124,8 +124,8 @@
|
|||||||
|
|
||||||
|
|
||||||
## 交流QQ群
|
## 交流QQ群
|
||||||
交流群①:190966648 <a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=mJafkvme3VNyiQlCFIFNRtY8Xlr7pj9U&jump_from=webapi&authKey=jL10vIESr+vO8wpxwyd6DlChzkrbHpzN9uhAsIHgAinL/Vvd+nvuRyilf2UqUlCy"><img border="0" src="https://bufanyun.cn-bj.ufileos.com/hotgo/group.png" alt="HotGo框架交流1群" title="HotGo框架交流1群"></a>
|
交流群①:190966648 <a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=mJafkvme3VNyiQlCFIFNRtY8Xlr7pj9U&jump_from=webapi&authKey=jL10vIESr+vO8wpxwyd6DlChzkrbHpzN9uhAsIHgAinL/Vvd+nvuRyilf2UqUlCy"><img border="0" src="https://gmycos.facms.cn/hotgo/group.png" alt="HotGo框架交流1群" title="HotGo框架交流1群"></a>
|
||||||
> <img src="https://bufanyun.cn-bj.ufileos.com/hotgo/hotgo1qun.png" width="400px"/>
|
> <img src="https://gmycos.facms.cn/hotgo/hotgo1qun.png" width="400px"/>
|
||||||
|
|
||||||
|
|
||||||
## 商用说明
|
## 商用说明
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
|
|
||||||
* 本项目包含的第三方源码和二进制文件之版权信息另行标注。
|
* 本项目包含的第三方源码和二进制文件之版权信息另行标注。
|
||||||
|
|
||||||
* 版权所有Copyright © 2020-2024 by Ms (https://github.com/bufanyun/hotgo)
|
* 版权所有Copyright © 2020-2026 by Ms (https://github.com/bufanyun/hotgo)
|
||||||
|
|
||||||
* All rights reserved。
|
* All rights reserved。
|
||||||
|
|
||||||
@@ -154,11 +154,11 @@
|
|||||||
|
|
||||||
|
|
||||||
## [感谢JetBrains提供的免费GoLand](https://jb.gg/OpenSource)
|
## [感谢JetBrains提供的免费GoLand](https://jb.gg/OpenSource)
|
||||||
[](https://jb.gg/OpenSource)
|
[](https://jb.gg/OpenSource)
|
||||||
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
[MIT © HotGo-2024](./LICENSE)
|
[MIT © HotGo-2026](./LICENSE)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
- [WebSocket服务器](sys-websocket-server.md)
|
- [WebSocket服务器](sys-websocket-server.md)
|
||||||
- [TCP服务器](sys-tcp-server.md)
|
- [TCP服务器](sys-tcp-server.md)
|
||||||
- [SaaS多租户](sys-tenant.md)
|
- [SaaS多租户](sys-tenant.md)
|
||||||
|
- [国际化](sys-i18n.md)
|
||||||
- [单元测试](sys-test.md)
|
- [单元测试](sys-test.md)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
1、HotGo 后台进入 开发工具->插件管理->找到创建新插件,根据引导进行创建即可。
|
1、HotGo 后台进入 开发工具->插件管理->找到创建新插件,根据引导进行创建即可。
|
||||||
|
|
||||||
```
|
```shell
|
||||||
创建成功后默认情况下会在以下目录中生成插件文件,假设新生成的插件名为:hgexample
|
创建成功后默认情况下会在以下目录中生成插件文件,假设新生成的插件名为:hgexample
|
||||||
|
|
||||||
1. /server/addons/hgexample/ # 插件模块目录
|
1. /server/addons/hgexample/ # 插件模块目录
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
2、创建插件完毕重启服务端后,插件管理中会出现你新创建的插件信息。操作栏有几个按钮,在此进行说明
|
2、创建插件完毕重启服务端后,插件管理中会出现你新创建的插件信息。操作栏有几个按钮,在此进行说明
|
||||||
- 安装:会自动执行 server/hgexample/main.go 文件中的Install方法,方法中的具体逻辑默认为空,可以根据实际情况自行配置。如生成后台菜单、生成插件配置表初始化数据、迁移home页面、web项目文件等。
|
- 安装:会自动执行 server/hgexample/main.go 文件中的Install方法,方法中的具体逻辑默认为空,可以根据实际情况自行配置。如生成后台菜单、生成插件配置表初始化数据、迁移home页面、web项目文件等。
|
||||||
```
|
```go
|
||||||
// Install 安装模块
|
// Install 安装模块
|
||||||
func (m *module) Install(ctx context.Context) (err error) {
|
func (m *module) Install(ctx context.Context) (err error) {
|
||||||
// ...
|
// ...
|
||||||
@@ -38,7 +38,7 @@ func (m *module) Install(ctx context.Context) (err error) {
|
|||||||
```
|
```
|
||||||
|
|
||||||
- 更新:会自动执行 server/hgexample/main.go 文件中的Upgrade方法,方法中的具体逻辑默认为空,可以根据实际情况自行配置。
|
- 更新:会自动执行 server/hgexample/main.go 文件中的Upgrade方法,方法中的具体逻辑默认为空,可以根据实际情况自行配置。
|
||||||
```
|
```go
|
||||||
// Upgrade 更新模块
|
// Upgrade 更新模块
|
||||||
func (m *module) Upgrade(ctx context.Context) (err error) {
|
func (m *module) Upgrade(ctx context.Context) (err error) {
|
||||||
// ...
|
// ...
|
||||||
@@ -47,7 +47,7 @@ func (m *module) Upgrade(ctx context.Context) (err error) {
|
|||||||
```
|
```
|
||||||
|
|
||||||
- 卸载:会自动执行 server/hgexample/main.go 文件中的UnInstall方法,方法中的具体逻辑默认为空,可以根据实际情况自行配置。如会清除所有的数据表和已安装的信息等。
|
- 卸载:会自动执行 server/hgexample/main.go 文件中的UnInstall方法,方法中的具体逻辑默认为空,可以根据实际情况自行配置。如会清除所有的数据表和已安装的信息等。
|
||||||
```
|
```go
|
||||||
// UnInstall 卸载模块
|
// UnInstall 卸载模块
|
||||||
func (m *module) UnInstall(ctx context.Context) (err error) {
|
func (m *module) UnInstall(ctx context.Context) (err error) {
|
||||||
// ...
|
// ...
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#### 模块结构
|
#### 模块结构
|
||||||
- 文件路径:server/internal/library/addons/module.go
|
- 文件路径:server/internal/library/addons/module.go
|
||||||
|
|
||||||
```go
|
```go
|
||||||
// Skeleton 模块骨架
|
// Skeleton 模块骨架
|
||||||
type Skeleton struct {
|
type Skeleton struct {
|
||||||
@@ -43,6 +44,7 @@ type Module interface {
|
|||||||
#### 获取模块信息
|
#### 获取模块信息
|
||||||
|
|
||||||
- 在插件模块内
|
- 在插件模块内
|
||||||
|
|
||||||
```go
|
```go
|
||||||
package main
|
package main
|
||||||
|
|
||||||
@@ -57,6 +59,7 @@ func test() {
|
|||||||
```
|
```
|
||||||
|
|
||||||
- 在插件模块外
|
- 在插件模块外
|
||||||
|
|
||||||
```go
|
```go
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ gf run main.go
|
|||||||
|
|
||||||
# web端
|
# web端
|
||||||
cd web
|
cd web
|
||||||
yarn dev
|
pnpm run dev 或 npm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
以下是一个关联表的CURD生成流程
|
以下是一个关联表的CURD生成流程
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ gf run main.go
|
|||||||
|
|
||||||
# web端
|
# web端
|
||||||
cd web
|
cd web
|
||||||
yarn dev
|
pnpm run dev 或 npm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
以下是一个基本的CURD生成流程
|
以下是一个基本的CURD生成流程
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ gf run main.go
|
|||||||
|
|
||||||
# web端
|
# web端
|
||||||
cd web
|
cd web
|
||||||
yarn dev
|
pnpm run dev 或 npm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
以下是一个基本的树形CURD生成流程
|
以下是一个基本的树形CURD生成流程
|
||||||
|
|||||||
BIN
docs/guide-zh-CN/images/issue/1.4.0.png
Normal file
BIN
docs/guide-zh-CN/images/issue/1.4.0.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 163 KiB |
BIN
docs/guide-zh-CN/images/issue/1.4.1.png
Normal file
BIN
docs/guide-zh-CN/images/issue/1.4.1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 283 KiB |
BIN
docs/guide-zh-CN/images/issue/1.4.2.png
Normal file
BIN
docs/guide-zh-CN/images/issue/1.4.2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 255 KiB |
BIN
docs/guide-zh-CN/images/issue/1.4.3.png
Normal file
BIN
docs/guide-zh-CN/images/issue/1.4.3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 294 KiB |
@@ -41,8 +41,9 @@ cd server && make build
|
|||||||
cd server # 切换到服务端目录下
|
cd server # 切换到服务端目录下
|
||||||
rm -rf ./resource/public/admin/ # 删除之前的web资源
|
rm -rf ./resource/public/admin/ # 删除之前的web资源
|
||||||
mkdir ./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对应的资源存放路径下
|
\cp -rf ./dist/* ../server/resource/public/admin/ # 将编译好的web资源复制到server对应的资源存放路径下
|
||||||
|
cd ../server # 切换回服务端目录下
|
||||||
echo "y" | gf build # 编译hotgo服务端
|
echo "y" | gf build # 编译hotgo服务端
|
||||||
|
|
||||||
# 不出意外你已经编译好了hotgo可执行文件!
|
# 不出意外你已经编译好了hotgo可执行文件!
|
||||||
@@ -57,7 +58,7 @@ echo "y" | gf build # 编译hotgo服务端
|
|||||||
|
|
||||||
# 编译web端
|
# 编译web端
|
||||||
cd web
|
cd web
|
||||||
yarn build
|
pnpm run build 或 npm run build
|
||||||
|
|
||||||
# web端编译完成后,将web/dist/*中的文件上传到`server`端线上运行目录:/resource/public/admin即可
|
# web端编译完成后,将web/dist/*中的文件上传到`server`端线上运行目录:/resource/public/admin即可
|
||||||
# 至此,web端和server端都可以独立覆盖更新
|
# 至此,web端和server端都可以独立覆盖更新
|
||||||
@@ -77,7 +78,7 @@ yarn build
|
|||||||
### Nginx配置
|
### Nginx配置
|
||||||
```
|
```
|
||||||
# websocket
|
# websocket
|
||||||
location ^~ /socket {
|
location = /socket {
|
||||||
proxy_pass http://127.0.0.1:8000/socket;
|
proxy_pass http://127.0.0.1:8000/socket;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
@@ -97,7 +98,9 @@ yarn build
|
|||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
proxy_pass http://127.0.0.1:8000/; # 设置代理服务器的协议和地址
|
proxy_pass http://127.0.0.1:8000/;
|
||||||
|
proxy_redirect off;
|
||||||
|
proxy_buffering off;
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection upgrade;
|
proxy_set_header Connection upgrade;
|
||||||
|
|||||||
@@ -11,21 +11,21 @@
|
|||||||
1. 前往https://nodejs.org/zh-cn/下载当前版本node
|
1. 前往https://nodejs.org/zh-cn/下载当前版本node
|
||||||
2. 命令行运行 `node -v` 若控制台输出版本号则node安装成功
|
2. 命令行运行 `node -v` 若控制台输出版本号则node安装成功
|
||||||
3. node 版本需大于等于 `16.0`
|
3. node 版本需大于等于 `16.0`
|
||||||
4. 安装yarn:`npm install -g yarn`
|
4. 安装pnpm:`npm install -g pnpm`
|
||||||
5. 命令行运行 `yarn -v` 若控制台输出版本号则前端环境搭建成功
|
5. 命令行运行 `pnpm -v` 若控制台输出版本号则前端环境搭建成功
|
||||||
|
|
||||||
### 后端环境
|
### 后端环境
|
||||||
1. 下载golang安装 版本号需>=1.21
|
1. 下载golang安装 版本号需>=1.23
|
||||||
2. 国际: https://golang.org/dl/
|
2. 国际: https://golang.org/dl/
|
||||||
3. 国内: https://golang.google.cn/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/)
|
5. 开发工具推荐 [Goland](https://www.jetbrains.com/go/)
|
||||||
|
|
||||||
### 使用说明
|
### 使用说明
|
||||||
|
|
||||||
> 需要本地具有 git node golang 环境
|
> 需要本地具有 git node golang 环境
|
||||||
|
|
||||||
- node版本 >= 16.0.0
|
- node版本 >= 20.0.0
|
||||||
- golang版本 >= 1.21
|
- golang版本 >= 1.23
|
||||||
- mysql版本 >= 5.7,引擎需要是 innoDB
|
- mysql版本 >= 5.7,引擎需要是 innoDB
|
||||||
- IDE推荐:Goland
|
- IDE推荐:Goland
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
|
|
||||||
### 环境要求
|
### 环境要求
|
||||||
|
|
||||||
- node版本 >= v16.0.0
|
- node版本 >= v20.0.0
|
||||||
- golang版本 >= v1.21
|
- golang版本 >= v1.23
|
||||||
- goframe版本 >=v2.7.0
|
- goframe版本 >=v2.7.0
|
||||||
- mysql版本 >=5.7
|
- mysql版本 >=5.7
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ gfcli:
|
|||||||
三、 启动服务
|
三、 启动服务
|
||||||
|
|
||||||
1、服务端:
|
1、服务端:
|
||||||
```shell script
|
```shell
|
||||||
cd server
|
cd server
|
||||||
|
|
||||||
# 设置国内代理,如果已经设置好了代理可以跳过
|
# 设置国内代理,如果已经设置好了代理可以跳过
|
||||||
@@ -86,15 +86,15 @@ gfcli:
|
|||||||
```
|
```
|
||||||
|
|
||||||
2、web前端:
|
2、web前端:
|
||||||
```shell script
|
```shell
|
||||||
cd web
|
cd web
|
||||||
# 首先确定你以安装node16.0以上版本并安装了包[npm、yarn],否则可能会出现一些未知报错
|
# 首先确定你以安装node16.0以上版本并安装了包[npm、pnpm],否则可能会出现一些未知报错
|
||||||
|
|
||||||
# 安装依赖
|
# 安装依赖
|
||||||
yarn install
|
pnpm install
|
||||||
|
|
||||||
# 启动web项目
|
# 启动web项目
|
||||||
yarn dev
|
pnpm run dev
|
||||||
|
|
||||||
# 如果顺利,至此到浏览器打开:http://你的IP:8001/admin
|
# 如果顺利,至此到浏览器打开:http://你的IP:8001/admin
|
||||||
# 登录账号:admin, 密码:123456
|
# 登录账号:admin, 密码:123456
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#### 1、安装数据库出现 json 报错不支持
|
#### 1、安装数据库出现 json 报错不支持
|
||||||
|
|
||||||
请安装 mysql5.7 及以上版本的数据库
|
请安装 mysql5.7 及以上版本的数据库。如果你使用的是mariadb请确认版本号,mariadb从 10.2 版本开始支持 json 数据类型。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -50,7 +50,31 @@
|
|||||||
|
|
||||||
系统运行目录下配置hack/config.yaml文件。如果是生产环境运行,并且不需要开发工具相关功能,可以将`manifest/config/config.yaml`配置文件中的`system.mode`值改为`product`,这样启动时不会加载开发工具相关功能
|
系统运行目录下配置hack/config.yaml文件。如果是生产环境运行,并且不需要开发工具相关功能,可以将`manifest/config/config.yaml`配置文件中的`system.mode`值改为`product`,这样启动时不会加载开发工具相关功能
|
||||||
|
|
||||||
|
#### 4、非超管角色提示:你没有访问权限!
|
||||||
|

|
||||||
|
|
||||||
|
此问题因当前角色访问的页面包含未分配权限的接口所致,在多角色场景中较为常见,解决步骤如下:
|
||||||
|
|
||||||
|
1. 定位缺失权限的接口
|
||||||
|
- 用超管账号进入系统应用 -> 日志管理 -> 全局日志,搜索状态码为`62 无访问权限`的记录
|
||||||
|
- 示例:若请求接口为`/admin/hgexample/treeTable/list`,需处理的权限路径为`/hgexample/treeTable/list`(去除`/admin`前缀)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
假如查到请求接口是:`/admin/hgexample/treeTable/list`,那需要分配的菜单权限就是:`/hgexample/treeTable/list`,要把`/admin`去掉
|
||||||
|
|
||||||
|
2. 配置菜单权限
|
||||||
|
- 进入权限管理 -> 菜单权限:
|
||||||
|
- 若目标菜单不存在,先新增菜单
|
||||||
|
- 若菜单已存在但未配置接口权限,就把步骤1中的权限路径添加到【分配权限】中(已配置则跳过)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
3. 分配权限给角色
|
||||||
|
- 进入权限管理 -> 角色权限,找到对应角色并点击【菜单权限】
|
||||||
|
- 勾选步骤2中配置的菜单权限,保存即可
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
### 四、前端相关
|
### 四、前端相关
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,67 @@
|
|||||||
|
|
||||||
> 如果升级(覆盖)代码后打开会出现 sql 报错, 请检查更新的数据库格式或自行调整
|
> 如果升级(覆盖)代码后打开会出现 sql 报错, 请检查更新的数据库格式或自行调整
|
||||||
|
|
||||||
|
|
||||||
|
### v2.18.6
|
||||||
|
updated 2025.10.25
|
||||||
|
|
||||||
|
- 新增:国际化(i18n)支持,内置简体中文、繁体中文、英文三种语言包
|
||||||
|
- 新增:附件管理支持外链图片转存至系统存储驱动
|
||||||
|
- 优化:全局微信公众号实例初始化逻辑,`AccessToken` 获取方式调整为稳定版接口
|
||||||
|
- 优化:菜单权限搜索功能,支持按菜单名称或路由地址进行检索
|
||||||
|
- 优化:角色权限管理中的菜单权限分配交互体验
|
||||||
|
- 优化:naive-ui版本升级到2.43.1
|
||||||
|
- 优化:gf版本升级到v2.9.4
|
||||||
|
- 修复:删除角色导致关联用户无法登录的问题,新增角色删除前置校验(检查是否存在关联用户)
|
||||||
|
|
||||||
|
|
||||||
|
### v2.17.8
|
||||||
|
updated 2025.7.13
|
||||||
|
|
||||||
|
- 优化:表格排序处理器兼容关联表别名
|
||||||
|
- 优化:优化动态统计数字在0值时显示问题
|
||||||
|
- 优化:优化首页快捷菜单点击事件范围
|
||||||
|
- 优化:优化短信、邮件验证码相关验证类数据排序
|
||||||
|
- 优化:优化Nginx配置,支持流式请求和兼容部分版本无法匹配到websocket规则问题
|
||||||
|
- 优化:naive-ui版本升级到2.42.0
|
||||||
|
- 优化:vue3-json-viewer版本升级到2.4.1
|
||||||
|
- 修复:修复可选用户选项`Fields`生成错误问题
|
||||||
|
|
||||||
|
|
||||||
|
### 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
|
### v2.15.1
|
||||||
updated 2024.4.22
|
updated 2024.4.22
|
||||||
|
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ gfcli:
|
|||||||
### 生成CRUD表格
|
### 生成CRUD表格
|
||||||
|
|
||||||
- 推荐使用热编译方式启动HotGo,这样生成完成页面自动刷新即可看到新生成内容,无需手动重启
|
- 推荐使用热编译方式启动HotGo,这样生成完成页面自动刷新即可看到新生成内容,无需手动重启
|
||||||
- 服务端热编译启动:`gf run main.go`, web前端启动:`yarn dev`
|
- 服务端热编译启动:`gf run main.go`, web前端启动:`pnpm run dev` 或 `npm run dev`
|
||||||
|
|
||||||
1、创建数据表
|
1、创建数据表
|
||||||
|
|
||||||
@@ -176,7 +176,7 @@ CREATE TABLE `hg_test_category` (
|
|||||||
|
|
||||||
1.3 插入测试数据
|
1.3 插入测试数据
|
||||||
```mysql
|
```mysql
|
||||||
INSERT INTO `hg_test_table` (`id`, `category_id`, `title`, `description`, `content`, `image`, `attachfile`, `city_id`, `switch`, `sort`, `status`, `created_by`, `updated_by`, `created_at`, `updated_at`, `deleted_at`) VALUES (1, 1, '测试标题', '描述', '<h2><strong>不知道写点啥!</strong></h2><p><br></p><iframe class=\"ql-video\" frameborder=\"0\" allowfullscreen=\"true\" src=\"https://media.w3.org/2010/05/sintel/trailer.mp4\"></iframe><p><br></p><p><img src=\"http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2023-02-09/cqdq9iuv0phsg8patk.png\"></p>', 'https://bufanyun.cn-bj.ufileos.com/hotgo/logo.sig.png', 'http://bufanyun.cn-bj.ufileos.com/hotgo/attachment/2022-12-30/cpf1x44idoycrtajf2.xlsx', 110102, 1, 10, 1, 0, 1, '2022-12-15 19:30:14', '2023-02-23 13:55:32', NULL);
|
INSERT INTO `hg_test_table` (`id`, `category_id`, `title`, `description`, `content`, `image`, `attachfile`, `city_id`, `switch`, `sort`, `status`, `created_by`, `updated_by`, `created_at`, `updated_at`, `deleted_at`) VALUES (1, 1, '测试标题', '描述', '<h2><strong>不知道写点啥!</strong></h2><p><br></p><iframe class=\"ql-video\" frameborder=\"0\" allowfullscreen=\"true\" src=\"https://media.w3.org/2010/05/sintel/trailer.mp4\"></iframe><p><br></p><p><img src=\"https://gmycos.facms.cn/hotgo/attachment/2023-02-09/cqdq9iuv0phsg8patk.png\"></p>', 'https://gmycos.facms.cn/hotgo/logo.sig.png', 'https://gmycos.facms.cn/hotgo/attachment/2022-12-30/cpf1x44idoycrtajf2.xlsx', 110102, 1, 10, 1, 0, 1, '2022-12-15 19:30:14', '2023-02-23 13:55:32', NULL);
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -117,6 +117,7 @@
|
|||||||

|

|
||||||
|
|
||||||
- 查询代码片段,参考路径:[server/internal/logic/admin/member.go](../../server/internal/logic/admin/member.go)
|
- 查询代码片段,参考路径:[server/internal/logic/admin/member.go](../../server/internal/logic/admin/member.go)
|
||||||
|
|
||||||
```go
|
```go
|
||||||
|
|
||||||
// 查询创建者
|
// 查询创建者
|
||||||
|
|||||||
@@ -63,16 +63,17 @@
|
|||||||
#### import
|
#### import
|
||||||
* 单行import不建议用圆括号包裹
|
* 单行import不建议用圆括号包裹
|
||||||
* 按照`官方包`,NEW LINE,`当前工程包`,NEW LINE,`第三方依赖包`顺序引入
|
* 按照`官方包`,NEW LINE,`当前工程包`,NEW LINE,`第三方依赖包`顺序引入
|
||||||
```go
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"string"
|
|
||||||
|
|
||||||
"greet/user/internal/config"
|
```go
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"string"
|
||||||
|
|
||||||
"google.golang.org/grpc"
|
"greet/user/internal/config"
|
||||||
)
|
|
||||||
```
|
"google.golang.org/grpc"
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
#### 函数返回
|
#### 函数返回
|
||||||
* 对象避免非指针返回
|
* 对象避免非指针返回
|
||||||
@@ -84,7 +85,8 @@
|
|||||||
|
|
||||||
#### 函数体编码
|
#### 函数体编码
|
||||||
* 建议一个block结束空一行,如if、for等
|
* 建议一个block结束空一行,如if、for等
|
||||||
```go
|
|
||||||
|
```go
|
||||||
func main (){
|
func main (){
|
||||||
if x==1{
|
if x==1{
|
||||||
// do something
|
// do something
|
||||||
@@ -92,15 +94,16 @@
|
|||||||
|
|
||||||
fmt.println("xxx")
|
fmt.println("xxx")
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
* return前尽可能空一行
|
* return前尽可能空一行
|
||||||
```go
|
|
||||||
func getUser(id string)(string,error){
|
|
||||||
....
|
|
||||||
|
|
||||||
return "xx",nil
|
```go
|
||||||
}
|
func getUser(id string)(string,error){
|
||||||
```
|
....
|
||||||
|
|
||||||
|
return "xx",nil
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### 框架规范
|
### 框架规范
|
||||||
|
|
||||||
|
|||||||
73
docs/guide-zh-CN/sys-i18n.md
Normal file
73
docs/guide-zh-CN/sys-i18n.md
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
## 国际化
|
||||||
|
|
||||||
|
|
||||||
|
目录
|
||||||
|
|
||||||
|
- 介绍
|
||||||
|
- 配置文件
|
||||||
|
- 服务端使用
|
||||||
|
- Web端使用
|
||||||
|
- 更多文档
|
||||||
|
|
||||||
|
### 介绍
|
||||||
|
|
||||||
|
从`v2.18.6`版本开始,HotGo 提供了完善的国际化(i18n)支持,内置简体中文、繁体中文和英文三种语言包,默认语言为简体中文。目前已对后台管理首页进行了多语言适配,开发者可基于该机制扩展实现业务模块的多语言功能。
|
||||||
|
|
||||||
|
### 配置文件
|
||||||
|
|
||||||
|
国际化配置位于 `server/manifest/config/config.yaml` 文件中:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# hotgo系统配置
|
||||||
|
system:
|
||||||
|
# ...
|
||||||
|
# 国际化
|
||||||
|
i18n:
|
||||||
|
switch: true # 国际化功能开关,可选值:false|true,默认:true
|
||||||
|
defaultLanguage: "zh-CN" # 默认语言,可选值:zh-CN|zh-TW|en,默认:zh-CN
|
||||||
|
```
|
||||||
|
|
||||||
|
### 服务端使用
|
||||||
|
|
||||||
|
多语言配置文件存放目录:`server/manifest/i18n`,您可以在该目录下添加自定义的语言映射文件。
|
||||||
|
|
||||||
|
**使用示例:**
|
||||||
|
|
||||||
|
```go
|
||||||
|
// 设置当前上下文的语言为英文
|
||||||
|
ctx := gctx.New()
|
||||||
|
gi18n.WithLanguage(ctx, "en")
|
||||||
|
|
||||||
|
// 基础翻译
|
||||||
|
gi18n.T(ctx, "你好,美丽世界")
|
||||||
|
// 输出:Hello, Beautiful World
|
||||||
|
|
||||||
|
// 格式化翻译(支持参数替换)
|
||||||
|
gi18n.Tf(ctx, "剩余%v余额", 100)
|
||||||
|
// 输出:Remaining 100 Balance
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### Web端使用
|
||||||
|
|
||||||
|
多语言配置文件存放目录:`web/src/locale`,您可以在该目录下添加自定义的语言映射文件。
|
||||||
|
|
||||||
|
> 提示:启用国际化功能后,后台管理界面右上角将显示语言切换选项。
|
||||||
|
|
||||||
|
**使用示例(假设当前语言为英文):**
|
||||||
|
|
||||||
|
```vue
|
||||||
|
<!-- 基础翻译 -->
|
||||||
|
<div>{{ t('你好,美丽世界') }}</div>
|
||||||
|
<!-- 输出:Hello, Beautiful World -->
|
||||||
|
|
||||||
|
<!-- 格式化翻译(支持参数替换) -->
|
||||||
|
<div>{{ t('剩余{num}余额', {num:100}) }}</div>
|
||||||
|
<!-- 输出:Remaining 100 Balance -->
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### 更多文档
|
||||||
|
|
||||||
|
- [gi18n](https://goframe.org/docs/core/gi18n)
|
||||||
|
- [vie-i18n](https://vue-i18n.intlify.dev)
|
||||||
@@ -158,6 +158,7 @@ func test(ctx context.Context) {
|
|||||||
|
|
||||||
#### 字典数据选项
|
#### 字典数据选项
|
||||||
- 文件路径:server/internal/model/dict.go
|
- 文件路径:server/internal/model/dict.go
|
||||||
|
|
||||||
```go
|
```go
|
||||||
package model
|
package model
|
||||||
|
|
||||||
@@ -232,6 +233,7 @@ var CreditGroupOptions = []*model.Option{
|
|||||||
|
|
||||||
##### 方法字典接口
|
##### 方法字典接口
|
||||||
- 文件路径:server/internal/consts/credit_log.go
|
- 文件路径:server/internal/consts/credit_log.go
|
||||||
|
|
||||||
```go
|
```go
|
||||||
package dict
|
package dict
|
||||||
|
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ func main() {
|
|||||||
- 下面我们以`text/xml`为例简单演示几种使用方法:
|
- 下面我们以`text/xml`为例简单演示几种使用方法:
|
||||||
|
|
||||||
1. 当你使用规范化路由时,可直接在XxxRes结构体的`g.Meta`中声明响应类型:
|
1. 当你使用规范化路由时,可直接在XxxRes结构体的`g.Meta`中声明响应类型:
|
||||||
|
|
||||||
```go
|
```go
|
||||||
type HelloReq struct {
|
type HelloReq struct {
|
||||||
g.Meta `path:"/hello" tags:"Hello" method:"get" summary:"You first hello api"`
|
g.Meta `path:"/hello" tags:"Hello" method:"get" summary:"You first hello api"`
|
||||||
@@ -95,6 +96,7 @@ type HelloRes struct {
|
|||||||
```
|
```
|
||||||
|
|
||||||
2. 在响应前设置响应头:
|
2. 在响应前设置响应头:
|
||||||
|
|
||||||
```go
|
```go
|
||||||
var (
|
var (
|
||||||
Hello = cHello{}
|
Hello = cHello{}
|
||||||
@@ -146,9 +148,7 @@ func main() {
|
|||||||
|
|
||||||
2. 在`server/internal/logic/middleware/response.go`中根据请求的独有特征进行单独的处理,兼容后续http处理。
|
2. 在`server/internal/logic/middleware/response.go`中根据请求的独有特征进行单独的处理,兼容后续http处理。
|
||||||
|
|
||||||
|
|
||||||
#### 重写响应错误提示
|
#### 重写响应错误提示
|
||||||
|
|
||||||
- 在实际开发中,我们可能想要隐藏一些敏感错误,返回给客户端友好的错误提示,但开发者同时又想需要看到真实的敏感错误。对此hotgo已经进行了过滤处理,下面是一个简单的例子:
|
- 在实际开发中,我们可能想要隐藏一些敏感错误,返回给客户端友好的错误提示,但开发者同时又想需要看到真实的敏感错误。对此hotgo已经进行了过滤处理,下面是一个简单的例子:
|
||||||
|
|
||||||
```go
|
```go
|
||||||
@@ -195,6 +195,7 @@ func test() error {
|
|||||||
```
|
```
|
||||||
|
|
||||||
- 控制台的输出日志:
|
- 控制台的输出日志:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
2023-05-15 18:05:07.776 {084022730d495f17f19e550140f3e1a8} 200 "GET http localhost:8000 /admin/member/list?page=1&pageSize=10&roleId=-1 HTTP/1.1" 0.002, 127.0.0.1, "http://192.168.0.207:8001/login", "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36 Co
|
2023-05-15 18:05:07.776 {084022730d495f17f19e550140f3e1a8} 200 "GET http localhost:8000 /admin/member/list?page=1&pageSize=10&roleId=-1 HTTP/1.1" 0.002, 127.0.0.1, "http://192.168.0.207:8001/login", "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36 Co
|
||||||
re/1.94.197.400 QQBrowser/11.7.5287.400", -1, "", ""
|
re/1.94.197.400 QQBrowser/11.7.5287.400", -1, "", ""
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ SaaS系统多租户多应用设计,已成为互联网企业的重要发展建
|
|||||||
|
|
||||||
- 在用户登录成功后,server端可通过上下文来获取用户部门类型来确定用户身份
|
- 在用户登录成功后,server端可通过上下文来获取用户部门类型来确定用户身份
|
||||||
- 文件路径:server/internal/library/contexts/context.go
|
- 文件路径:server/internal/library/contexts/context.go
|
||||||
|
|
||||||
```go
|
```go
|
||||||
package contexts
|
package contexts
|
||||||
|
|
||||||
@@ -87,6 +88,7 @@ func IsUserDept(ctx context.Context) bool {
|
|||||||
|
|
||||||
- 在用户登录成功后,web端可通`useUserStore`来获取用户部门类型来确定用户身份
|
- 在用户登录成功后,web端可通`useUserStore`来获取用户部门类型来确定用户身份
|
||||||
- 文件路径:web/src/store/modules/user.ts
|
- 文件路径:web/src/store/modules/user.ts
|
||||||
|
|
||||||
```vue
|
```vue
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useUserStore } from '@/store/modules/user';
|
import { useUserStore } from '@/store/modules/user';
|
||||||
@@ -125,6 +127,7 @@ HotGo定位是中小型应用开发,推荐采用一套数据库不同Schema。
|
|||||||
下面是多租户功能演示例子代码中的使用片段
|
下面是多租户功能演示例子代码中的使用片段
|
||||||
|
|
||||||
- 封装查询Model
|
- 封装查询Model
|
||||||
|
|
||||||
```go
|
```go
|
||||||
// Model 多租户功能演示ORM模型
|
// Model 多租户功能演示ORM模型
|
||||||
func (s *sSysTenantOrder) Model(ctx context.Context, option ...*handler.Option) *gdb.Model {
|
func (s *sSysTenantOrder) Model(ctx context.Context, option ...*handler.Option) *gdb.Model {
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
### 全局消息监听
|
### 全局消息监听
|
||||||
- 所有全局的消息监听都在这里
|
- 所有全局的消息监听都在这里
|
||||||
- 文件路径:web/src/utils/websocket/registerMessage.ts
|
- 文件路径:web/src/utils/websocket/registerMessage.ts
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import { TABS_ROUTES } from '@/store/mutation-types';
|
import { TABS_ROUTES } from '@/store/mutation-types';
|
||||||
import { SocketEnum } from '@/enums/socketEnum';
|
import { SocketEnum } from '@/enums/socketEnum';
|
||||||
@@ -51,6 +52,7 @@ export function registerGlobalMessage() {
|
|||||||
#### 单页面消息监听
|
#### 单页面消息监听
|
||||||
- 当你只需要某个页面使用WebSocket,这将是一个不错的选择,下面是一个简单的演示例子
|
- 当你只需要某个页面使用WebSocket,这将是一个不错的选择,下面是一个简单的演示例子
|
||||||
- 文件路径:web/src/views/addons/hgexample/portal/websocketTest.vue
|
- 文件路径:web/src/views/addons/hgexample/portal/websocketTest.vue
|
||||||
|
|
||||||
```vue
|
```vue
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
@@ -190,6 +192,7 @@ export function registerGlobalMessage() {
|
|||||||
|
|
||||||
#### 发送消息
|
#### 发送消息
|
||||||
- 向服务器发送一条消息
|
- 向服务器发送一条消息
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import { sendMsg } from '@/utils/websocket';
|
import { sendMsg } from '@/utils/websocket';
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
#### 1.消息处理接口
|
#### 1.消息处理接口
|
||||||
- 消息处理在设计上采用了接口化的思路。只需要实现以下接口,即可进行WebSocket消息注册
|
- 消息处理在设计上采用了接口化的思路。只需要实现以下接口,即可进行WebSocket消息注册
|
||||||
- 文件路径:server/internal/websocket/model.go
|
- 文件路径:server/internal/websocket/model.go
|
||||||
|
|
||||||
```go
|
```go
|
||||||
package websocket
|
package websocket
|
||||||
|
|
||||||
@@ -26,6 +27,7 @@ type EventHandler func(client *Client, req *WRequest)
|
|||||||
#### 2.定义消息处理方法
|
#### 2.定义消息处理方法
|
||||||
- 以下是功能案例中的一个简单演示,实现了消息处理接口,并将收到的消息原样发送给客户端
|
- 以下是功能案例中的一个简单演示,实现了消息处理接口,并将收到的消息原样发送给客户端
|
||||||
- 文件路径:server/addons/hgexample/controller/websocket/handler/index.go
|
- 文件路径:server/addons/hgexample/controller/websocket/handler/index.go
|
||||||
|
|
||||||
```go
|
```go
|
||||||
package handler
|
package handler
|
||||||
|
|
||||||
@@ -52,6 +54,7 @@ func (c *cIndex) TestMessage(client *websocket.Client, req *websocket.WRequest)
|
|||||||
#### 3.注册消息
|
#### 3.注册消息
|
||||||
- 定义消息处理方法后,需要将其注册到WebSocket消息处理器,一般放在对应应用模块的`router/websocket.go`下即可
|
- 定义消息处理方法后,需要将其注册到WebSocket消息处理器,一般放在对应应用模块的`router/websocket.go`下即可
|
||||||
- 文件路径:server/addons/hgexample/router/websocket.go
|
- 文件路径:server/addons/hgexample/router/websocket.go
|
||||||
|
|
||||||
```go
|
```go
|
||||||
package router
|
package router
|
||||||
|
|
||||||
@@ -80,6 +83,7 @@ func WebSocket(ctx context.Context, group *ghttp.RouterGroup) {
|
|||||||
|
|
||||||
### 常用方法
|
### 常用方法
|
||||||
- websocket服务器还提供了一些常用的方法,下面只对部分进行说明
|
- websocket服务器还提供了一些常用的方法,下面只对部分进行说明
|
||||||
|
|
||||||
```go
|
```go
|
||||||
func test() {
|
func test() {
|
||||||
websocket.SendToAll() // 发送全部客户端
|
websocket.SendToAll() // 发送全部客户端
|
||||||
@@ -105,6 +109,7 @@ func test() {
|
|||||||
### 其他
|
### 其他
|
||||||
- WebSocket被连接时需验证用户认证中间件,所以用户必须登录成功后才能连接成功
|
- WebSocket被连接时需验证用户认证中间件,所以用户必须登录成功后才能连接成功
|
||||||
- 参考文件:server/internal/logic/middleware/weboscket_auth.go
|
- 参考文件:server/internal/logic/middleware/weboscket_auth.go
|
||||||
|
|
||||||
```go
|
```go
|
||||||
package middleware
|
package middleware
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
项目开发完成之后,执行以下命令进行构建
|
项目开发完成之后,执行以下命令进行构建
|
||||||
```shell
|
```shell
|
||||||
yarn build
|
pnpm run build 或 npm run build
|
||||||
```
|
```
|
||||||
构建打包成功之后,会在根目录生成 dist 文件夹,里面就是构建打包好的文件
|
构建打包成功之后,会在根目录生成 dist 文件夹,里面就是构建打包好的文件
|
||||||
|
|
||||||
@@ -40,15 +40,15 @@ VITE_LEGACY = true
|
|||||||
使用项目自定的命令进行预览(推荐)
|
使用项目自定的命令进行预览(推荐)
|
||||||
```shell
|
```shell
|
||||||
# 先打包在进行预览
|
# 先打包在进行预览
|
||||||
yarn preview
|
pnpm run preview 或 npm run preview
|
||||||
# 直接预览本地 dist 文件目录
|
# 直接预览本地 dist 文件目录
|
||||||
yarn preview:dist
|
pnpm run preview:dist 或 npm run preview:dist
|
||||||
```
|
```
|
||||||
|
|
||||||
- 本地服务器预览(通过 live-server)
|
- 本地服务器预览(通过 live-server)
|
||||||
```shell
|
```shell
|
||||||
# 1.全局安装live-server
|
# 1.全局安装live-server
|
||||||
yarn global add live-server
|
npm -g install live-server
|
||||||
# 2. 进入打包的后目录
|
# 2. 进入打包的后目录
|
||||||
cd ./dist
|
cd ./dist
|
||||||
# 本地预览,默认端口8080
|
# 本地预览,默认端口8080
|
||||||
@@ -60,7 +60,7 @@ live-server --port 9000
|
|||||||
### 分析构建文件体积
|
### 分析构建文件体积
|
||||||
如果你的构建文件很大,可以通过项目内置 [rollup-plugin-analyzer](https://github.com/doesdev/rollup-plugin-analyzer) 插件进行代码体积分析,从而优化你的代码。
|
如果你的构建文件很大,可以通过项目内置 [rollup-plugin-analyzer](https://github.com/doesdev/rollup-plugin-analyzer) 插件进行代码体积分析,从而优化你的代码。
|
||||||
```shell
|
```shell
|
||||||
yarn report
|
pnpm run report 或 npm run report
|
||||||
```
|
```
|
||||||
运行之后,在自动打开的页面可以看到具体的体积分布,以分析哪些依赖有问题。
|
运行之后,在自动打开的页面可以看到具体的体积分布,以分析哪些依赖有问题。
|
||||||
|
|
||||||
|
|||||||
187
index.html
Normal file
187
index.html
Normal file
@@ -0,0 +1,187 @@
|
|||||||
|
<!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 //docsify.js.org/#/themes) -->
|
||||||
|
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css">
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="app"></div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Docsify Configuration (see //docsify.js.org/#/configuration)
|
||||||
|
window.$docsify = {
|
||||||
|
name: "HotGo-V2",
|
||||||
|
nameLink: {
|
||||||
|
'/': '/hotgo/',
|
||||||
|
},
|
||||||
|
relativePath: true,
|
||||||
|
// alias: {
|
||||||
|
// "/.*/_navbar.md": "/_navbar.md",
|
||||||
|
// },
|
||||||
|
// themeColor: "#42b983",
|
||||||
|
// logo: "//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="//cdn.jsdelivr.net/npm/docsify@4/lib/docsify.min.js"></script>
|
||||||
|
|
||||||
|
<!-- Recommended -->
|
||||||
|
<script src="//cdn.jsdelivr.net/npm/docsify@4/lib/plugins/zoom-image.min.js"></script>
|
||||||
|
<script src="//cdn.jsdelivr.net/npm/docsify@4/lib/plugins/search.js"></script>
|
||||||
|
<script src="//cdn.jsdelivr.net/npm/docsify-copy-code/dist/docsify-copy-code.min.js"></script>
|
||||||
|
<script src="//cdn.jsdelivr.net/npm/docsify-pagination/dist/docsify-pagination.min.js"></script>
|
||||||
|
<script src="//cdn.jsdelivr.net/npm/docsify-hide-code/dist/docsify-hide-code.min.js"></script>
|
||||||
|
<script src="//cdn.jsdelivr.net/npm/docsify-progress@latest/dist/progress.min.js"></script>
|
||||||
|
<script src="//cdn.jsdelivr.net/npm/docsify-example-panels"></script>
|
||||||
|
|
||||||
|
<!-- Prism code highlight -->
|
||||||
|
<script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-bash.min.js"></script>
|
||||||
|
<script src="//cdn.jsdelivr.net/npm/prismjs@1/components/prism-matlab.min.js"></script>
|
||||||
|
<script src="//cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-go.min.js"></script>
|
||||||
|
<script src="//cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-yaml.min.js"></script>
|
||||||
|
<script src="//cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-vue.min.js"></script>
|
||||||
|
<script src="//cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-json.min.js"></script>
|
||||||
|
<script src="//cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-sql.min.js"></script>
|
||||||
|
|
||||||
|
<!--mermaid插件-->
|
||||||
|
<script type="module">
|
||||||
|
import mermaid from "https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs";
|
||||||
|
mermaid.initialize({ startOnLoad: true });
|
||||||
|
window.mermaid = mermaid;
|
||||||
|
</script>
|
||||||
|
<script src="//unpkg.com/docsify-mermaid@2.0.1/dist/docsify-mermaid.js"></script>
|
||||||
|
|
||||||
|
<!-- docsify-dark-switcher -->
|
||||||
|
<script src="//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="//cdn.jsdelivr.net/npm/docsify-plugin-flexible-alerts/dist/docsify-plugin-flexible-alerts.min.js"></script>
|
||||||
|
<script src="//cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/js/all.min.js"></script>
|
||||||
|
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/fontawesome.min.css">
|
||||||
|
|
||||||
|
<!-- docsify-versioned-plugin -->
|
||||||
|
<!-- <script src="//cdn.jsdelivr.net/npm/docsify-versioned-plugin@0.0.1/index.js"></script>
|
||||||
|
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify-versioned-plugin@0.0.1/styles.css"> -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -13,14 +13,15 @@ run:
|
|||||||
# Include test files or not.
|
# Include test files or not.
|
||||||
# Default: true
|
# Default: true
|
||||||
tests: false
|
tests: false
|
||||||
|
go: "1.20"
|
||||||
|
|
||||||
# Which dirs to skip: issues from them won't be reported.
|
# Which dirs to skip: issues from them won't be reported.
|
||||||
# Can use regexp here: `generated.*`, regexp is applied on full path.
|
# Can use regexp here: `generated.*`, regexp is applied on full path.
|
||||||
# Default value is empty list,
|
# Default value is empty list,
|
||||||
# but default dirs are skipped independently of this option's value (see skip-dirs-use-default).
|
# 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.
|
# "/" will be replaced by current OS file path separator to properly work on Windows.
|
||||||
skip-dirs:
|
# skip-dirs:
|
||||||
- internal/library/hggen/internal
|
# - internal/library/hggen/internal
|
||||||
|
|
||||||
# Which files to skip: they will be analyzed, but issues from them won't be reported.
|
# Which files to skip: they will be analyzed, but issues from them won't be reported.
|
||||||
# Default value is empty list,
|
# Default value is empty list,
|
||||||
@@ -28,7 +29,7 @@ run:
|
|||||||
# we confidently recognize autogenerated files.
|
# we confidently recognize autogenerated files.
|
||||||
# If it's not please let us know.
|
# If it's not please let us know.
|
||||||
# "/" will be replaced by current OS file path separator to properly work on Windows.
|
# "/" will be replaced by current OS file path separator to properly work on Windows.
|
||||||
skip-files: []
|
# skip-files: []
|
||||||
|
|
||||||
|
|
||||||
# Main linters configurations.
|
# Main linters configurations.
|
||||||
@@ -71,6 +72,9 @@ issues:
|
|||||||
- linters:
|
- linters:
|
||||||
- gocritic
|
- gocritic
|
||||||
text: "unnecessaryDefer:"
|
text: "unnecessaryDefer:"
|
||||||
|
exclude-dirs:
|
||||||
|
- internal/library/hggen/internal
|
||||||
|
exclude-files: []
|
||||||
|
|
||||||
|
|
||||||
# https://golangci-lint.run/usage/linters
|
# https://golangci-lint.run/usage/linters
|
||||||
@@ -176,7 +180,7 @@ linters-settings:
|
|||||||
# Select the Go version to target.
|
# Select the Go version to target.
|
||||||
# Default: 1.13
|
# Default: 1.13
|
||||||
# Deprecated: use the global `run.go` instead.
|
# Deprecated: use the global `run.go` instead.
|
||||||
go: "1.15"
|
# go: "1.15"
|
||||||
# Sxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
|
# Sxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
|
||||||
# Default: ["*"]
|
# Default: ["*"]
|
||||||
checks: [
|
checks: [
|
||||||
@@ -187,7 +191,7 @@ linters-settings:
|
|||||||
govet:
|
govet:
|
||||||
# Report about shadowed variables.
|
# Report about shadowed variables.
|
||||||
# Default: false
|
# Default: false
|
||||||
check-shadowing: true
|
# check-shadowing: true
|
||||||
# Settings per analyzer.
|
# Settings per analyzer.
|
||||||
settings:
|
settings:
|
||||||
# Analyzer name, run `go tool vet help` to see all analyzers.
|
# Analyzer name, run `go tool vet help` to see all analyzers.
|
||||||
@@ -263,7 +267,7 @@ linters-settings:
|
|||||||
# Select the Go version to target.
|
# Select the Go version to target.
|
||||||
# Default: "1.13"
|
# Default: "1.13"
|
||||||
# Deprecated: use the global `run.go` instead.
|
# Deprecated: use the global `run.go` instead.
|
||||||
go: "1.15"
|
# go: "1.15"
|
||||||
# SAxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
|
# SAxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
|
||||||
# Default: ["*"]
|
# Default: ["*"]
|
||||||
checks: [ "all","-SA1019","-SA4015","-SA1029","-SA1016","-SA9003","-SA4006","-SA6003" ]
|
checks: [ "all","-SA1019","-SA4015","-SA1029","-SA1016","-SA9003","-SA4006","-SA6003" ]
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ ADMIN_RESOURCE_PATH = "/resource/public/admin/"
|
|||||||
build:
|
build:
|
||||||
@rm -rf ./$(ADMIN_RESOURCE_PATH)
|
@rm -rf ./$(ADMIN_RESOURCE_PATH)
|
||||||
@mkdir ./$(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
|
@echo "y" | gf build
|
||||||
|
|
||||||
# 通过热编译启动所有服务
|
# 通过热编译启动所有服务
|
||||||
@@ -36,7 +37,7 @@ auth:
|
|||||||
# 启动web服务
|
# 启动web服务
|
||||||
.PHONY: web
|
.PHONY: web
|
||||||
web:
|
web:
|
||||||
@cd ../web && yarn dev
|
@cd ../web && pnpm run dev
|
||||||
|
|
||||||
# 刷新casbin权限
|
# 刷新casbin权限
|
||||||
.PHONY: refresh
|
.PHONY: refresh
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ func (s *sSysTable) Edit(ctx context.Context, in *sysin.TableEditInp) (err error
|
|||||||
|
|
||||||
// 新增
|
// 新增
|
||||||
in.CreatedBy = contexts.GetUserId(ctx)
|
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, "新增表格失败,请稍后重试!")
|
err = gerror.Wrap(err, "新增表格失败,请稍后重试!")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,7 +133,6 @@ func (s *sSysTenantOrder) Export(ctx context.Context, in *sysin.TenantOrderListI
|
|||||||
// Edit 修改/新增多租户功能演示
|
// Edit 修改/新增多租户功能演示
|
||||||
func (s *sSysTenantOrder) Edit(ctx context.Context, in *sysin.TenantOrderEditInp) (err error) {
|
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) {
|
return g.DB().Transaction(ctx, func(ctx context.Context, tx gdb.TX) (err error) {
|
||||||
|
|
||||||
// 修改
|
// 修改
|
||||||
if in.Id > 0 {
|
if in.Id > 0 {
|
||||||
if _, err = s.Model(ctx).
|
if _, err = s.Model(ctx).
|
||||||
@@ -158,7 +157,6 @@ func (s *sSysTenantOrder) Edit(ctx context.Context, in *sysin.TenantOrderEditInp
|
|||||||
|
|
||||||
// Delete 删除多租户功能演示
|
// Delete 删除多租户功能演示
|
||||||
func (s *sSysTenantOrder) Delete(ctx context.Context, in *sysin.TenantOrderDeleteInp) (err error) {
|
func (s *sSysTenantOrder) Delete(ctx context.Context, in *sysin.TenantOrderDeleteInp) (err error) {
|
||||||
|
|
||||||
if _, err = s.Model(ctx).WherePri(in.Id).Delete(); err != nil {
|
if _, err = s.Model(ctx).WherePri(in.Id).Delete(); err != nil {
|
||||||
err = gerror.Wrap(err, "删除多租户功能演示失败,请稍后重试!")
|
err = gerror.Wrap(err, "删除多租户功能演示失败,请稍后重试!")
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ func (s *sSysTreeTable) Edit(ctx context.Context, in *sysin.TableEditInp) (err e
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
in.CreatedBy = contexts.GetUserId(ctx)
|
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, "新增表格失败,请稍后重试!")
|
err = gerror.Wrap(err, "新增表格失败,请稍后重试!")
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,21 +47,3 @@ type ClearKindReq struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ClearKindRes 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"`
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -77,6 +77,9 @@ type SiteLoginConfigReq struct {
|
|||||||
|
|
||||||
type SiteLoginConfigRes struct {
|
type SiteLoginConfigRes struct {
|
||||||
*model.LoginConfig
|
*model.LoginConfig
|
||||||
|
I18nSwitch bool `json:"i18nSwitch" dc:"国际化开关"`
|
||||||
|
DefaultLanguage string `json:"defaultLanguage" dc:"默认语言设置"`
|
||||||
|
ProjectName string `json:"projectName" dc:"项目名称"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// SitePingReq ping
|
// SitePingReq ping
|
||||||
|
|||||||
@@ -36,3 +36,13 @@ type UploadPartReq struct {
|
|||||||
type UploadPartRes struct {
|
type UploadPartRes struct {
|
||||||
*sysin.UploadPartModel
|
*sysin.UploadPartModel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ImageTransferStorageReq 图片链接转存
|
||||||
|
type ImageTransferStorageReq struct {
|
||||||
|
g.Meta `path:"/upload/imageTransferStorage" tags:"附件" method:"post" summary:"图片链接转存"`
|
||||||
|
sysin.ImageTransferStorageInp
|
||||||
|
}
|
||||||
|
|
||||||
|
type ImageTransferStorageRes struct {
|
||||||
|
*sysin.ImageTransferStorageModel
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// @Copyright Copyright (c) 2024 HotGo CLI
|
// @Copyright Copyright (c) 2024 HotGo CLI
|
||||||
// @Author Ms <133814250@qq.com>
|
// @Author Ms <133814250@qq.com>
|
||||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||||
// @AutoGenerate Version 2.13.1
|
// @AutoGenerate Version 2.15.7
|
||||||
package curddemo
|
package curddemo
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@@ -68,6 +68,14 @@ type MaxSortRes struct {
|
|||||||
*sysin.CurdDemoMaxSortModel
|
*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列表开关状态
|
// SwitchReq 更新CURD列表开关状态
|
||||||
type SwitchReq struct {
|
type SwitchReq struct {
|
||||||
g.Meta `path:"/curdDemo/switch" method:"post" tags:"CURD列表" summary:"更新CURD列表状态"`
|
g.Meta `path:"/curdDemo/switch" method:"post" tags:"CURD列表" summary:"更新CURD列表状态"`
|
||||||
|
|||||||
@@ -30,16 +30,6 @@ type ExportReq struct {
|
|||||||
|
|
||||||
type ExportRes 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 删除登录日志
|
// DeleteReq 删除登录日志
|
||||||
type DeleteReq struct {
|
type DeleteReq struct {
|
||||||
g.Meta `path:"/loginLog/delete" method:"post" tags:"登录日志" summary:"删除登录日志"`
|
g.Meta `path:"/loginLog/delete" method:"post" tags:"登录日志" summary:"删除登录日志"`
|
||||||
|
|||||||
@@ -87,8 +87,7 @@ type NetOptionReq struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type NetOptionRes struct {
|
type NetOptionRes struct {
|
||||||
LicenseGroup form.Selects `json:"licenseGroup" dc:"授权分组"`
|
Routes []*RouteSelect `json:"routes" dc:"路由选项"`
|
||||||
Routes []*RouteSelect `json:"routes" dc:"路由选项"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type RouteSelect struct {
|
type RouteSelect struct {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// @Copyright Copyright (c) 2024 HotGo CLI
|
// @Copyright Copyright (c) 2024 HotGo CLI
|
||||||
// @Author Ms <133814250@qq.com>
|
// @Author Ms <133814250@qq.com>
|
||||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||||
// @AutoGenerate Version 2.13.1
|
// @AutoGenerate Version 2.15.7
|
||||||
package normaltreedemo
|
package normaltreedemo
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
// Package optiontreedemo
|
// Package optiontreedemo
|
||||||
// @Link https://github.com/bufanyun/hotgo
|
// @Link https://github.com/bufanyun/hotgo
|
||||||
// @Copyright Copyright (c) 2024 HotGo CLI
|
// @Copyright Copyright (c) 2025 HotGo CLI
|
||||||
// @Author Ms <133814250@qq.com>
|
// @Author Ms <133814250@qq.com>
|
||||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||||
// @AutoGenerate Version 2.13.1
|
// @AutoGenerate Version 2.17.8
|
||||||
package optiontreedemo
|
package optiontreedemo
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// @Copyright Copyright (c) 2024 HotGo CLI
|
// @Copyright Copyright (c) 2024 HotGo CLI
|
||||||
// @Author Ms <133814250@qq.com>
|
// @Author Ms <133814250@qq.com>
|
||||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||||
// @AutoGenerate Version 2.13.1
|
// @AutoGenerate Version 2.15.7
|
||||||
package testcategory
|
package testcategory
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
// Package member
|
// =================================================================================
|
||||||
// @Link https://github.com/bufanyun/hotgo
|
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
// =================================================================================
|
||||||
// @Author Ms <133814250@qq.com>
|
|
||||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
|
||||||
package member
|
package member
|
||||||
|
|
||||||
import "github.com/gogf/gf/v2/frame/g"
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
// GetIdByCodeReq 通过邀请码获取用户ID
|
"hotgo/api/api/member/v1"
|
||||||
type GetIdByCodeReq struct {
|
)
|
||||||
g.Meta `path:"/member/getIdByCode" method:"post" tags:"用户" summary:"通过邀请码获取用户ID"`
|
|
||||||
Code string `json:"code" dc:"邀请码"`
|
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
|
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||||
// @Author Ms <133814250@qq.com>
|
// @Author Ms <133814250@qq.com>
|
||||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||||
package pay
|
package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/gogf/gf/v2/frame/g"
|
|
||||||
"hotgo/internal/model/input/payin"
|
"hotgo/internal/model/input/payin"
|
||||||
|
|
||||||
|
"github.com/gogf/gf/v2/frame/g"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NotifyAliPayReq 支付宝回调
|
// NotifyAliPayReq 支付宝回调
|
||||||
186
server/go.mod
186
server/go.mod
@@ -1,141 +1,159 @@
|
|||||||
module hotgo
|
module hotgo
|
||||||
|
|
||||||
go 1.21
|
go 1.24.4
|
||||||
|
|
||||||
toolchain go1.22.1
|
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/Shopify/sarama v1.34.1
|
github.com/IBM/sarama v1.45.2
|
||||||
github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.2
|
github.com/alibabacloud-go/darabonba-openapi/v2 v2.1.7
|
||||||
github.com/alibabacloud-go/dysmsapi-20170525/v3 v3.0.5
|
github.com/alibabacloud-go/dysmsapi-20170525/v3 v3.0.6
|
||||||
github.com/alibabacloud-go/tea v1.1.20
|
github.com/alibabacloud-go/tea v1.3.9
|
||||||
github.com/alibabacloud-go/tea-utils/v2 v2.0.1
|
github.com/alibabacloud-go/tea-utils/v2 v2.0.7
|
||||||
github.com/aliyun/aliyun-oss-go-sdk v2.2.6+incompatible
|
github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible
|
||||||
github.com/apache/rocketmq-client-go/v2 v2.1.2
|
github.com/apache/rocketmq-client-go/v2 v2.1.2
|
||||||
github.com/casbin/casbin/v2 v2.55.0
|
github.com/casbin/casbin/v2 v2.108.0
|
||||||
github.com/forgoer/openssl v1.4.0
|
github.com/forgoer/openssl v1.6.1
|
||||||
github.com/go-pay/gopay v1.5.91
|
github.com/go-pay/crypto v0.0.1
|
||||||
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.7.0
|
github.com/go-pay/gopay v1.5.114
|
||||||
github.com/gogf/gf/contrib/nosql/redis/v2 v2.7.0
|
github.com/go-pay/smap v0.0.2
|
||||||
github.com/gogf/gf/contrib/trace/jaeger/v2 v2.7.0
|
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.9.4
|
||||||
github.com/gogf/gf/v2 v2.7.0
|
github.com/gogf/gf/contrib/nosql/redis/v2 v2.9.4
|
||||||
|
github.com/gogf/gf/contrib/trace/jaeger/v2 v2.7.4
|
||||||
|
github.com/gogf/gf/v2 v2.9.4
|
||||||
github.com/gogf/selfupdate v0.0.0-20231215043001-5c48c528462f
|
github.com/gogf/selfupdate v0.0.0-20231215043001-5c48c528462f
|
||||||
github.com/golang-jwt/jwt/v5 v5.0.0
|
github.com/golang-jwt/jwt/v5 v5.2.2
|
||||||
github.com/gorilla/websocket v1.5.1
|
github.com/gorilla/websocket v1.5.3
|
||||||
github.com/kayon/iploc v0.0.0-20200312105652-bda3e968a794
|
github.com/kayon/iploc v0.0.0-20200312105652-bda3e968a794
|
||||||
github.com/minio/minio-go/v7 v7.0.63
|
github.com/minio/minio-go/v7 v7.0.94
|
||||||
github.com/mojocn/base64Captcha v1.3.6
|
github.com/mojocn/base64Captcha v1.3.8
|
||||||
github.com/olekukonko/tablewriter v0.0.5
|
github.com/olekukonko/tablewriter v1.1.0
|
||||||
github.com/qiniu/go-sdk/v7 v7.14.0
|
github.com/qiniu/go-sdk/v7 v7.25.4
|
||||||
github.com/shirou/gopsutil/v3 v3.23.3
|
github.com/schollz/progressbar/v3 v3.18.0
|
||||||
github.com/silenceper/wechat/v2 v2.1.4
|
github.com/shirou/gopsutil/v3 v3.24.5
|
||||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.633
|
github.com/silenceper/wechat/v2 v2.1.9
|
||||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sms v1.0.633
|
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1202
|
||||||
github.com/tencentyun/cos-go-sdk-v5 v0.7.45
|
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sms v1.0.1200
|
||||||
github.com/ufilesdk-dev/ufile-gosdk v1.0.3
|
github.com/tencentyun/cos-go-sdk-v5 v0.7.66
|
||||||
github.com/xuri/excelize/v2 v2.6.0
|
github.com/ufilesdk-dev/ufile-gosdk v1.0.6
|
||||||
go.opentelemetry.io/otel v1.25.0
|
github.com/xuri/excelize/v2 v2.9.1
|
||||||
golang.org/x/mod v0.9.0
|
go.opentelemetry.io/otel v1.38.0
|
||||||
golang.org/x/net v0.24.0
|
golang.org/x/mod v0.26.0
|
||||||
golang.org/x/tools v0.7.0
|
golang.org/x/net v0.43.0
|
||||||
|
golang.org/x/tools v0.35.0
|
||||||
gopkg.in/yaml.v3 v3.0.1
|
gopkg.in/yaml.v3 v3.0.1
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
aead.dev/minisign v0.2.0 // indirect
|
aead.dev/minisign v0.2.0 // indirect
|
||||||
filippo.io/edwards25519 v1.1.0 // indirect
|
github.com/BurntSushi/toml v1.5.0 // indirect
|
||||||
github.com/BurntSushi/toml v1.3.2 // indirect
|
github.com/alex-ant/gomath v0.0.0-20160516115720-89013a210a82 // indirect
|
||||||
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible // indirect
|
github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.5 // indirect
|
||||||
github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4 // indirect
|
github.com/alibabacloud-go/debug v1.0.1 // indirect
|
||||||
github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68 // indirect
|
|
||||||
github.com/alibabacloud-go/endpoint-util v1.1.0 // 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/openapi-util v0.1.0 // indirect
|
||||||
github.com/alibabacloud-go/tea-utils v1.3.1 // 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.4.5 // indirect
|
||||||
github.com/aliyun/credentials-go v1.1.2 // indirect
|
github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect
|
||||||
github.com/bradfitz/gomemcache v0.0.0-20220106215444-fb4bf637b56d // 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/cespare/xxhash/v2 v2.3.0 // indirect
|
||||||
github.com/clbanning/mxj v1.8.4 // indirect
|
github.com/clbanning/mxj v1.8.4 // indirect
|
||||||
github.com/clbanning/mxj/v2 v2.7.0 // indirect
|
github.com/clbanning/mxj/v2 v2.7.0 // indirect
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
||||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||||
github.com/eapache/go-resiliency v1.2.0 // indirect
|
github.com/eapache/go-resiliency v1.7.0 // indirect
|
||||||
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect
|
github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect
|
||||||
github.com/eapache/queue v1.1.0 // indirect
|
github.com/eapache/queue v1.1.0 // indirect
|
||||||
github.com/emirpasic/gods v1.12.0 // indirect
|
github.com/emirpasic/gods v1.18.1 // indirect
|
||||||
github.com/fatih/color v1.16.0 // indirect
|
github.com/fatih/color v1.18.0 // indirect
|
||||||
github.com/fatih/structs v1.1.0 // indirect
|
github.com/fatih/structs v1.1.0 // indirect
|
||||||
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
github.com/fsnotify/fsnotify v1.9.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-logr/stdr v1.2.2 // indirect
|
||||||
github.com/go-ole/go-ole v1.2.6 // indirect
|
github.com/go-ole/go-ole v1.2.6 // indirect
|
||||||
|
github.com/go-pay/errgroup v0.0.3 // 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-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/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/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/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/grokify/html-strip-tags-go v0.1.0 // indirect
|
||||||
github.com/hashicorp/errwrap v1.0.0 // indirect
|
github.com/hashicorp/errwrap v1.0.0 // indirect
|
||||||
github.com/hashicorp/go-multierror v1.1.1 // 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/aescts/v2 v2.0.0 // indirect
|
||||||
github.com/jcmturner/dnsutils/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/gofork v1.7.6 // indirect
|
||||||
github.com/jcmturner/gokrb5/v8 v8.4.2 // indirect
|
github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect
|
||||||
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
|
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
|
||||||
github.com/json-iterator/go v1.1.12 // indirect
|
github.com/json-iterator/go v1.1.12 // indirect
|
||||||
github.com/klauspost/compress v1.17.2 // indirect
|
github.com/klauspost/compress v1.18.0 // indirect
|
||||||
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
|
github.com/klauspost/cpuid/v2 v2.2.10 // indirect
|
||||||
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // 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.10 // indirect
|
||||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
github.com/mattn/go-colorable v0.1.14 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.20 // 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/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/mitchellh/mapstructure v1.4.3 // indirect
|
||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||||
github.com/modern-go/reflect2 v1.0.2 // 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/mozillazg/go-httpheader v0.2.1 // indirect
|
||||||
|
github.com/olekukonko/errors v1.1.0 // indirect
|
||||||
|
github.com/olekukonko/ll v0.0.9 // indirect
|
||||||
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
|
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
|
||||||
github.com/pierrec/lz4/v4 v4.1.18 // indirect
|
github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect
|
||||||
github.com/pkg/errors v0.9.1 // 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/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
|
||||||
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // 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.12.1 // indirect
|
||||||
github.com/richardlehane/mscfb v1.0.4 // 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/rivo/uniseg v0.4.7 // indirect
|
||||||
github.com/rs/xid v1.5.0 // indirect
|
github.com/rs/xid v1.6.0 // indirect
|
||||||
github.com/shoenig/go-m1cpu v0.1.4 // indirect
|
github.com/shoenig/go-m1cpu v0.1.6 // indirect
|
||||||
github.com/sirupsen/logrus v1.9.3 // indirect
|
github.com/sirupsen/logrus v1.9.0 // indirect
|
||||||
github.com/spf13/cast v1.4.1 // indirect
|
github.com/spf13/cast v1.4.1 // indirect
|
||||||
github.com/tidwall/gjson v1.14.1 // indirect
|
github.com/tidwall/gjson v1.14.1 // indirect
|
||||||
github.com/tidwall/match v1.1.1 // indirect
|
github.com/tidwall/match v1.1.1 // indirect
|
||||||
github.com/tidwall/pretty v1.2.0 // indirect
|
github.com/tidwall/pretty v1.2.0 // indirect
|
||||||
github.com/tjfoc/gmsm v1.3.2 // indirect
|
github.com/tiendc/go-deepcopy v1.6.0 // indirect
|
||||||
github.com/tklauser/go-sysconf v0.3.11 // indirect
|
github.com/tinylib/msgp v1.3.0 // indirect
|
||||||
github.com/tklauser/numcpus v0.6.0 // indirect
|
github.com/tjfoc/gmsm v1.4.1 // indirect
|
||||||
github.com/xuri/efp v0.0.0-20220407160117-ad0f7a785be8 // indirect
|
github.com/tklauser/go-sysconf v0.3.12 // indirect
|
||||||
github.com/xuri/nfp v0.0.0-20220409054826-5e722a1d9e22 // indirect
|
github.com/tklauser/numcpus v0.6.1 // indirect
|
||||||
github.com/yusufpapurcu/wmi v1.2.2 // indirect
|
github.com/xuri/efp v0.0.1 // indirect
|
||||||
go.opentelemetry.io/otel/exporters/jaeger v1.17.0 // indirect
|
github.com/xuri/nfp v0.0.1 // indirect
|
||||||
go.opentelemetry.io/otel/metric v1.25.0 // indirect
|
github.com/yusufpapurcu/wmi v1.2.4 // indirect
|
||||||
go.opentelemetry.io/otel/sdk v1.25.0 // indirect
|
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
|
||||||
go.opentelemetry.io/otel/trace v1.25.0 // indirect
|
go.opentelemetry.io/otel/exporters/jaeger v1.14.0 // indirect
|
||||||
go.uber.org/atomic v1.7.0 // indirect
|
go.opentelemetry.io/otel/metric v1.38.0 // indirect
|
||||||
golang.org/x/crypto v0.22.0 // indirect
|
go.opentelemetry.io/otel/sdk v1.38.0 // indirect
|
||||||
golang.org/x/image v0.13.0 // indirect
|
go.opentelemetry.io/otel/trace v1.38.0 // indirect
|
||||||
golang.org/x/sync v0.1.0 // indirect
|
go.uber.org/atomic v1.5.1 // indirect
|
||||||
golang.org/x/sys v0.19.0 // indirect
|
golang.org/x/crypto v0.41.0 // indirect
|
||||||
golang.org/x/text v0.14.0 // indirect
|
golang.org/x/image v0.25.0 // indirect
|
||||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
|
golang.org/x/lint v0.0.0-20190930215403-16217165b5de // indirect
|
||||||
|
golang.org/x/sync v0.16.0 // indirect
|
||||||
|
golang.org/x/sys v0.35.0 // indirect
|
||||||
|
golang.org/x/term v0.34.0 // indirect
|
||||||
|
golang.org/x/text v0.28.0 // indirect
|
||||||
|
golang.org/x/time v0.12.0 // indirect
|
||||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||||
gopkg.in/natefinch/lumberjack.v2 v2.0.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
|
stathat.com/c/consistent v1.0.0 // indirect
|
||||||
)
|
)
|
||||||
|
|||||||
813
server/go.sum
813
server/go.sum
File diff suppressed because it is too large
Load Diff
@@ -39,3 +39,9 @@ gfcli:
|
|||||||
# dstFolder: "internal/service"
|
# dstFolder: "internal/service"
|
||||||
# dstFileNameCase: "CamelLower"
|
# 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 // 数字计算
|
||||||
|
)
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// Package consts
|
// Package consts
|
||||||
// @Link https://github.com/bufanyun/hotgo
|
// @Link https://github.com/bufanyun/hotgo
|
||||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
// @Copyright Copyright (c) 2025 HotGo CLI
|
||||||
// @Author Ms <133814250@qq.com>
|
// @Author Ms <133814250@qq.com>
|
||||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||||
package consts
|
package consts
|
||||||
@@ -9,11 +9,12 @@ package consts
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
DemoTips = "演示系统已隐藏" // 演示系统敏感数据打码
|
DemoTips = "演示系统已隐藏" // 演示系统敏感数据打码
|
||||||
NilJsonToString = "{}" // 空json初始化值
|
NilJsonToString = "{}" // 空json初始化值
|
||||||
RegionSpilt = " / " // 地区分隔符
|
RegionSpilt = " / " // 地区分隔符
|
||||||
Unknown = "Unknown" // Unknown
|
Unknown = "Unknown" // Unknown
|
||||||
SuperRoleKey = "super" // 超管角色唯一标识符,通过角色验证超管
|
SuperRoleKey = "super" // 超管角色唯一标识符,通过角色验证超管
|
||||||
MaxServeLogContentLen = 2048 // 最大保留服务日志内容大小
|
MaxServeLogContentLen = 2048 // 最大保留服务日志内容大小
|
||||||
|
SysDefaultLanguage = "zh_CN" // 系统默认语言,当配置文件没有国际化配置时生效
|
||||||
)
|
)
|
||||||
|
|
||||||
// curd.
|
// curd.
|
||||||
|
|||||||
@@ -18,12 +18,6 @@ const (
|
|||||||
EmsTemplateCash = "cash" // 申请提现
|
EmsTemplateCash = "cash" // 申请提现
|
||||||
)
|
)
|
||||||
|
|
||||||
// 验证码状态
|
|
||||||
const (
|
|
||||||
EmsStatusNotUsed = 1 // 未使用
|
|
||||||
EmsStatusUsed = 2 // 已使用
|
|
||||||
)
|
|
||||||
|
|
||||||
var EmsSubjectMap = g.MapStrStr{
|
var EmsSubjectMap = g.MapStrStr{
|
||||||
EmsTemplateText: "这是一封来自HotGo的邮件",
|
EmsTemplateText: "这是一封来自HotGo的邮件",
|
||||||
EmsTemplateCode: "验证码",
|
EmsTemplateCode: "验证码",
|
||||||
|
|||||||
@@ -5,9 +5,57 @@
|
|||||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||||
package consts
|
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 (
|
const (
|
||||||
HTTPContentTypeXml = "text/xml"
|
HTTPContentTypeXml = "text/xml"
|
||||||
HTTPContentTypeHtml = "text/html"
|
HTTPContentTypeHtml = "text/html"
|
||||||
HTTPContentTypeStream = "text/event-stream"
|
HTTPContentTypeStream = "text/event-stream"
|
||||||
HTTPContentTypeJson = "application/json"
|
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(), "失败")),
|
||||||
|
dict.GenWarningOption(gcode.CodeSecurityReason.Code(), fmt.Sprintf("%v %v", gcode.CodeSecurityReason.Code(), "无访问权限")),
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,6 +5,15 @@
|
|||||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||||
package consts
|
package consts
|
||||||
|
|
||||||
|
import (
|
||||||
|
"hotgo/internal/library/dict"
|
||||||
|
"hotgo/internal/model"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
dict.RegisterEnums("ServerLicenseGroupOptions", "服务授权分组选项", ServerLicenseGroupOptions)
|
||||||
|
}
|
||||||
|
|
||||||
// 授权分组
|
// 授权分组
|
||||||
const (
|
const (
|
||||||
LicenseGroupDefault = "default" // 默认组
|
LicenseGroupDefault = "default" // 默认组
|
||||||
@@ -12,8 +21,9 @@ const (
|
|||||||
LicenseGroupAuth = "auth" // 服务授权
|
LicenseGroupAuth = "auth" // 服务授权
|
||||||
)
|
)
|
||||||
|
|
||||||
var LicenseGroupNameMap = map[string]string{
|
// ServerLicenseGroupOptions 服务授权分组选项
|
||||||
LicenseGroupDefault: "默认组",
|
var ServerLicenseGroupOptions = []*model.Option{
|
||||||
LicenseGroupCron: "定时任务",
|
dict.GenWarningOption(LicenseGroupDefault, "默认组"),
|
||||||
LicenseGroupAuth: "服务授权",
|
dict.GenSuccessOption(LicenseGroupCron, "定时任务"),
|
||||||
|
dict.GenSuccessOption(LicenseGroupAuth, "服务授权"),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
package consts
|
package consts
|
||||||
|
|
||||||
// 短信驱动
|
// 短信驱动
|
||||||
|
|
||||||
const (
|
const (
|
||||||
SmsDriveAliYun = "aliyun" // 阿里云
|
SmsDriveAliYun = "aliyun" // 阿里云
|
||||||
SmsDriveTencent = "tencent" // 腾讯云
|
SmsDriveTencent = "tencent" // 腾讯云
|
||||||
@@ -32,9 +31,3 @@ var (
|
|||||||
SmsTemplateCash: "申请提现",
|
SmsTemplateCash: "申请提现",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
// 验证码状态
|
|
||||||
const (
|
|
||||||
SmsStatusNotUsed = 1 // 未使用
|
|
||||||
SmsStatusUsed = 2 // 已使用
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -5,6 +5,16 @@
|
|||||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||||
package consts
|
package consts
|
||||||
|
|
||||||
|
import (
|
||||||
|
"hotgo/internal/library/dict"
|
||||||
|
"hotgo/internal/model"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
dict.RegisterEnums("CodeStatusOptions", "验证码状态选项", CodeStatusOptions)
|
||||||
|
dict.RegisterEnums("BlacklistStatusOptions", "黑名单拉黑状态选项", BlacklistStatusOptions)
|
||||||
|
}
|
||||||
|
|
||||||
// 状态码
|
// 状态码
|
||||||
const (
|
const (
|
||||||
StatusALL int = -1 // 全部状态
|
StatusALL int = -1 // 全部状态
|
||||||
@@ -14,3 +24,26 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var StatusSlice = []int{StatusALL, StatusEnabled, StatusDisable, StatusDelete}
|
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, "已解封"),
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
// Package consts
|
// Package consts
|
||||||
// @Link https://github.com/bufanyun/hotgo
|
// @Link https://github.com/bufanyun/hotgo
|
||||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
// @Copyright Copyright (c) 2025 HotGo CLI
|
||||||
// @Author Ms <133814250@qq.com>
|
// @Author Ms <133814250@qq.com>
|
||||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||||
package consts
|
package consts
|
||||||
|
|
||||||
// VersionApp HotGo版本
|
// VersionApp HotGo版本
|
||||||
const (
|
const (
|
||||||
VersionApp = "2.15.1"
|
VersionApp = "2.18.6"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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) {
|
func (c *cMonitor) NetOption(ctx context.Context, req *monitor.NetOptionReq) (res *monitor.NetOptionRes, err error) {
|
||||||
res = new(monitor.NetOptionRes)
|
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() {
|
for _, v := range service.TCPServer().Instance().GetRoutes() {
|
||||||
// 无需勾选的路由
|
// 无需勾选的路由
|
||||||
disabled := false
|
disabled := false
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ package common
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/gogf/gf/v2/errors/gerror"
|
"github.com/gogf/gf/v2/errors/gerror"
|
||||||
"github.com/gogf/gf/v2/frame/g"
|
|
||||||
"hotgo/api/admin/common"
|
"hotgo/api/admin/common"
|
||||||
"hotgo/internal/consts"
|
"hotgo/internal/consts"
|
||||||
|
"hotgo/internal/dao"
|
||||||
"hotgo/internal/library/contexts"
|
"hotgo/internal/library/contexts"
|
||||||
"hotgo/internal/model/entity"
|
"hotgo/internal/model/entity"
|
||||||
"hotgo/internal/model/input/sysin"
|
"hotgo/internal/model/input/sysin"
|
||||||
@@ -53,7 +53,7 @@ func (c *cEms) SendBindEms(ctx context.Context, _ *common.SendBindEmsReq) (res *
|
|||||||
return
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,18 +7,20 @@ package common
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/gogf/gf/v2/errors/gerror"
|
"github.com/gogf/gf/v2/i18n/gi18n"
|
||||||
"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/api/admin/common"
|
||||||
"hotgo/internal/consts"
|
"hotgo/internal/consts"
|
||||||
"hotgo/internal/library/captcha"
|
"hotgo/internal/library/captcha"
|
||||||
"hotgo/internal/library/token"
|
"hotgo/internal/library/token"
|
||||||
"hotgo/internal/service"
|
"hotgo/internal/service"
|
||||||
"hotgo/utility/validate"
|
"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{}
|
var Site = cSite{}
|
||||||
@@ -44,7 +46,12 @@ func (c *cSite) Config(ctx context.Context, _ *common.SiteConfigReq) (res *commo
|
|||||||
|
|
||||||
func (c *cSite) getWsAddr(ctx context.Context, request *ghttp.Request) string {
|
func (c *cSite) getWsAddr(ctx context.Context, request *ghttp.Request) string {
|
||||||
// 如果是本地IP访问,则认为是调试模式,走实际请求地址,否则走配置中的地址
|
// 如果是本地IP访问,则认为是调试模式,走实际请求地址,否则走配置中的地址
|
||||||
|
// 尝试读取hostname,兼容本地运行模式
|
||||||
ip := ghttp.RequestFromCtx(ctx).GetHeader("hostname")
|
ip := ghttp.RequestFromCtx(ctx).GetHeader("hostname")
|
||||||
|
if len(ip) == 0 {
|
||||||
|
ip = ghttp.RequestFromCtx(ctx).GetHost()
|
||||||
|
}
|
||||||
|
|
||||||
if validate.IsLocalIPAddr(ip) {
|
if validate.IsLocalIPAddr(ip) {
|
||||||
return "ws://" + ip + ":" + gstr.StrEx(request.Host, ":") + g.Cfg().MustGet(ctx, "router.websocket.prefix").String()
|
return "ws://" + ip + ":" + gstr.StrEx(request.Host, ":") + g.Cfg().MustGet(ctx, "router.websocket.prefix").String()
|
||||||
}
|
}
|
||||||
@@ -58,7 +65,12 @@ func (c *cSite) getWsAddr(ctx context.Context, request *ghttp.Request) string {
|
|||||||
|
|
||||||
func (c *cSite) getDomain(ctx context.Context, request *ghttp.Request) string {
|
func (c *cSite) getDomain(ctx context.Context, request *ghttp.Request) string {
|
||||||
// 如果是本地IP访问,则认为是调试模式,走实际请求地址,否则走配置中的地址
|
// 如果是本地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) {
|
if validate.IsLocalIPAddr(ip) {
|
||||||
return "http://" + ip + ":" + gstr.StrEx(request.Host, ":")
|
return "http://" + ip + ":" + gstr.StrEx(request.Host, ":")
|
||||||
}
|
}
|
||||||
@@ -79,12 +91,19 @@ func (c *cSite) LoginConfig(ctx context.Context, _ *common.SiteLoginConfigReq) (
|
|||||||
}
|
}
|
||||||
|
|
||||||
res.LoginConfig = login
|
res.LoginConfig = login
|
||||||
|
res.I18nSwitch = g.Cfg().MustGet(ctx, "system.i18n.switch", true).Bool()
|
||||||
|
res.DefaultLanguage = g.Cfg().MustGet(ctx, "system.i18n.defaultLanguage", consts.SysDefaultLanguage).String()
|
||||||
|
res.ProjectName = gi18n.T(ctx, "HotGo管理系统")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Captcha 登录验证码
|
// Captcha 登录验证码
|
||||||
func (c *cSite) Captcha(ctx context.Context, _ *common.LoginCaptchaReq) (res *common.LoginCaptchaRes, err error) {
|
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}
|
res = &common.LoginCaptchaRes{Cid: cid, Base64: base64}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -102,7 +121,7 @@ func (c *cSite) AccountLogin(ctx context.Context, req *common.AccountLoginReq) (
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !req.IsLock && login.CaptchaSwitch == 1 {
|
if !req.IsLock && login.CaptchaSwitch == consts.StatusEnabled {
|
||||||
// 校验 验证码
|
// 校验 验证码
|
||||||
if !captcha.Verify(req.Cid, req.Code) {
|
if !captcha.Verify(req.Cid, req.Code) {
|
||||||
err = gerror.New("验证码错误")
|
err = gerror.New("验证码错误")
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ package common
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/gogf/gf/v2/errors/gerror"
|
"github.com/gogf/gf/v2/errors/gerror"
|
||||||
"github.com/gogf/gf/v2/frame/g"
|
|
||||||
"hotgo/api/admin/common"
|
"hotgo/api/admin/common"
|
||||||
"hotgo/internal/consts"
|
"hotgo/internal/consts"
|
||||||
|
"hotgo/internal/dao"
|
||||||
"hotgo/internal/library/contexts"
|
"hotgo/internal/library/contexts"
|
||||||
"hotgo/internal/model/entity"
|
"hotgo/internal/model/entity"
|
||||||
"hotgo/internal/model/input/sysin"
|
"hotgo/internal/model/input/sysin"
|
||||||
@@ -39,7 +39,7 @@ func (c *cSms) SendBindSms(ctx context.Context, _ *common.SendBindSmsReq) (res *
|
|||||||
return
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -57,3 +57,10 @@ func (c *cUpload) UploadPart(ctx context.Context, req *common.UploadPartReq) (re
|
|||||||
res.UploadPartModel = data
|
res.UploadPartModel = data
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ImageTransferStorage 图片链接转存
|
||||||
|
func (c *cUpload) ImageTransferStorage(ctx context.Context, req *common.ImageTransferStorageReq) (res *common.ImageTransferStorageRes, err error) {
|
||||||
|
res = new(common.ImageTransferStorageRes)
|
||||||
|
res.ImageTransferStorageModel, err = service.CommonUpload().ImageTransferStorage(ctx, &req.ImageTransferStorageInp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ package sys
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"hotgo/api/admin/attachment"
|
"hotgo/api/admin/attachment"
|
||||||
"hotgo/internal/library/storager"
|
|
||||||
"hotgo/internal/model/input/sysin"
|
|
||||||
"hotgo/internal/service"
|
"hotgo/internal/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -50,42 +48,6 @@ func (c *cAttachment) List(ctx context.Context, req *attachment.ListReq) (res *a
|
|||||||
return
|
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 清空上传类型
|
// ClearKind 清空上传类型
|
||||||
func (c *cAttachment) ClearKind(ctx context.Context, req *attachment.ClearKindReq) (res *attachment.ClearKindRes, err error) {
|
func (c *cAttachment) ClearKind(ctx context.Context, req *attachment.ClearKindReq) (res *attachment.ClearKindRes, err error) {
|
||||||
err = service.SysAttachment().ClearKind(ctx, &req.AttachmentClearKindInp)
|
err = service.SysAttachment().ClearKind(ctx, &req.AttachmentClearKindInp)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// @Copyright Copyright (c) 2024 HotGo CLI
|
// @Copyright Copyright (c) 2024 HotGo CLI
|
||||||
// @Author Ms <133814250@qq.com>
|
// @Author Ms <133814250@qq.com>
|
||||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||||
// @AutoGenerate Version 2.13.1
|
// @AutoGenerate Version 2.15.7
|
||||||
package sys
|
package sys
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@@ -78,6 +78,12 @@ func (c *cCurdDemo) Delete(ctx context.Context, req *curddemo.DeleteReq) (res *c
|
|||||||
return
|
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列表开关状态
|
// Switch 更新CURD列表开关状态
|
||||||
func (c *cCurdDemo) Switch(ctx context.Context, req *curddemo.SwitchReq) (res *curddemo.SwitchRes, err error) {
|
func (c *cCurdDemo) Switch(ctx context.Context, req *curddemo.SwitchReq) (res *curddemo.SwitchRes, err error) {
|
||||||
err = service.SysCurdDemo().Switch(ctx, &req.CurdDemoSwitchInp)
|
err = service.SysCurdDemo().Switch(ctx, &req.CurdDemoSwitchInp)
|
||||||
|
|||||||
@@ -38,18 +38,6 @@ func (c *cLoginLog) Export(ctx context.Context, req *loginlog.ExportReq) (res *l
|
|||||||
return
|
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 删除登录日志
|
// Delete 删除登录日志
|
||||||
func (c *cLoginLog) Delete(ctx context.Context, req *loginlog.DeleteReq) (res *loginlog.DeleteRes, err error) {
|
func (c *cLoginLog) Delete(ctx context.Context, req *loginlog.DeleteReq) (res *loginlog.DeleteRes, err error) {
|
||||||
err = service.SysLoginLog().Delete(ctx, &req.LoginLogDeleteInp)
|
err = service.SysLoginLog().Delete(ctx, &req.LoginLogDeleteInp)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// @Copyright Copyright (c) 2024 HotGo CLI
|
// @Copyright Copyright (c) 2024 HotGo CLI
|
||||||
// @Author Ms <133814250@qq.com>
|
// @Author Ms <133814250@qq.com>
|
||||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||||
// @AutoGenerate Version 2.13.1
|
// @AutoGenerate Version 2.15.7
|
||||||
package sys
|
package sys
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@@ -75,6 +75,15 @@ func (c *cNormalTreeDemo) Delete(ctx context.Context, req *normaltreedemo.Delete
|
|||||||
// TreeOption 获取普通树表关系树选项
|
// TreeOption 获取普通树表关系树选项
|
||||||
func (c *cNormalTreeDemo) TreeOption(ctx context.Context, req *normaltreedemo.TreeOptionReq) (res *normaltreedemo.TreeOptionRes, err error) {
|
func (c *cNormalTreeDemo) TreeOption(ctx context.Context, req *normaltreedemo.TreeOptionReq) (res *normaltreedemo.TreeOptionRes, err error) {
|
||||||
data, err := service.SysNormalTreeDemo().TreeOption(ctx)
|
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
|
return
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
// Package sys
|
// Package sys
|
||||||
// @Link https://github.com/bufanyun/hotgo
|
// @Link https://github.com/bufanyun/hotgo
|
||||||
// @Copyright Copyright (c) 2024 HotGo CLI
|
// @Copyright Copyright (c) 2025 HotGo CLI
|
||||||
// @Author Ms <133814250@qq.com>
|
// @Author Ms <133814250@qq.com>
|
||||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||||
// @AutoGenerate Version 2.13.1
|
// @AutoGenerate Version 2.17.8
|
||||||
package sys
|
package sys
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@@ -75,6 +75,15 @@ func (c *cOptionTreeDemo) Delete(ctx context.Context, req *optiontreedemo.Delete
|
|||||||
// TreeOption 获取选项树表关系树选项
|
// TreeOption 获取选项树表关系树选项
|
||||||
func (c *cOptionTreeDemo) TreeOption(ctx context.Context, req *optiontreedemo.TreeOptionReq) (res *optiontreedemo.TreeOptionRes, err error) {
|
func (c *cOptionTreeDemo) TreeOption(ctx context.Context, req *optiontreedemo.TreeOptionReq) (res *optiontreedemo.TreeOptionRes, err error) {
|
||||||
data, err := service.SysOptionTreeDemo().TreeOption(ctx)
|
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
|
return
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
// @Copyright Copyright (c) 2024 HotGo CLI
|
// @Copyright Copyright (c) 2024 HotGo CLI
|
||||||
// @Author Ms <133814250@qq.com>
|
// @Author Ms <133814250@qq.com>
|
||||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||||
// @AutoGenerate Version 2.13.1
|
// @AutoGenerate Version 2.15.7
|
||||||
package sys
|
package sys
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -1,23 +1,5 @@
|
|||||||
// Package member
|
// =================================================================================
|
||||||
// @Link https://github.com/bufanyun/hotgo
|
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
||||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
// =================================================================================
|
||||||
// @Author Ms <133814250@qq.com>
|
|
||||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
|
||||||
package member
|
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
|
||||||
|
}
|
||||||
19
server/internal/dao/addon_hgexample_table.go
Normal file → Executable file
19
server/internal/dao/addon_hgexample_table.go
Normal file → Executable file
@@ -1,5 +1,5 @@
|
|||||||
// =================================================================================
|
// =================================================================================
|
||||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
|
||||||
// =================================================================================
|
// =================================================================================
|
||||||
|
|
||||||
package dao
|
package dao
|
||||||
@@ -8,20 +8,15 @@ import (
|
|||||||
"hotgo/internal/dao/internal"
|
"hotgo/internal/dao/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
// internalAddonHgexampleTableDao is internal type for wrapping internal DAO implements.
|
// addonHgexampleTableDao is the data access object for the table hg_addon_hgexample_table.
|
||||||
type internalAddonHgexampleTableDao = *internal.AddonHgexampleTableDao
|
// You can define custom methods on it to extend its functionality as needed.
|
||||||
|
|
||||||
// addonHgexampleTableDao is the data access object for table hg_addon_hgexample_table.
|
|
||||||
// You can define custom methods on it to extend its functionality as you wish.
|
|
||||||
type addonHgexampleTableDao struct {
|
type addonHgexampleTableDao struct {
|
||||||
internalAddonHgexampleTableDao
|
*internal.AddonHgexampleTableDao
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// AddonHgexampleTable is globally public accessible object for table hg_addon_hgexample_table operations.
|
// AddonHgexampleTable is a globally accessible object for table hg_addon_hgexample_table operations.
|
||||||
AddonHgexampleTable = addonHgexampleTableDao{
|
AddonHgexampleTable = addonHgexampleTableDao{internal.NewAddonHgexampleTableDao()}
|
||||||
internal.NewAddonHgexampleTableDao(),
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Fill with you ideas below.
|
// Add your custom methods and functionality below.
|
||||||
|
|||||||
19
server/internal/dao/addon_hgexample_tenant_order.go
Normal file → Executable file
19
server/internal/dao/addon_hgexample_tenant_order.go
Normal file → Executable file
@@ -1,5 +1,5 @@
|
|||||||
// =================================================================================
|
// =================================================================================
|
||||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
|
||||||
// =================================================================================
|
// =================================================================================
|
||||||
|
|
||||||
package dao
|
package dao
|
||||||
@@ -8,20 +8,15 @@ import (
|
|||||||
"hotgo/internal/dao/internal"
|
"hotgo/internal/dao/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
// internalAddonHgexampleTenantOrderDao is internal type for wrapping internal DAO implements.
|
// addonHgexampleTenantOrderDao is the data access object for the table hg_addon_hgexample_tenant_order.
|
||||||
type internalAddonHgexampleTenantOrderDao = *internal.AddonHgexampleTenantOrderDao
|
// You can define custom methods on it to extend its functionality as needed.
|
||||||
|
|
||||||
// addonHgexampleTenantOrderDao is the data access object for table hg_addon_hgexample_tenant_order.
|
|
||||||
// You can define custom methods on it to extend its functionality as you wish.
|
|
||||||
type addonHgexampleTenantOrderDao struct {
|
type addonHgexampleTenantOrderDao struct {
|
||||||
internalAddonHgexampleTenantOrderDao
|
*internal.AddonHgexampleTenantOrderDao
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// AddonHgexampleTenantOrder is globally public accessible object for table hg_addon_hgexample_tenant_order operations.
|
// AddonHgexampleTenantOrder is a globally accessible object for table hg_addon_hgexample_tenant_order operations.
|
||||||
AddonHgexampleTenantOrder = addonHgexampleTenantOrderDao{
|
AddonHgexampleTenantOrder = addonHgexampleTenantOrderDao{internal.NewAddonHgexampleTenantOrderDao()}
|
||||||
internal.NewAddonHgexampleTenantOrderDao(),
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Fill with you ideas below.
|
// Add your custom methods and functionality below.
|
||||||
|
|||||||
19
server/internal/dao/admin_cash.go
Normal file → Executable file
19
server/internal/dao/admin_cash.go
Normal file → Executable file
@@ -1,5 +1,5 @@
|
|||||||
// =================================================================================
|
// =================================================================================
|
||||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
|
||||||
// =================================================================================
|
// =================================================================================
|
||||||
|
|
||||||
package dao
|
package dao
|
||||||
@@ -8,20 +8,15 @@ import (
|
|||||||
"hotgo/internal/dao/internal"
|
"hotgo/internal/dao/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
// internalAdminCashDao is internal type for wrapping internal DAO implements.
|
// adminCashDao is the data access object for the table hg_admin_cash.
|
||||||
type internalAdminCashDao = *internal.AdminCashDao
|
// You can define custom methods on it to extend its functionality as needed.
|
||||||
|
|
||||||
// adminCashDao is the data access object for table hg_admin_cash.
|
|
||||||
// You can define custom methods on it to extend its functionality as you wish.
|
|
||||||
type adminCashDao struct {
|
type adminCashDao struct {
|
||||||
internalAdminCashDao
|
*internal.AdminCashDao
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// AdminCash is globally public accessible object for table hg_admin_cash operations.
|
// AdminCash is a globally accessible object for table hg_admin_cash operations.
|
||||||
AdminCash = adminCashDao{
|
AdminCash = adminCashDao{internal.NewAdminCashDao()}
|
||||||
internal.NewAdminCashDao(),
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Fill with you ideas below.
|
// Add your custom methods and functionality below.
|
||||||
|
|||||||
19
server/internal/dao/admin_credits_log.go
Normal file → Executable file
19
server/internal/dao/admin_credits_log.go
Normal file → Executable file
@@ -1,5 +1,5 @@
|
|||||||
// =================================================================================
|
// =================================================================================
|
||||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
|
||||||
// =================================================================================
|
// =================================================================================
|
||||||
|
|
||||||
package dao
|
package dao
|
||||||
@@ -8,20 +8,15 @@ import (
|
|||||||
"hotgo/internal/dao/internal"
|
"hotgo/internal/dao/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
// internalAdminCreditsLogDao is internal type for wrapping internal DAO implements.
|
// adminCreditsLogDao is the data access object for the table hg_admin_credits_log.
|
||||||
type internalAdminCreditsLogDao = *internal.AdminCreditsLogDao
|
// You can define custom methods on it to extend its functionality as needed.
|
||||||
|
|
||||||
// adminCreditsLogDao is the data access object for table hg_admin_credits_log.
|
|
||||||
// You can define custom methods on it to extend its functionality as you wish.
|
|
||||||
type adminCreditsLogDao struct {
|
type adminCreditsLogDao struct {
|
||||||
internalAdminCreditsLogDao
|
*internal.AdminCreditsLogDao
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// AdminCreditsLog is globally public accessible object for table hg_admin_credits_log operations.
|
// AdminCreditsLog is a globally accessible object for table hg_admin_credits_log operations.
|
||||||
AdminCreditsLog = adminCreditsLogDao{
|
AdminCreditsLog = adminCreditsLogDao{internal.NewAdminCreditsLogDao()}
|
||||||
internal.NewAdminCreditsLogDao(),
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Fill with you ideas below.
|
// Add your custom methods and functionality below.
|
||||||
|
|||||||
19
server/internal/dao/admin_dept.go
Normal file → Executable file
19
server/internal/dao/admin_dept.go
Normal file → Executable file
@@ -1,5 +1,5 @@
|
|||||||
// =================================================================================
|
// =================================================================================
|
||||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
|
||||||
// =================================================================================
|
// =================================================================================
|
||||||
|
|
||||||
package dao
|
package dao
|
||||||
@@ -8,20 +8,15 @@ import (
|
|||||||
"hotgo/internal/dao/internal"
|
"hotgo/internal/dao/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
// internalAdminDeptDao is internal type for wrapping internal DAO implements.
|
// adminDeptDao is the data access object for the table hg_admin_dept.
|
||||||
type internalAdminDeptDao = *internal.AdminDeptDao
|
// You can define custom methods on it to extend its functionality as needed.
|
||||||
|
|
||||||
// adminDeptDao is the data access object for table hg_admin_dept.
|
|
||||||
// You can define custom methods on it to extend its functionality as you wish.
|
|
||||||
type adminDeptDao struct {
|
type adminDeptDao struct {
|
||||||
internalAdminDeptDao
|
*internal.AdminDeptDao
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// AdminDept is globally public accessible object for table hg_admin_dept operations.
|
// AdminDept is a globally accessible object for table hg_admin_dept operations.
|
||||||
AdminDept = adminDeptDao{
|
AdminDept = adminDeptDao{internal.NewAdminDeptDao()}
|
||||||
internal.NewAdminDeptDao(),
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Fill with you ideas below.
|
// Add your custom methods and functionality below.
|
||||||
|
|||||||
19
server/internal/dao/admin_member.go
Normal file → Executable file
19
server/internal/dao/admin_member.go
Normal file → Executable file
@@ -1,5 +1,5 @@
|
|||||||
// =================================================================================
|
// =================================================================================
|
||||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
|
||||||
// =================================================================================
|
// =================================================================================
|
||||||
|
|
||||||
package dao
|
package dao
|
||||||
@@ -8,20 +8,15 @@ import (
|
|||||||
"hotgo/internal/dao/internal"
|
"hotgo/internal/dao/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
// internalAdminMemberDao is internal type for wrapping internal DAO implements.
|
// adminMemberDao is the data access object for the table hg_admin_member.
|
||||||
type internalAdminMemberDao = *internal.AdminMemberDao
|
// You can define custom methods on it to extend its functionality as needed.
|
||||||
|
|
||||||
// adminMemberDao is the data access object for table hg_admin_member.
|
|
||||||
// You can define custom methods on it to extend its functionality as you wish.
|
|
||||||
type adminMemberDao struct {
|
type adminMemberDao struct {
|
||||||
internalAdminMemberDao
|
*internal.AdminMemberDao
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// AdminMember is globally public accessible object for table hg_admin_member operations.
|
// AdminMember is a globally accessible object for table hg_admin_member operations.
|
||||||
AdminMember = adminMemberDao{
|
AdminMember = adminMemberDao{internal.NewAdminMemberDao()}
|
||||||
internal.NewAdminMemberDao(),
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Fill with you ideas below.
|
// Add your custom methods and functionality below.
|
||||||
|
|||||||
19
server/internal/dao/admin_member_post.go
Normal file → Executable file
19
server/internal/dao/admin_member_post.go
Normal file → Executable file
@@ -1,5 +1,5 @@
|
|||||||
// =================================================================================
|
// =================================================================================
|
||||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
|
||||||
// =================================================================================
|
// =================================================================================
|
||||||
|
|
||||||
package dao
|
package dao
|
||||||
@@ -8,20 +8,15 @@ import (
|
|||||||
"hotgo/internal/dao/internal"
|
"hotgo/internal/dao/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
// internalAdminMemberPostDao is internal type for wrapping internal DAO implements.
|
// adminMemberPostDao is the data access object for the table hg_admin_member_post.
|
||||||
type internalAdminMemberPostDao = *internal.AdminMemberPostDao
|
// You can define custom methods on it to extend its functionality as needed.
|
||||||
|
|
||||||
// adminMemberPostDao is the data access object for table hg_admin_member_post.
|
|
||||||
// You can define custom methods on it to extend its functionality as you wish.
|
|
||||||
type adminMemberPostDao struct {
|
type adminMemberPostDao struct {
|
||||||
internalAdminMemberPostDao
|
*internal.AdminMemberPostDao
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// AdminMemberPost is globally public accessible object for table hg_admin_member_post operations.
|
// AdminMemberPost is a globally accessible object for table hg_admin_member_post operations.
|
||||||
AdminMemberPost = adminMemberPostDao{
|
AdminMemberPost = adminMemberPostDao{internal.NewAdminMemberPostDao()}
|
||||||
internal.NewAdminMemberPostDao(),
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Fill with you ideas below.
|
// Add your custom methods and functionality below.
|
||||||
|
|||||||
19
server/internal/dao/admin_member_role.go
Normal file → Executable file
19
server/internal/dao/admin_member_role.go
Normal file → Executable file
@@ -1,5 +1,5 @@
|
|||||||
// =================================================================================
|
// =================================================================================
|
||||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
|
||||||
// =================================================================================
|
// =================================================================================
|
||||||
|
|
||||||
package dao
|
package dao
|
||||||
@@ -8,20 +8,15 @@ import (
|
|||||||
"hotgo/internal/dao/internal"
|
"hotgo/internal/dao/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
// internalAdminMemberRoleDao is internal type for wrapping internal DAO implements.
|
// adminMemberRoleDao is the data access object for the table hg_admin_member_role.
|
||||||
type internalAdminMemberRoleDao = *internal.AdminMemberRoleDao
|
// You can define custom methods on it to extend its functionality as needed.
|
||||||
|
|
||||||
// adminMemberRoleDao is the data access object for table hg_admin_member_role.
|
|
||||||
// You can define custom methods on it to extend its functionality as you wish.
|
|
||||||
type adminMemberRoleDao struct {
|
type adminMemberRoleDao struct {
|
||||||
internalAdminMemberRoleDao
|
*internal.AdminMemberRoleDao
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// AdminMemberRole is globally public accessible object for table hg_admin_member_role operations.
|
// AdminMemberRole is a globally accessible object for table hg_admin_member_role operations.
|
||||||
AdminMemberRole = adminMemberRoleDao{
|
AdminMemberRole = adminMemberRoleDao{internal.NewAdminMemberRoleDao()}
|
||||||
internal.NewAdminMemberRoleDao(),
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Fill with you ideas below.
|
// Add your custom methods and functionality below.
|
||||||
|
|||||||
19
server/internal/dao/admin_menu.go
Normal file → Executable file
19
server/internal/dao/admin_menu.go
Normal file → Executable file
@@ -1,5 +1,5 @@
|
|||||||
// =================================================================================
|
// =================================================================================
|
||||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
|
||||||
// =================================================================================
|
// =================================================================================
|
||||||
|
|
||||||
package dao
|
package dao
|
||||||
@@ -8,20 +8,15 @@ import (
|
|||||||
"hotgo/internal/dao/internal"
|
"hotgo/internal/dao/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
// internalAdminMenuDao is internal type for wrapping internal DAO implements.
|
// adminMenuDao is the data access object for the table hg_admin_menu.
|
||||||
type internalAdminMenuDao = *internal.AdminMenuDao
|
// You can define custom methods on it to extend its functionality as needed.
|
||||||
|
|
||||||
// adminMenuDao is the data access object for table hg_admin_menu.
|
|
||||||
// You can define custom methods on it to extend its functionality as you wish.
|
|
||||||
type adminMenuDao struct {
|
type adminMenuDao struct {
|
||||||
internalAdminMenuDao
|
*internal.AdminMenuDao
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// AdminMenu is globally public accessible object for table hg_admin_menu operations.
|
// AdminMenu is a globally accessible object for table hg_admin_menu operations.
|
||||||
AdminMenu = adminMenuDao{
|
AdminMenu = adminMenuDao{internal.NewAdminMenuDao()}
|
||||||
internal.NewAdminMenuDao(),
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Fill with you ideas below.
|
// Add your custom methods and functionality below.
|
||||||
|
|||||||
19
server/internal/dao/admin_notice.go
Normal file → Executable file
19
server/internal/dao/admin_notice.go
Normal file → Executable file
@@ -1,5 +1,5 @@
|
|||||||
// =================================================================================
|
// =================================================================================
|
||||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
|
||||||
// =================================================================================
|
// =================================================================================
|
||||||
|
|
||||||
package dao
|
package dao
|
||||||
@@ -8,20 +8,15 @@ import (
|
|||||||
"hotgo/internal/dao/internal"
|
"hotgo/internal/dao/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
// internalAdminNoticeDao is internal type for wrapping internal DAO implements.
|
// adminNoticeDao is the data access object for the table hg_admin_notice.
|
||||||
type internalAdminNoticeDao = *internal.AdminNoticeDao
|
// You can define custom methods on it to extend its functionality as needed.
|
||||||
|
|
||||||
// adminNoticeDao is the data access object for table hg_admin_notice.
|
|
||||||
// You can define custom methods on it to extend its functionality as you wish.
|
|
||||||
type adminNoticeDao struct {
|
type adminNoticeDao struct {
|
||||||
internalAdminNoticeDao
|
*internal.AdminNoticeDao
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// AdminNotice is globally public accessible object for table hg_admin_notice operations.
|
// AdminNotice is a globally accessible object for table hg_admin_notice operations.
|
||||||
AdminNotice = adminNoticeDao{
|
AdminNotice = adminNoticeDao{internal.NewAdminNoticeDao()}
|
||||||
internal.NewAdminNoticeDao(),
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Fill with you ideas below.
|
// Add your custom methods and functionality below.
|
||||||
|
|||||||
19
server/internal/dao/admin_notice_read.go
Normal file → Executable file
19
server/internal/dao/admin_notice_read.go
Normal file → Executable file
@@ -1,5 +1,5 @@
|
|||||||
// =================================================================================
|
// =================================================================================
|
||||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
|
||||||
// =================================================================================
|
// =================================================================================
|
||||||
|
|
||||||
package dao
|
package dao
|
||||||
@@ -8,20 +8,15 @@ import (
|
|||||||
"hotgo/internal/dao/internal"
|
"hotgo/internal/dao/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
// internalAdminNoticeReadDao is internal type for wrapping internal DAO implements.
|
// adminNoticeReadDao is the data access object for the table hg_admin_notice_read.
|
||||||
type internalAdminNoticeReadDao = *internal.AdminNoticeReadDao
|
// You can define custom methods on it to extend its functionality as needed.
|
||||||
|
|
||||||
// adminNoticeReadDao is the data access object for table hg_admin_notice_read.
|
|
||||||
// You can define custom methods on it to extend its functionality as you wish.
|
|
||||||
type adminNoticeReadDao struct {
|
type adminNoticeReadDao struct {
|
||||||
internalAdminNoticeReadDao
|
*internal.AdminNoticeReadDao
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// AdminNoticeRead is globally public accessible object for table hg_admin_notice_read operations.
|
// AdminNoticeRead is a globally accessible object for table hg_admin_notice_read operations.
|
||||||
AdminNoticeRead = adminNoticeReadDao{
|
AdminNoticeRead = adminNoticeReadDao{internal.NewAdminNoticeReadDao()}
|
||||||
internal.NewAdminNoticeReadDao(),
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Fill with you ideas below.
|
// Add your custom methods and functionality below.
|
||||||
|
|||||||
19
server/internal/dao/admin_oauth.go
Normal file → Executable file
19
server/internal/dao/admin_oauth.go
Normal file → Executable file
@@ -1,5 +1,5 @@
|
|||||||
// =================================================================================
|
// =================================================================================
|
||||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
|
||||||
// =================================================================================
|
// =================================================================================
|
||||||
|
|
||||||
package dao
|
package dao
|
||||||
@@ -8,20 +8,15 @@ import (
|
|||||||
"hotgo/internal/dao/internal"
|
"hotgo/internal/dao/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
// internalAdminOauthDao is internal type for wrapping internal DAO implements.
|
// adminOauthDao is the data access object for the table hg_admin_oauth.
|
||||||
type internalAdminOauthDao = *internal.AdminOauthDao
|
// You can define custom methods on it to extend its functionality as needed.
|
||||||
|
|
||||||
// adminOauthDao is the data access object for table hg_admin_oauth.
|
|
||||||
// You can define custom methods on it to extend its functionality as you wish.
|
|
||||||
type adminOauthDao struct {
|
type adminOauthDao struct {
|
||||||
internalAdminOauthDao
|
*internal.AdminOauthDao
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// AdminOauth is globally public accessible object for table hg_admin_oauth operations.
|
// AdminOauth is a globally accessible object for table hg_admin_oauth operations.
|
||||||
AdminOauth = adminOauthDao{
|
AdminOauth = adminOauthDao{internal.NewAdminOauthDao()}
|
||||||
internal.NewAdminOauthDao(),
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Fill with you ideas below.
|
// Add your custom methods and functionality below.
|
||||||
|
|||||||
19
server/internal/dao/admin_order.go
Normal file → Executable file
19
server/internal/dao/admin_order.go
Normal file → Executable file
@@ -1,5 +1,5 @@
|
|||||||
// =================================================================================
|
// =================================================================================
|
||||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
|
||||||
// =================================================================================
|
// =================================================================================
|
||||||
|
|
||||||
package dao
|
package dao
|
||||||
@@ -8,20 +8,15 @@ import (
|
|||||||
"hotgo/internal/dao/internal"
|
"hotgo/internal/dao/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
// internalAdminOrderDao is internal type for wrapping internal DAO implements.
|
// adminOrderDao is the data access object for the table hg_admin_order.
|
||||||
type internalAdminOrderDao = *internal.AdminOrderDao
|
// You can define custom methods on it to extend its functionality as needed.
|
||||||
|
|
||||||
// adminOrderDao is the data access object for table hg_admin_order.
|
|
||||||
// You can define custom methods on it to extend its functionality as you wish.
|
|
||||||
type adminOrderDao struct {
|
type adminOrderDao struct {
|
||||||
internalAdminOrderDao
|
*internal.AdminOrderDao
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// AdminOrder is globally public accessible object for table hg_admin_order operations.
|
// AdminOrder is a globally accessible object for table hg_admin_order operations.
|
||||||
AdminOrder = adminOrderDao{
|
AdminOrder = adminOrderDao{internal.NewAdminOrderDao()}
|
||||||
internal.NewAdminOrderDao(),
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Fill with you ideas below.
|
// Add your custom methods and functionality below.
|
||||||
|
|||||||
19
server/internal/dao/admin_post.go
Normal file → Executable file
19
server/internal/dao/admin_post.go
Normal file → Executable file
@@ -1,5 +1,5 @@
|
|||||||
// =================================================================================
|
// =================================================================================
|
||||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
|
||||||
// =================================================================================
|
// =================================================================================
|
||||||
|
|
||||||
package dao
|
package dao
|
||||||
@@ -8,20 +8,15 @@ import (
|
|||||||
"hotgo/internal/dao/internal"
|
"hotgo/internal/dao/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
// internalAdminPostDao is internal type for wrapping internal DAO implements.
|
// adminPostDao is the data access object for the table hg_admin_post.
|
||||||
type internalAdminPostDao = *internal.AdminPostDao
|
// You can define custom methods on it to extend its functionality as needed.
|
||||||
|
|
||||||
// adminPostDao is the data access object for table hg_admin_post.
|
|
||||||
// You can define custom methods on it to extend its functionality as you wish.
|
|
||||||
type adminPostDao struct {
|
type adminPostDao struct {
|
||||||
internalAdminPostDao
|
*internal.AdminPostDao
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// AdminPost is globally public accessible object for table hg_admin_post operations.
|
// AdminPost is a globally accessible object for table hg_admin_post operations.
|
||||||
AdminPost = adminPostDao{
|
AdminPost = adminPostDao{internal.NewAdminPostDao()}
|
||||||
internal.NewAdminPostDao(),
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Fill with you ideas below.
|
// Add your custom methods and functionality below.
|
||||||
|
|||||||
19
server/internal/dao/admin_role.go
Normal file → Executable file
19
server/internal/dao/admin_role.go
Normal file → Executable file
@@ -1,5 +1,5 @@
|
|||||||
// =================================================================================
|
// =================================================================================
|
||||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
|
||||||
// =================================================================================
|
// =================================================================================
|
||||||
|
|
||||||
package dao
|
package dao
|
||||||
@@ -8,20 +8,15 @@ import (
|
|||||||
"hotgo/internal/dao/internal"
|
"hotgo/internal/dao/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
// internalAdminRoleDao is internal type for wrapping internal DAO implements.
|
// adminRoleDao is the data access object for the table hg_admin_role.
|
||||||
type internalAdminRoleDao = *internal.AdminRoleDao
|
// You can define custom methods on it to extend its functionality as needed.
|
||||||
|
|
||||||
// adminRoleDao is the data access object for table hg_admin_role.
|
|
||||||
// You can define custom methods on it to extend its functionality as you wish.
|
|
||||||
type adminRoleDao struct {
|
type adminRoleDao struct {
|
||||||
internalAdminRoleDao
|
*internal.AdminRoleDao
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// AdminRole is globally public accessible object for table hg_admin_role operations.
|
// AdminRole is a globally accessible object for table hg_admin_role operations.
|
||||||
AdminRole = adminRoleDao{
|
AdminRole = adminRoleDao{internal.NewAdminRoleDao()}
|
||||||
internal.NewAdminRoleDao(),
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Fill with you ideas below.
|
// Add your custom methods and functionality below.
|
||||||
|
|||||||
19
server/internal/dao/admin_role_casbin.go
Normal file → Executable file
19
server/internal/dao/admin_role_casbin.go
Normal file → Executable file
@@ -1,5 +1,5 @@
|
|||||||
// =================================================================================
|
// =================================================================================
|
||||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
|
||||||
// =================================================================================
|
// =================================================================================
|
||||||
|
|
||||||
package dao
|
package dao
|
||||||
@@ -8,20 +8,15 @@ import (
|
|||||||
"hotgo/internal/dao/internal"
|
"hotgo/internal/dao/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
// internalAdminRoleCasbinDao is internal type for wrapping internal DAO implements.
|
// adminRoleCasbinDao is the data access object for the table hg_admin_role_casbin.
|
||||||
type internalAdminRoleCasbinDao = *internal.AdminRoleCasbinDao
|
// You can define custom methods on it to extend its functionality as needed.
|
||||||
|
|
||||||
// adminRoleCasbinDao is the data access object for table hg_admin_role_casbin.
|
|
||||||
// You can define custom methods on it to extend its functionality as you wish.
|
|
||||||
type adminRoleCasbinDao struct {
|
type adminRoleCasbinDao struct {
|
||||||
internalAdminRoleCasbinDao
|
*internal.AdminRoleCasbinDao
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// AdminRoleCasbin is globally public accessible object for table hg_admin_role_casbin operations.
|
// AdminRoleCasbin is a globally accessible object for table hg_admin_role_casbin operations.
|
||||||
AdminRoleCasbin = adminRoleCasbinDao{
|
AdminRoleCasbin = adminRoleCasbinDao{internal.NewAdminRoleCasbinDao()}
|
||||||
internal.NewAdminRoleCasbinDao(),
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Fill with you ideas below.
|
// Add your custom methods and functionality below.
|
||||||
|
|||||||
19
server/internal/dao/admin_role_menu.go
Normal file → Executable file
19
server/internal/dao/admin_role_menu.go
Normal file → Executable file
@@ -1,5 +1,5 @@
|
|||||||
// =================================================================================
|
// =================================================================================
|
||||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
|
||||||
// =================================================================================
|
// =================================================================================
|
||||||
|
|
||||||
package dao
|
package dao
|
||||||
@@ -8,20 +8,15 @@ import (
|
|||||||
"hotgo/internal/dao/internal"
|
"hotgo/internal/dao/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
// internalAdminRoleMenuDao is internal type for wrapping internal DAO implements.
|
// adminRoleMenuDao is the data access object for the table hg_admin_role_menu.
|
||||||
type internalAdminRoleMenuDao = *internal.AdminRoleMenuDao
|
// You can define custom methods on it to extend its functionality as needed.
|
||||||
|
|
||||||
// adminRoleMenuDao is the data access object for table hg_admin_role_menu.
|
|
||||||
// You can define custom methods on it to extend its functionality as you wish.
|
|
||||||
type adminRoleMenuDao struct {
|
type adminRoleMenuDao struct {
|
||||||
internalAdminRoleMenuDao
|
*internal.AdminRoleMenuDao
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// AdminRoleMenu is globally public accessible object for table hg_admin_role_menu operations.
|
// AdminRoleMenu is a globally accessible object for table hg_admin_role_menu operations.
|
||||||
AdminRoleMenu = adminRoleMenuDao{
|
AdminRoleMenu = adminRoleMenuDao{internal.NewAdminRoleMenuDao()}
|
||||||
internal.NewAdminRoleMenuDao(),
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Fill with you ideas below.
|
// Add your custom methods and functionality below.
|
||||||
|
|||||||
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"
|
"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 {
|
type AddonHgexampleTableDao struct {
|
||||||
table string // table is the underlying table name of the DAO.
|
table string // table is the underlying table name of the DAO.
|
||||||
group string // group is the database configuration group name of current 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.
|
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 {
|
type AddonHgexampleTableColumns struct {
|
||||||
Id string // ID
|
Id string // ID
|
||||||
Pid string // 上级ID
|
Pid string // 上级ID
|
||||||
@@ -59,7 +60,7 @@ type AddonHgexampleTableColumns struct {
|
|||||||
DeletedAt string // 删除时间
|
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{
|
var addonHgexampleTableColumns = AddonHgexampleTableColumns{
|
||||||
Id: "id",
|
Id: "id",
|
||||||
Pid: "pid",
|
Pid: "pid",
|
||||||
@@ -101,44 +102,49 @@ var addonHgexampleTableColumns = AddonHgexampleTableColumns{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewAddonHgexampleTableDao creates and returns a new DAO object for table data access.
|
// NewAddonHgexampleTableDao creates and returns a new DAO object for table data access.
|
||||||
func NewAddonHgexampleTableDao() *AddonHgexampleTableDao {
|
func NewAddonHgexampleTableDao(handlers ...gdb.ModelHandler) *AddonHgexampleTableDao {
|
||||||
return &AddonHgexampleTableDao{
|
return &AddonHgexampleTableDao{
|
||||||
group: "default",
|
group: "default",
|
||||||
table: "hg_addon_hgexample_table",
|
table: "hg_addon_hgexample_table",
|
||||||
columns: addonHgexampleTableColumns,
|
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 {
|
func (dao *AddonHgexampleTableDao) DB() gdb.DB {
|
||||||
return g.DB(dao.group)
|
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 {
|
func (dao *AddonHgexampleTableDao) Table() string {
|
||||||
return dao.table
|
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 {
|
func (dao *AddonHgexampleTableDao) Columns() AddonHgexampleTableColumns {
|
||||||
return dao.columns
|
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 {
|
func (dao *AddonHgexampleTableDao) Group() string {
|
||||||
return dao.group
|
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 {
|
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.
|
// 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.
|
// 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.
|
// 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) {
|
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)
|
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"
|
"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 {
|
type AddonHgexampleTenantOrderDao struct {
|
||||||
table string // table is the underlying table name of the DAO.
|
table string // table is the underlying table name of the DAO.
|
||||||
group string // group is the database configuration group name of current 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.
|
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 {
|
type AddonHgexampleTenantOrderColumns struct {
|
||||||
Id string // 主键
|
Id string // 主键
|
||||||
TenantId string // 租户ID
|
TenantId string // 租户ID
|
||||||
@@ -33,7 +34,7 @@ type AddonHgexampleTenantOrderColumns struct {
|
|||||||
UpdatedAt string // 修改时间
|
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{
|
var addonHgexampleTenantOrderColumns = AddonHgexampleTenantOrderColumns{
|
||||||
Id: "id",
|
Id: "id",
|
||||||
TenantId: "tenant_id",
|
TenantId: "tenant_id",
|
||||||
@@ -49,44 +50,49 @@ var addonHgexampleTenantOrderColumns = AddonHgexampleTenantOrderColumns{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewAddonHgexampleTenantOrderDao creates and returns a new DAO object for table data access.
|
// NewAddonHgexampleTenantOrderDao creates and returns a new DAO object for table data access.
|
||||||
func NewAddonHgexampleTenantOrderDao() *AddonHgexampleTenantOrderDao {
|
func NewAddonHgexampleTenantOrderDao(handlers ...gdb.ModelHandler) *AddonHgexampleTenantOrderDao {
|
||||||
return &AddonHgexampleTenantOrderDao{
|
return &AddonHgexampleTenantOrderDao{
|
||||||
group: "default",
|
group: "default",
|
||||||
table: "hg_addon_hgexample_tenant_order",
|
table: "hg_addon_hgexample_tenant_order",
|
||||||
columns: addonHgexampleTenantOrderColumns,
|
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 {
|
func (dao *AddonHgexampleTenantOrderDao) DB() gdb.DB {
|
||||||
return g.DB(dao.group)
|
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 {
|
func (dao *AddonHgexampleTenantOrderDao) Table() string {
|
||||||
return dao.table
|
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 {
|
func (dao *AddonHgexampleTenantOrderDao) Columns() AddonHgexampleTenantOrderColumns {
|
||||||
return dao.columns
|
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 {
|
func (dao *AddonHgexampleTenantOrderDao) Group() string {
|
||||||
return dao.group
|
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 {
|
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.
|
// 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.
|
// 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.
|
// 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) {
|
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)
|
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"
|
"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 {
|
type AdminCashDao struct {
|
||||||
table string // table is the underlying table name of the DAO.
|
table string // table is the underlying table name of the DAO.
|
||||||
group string // group is the database configuration group name of current 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.
|
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 {
|
type AdminCashColumns struct {
|
||||||
Id string // ID
|
Id string // ID
|
||||||
MemberId string // 管理员ID
|
MemberId string // 管理员ID
|
||||||
@@ -32,7 +33,7 @@ type AdminCashColumns struct {
|
|||||||
CreatedAt string // 申请时间
|
CreatedAt string // 申请时间
|
||||||
}
|
}
|
||||||
|
|
||||||
// adminCashColumns holds the columns for table hg_admin_cash.
|
// adminCashColumns holds the columns for the table hg_admin_cash.
|
||||||
var adminCashColumns = AdminCashColumns{
|
var adminCashColumns = AdminCashColumns{
|
||||||
Id: "id",
|
Id: "id",
|
||||||
MemberId: "member_id",
|
MemberId: "member_id",
|
||||||
@@ -47,44 +48,49 @@ var adminCashColumns = AdminCashColumns{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewAdminCashDao creates and returns a new DAO object for table data access.
|
// NewAdminCashDao creates and returns a new DAO object for table data access.
|
||||||
func NewAdminCashDao() *AdminCashDao {
|
func NewAdminCashDao(handlers ...gdb.ModelHandler) *AdminCashDao {
|
||||||
return &AdminCashDao{
|
return &AdminCashDao{
|
||||||
group: "default",
|
group: "default",
|
||||||
table: "hg_admin_cash",
|
table: "hg_admin_cash",
|
||||||
columns: adminCashColumns,
|
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 {
|
func (dao *AdminCashDao) DB() gdb.DB {
|
||||||
return g.DB(dao.group)
|
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 {
|
func (dao *AdminCashDao) Table() string {
|
||||||
return dao.table
|
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 {
|
func (dao *AdminCashDao) Columns() AdminCashColumns {
|
||||||
return dao.columns
|
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 {
|
func (dao *AdminCashDao) Group() string {
|
||||||
return dao.group
|
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 {
|
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.
|
// 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.
|
// 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.
|
// 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) {
|
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)
|
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"
|
"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 {
|
type AdminCreditsLogDao struct {
|
||||||
table string // table is the underlying table name of the DAO.
|
table string // table is the underlying table name of the DAO.
|
||||||
group string // group is the database configuration group name of current 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.
|
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 {
|
type AdminCreditsLogColumns struct {
|
||||||
Id string // 变动ID
|
Id string // 变动ID
|
||||||
MemberId string // 管理员ID
|
MemberId string // 管理员ID
|
||||||
@@ -37,7 +38,7 @@ type AdminCreditsLogColumns struct {
|
|||||||
UpdatedAt string // 修改时间
|
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{
|
var adminCreditsLogColumns = AdminCreditsLogColumns{
|
||||||
Id: "id",
|
Id: "id",
|
||||||
MemberId: "member_id",
|
MemberId: "member_id",
|
||||||
@@ -57,44 +58,49 @@ var adminCreditsLogColumns = AdminCreditsLogColumns{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewAdminCreditsLogDao creates and returns a new DAO object for table data access.
|
// NewAdminCreditsLogDao creates and returns a new DAO object for table data access.
|
||||||
func NewAdminCreditsLogDao() *AdminCreditsLogDao {
|
func NewAdminCreditsLogDao(handlers ...gdb.ModelHandler) *AdminCreditsLogDao {
|
||||||
return &AdminCreditsLogDao{
|
return &AdminCreditsLogDao{
|
||||||
group: "default",
|
group: "default",
|
||||||
table: "hg_admin_credits_log",
|
table: "hg_admin_credits_log",
|
||||||
columns: adminCreditsLogColumns,
|
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 {
|
func (dao *AdminCreditsLogDao) DB() gdb.DB {
|
||||||
return g.DB(dao.group)
|
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 {
|
func (dao *AdminCreditsLogDao) Table() string {
|
||||||
return dao.table
|
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 {
|
func (dao *AdminCreditsLogDao) Columns() AdminCreditsLogColumns {
|
||||||
return dao.columns
|
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 {
|
func (dao *AdminCreditsLogDao) Group() string {
|
||||||
return dao.group
|
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 {
|
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.
|
// 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.
|
// 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.
|
// 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) {
|
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)
|
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"
|
"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 {
|
type AdminDeptDao struct {
|
||||||
table string // table is the underlying table name of the DAO.
|
table string // table is the underlying table name of the DAO.
|
||||||
group string // group is the database configuration group name of current 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.
|
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 {
|
type AdminDeptColumns struct {
|
||||||
Id string // 部门ID
|
Id string // 部门ID
|
||||||
Pid string // 父部门ID
|
Pid string // 父部门ID
|
||||||
@@ -36,7 +37,7 @@ type AdminDeptColumns struct {
|
|||||||
UpdatedAt string // 更新时间
|
UpdatedAt string // 更新时间
|
||||||
}
|
}
|
||||||
|
|
||||||
// adminDeptColumns holds the columns for table hg_admin_dept.
|
// adminDeptColumns holds the columns for the table hg_admin_dept.
|
||||||
var adminDeptColumns = AdminDeptColumns{
|
var adminDeptColumns = AdminDeptColumns{
|
||||||
Id: "id",
|
Id: "id",
|
||||||
Pid: "pid",
|
Pid: "pid",
|
||||||
@@ -55,44 +56,49 @@ var adminDeptColumns = AdminDeptColumns{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewAdminDeptDao creates and returns a new DAO object for table data access.
|
// NewAdminDeptDao creates and returns a new DAO object for table data access.
|
||||||
func NewAdminDeptDao() *AdminDeptDao {
|
func NewAdminDeptDao(handlers ...gdb.ModelHandler) *AdminDeptDao {
|
||||||
return &AdminDeptDao{
|
return &AdminDeptDao{
|
||||||
group: "default",
|
group: "default",
|
||||||
table: "hg_admin_dept",
|
table: "hg_admin_dept",
|
||||||
columns: adminDeptColumns,
|
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 {
|
func (dao *AdminDeptDao) DB() gdb.DB {
|
||||||
return g.DB(dao.group)
|
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 {
|
func (dao *AdminDeptDao) Table() string {
|
||||||
return dao.table
|
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 {
|
func (dao *AdminDeptDao) Columns() AdminDeptColumns {
|
||||||
return dao.columns
|
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 {
|
func (dao *AdminDeptDao) Group() string {
|
||||||
return dao.group
|
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 {
|
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.
|
// 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.
|
// 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.
|
// 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) {
|
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)
|
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"
|
"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 {
|
type AdminMemberDao struct {
|
||||||
table string // table is the underlying table name of the DAO.
|
table string // table is the underlying table name of the DAO.
|
||||||
group string // group is the database configuration group name of current 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.
|
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 {
|
type AdminMemberColumns struct {
|
||||||
Id string // 管理员ID
|
Id string // 管理员ID
|
||||||
DeptId string // 部门ID
|
DeptId string // 部门ID
|
||||||
@@ -50,7 +51,7 @@ type AdminMemberColumns struct {
|
|||||||
UpdatedAt string // 修改时间
|
UpdatedAt string // 修改时间
|
||||||
}
|
}
|
||||||
|
|
||||||
// adminMemberColumns holds the columns for table hg_admin_member.
|
// adminMemberColumns holds the columns for the table hg_admin_member.
|
||||||
var adminMemberColumns = AdminMemberColumns{
|
var adminMemberColumns = AdminMemberColumns{
|
||||||
Id: "id",
|
Id: "id",
|
||||||
DeptId: "dept_id",
|
DeptId: "dept_id",
|
||||||
@@ -83,44 +84,49 @@ var adminMemberColumns = AdminMemberColumns{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewAdminMemberDao creates and returns a new DAO object for table data access.
|
// NewAdminMemberDao creates and returns a new DAO object for table data access.
|
||||||
func NewAdminMemberDao() *AdminMemberDao {
|
func NewAdminMemberDao(handlers ...gdb.ModelHandler) *AdminMemberDao {
|
||||||
return &AdminMemberDao{
|
return &AdminMemberDao{
|
||||||
group: "default",
|
group: "default",
|
||||||
table: "hg_admin_member",
|
table: "hg_admin_member",
|
||||||
columns: adminMemberColumns,
|
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 {
|
func (dao *AdminMemberDao) DB() gdb.DB {
|
||||||
return g.DB(dao.group)
|
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 {
|
func (dao *AdminMemberDao) Table() string {
|
||||||
return dao.table
|
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 {
|
func (dao *AdminMemberDao) Columns() AdminMemberColumns {
|
||||||
return dao.columns
|
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 {
|
func (dao *AdminMemberDao) Group() string {
|
||||||
return dao.group
|
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 {
|
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.
|
// 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.
|
// 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.
|
// 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) {
|
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)
|
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"
|
"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 {
|
type AdminMemberPostDao struct {
|
||||||
table string // table is the underlying table name of the DAO.
|
table string // table is the underlying table name of the DAO.
|
||||||
group string // group is the database configuration group name of current 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.
|
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 {
|
type AdminMemberPostColumns struct {
|
||||||
MemberId string // 管理员ID
|
MemberId string // 管理员ID
|
||||||
PostId 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{
|
var adminMemberPostColumns = AdminMemberPostColumns{
|
||||||
MemberId: "member_id",
|
MemberId: "member_id",
|
||||||
PostId: "post_id",
|
PostId: "post_id",
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewAdminMemberPostDao creates and returns a new DAO object for table data access.
|
// NewAdminMemberPostDao creates and returns a new DAO object for table data access.
|
||||||
func NewAdminMemberPostDao() *AdminMemberPostDao {
|
func NewAdminMemberPostDao(handlers ...gdb.ModelHandler) *AdminMemberPostDao {
|
||||||
return &AdminMemberPostDao{
|
return &AdminMemberPostDao{
|
||||||
group: "default",
|
group: "default",
|
||||||
table: "hg_admin_member_post",
|
table: "hg_admin_member_post",
|
||||||
columns: adminMemberPostColumns,
|
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 {
|
func (dao *AdminMemberPostDao) DB() gdb.DB {
|
||||||
return g.DB(dao.group)
|
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 {
|
func (dao *AdminMemberPostDao) Table() string {
|
||||||
return dao.table
|
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 {
|
func (dao *AdminMemberPostDao) Columns() AdminMemberPostColumns {
|
||||||
return dao.columns
|
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 {
|
func (dao *AdminMemberPostDao) Group() string {
|
||||||
return dao.group
|
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 {
|
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.
|
// 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.
|
// 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.
|
// 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) {
|
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)
|
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