mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-01-23 02:40:23 +08:00
发布v2.7.6版本
This commit is contained in:
parent
aff0ff3af5
commit
773f26b479
@ -11,20 +11,32 @@
|
||||
|
||||
> 如果升级(覆盖)代码后打开会出现 sql 报错, 请检查更新的数据库格式或自行调整
|
||||
|
||||
|
||||
### v2.7.6
|
||||
updated 2023.06.19
|
||||
|
||||
- 优化:gf版本升级到v2.4.3
|
||||
- 修复:部门管理查询空指针问题
|
||||
- 优化:附件md5生成方式调整(与更新前已上传的文件md5不兼容,如果业务有影响请注意调整)
|
||||
|
||||
|
||||
### v2.7.3
|
||||
updated 2023.05.14
|
||||
|
||||
- 增加:增加注册、手机号登录、二维码邀请注册功能
|
||||
- 优化:优化管理员业务模块验证唯一属性接口,将登录相关功能拆分到管理员基础模块中
|
||||
- 移除:移除web端mock插件
|
||||
|
||||
### v2.6.10
|
||||
updated 2023.05.12
|
||||
|
||||
- 增加:增加jwt+缓存驱动实现的令牌认证,支持自动续约、可控过期失效策略
|
||||
- 移除:移除旧jwt功能库
|
||||
- 移除:移除`decimal`、`mahonia` package
|
||||
|
||||
### v2.6.7
|
||||
updated 2023.05.10
|
||||
|
||||
- 增加:增加支付网关:集成支付宝、微信支付、QQ支付,可通过后台直接配置参数
|
||||
- 增加:增加资金管理模块,包含在线充值、申请提现、资金变动明细功能
|
||||
- 增加:增加redis延迟队列
|
||||
@ -40,9 +52,9 @@ updated 2023.05.10
|
||||
- 修复:修复本地缓存当缓存不存在时的异常错误问题
|
||||
- 修复:修复访问日志偶尔出现无法记录问题
|
||||
|
||||
|
||||
### v2.5.3
|
||||
updated 2023.04.10
|
||||
|
||||
- 优化:优化IP地理位置定位,增加地理位置缓存,避免相同IP并发操作
|
||||
- 优化:优化日志管理中相关列表字段过多在小屏设备列表不显示滚动条情况
|
||||
- 增加:增加短信驱动:腾讯云短信,可通过后台一键切换
|
||||
@ -50,6 +62,7 @@ updated 2023.04.10
|
||||
|
||||
### v2.4.9
|
||||
updated 2023.04.05
|
||||
|
||||
- 优化:优化全局日志数据加载和分页加载,大分页增加分批次加载
|
||||
- 优化:优化TCP服务认证,超出多端登录上限时直接踢掉所有在线让其重连
|
||||
- 增加:增加上传驱动:腾讯云cos、阿里云oss、七牛云对象存储
|
||||
@ -58,11 +71,13 @@ updated 2023.04.05
|
||||
|
||||
### v2.4.4
|
||||
updated 2023.03.16
|
||||
|
||||
- 优化:优化代码生成多库生成时的菜单sql默认指向默认数据库分组
|
||||
- 优化:优化TCP服务认证机制
|
||||
|
||||
### v2.4.2
|
||||
updated 2023.03.11
|
||||
|
||||
- 修复:修复字典管理列表无法添加/编辑问题
|
||||
- 优化:优化代码生成文档
|
||||
- 优化:优化部门树形选项排序问题
|
||||
|
@ -7,46 +7,13 @@ package menu
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/internal/model/input/adminin"
|
||||
)
|
||||
|
||||
// MaxSortReq 菜单最大排序
|
||||
type MaxSortReq struct {
|
||||
g.Meta `path:"/menu/maxSort" method:"get" tags:"菜单" summary:"菜单最大排序"`
|
||||
Id int64 `json:"id" dc:"菜单ID"`
|
||||
}
|
||||
|
||||
type MaxSortRes struct {
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
}
|
||||
|
||||
// CodeUniqueReq 菜单编码是否唯一
|
||||
type CodeUniqueReq struct {
|
||||
g.Meta `path:"/menu/code_unique" method:"get" tags:"菜单" summary:"菜单编码是否唯一"`
|
||||
Code string `json:"code" v:"required#菜单编码不能为空" dc:"菜单编码"`
|
||||
Id int64 `json:"id" dc:"菜单ID"`
|
||||
}
|
||||
|
||||
type CodeUniqueRes struct {
|
||||
IsUnique bool `json:"is_unique" dc:"是否唯一"`
|
||||
}
|
||||
|
||||
// NameUniqueReq 菜单名称是否唯一
|
||||
type NameUniqueReq struct {
|
||||
g.Meta `path:"/menu/name_unique" method:"get" tags:"菜单" summary:"菜单名称是否唯一"`
|
||||
Name string `json:"name" v:"required#菜单名称不能为空" dc:"菜单名称"`
|
||||
Id int64 `json:"id" dc:"菜单ID"`
|
||||
}
|
||||
|
||||
type NameUniqueRes struct {
|
||||
IsUnique bool `json:"is_unique" dc:"是否唯一"`
|
||||
}
|
||||
|
||||
// EditReq 修改/新增菜单
|
||||
type EditReq struct {
|
||||
g.Meta `path:"/menu/edit" method:"post" tags:"菜单" summary:"修改/新增菜单"`
|
||||
entity.AdminMenu
|
||||
adminin.MenuEditInp
|
||||
}
|
||||
|
||||
type EditRes struct{}
|
||||
@ -54,26 +21,15 @@ type EditRes struct{}
|
||||
// DeleteReq 删除菜单
|
||||
type DeleteReq struct {
|
||||
g.Meta `path:"/menu/delete" method:"post" tags:"菜单" summary:"删除菜单"`
|
||||
Id interface{} `json:"id" v:"required#菜单ID不能为空" dc:"菜单ID"`
|
||||
adminin.MenuDeleteInp
|
||||
}
|
||||
|
||||
type DeleteRes struct{}
|
||||
|
||||
// ViewReq 获取指定菜单信息
|
||||
type ViewReq struct {
|
||||
g.Meta `path:"/menu/view" method:"get" tags:"菜单" summary:"获取指定菜单信息"`
|
||||
Id string `json:"id" v:"required#菜单ID不能为空" dc:"菜单ID"`
|
||||
}
|
||||
|
||||
type ViewRes struct {
|
||||
*entity.AdminMenu
|
||||
}
|
||||
|
||||
// ListReq 获取菜单列表
|
||||
type ListReq struct {
|
||||
g.Meta `path:"/menu/list" method:"get" tags:"菜单" summary:"获取菜单列表"`
|
||||
form.PageReq
|
||||
Pid int64 `json:"pid" dc:"父ID"`
|
||||
adminin.MenuListInp
|
||||
}
|
||||
|
||||
type ListRes struct {
|
||||
|
@ -13,10 +13,10 @@ require (
|
||||
github.com/casbin/casbin/v2 v2.55.0
|
||||
github.com/forgoer/openssl v1.4.0
|
||||
github.com/go-pay/gopay v1.5.91
|
||||
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.4.1
|
||||
github.com/gogf/gf/contrib/nosql/redis/v2 v2.4.1
|
||||
github.com/gogf/gf/contrib/trace/jaeger/v2 v2.4.2
|
||||
github.com/gogf/gf/v2 v2.4.2
|
||||
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.4.3
|
||||
github.com/gogf/gf/contrib/nosql/redis/v2 v2.4.3
|
||||
github.com/gogf/gf/contrib/trace/jaeger/v2 v2.4.3
|
||||
github.com/gogf/gf/v2 v2.4.3
|
||||
github.com/golang-jwt/jwt/v5 v5.0.0
|
||||
github.com/gorilla/websocket v1.5.0
|
||||
github.com/kayon/iploc v0.0.0-20200312105652-bda3e968a794
|
||||
@ -30,12 +30,13 @@ require (
|
||||
github.com/tencentyun/cos-go-sdk-v5 v0.7.41
|
||||
github.com/ufilesdk-dev/ufile-gosdk v1.0.3
|
||||
github.com/xuri/excelize/v2 v2.6.0
|
||||
go.opentelemetry.io/otel v1.16.0
|
||||
golang.org/x/tools v0.7.0
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/BurntSushi/toml v1.2.1 // indirect
|
||||
github.com/BurntSushi/toml v1.3.2 // indirect
|
||||
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible // indirect
|
||||
github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4 // indirect
|
||||
github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68 // indirect
|
||||
@ -82,7 +83,7 @@ require (
|
||||
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
|
||||
github.com/magiconair/properties v1.8.7 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.18 // indirect
|
||||
github.com/mattn/go-isatty v0.0.19 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.14 // indirect
|
||||
github.com/mitchellh/mapstructure v1.4.3 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
@ -108,18 +109,18 @@ require (
|
||||
github.com/xuri/efp v0.0.0-20220407160117-ad0f7a785be8 // indirect
|
||||
github.com/xuri/nfp v0.0.0-20220409054826-5e722a1d9e22 // indirect
|
||||
github.com/yusufpapurcu/wmi v1.2.2 // indirect
|
||||
go.opentelemetry.io/otel v1.15.1 // indirect
|
||||
go.opentelemetry.io/otel/exporters/jaeger v1.7.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.15.1 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.15.1 // indirect
|
||||
go.opentelemetry.io/otel/exporters/jaeger v1.16.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.16.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.16.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.16.0 // indirect
|
||||
go.uber.org/atomic v1.7.0 // indirect
|
||||
golang.org/x/crypto v0.7.0 // indirect
|
||||
golang.org/x/crypto v0.10.0 // indirect
|
||||
golang.org/x/image v0.0.0-20211028202545-6944b10bf410 // indirect
|
||||
golang.org/x/mod v0.9.0 // indirect
|
||||
golang.org/x/net v0.10.0 // indirect
|
||||
golang.org/x/net v0.11.0 // indirect
|
||||
golang.org/x/sync v0.1.0 // indirect
|
||||
golang.org/x/sys v0.8.0 // indirect
|
||||
golang.org/x/text v0.9.0 // indirect
|
||||
golang.org/x/sys v0.9.0 // indirect
|
||||
golang.org/x/text v0.10.0 // indirect
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
|
||||
gopkg.in/ini.v1 v1.56.0 // indirect
|
||||
stathat.com/c/consistent v1.0.0 // indirect
|
||||
|
@ -33,8 +33,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
|
||||
github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=
|
||||
github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
|
||||
github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
|
||||
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible h1:1G1pk05UrOh0NlF1oeaaix1x8XzrfjIDK47TY0Zehcw=
|
||||
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
|
||||
@ -168,15 +168,14 @@ github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrt
|
||||
github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
|
||||
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
||||
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
|
||||
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.4.1 h1:ra6aO6+KUufCg9eK52oj6Q2SnCdrmkSZF9pd32EIivQ=
|
||||
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.4.1/go.mod h1:xubKxCvgbPt9r4yD3ecJoP3DC3sHqcJoMyS0eX837Zg=
|
||||
github.com/gogf/gf/contrib/nosql/redis/v2 v2.4.1 h1:PzAu6efos26gXyBO+aaNZ40hlNsA2T/qLOgP2RgIFaM=
|
||||
github.com/gogf/gf/contrib/nosql/redis/v2 v2.4.1/go.mod h1:0t7pBtXdfuemskzkdxyC2y9nUG63wdldvGRCaQiJ+MM=
|
||||
github.com/gogf/gf/contrib/trace/jaeger/v2 v2.4.2 h1:ib0xrG6SIxOWigUzoFo7p/Nb41CrC513pMFvcN4MAWg=
|
||||
github.com/gogf/gf/contrib/trace/jaeger/v2 v2.4.2/go.mod h1:Ur1/JBxoFOqRTlFDiOjCINZiAOdEIJRw6nZ69zIceQ8=
|
||||
github.com/gogf/gf/v2 v2.4.1/go.mod h1:tsbmtwcAl2chcYoq/fP9W2FZf06aw4i89X34nbSHo9Y=
|
||||
github.com/gogf/gf/v2 v2.4.2 h1:31ekx+YKisG84/iEC2Ih6lB+g92+sB9R+VrfIbqfpac=
|
||||
github.com/gogf/gf/v2 v2.4.2/go.mod h1:tsbmtwcAl2chcYoq/fP9W2FZf06aw4i89X34nbSHo9Y=
|
||||
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.4.3 h1:KQ+NbjzRnc6vI59txxb7xh1z7XUNSECuVrKagunpdNU=
|
||||
github.com/gogf/gf/contrib/drivers/mysql/v2 v2.4.3/go.mod h1:6X8mwgoByuHnal8X+iLYWvtQQf5ONfOUgsXd9309rJ8=
|
||||
github.com/gogf/gf/contrib/nosql/redis/v2 v2.4.3 h1:mDOAJJ3H6LSPdAR+0urO5S5WpglVFGuZTQx31L3o01Y=
|
||||
github.com/gogf/gf/contrib/nosql/redis/v2 v2.4.3/go.mod h1:t/9bT/mPQfoO4IhXTeGpPXooQ0STSoe/4ZspJLJoGug=
|
||||
github.com/gogf/gf/contrib/trace/jaeger/v2 v2.4.3 h1:yUNE2/LiACU36uFNeSEISwtWVyEQtFhRV0tVec8hOTU=
|
||||
github.com/gogf/gf/contrib/trace/jaeger/v2 v2.4.3/go.mod h1:Q/BRwWQUKKRbrr3blYV2M5ukNXJHlITJJLCw0RNfjss=
|
||||
github.com/gogf/gf/v2 v2.4.3 h1:OP91EICmypAEaEpwSyjFnAZtTfcmeKXJQnPP4FZR/BM=
|
||||
github.com/gogf/gf/v2 v2.4.3/go.mod h1:tsbmtwcAl2chcYoq/fP9W2FZf06aw4i89X34nbSHo9Y=
|
||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE=
|
||||
github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
|
||||
@ -325,8 +324,8 @@ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovk
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
||||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||
github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98=
|
||||
github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
|
||||
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||
github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU=
|
||||
github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
||||
@ -451,8 +450,8 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
|
||||
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.194/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.633 h1:Yj8s35IjbgaHp4Ic9BZLVGWdN2gXBMtwYi1JJ+qYbrc=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.633/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y=
|
||||
@ -503,16 +502,19 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk=
|
||||
go.opentelemetry.io/otel v1.15.1 h1:3Iwq3lfRByPaws0f6bU3naAqOR1n5IeDWd9390kWHa8=
|
||||
go.opentelemetry.io/otel v1.15.1/go.mod h1:mHHGEHVDLal6YrKMmk9LqC4a3sF5g+fHfrttQIB1NTc=
|
||||
go.opentelemetry.io/otel/exporters/jaeger v1.7.0 h1:wXgjiRldljksZkZrldGVe6XrG9u3kYDyQmkZwmm5dI0=
|
||||
go.opentelemetry.io/otel v1.16.0 h1:Z7GVAX/UkAXPKsy94IU+i6thsQS4nb7LviLpnaNeW8s=
|
||||
go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4=
|
||||
go.opentelemetry.io/otel/exporters/jaeger v1.7.0/go.mod h1:PwQAOqBgqbLQRKlj466DuD2qyMjbtcPpfPfj+AqbSBs=
|
||||
go.opentelemetry.io/otel/exporters/jaeger v1.16.0 h1:YhxxmXZ011C0aDZKoNw+juVWAmEfv/0W2XBOv9aHTaA=
|
||||
go.opentelemetry.io/otel/exporters/jaeger v1.16.0/go.mod h1:grYbBo/5afWlPpdPZYhyn78Bk04hnvxn2+hvxQhKIQM=
|
||||
go.opentelemetry.io/otel/metric v1.16.0 h1:RbrpwVG1Hfv85LgnZ7+txXioPDoh6EdbZHo26Q3hqOo=
|
||||
go.opentelemetry.io/otel/metric v1.16.0/go.mod h1:QE47cpOmkwipPiefDwo2wDzwJrlfxxNYodqc4xnGCo4=
|
||||
go.opentelemetry.io/otel/sdk v1.7.0/go.mod h1:uTEOTwaqIVuTGiJN7ii13Ibp75wJmYUDe374q6cZwUU=
|
||||
go.opentelemetry.io/otel/sdk v1.15.1 h1:5FKR+skgpzvhPQHIEfcwMYjCBr14LWzs3uSqKiQzETI=
|
||||
go.opentelemetry.io/otel/sdk v1.15.1/go.mod h1:8rVtxQfrbmbHKfqzpQkT5EzZMcbMBwTzNAggbEAM0KA=
|
||||
go.opentelemetry.io/otel/sdk v1.16.0 h1:Z1Ok1YsijYL0CSJpHt4cS3wDDh7p572grzNrBMiMWgE=
|
||||
go.opentelemetry.io/otel/sdk v1.16.0/go.mod h1:tMsIuKXuuIWPBAOrH+eHtvhTL+SntFtXF9QD68aP6p4=
|
||||
go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU=
|
||||
go.opentelemetry.io/otel/trace v1.15.1 h1:uXLo6iHJEzDfrNC0L0mNjItIp06SyaBQxu5t3xMlngY=
|
||||
go.opentelemetry.io/otel/trace v1.15.1/go.mod h1:IWdQG/5N1x7f6YUlmdLeJvH9yxtuJAfc4VW5Agv9r/8=
|
||||
go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZEu5MQs=
|
||||
go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0=
|
||||
go.uber.org/atomic v1.5.1/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
|
||||
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
|
||||
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
||||
@ -530,8 +532,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y
|
||||
golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20220408190544-5352b0902921/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A=
|
||||
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
|
||||
golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM=
|
||||
golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
@ -607,8 +609,8 @@ golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qx
|
||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20220407224826-aac1ed45d8e3/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||
golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||
golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU=
|
||||
golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
@ -689,8 +691,8 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s=
|
||||
golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
@ -701,8 +703,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.3.8-0.20211105212822-18b340fc7af2/go.mod h1:EFNZuWvGYxIRUEX+K8UmCFwYmZjqcrnq15ZuVldZkZ0=
|
||||
golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58=
|
||||
golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs=
|
||||
|
@ -7,5 +7,5 @@ package consts
|
||||
|
||||
// VersionApp HotGo版本
|
||||
const (
|
||||
VersionApp = "2.7.3"
|
||||
VersionApp = "2.7.6"
|
||||
)
|
||||
|
@ -7,8 +7,11 @@ package admin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"hotgo/api/admin/menu"
|
||||
"hotgo/internal/model/input/adminin"
|
||||
"hotgo/internal/service"
|
||||
"hotgo/utility/validate"
|
||||
)
|
||||
|
||||
// Menu 菜单
|
||||
@ -18,44 +21,47 @@ var (
|
||||
|
||||
type cMenu struct{}
|
||||
|
||||
// MaxSort 最大排序
|
||||
func (c *cMenu) MaxSort(ctx context.Context, req *menu.MaxSortReq) (res *menu.MaxSortRes, err error) {
|
||||
res, err = service.AdminMenu().MaxSort(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// NameUnique 菜单名称是否唯一
|
||||
func (c *cMenu) NameUnique(ctx context.Context, req *menu.NameUniqueReq) (res *menu.NameUniqueRes, err error) {
|
||||
res, err = service.AdminMenu().NameUnique(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// CodeUnique 菜单编码是否唯一
|
||||
func (c *cMenu) CodeUnique(ctx context.Context, req *menu.CodeUniqueReq) (res *menu.CodeUniqueRes, err error) {
|
||||
res, err = service.AdminMenu().CodeUnique(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete 删除
|
||||
func (c *cMenu) Delete(ctx context.Context, req *menu.DeleteReq) (res *menu.DeleteRes, err error) {
|
||||
err = service.AdminMenu().Delete(ctx, req)
|
||||
var in adminin.MenuDeleteInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.AdminMenu().Delete(ctx, in)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 更新
|
||||
func (c *cMenu) Edit(ctx context.Context, req *menu.EditReq) (res *menu.EditRes, err error) {
|
||||
err = service.AdminMenu().Edit(ctx, req)
|
||||
return
|
||||
}
|
||||
var in adminin.MenuEditInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
// View 获取信息
|
||||
func (c *cMenu) View(ctx context.Context, req *menu.ViewReq) (res *menu.ViewRes, err error) {
|
||||
res, err = service.AdminMenu().View(ctx, req)
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = service.AdminMenu().Edit(ctx, in)
|
||||
return
|
||||
}
|
||||
|
||||
// List 获取列表
|
||||
func (c *cMenu) List(ctx context.Context, req *menu.ListReq) (res menu.ListRes, err error) {
|
||||
res.List, err = service.AdminMenu().List(ctx, req)
|
||||
var in adminin.MenuListInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res.List, err = service.AdminMenu().List(ctx, in)
|
||||
return
|
||||
}
|
||||
|
@ -5,11 +5,7 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/dao/internal"
|
||||
"hotgo/internal/model/entity"
|
||||
)
|
||||
|
||||
// internalAdminMenuDao is internal type for wrapping internal DAO implements.
|
||||
@ -27,45 +23,3 @@ var (
|
||||
internal.NewAdminMenuDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// IsUniqueTitle 判断标题是否唯一
|
||||
func (dao *adminMenuDao) IsUniqueTitle(ctx context.Context, id int64, title string) (bool, error) {
|
||||
var data *entity.AdminMenu
|
||||
m := dao.Ctx(ctx).Where("title", title)
|
||||
|
||||
if id > 0 {
|
||||
m = m.WhereNot("id", id)
|
||||
}
|
||||
|
||||
if err := m.Scan(&data); err != nil {
|
||||
err = gerror.Wrap(err, consts.ErrorORM)
|
||||
return false, err
|
||||
}
|
||||
|
||||
if data == nil {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
return false, nil
|
||||
}
|
||||
|
||||
// IsUniqueName 判断编码是否唯一
|
||||
func (dao *adminMenuDao) IsUniqueName(ctx context.Context, id int64, name string) (bool, error) {
|
||||
var data *entity.AdminMenu
|
||||
m := dao.Ctx(ctx).Where("name", name)
|
||||
|
||||
if id > 0 {
|
||||
m = m.WhereNot("id", id)
|
||||
}
|
||||
|
||||
if err := m.Scan(&data); err != nil {
|
||||
err = gerror.Wrap(err, consts.ErrorORM)
|
||||
return false, err
|
||||
}
|
||||
|
||||
if data == nil {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
return false, nil
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ package dao
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/dao/internal"
|
||||
"hotgo/internal/model/entity"
|
||||
@ -53,20 +54,12 @@ func (dao *sysDictTypeDao) IsUniqueType(ctx context.Context, id int64, typeName
|
||||
|
||||
// GetTypes 获取指定ID的所有类型标识,包含下级
|
||||
func (dao *sysDictTypeDao) GetTypes(ctx context.Context, id int64) (types []string, err error) {
|
||||
m := dao.Ctx(ctx).Fields("type").Where("id", id).
|
||||
columns, err := dao.Ctx(ctx).Fields("type").
|
||||
Where("id", id).
|
||||
WhereOr("pid", id).
|
||||
Where("status", consts.StatusEnabled)
|
||||
list, err := m.Array()
|
||||
if err != nil {
|
||||
err = gerror.Wrap(err, consts.ErrorORM)
|
||||
return types, err
|
||||
}
|
||||
|
||||
for _, v := range list {
|
||||
types = append(types, v.String())
|
||||
}
|
||||
|
||||
return types, nil
|
||||
Where("status", consts.StatusEnabled).All()
|
||||
types = g.NewVar(columns).Strings()
|
||||
return
|
||||
}
|
||||
|
||||
// GetType 获取指定ID的类型标识
|
||||
|
@ -31,11 +31,6 @@ func Init(ctx context.Context) {
|
||||
// 设置服务日志处理
|
||||
g.Log().SetHandlers(LoggingServeLogHandler)
|
||||
|
||||
if _, err := g.Cfg().Get(ctx, "hotgo.debug"); err != nil {
|
||||
g.Log().Fatal(ctx, "配置读取异常:", err, "\r\n你确定 config/config.yaml 文件存在且格式正确吗?\r\n")
|
||||
return
|
||||
}
|
||||
|
||||
// 默认上海时区
|
||||
if err := gtime.SetTimeZone("Asia/Shanghai"); err != nil {
|
||||
g.Log().Fatalf(ctx, "时区设置异常 err:%+v", err)
|
||||
|
@ -6,6 +6,8 @@
|
||||
package storager
|
||||
|
||||
import (
|
||||
"crypto/md5"
|
||||
"fmt"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
@ -158,3 +160,20 @@ func UploadFileByte(file *ghttp.UploadFile) ([]byte, error) {
|
||||
}
|
||||
return io.ReadAll(open)
|
||||
}
|
||||
|
||||
// CalcFileMd5 计算文件md5值
|
||||
func CalcFileMd5(file *ghttp.UploadFile) (string, error) {
|
||||
f, err := file.Open()
|
||||
if err != nil {
|
||||
err = gerror.Wrapf(err, `os.Open failed for name "%s"`, file.Filename)
|
||||
return "", err
|
||||
}
|
||||
defer f.Close()
|
||||
h := md5.New()
|
||||
_, err = io.Copy(h, f)
|
||||
if err != nil {
|
||||
err = gerror.Wrap(err, `io.Copy failed`)
|
||||
return "", err
|
||||
}
|
||||
return fmt.Sprintf("%x", h.Sum(nil)), nil
|
||||
}
|
||||
|
@ -7,12 +7,10 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v2/util/grand"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/library/contexts"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/utility/encrypt"
|
||||
"hotgo/utility/url"
|
||||
"hotgo/utility/validate"
|
||||
"strconv"
|
||||
@ -163,12 +161,8 @@ func GetFileMeta(file *ghttp.UploadFile) (meta *FileMeta, err error) {
|
||||
}
|
||||
meta.NaiveType = naiveType
|
||||
|
||||
// 文件hash
|
||||
b, err := UploadFileByte(file)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
meta.Md5 = encrypt.Md5ToString(gconv.String(encrypt.Hash32(b)))
|
||||
// 计算md5值
|
||||
meta.Md5, err = CalcFileMd5(file)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ func init() {
|
||||
service.RegisterAdminCash(NewAdminCash())
|
||||
}
|
||||
|
||||
// View 获取指定字典类型信息
|
||||
// View 获取指定提现信息
|
||||
func (s *sAdminCash) View(ctx context.Context, in adminin.CashViewInp) (res *adminin.CashViewModel, err error) {
|
||||
if !service.AdminMember().VerifySuperId(ctx, contexts.GetUserId(ctx)) {
|
||||
err = gerror.New("没有访问权限")
|
||||
|
@ -68,7 +68,6 @@ func (s *sAdminDept) Edit(ctx context.Context, in adminin.DeptEditInp) (err erro
|
||||
|
||||
// 修改
|
||||
if in.Id > 0 {
|
||||
|
||||
// 获取父级tree
|
||||
var pTree gdb.Value
|
||||
pTree, err = dao.AdminDept.Ctx(ctx).Where("id", in.Pid).Fields("tree").Value()
|
||||
@ -87,7 +86,6 @@ func (s *sAdminDept) Edit(ctx context.Context, in adminin.DeptEditInp) (err erro
|
||||
// 如果当前部门有子级,更新子级tree关系树
|
||||
return updateChildrenTree(ctx, in.Id, in.Level, in.Tree)
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@ -98,20 +96,18 @@ func (s *sAdminDept) Edit(ctx context.Context, in adminin.DeptEditInp) (err erro
|
||||
|
||||
func updateChildrenTree(ctx context.Context, _id int64, _level int, _tree string) (err error) {
|
||||
var list []*entity.AdminDept
|
||||
err = dao.AdminDept.Ctx(ctx).Where("pid", _id).Scan(&list)
|
||||
if err != nil {
|
||||
if err = dao.AdminDept.Ctx(ctx).Where("pid", _id).Scan(&list); err != nil || list == nil {
|
||||
return
|
||||
}
|
||||
for _, child := range list {
|
||||
child.Level = _level + 1
|
||||
child.Tree = tree.GenLabel(_tree, child.Id)
|
||||
|
||||
_, err = dao.AdminDept.Ctx(ctx).Where("id", child.Id).Data("level", child.Level, "tree", child.Tree).Update()
|
||||
if err != nil {
|
||||
return err
|
||||
if _, err = dao.AdminDept.Ctx(ctx).Where("id", child.Id).Data("level", child.Level, "tree", child.Tree).Update(); err != nil {
|
||||
return
|
||||
}
|
||||
err = updateChildrenTree(ctx, child.Id, child.Level, child.Tree)
|
||||
if err != nil {
|
||||
|
||||
if err = updateChildrenTree(ctx, child.Id, child.Level, child.Tree); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
@ -121,7 +117,7 @@ func updateChildrenTree(ctx context.Context, _id int64, _level int, _tree string
|
||||
// Status 更新部门状态
|
||||
func (s *sAdminDept) Status(ctx context.Context, in adminin.DeptStatusInp) (err error) {
|
||||
if _, err = dao.AdminDept.Ctx(ctx).Where("id", in.Id).Data("status", in.Status).Update(); err != nil {
|
||||
err = gerror.Wrap(err, consts.ErrorORM)
|
||||
err = gerror.Wrap(err, "更新部门状态失败!")
|
||||
}
|
||||
return
|
||||
}
|
||||
@ -130,7 +126,7 @@ func (s *sAdminDept) Status(ctx context.Context, in adminin.DeptStatusInp) (err
|
||||
func (s *sAdminDept) MaxSort(ctx context.Context, in adminin.DeptMaxSortInp) (res *adminin.DeptMaxSortModel, err error) {
|
||||
if in.Id > 0 {
|
||||
if err = dao.AdminDept.Ctx(ctx).Where("id", in.Id).Order("sort desc").Scan(&res); err != nil {
|
||||
err = gerror.Wrap(err, consts.ErrorORM)
|
||||
err = gerror.Wrap(err, "获取部门数据异常!")
|
||||
return
|
||||
}
|
||||
}
|
||||
@ -143,9 +139,11 @@ func (s *sAdminDept) MaxSort(ctx context.Context, in adminin.DeptMaxSortInp) (re
|
||||
return
|
||||
}
|
||||
|
||||
// View 获取指定字典类型信息
|
||||
// View 获取指定部门信息
|
||||
func (s *sAdminDept) View(ctx context.Context, in adminin.DeptViewInp) (res *adminin.DeptViewModel, err error) {
|
||||
err = dao.AdminDept.Ctx(ctx).Where("id", in.Id).Scan(&res)
|
||||
if err = dao.AdminDept.Ctx(ctx).Where("id", in.Id).Scan(&res); err != nil {
|
||||
err = gerror.Wrap(err, "获取部门信息失败!")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@ -165,17 +163,19 @@ func (s *sAdminDept) Option(ctx context.Context, in adminin.DeptOptionInp) (res
|
||||
|
||||
totalCount, err = mod.Count()
|
||||
if err != nil {
|
||||
err = gerror.Wrap(err, consts.ErrorORM)
|
||||
err = gerror.Wrap(err, "获取部门数据行失败!")
|
||||
return
|
||||
}
|
||||
|
||||
if err = mod.Page(in.Page, in.PerPage).Order("sort asc,id asc").Scan(&models); err != nil {
|
||||
err = gerror.Wrap(err, consts.ErrorORM)
|
||||
err = gerror.Wrap(err, "获取部门数据失败!")
|
||||
return
|
||||
}
|
||||
|
||||
res = new(adminin.DeptOptionModel)
|
||||
res.List = s.treeList(pid, models)
|
||||
if models != nil {
|
||||
res.List = s.treeList(pid, models)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@ -190,42 +190,37 @@ func (s *sAdminDept) List(ctx context.Context, in adminin.DeptListInp) (res *adm
|
||||
|
||||
// 部门名称
|
||||
if in.Name != "" {
|
||||
values, err := dao.AdminDept.Ctx(ctx).Fields("pid").WhereLike("name", "%"+in.Name+"%").Array()
|
||||
columns, err := dao.AdminDept.Ctx(ctx).Fields("pid").WhereLike("name", "%"+in.Name+"%").All()
|
||||
if err != nil {
|
||||
err = gerror.Wrap(err, consts.ErrorORM)
|
||||
err = gerror.Wrap(err, "过滤部门列表失败-1!")
|
||||
return nil, err
|
||||
}
|
||||
for i := 0; i < len(values); i++ {
|
||||
ids = append(ids, values[i].Int64())
|
||||
pids = append(pids, values[i].Int64())
|
||||
}
|
||||
|
||||
ds := g.NewVar(columns.Array()).Int64s()
|
||||
ids = append(ids, ds...)
|
||||
pids = append(pids, ds...)
|
||||
if len(ids) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
}
|
||||
|
||||
if in.Code != "" {
|
||||
values, err := dao.AdminDept.Ctx(ctx).Fields("pid").
|
||||
WhereLike("code", "%"+in.Code+"%").Array()
|
||||
columns, err := dao.AdminDept.Ctx(ctx).Fields("pid").WhereLike("code", "%"+in.Code+"%").All()
|
||||
if err != nil {
|
||||
err = gerror.Wrap(err, consts.ErrorORM)
|
||||
err = gerror.Wrap(err, "过滤部门列表失败-2!")
|
||||
return nil, err
|
||||
}
|
||||
for i := 0; i < len(values); i++ {
|
||||
ids = append(ids, values[i].Int64())
|
||||
pids = append(pids, values[i].Int64())
|
||||
}
|
||||
|
||||
ds := g.NewVar(columns.Array()).Int64s()
|
||||
ids = append(ids, ds...)
|
||||
pids = append(pids, ds...)
|
||||
if len(ids) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
}
|
||||
|
||||
if len(ids) > 0 {
|
||||
ids = convert.UniqueSlice(ids)
|
||||
pids = convert.UniqueSlice(pids)
|
||||
mod = mod.Wheref(`id in (?) or pid in (?)`, ids, pids)
|
||||
mod = mod.Wheref(`id in (?) or pid in (?)`, convert.UniqueSlice(ids), convert.UniqueSlice(pids))
|
||||
}
|
||||
|
||||
if err = mod.Order("pid asc,sort asc").Scan(&models); err != nil {
|
||||
@ -240,13 +235,16 @@ func (s *sAdminDept) List(ctx context.Context, in adminin.DeptListInp) (res *adm
|
||||
|
||||
// GetName 获取部门名称
|
||||
func (s *sAdminDept) GetName(ctx context.Context, id int64) (name string, err error) {
|
||||
var data entity.AdminDept
|
||||
err = dao.AdminDept.Ctx(ctx).Where("id", id).Fields("name").Scan(&data)
|
||||
if err != nil {
|
||||
err = gerror.Wrap(err, consts.ErrorORM)
|
||||
return name, err
|
||||
var data *entity.AdminDept
|
||||
if err = dao.AdminDept.Ctx(ctx).Where("id", id).Fields("name").Scan(&data); err != nil {
|
||||
err = gerror.Wrap(err, "获取部门名称失败!")
|
||||
return
|
||||
}
|
||||
|
||||
if data == nil {
|
||||
err = gerror.Wrap(err, "部门不存在!")
|
||||
return
|
||||
}
|
||||
return data.Name, nil
|
||||
}
|
||||
|
||||
|
@ -584,20 +584,17 @@ func (s *sAdminMember) List(ctx context.Context, in adminin.MemberListInp) (list
|
||||
return
|
||||
}
|
||||
|
||||
for i := 0; i < len(list); i++ {
|
||||
posts, err := dao.AdminMemberPost.Ctx(ctx).
|
||||
for _, v := range list {
|
||||
columns, err := dao.AdminMemberPost.Ctx(ctx).
|
||||
Fields(dao.AdminMemberPost.Columns().PostId).
|
||||
Where(dao.AdminMemberPost.Columns().MemberId, list[i].Id).
|
||||
Array()
|
||||
Where(dao.AdminMemberPost.Columns().MemberId, v.Id).All()
|
||||
|
||||
if err != nil {
|
||||
err = gerror.Wrap(err, "获取用户岗位数据失败!")
|
||||
return nil, 0, err
|
||||
}
|
||||
|
||||
for _, v := range posts {
|
||||
list[i].PostIds = append(list[i].PostIds, v.Int64())
|
||||
}
|
||||
v.PostIds = g.NewVar(columns.Array()).Int64s()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -8,18 +8,18 @@ package admin
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"hotgo/api/admin/menu"
|
||||
"hotgo/api/admin/role"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/dao"
|
||||
"hotgo/internal/library/casbin"
|
||||
"hotgo/internal/library/contexts"
|
||||
"hotgo/internal/library/hgorm"
|
||||
"hotgo/internal/model/do"
|
||||
"hotgo/internal/model/input/adminin"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/internal/service"
|
||||
"hotgo/utility/convert"
|
||||
"hotgo/utility/tree"
|
||||
@ -35,40 +35,9 @@ func init() {
|
||||
service.RegisterAdminMenu(NewAdminMenu())
|
||||
}
|
||||
|
||||
// MaxSort 最大排序
|
||||
func (s *sAdminMenu) MaxSort(ctx context.Context, req *menu.MaxSortReq) (res *menu.MaxSortRes, err error) {
|
||||
if req.Id > 0 {
|
||||
if err = dao.AdminMenu.Ctx(ctx).Where("id", req.Id).Order("sort desc").Scan(&res); err != nil {
|
||||
err = gerror.Wrap(err, consts.ErrorORM)
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
if res == nil {
|
||||
res = new(menu.MaxSortRes)
|
||||
}
|
||||
|
||||
res.Sort = form.DefaultMaxSort(ctx, res.Sort)
|
||||
return
|
||||
}
|
||||
|
||||
// NameUnique 菜单名称是否唯一
|
||||
func (s *sAdminMenu) NameUnique(ctx context.Context, req *menu.NameUniqueReq) (res *menu.NameUniqueRes, err error) {
|
||||
res = new(menu.NameUniqueRes)
|
||||
res.IsUnique, err = dao.AdminMenu.IsUniqueName(ctx, req.Id, req.Name)
|
||||
return
|
||||
}
|
||||
|
||||
// CodeUnique 菜单编码是否唯一
|
||||
func (s *sAdminMenu) CodeUnique(ctx context.Context, req *menu.CodeUniqueReq) (res *menu.CodeUniqueRes, err error) {
|
||||
res = new(menu.CodeUniqueRes)
|
||||
res.IsUnique, err = dao.AdminMenu.IsUniqueName(ctx, req.Id, req.Code)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete 删除
|
||||
func (s *sAdminMenu) Delete(ctx context.Context, req *menu.DeleteReq) (err error) {
|
||||
exist, err := dao.AdminMenu.Ctx(ctx).Where("pid", req.Id).One()
|
||||
func (s *sAdminMenu) Delete(ctx context.Context, in adminin.MenuDeleteInp) (err error) {
|
||||
exist, err := dao.AdminMenu.Ctx(ctx).Where("pid", in.Id).One()
|
||||
if err != nil {
|
||||
err = gerror.Wrap(err, consts.ErrorORM)
|
||||
return err
|
||||
@ -76,74 +45,76 @@ func (s *sAdminMenu) Delete(ctx context.Context, req *menu.DeleteReq) (err error
|
||||
if !exist.IsEmpty() {
|
||||
return gerror.New("请先删除该菜单下的所有菜单!")
|
||||
}
|
||||
_, err = dao.AdminMenu.Ctx(ctx).Where("id", req.Id).Delete()
|
||||
_, err = dao.AdminMenu.Ctx(ctx).Where("id", in.Id).Delete()
|
||||
return
|
||||
}
|
||||
|
||||
// VerifyUnique 验证菜单唯一属性
|
||||
func (s *sAdminMenu) VerifyUnique(ctx context.Context, in adminin.VerifyUniqueInp) (err error) {
|
||||
if in.Where == nil {
|
||||
return
|
||||
}
|
||||
|
||||
cols := dao.AdminMenu.Columns()
|
||||
msgMap := g.MapStrStr{
|
||||
cols.Name: "菜单编码已存在,请换一个",
|
||||
cols.Title: "菜单名称已存在,请换一个",
|
||||
}
|
||||
|
||||
for k, v := range in.Where {
|
||||
if v == "" {
|
||||
continue
|
||||
}
|
||||
message, ok := msgMap[k]
|
||||
if !ok {
|
||||
err = gerror.Newf("字段 [ %v ] 未配置唯一属性验证", k)
|
||||
return
|
||||
}
|
||||
if err = hgorm.IsUnique(ctx, &dao.AdminMenu, g.Map{k: v}, message, in.Id); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 修改/新增
|
||||
func (s *sAdminMenu) Edit(ctx context.Context, req *menu.EditReq) (err error) {
|
||||
var (
|
||||
pidData *do.AdminMenu
|
||||
uniqueName bool
|
||||
uniqueCode bool
|
||||
)
|
||||
|
||||
if req.Title == "" {
|
||||
err = gerror.New("菜单名称不能为空")
|
||||
return err
|
||||
}
|
||||
if req.Type != 3 && req.Path == "" {
|
||||
err = gerror.New("路由地址不能为空")
|
||||
return err
|
||||
}
|
||||
if req.Name == "" {
|
||||
err = gerror.New("路由名称不能为空")
|
||||
return err
|
||||
}
|
||||
|
||||
uniqueName, err = dao.AdminMenu.IsUniqueTitle(ctx, req.Id, req.Title)
|
||||
func (s *sAdminMenu) Edit(ctx context.Context, in adminin.MenuEditInp) (err error) {
|
||||
// 验证唯一性
|
||||
err = s.VerifyUnique(ctx, adminin.VerifyUniqueInp{
|
||||
Where: g.Map{
|
||||
dao.AdminMenu.Columns().Title: in.Title,
|
||||
dao.AdminMenu.Columns().Name: in.Name,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
err = gerror.Wrap(err, consts.ErrorORM)
|
||||
return err
|
||||
}
|
||||
if !uniqueName {
|
||||
err = gerror.New("菜单名称已存在")
|
||||
return err
|
||||
return
|
||||
}
|
||||
|
||||
uniqueCode, err = dao.AdminMenu.IsUniqueName(ctx, req.Id, req.Name)
|
||||
if err != nil {
|
||||
err = gerror.Wrap(err, consts.ErrorORM)
|
||||
return err
|
||||
}
|
||||
if !uniqueCode {
|
||||
err = gerror.New("菜单编码已存在")
|
||||
return err
|
||||
}
|
||||
var pd *do.AdminMenu
|
||||
|
||||
// 维护菜单等级
|
||||
if req.Pid == 0 {
|
||||
req.Level = 1
|
||||
if in.Pid == 0 {
|
||||
in.Level = 1
|
||||
} else {
|
||||
if err = dao.AdminMenu.Ctx(ctx).Where("id", req.Pid).Scan(&pidData); err != nil {
|
||||
if err = dao.AdminMenu.Ctx(ctx).Where("id", in.Pid).Scan(&pd); err != nil {
|
||||
err = gerror.Wrap(err, consts.ErrorORM)
|
||||
return err
|
||||
}
|
||||
if pidData == nil {
|
||||
if pd == nil {
|
||||
return gerror.New("上级菜单信息错误")
|
||||
}
|
||||
req.Level = gconv.Int(pidData.Level) + 1
|
||||
in.Level = gconv.Int(pd.Level) + 1
|
||||
}
|
||||
|
||||
// 修改
|
||||
req.UpdatedAt = gtime.Now()
|
||||
if req.Id > 0 {
|
||||
if req.Pid == req.Id {
|
||||
in.UpdatedAt = gtime.Now()
|
||||
if in.Id > 0 {
|
||||
if in.Pid == in.Id {
|
||||
return gerror.New("上级菜单不能是当前菜单")
|
||||
}
|
||||
_, err = dao.AdminMenu.Ctx(ctx).Where("id", req.Id).Data(req).Update()
|
||||
if err != nil {
|
||||
err = gerror.Wrap(err, consts.ErrorORM)
|
||||
|
||||
if _, err = dao.AdminMenu.Ctx(ctx).Where("id", in.Id).Data(in).Update(); err != nil {
|
||||
err = gerror.Wrap(err, "修改菜单失败!")
|
||||
return err
|
||||
}
|
||||
|
||||
@ -151,23 +122,17 @@ func (s *sAdminMenu) Edit(ctx context.Context, req *menu.EditReq) (err error) {
|
||||
}
|
||||
|
||||
// 新增
|
||||
req.CreatedAt = gtime.Now()
|
||||
_, err = dao.AdminMenu.Ctx(ctx).Data(req).Insert()
|
||||
if err != nil {
|
||||
err = gerror.Wrap(err, consts.ErrorORM)
|
||||
in.CreatedAt = gtime.Now()
|
||||
|
||||
if _, err = dao.AdminMenu.Ctx(ctx).Data(in).Insert(); err != nil {
|
||||
err = gerror.Wrap(err, "新增菜单失败!")
|
||||
return err
|
||||
}
|
||||
return casbin.Refresh(ctx)
|
||||
}
|
||||
|
||||
// View 获取信息
|
||||
func (s *sAdminMenu) View(ctx context.Context, req *menu.ViewReq) (res *menu.ViewRes, err error) {
|
||||
err = dao.AdminMenu.Ctx(ctx).Where("id", req.Id).Scan(&res)
|
||||
return
|
||||
}
|
||||
|
||||
// List 获取菜单列表
|
||||
func (s *sAdminMenu) List(ctx context.Context, req *menu.ListReq) (lists []map[string]interface{}, err error) {
|
||||
func (s *sAdminMenu) List(ctx context.Context, in adminin.MenuListInp) (lists []map[string]interface{}, err error) {
|
||||
var models []*adminin.MenuTree
|
||||
err = dao.AdminMenu.Ctx(ctx).Order("sort asc,id desc").Scan(&models)
|
||||
if err != nil {
|
||||
|
@ -322,19 +322,18 @@ func (s *sAdminNotice) UnreadCount(ctx context.Context, in adminin.NoticeUnreadC
|
||||
|
||||
// messageIds 获取我的消息所有的消息ID
|
||||
func (s *sAdminNotice) messageIds(ctx context.Context, memberId int64) (ids []int64, err error) {
|
||||
array, err := s.Model(ctx, &handler.Option{FilterAuth: false}).
|
||||
columns, err := s.Model(ctx, &handler.Option{FilterAuth: false}).
|
||||
Fields("id").
|
||||
Where("status", consts.StatusEnabled).
|
||||
Where("(`type` IN(?) OR (`type` = ? and JSON_CONTAINS(`receiver`,'"+gconv.String(memberId)+"')))",
|
||||
[]int{consts.NoticeTypeNotify, consts.NoticeTypeNotice}, consts.NoticeTypeLetter,
|
||||
).Array()
|
||||
).All()
|
||||
if err != nil {
|
||||
err = gerror.Wrap(err, "获取我的消息失败!")
|
||||
return
|
||||
}
|
||||
|
||||
for _, v := range array {
|
||||
ids = append(ids, v.Int64())
|
||||
}
|
||||
ids = g.NewVar(columns).Int64s()
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@ func (s *sAdminPost) CodeUnique(ctx context.Context, in adminin.PostCodeUniqueIn
|
||||
return
|
||||
}
|
||||
|
||||
// View 获取指定字典类型信息
|
||||
// View 获取指定岗位信息
|
||||
func (s *sAdminPost) View(ctx context.Context, in adminin.PostViewInp) (res *adminin.PostViewModel, err error) {
|
||||
err = dao.AdminPost.Ctx(ctx).Where("id", in.Id).Scan(&res)
|
||||
return
|
||||
|
@ -141,13 +141,10 @@ func (s *sAdminRole) UpdatePermissions(ctx context.Context, in adminin.UpdatePer
|
||||
return
|
||||
}
|
||||
|
||||
if len(in.MenuIds) == 0 {
|
||||
if in.MenuIds = convert.UniqueSlice(in.MenuIds); len(in.MenuIds) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
// 去重
|
||||
in.MenuIds = convert.UniqueSlice(in.MenuIds)
|
||||
|
||||
list := make(g.List, 0, len(in.MenuIds))
|
||||
for _, v := range in.MenuIds {
|
||||
list = append(list, g.Map{
|
||||
@ -160,7 +157,6 @@ func (s *sAdminRole) UpdatePermissions(ctx context.Context, in adminin.UpdatePer
|
||||
err = gerror.Wrap(err, consts.ErrorORM)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
})
|
||||
|
||||
@ -217,20 +213,18 @@ func (s *sAdminRole) Edit(ctx context.Context, in adminin.RoleEditInp) (err erro
|
||||
|
||||
func updateRoleChildrenTree(ctx context.Context, _id int64, _level int, _tree string) (err error) {
|
||||
var list []*entity.AdminDept
|
||||
err = dao.AdminRole.Ctx(ctx).Where("pid", _id).Scan(&list)
|
||||
if err != nil {
|
||||
if err = dao.AdminRole.Ctx(ctx).Where("pid", _id).Scan(&list); err != nil {
|
||||
return
|
||||
}
|
||||
for _, child := range list {
|
||||
child.Level = _level + 1
|
||||
child.Tree = tree.GenLabel(_tree, child.Id)
|
||||
|
||||
_, err = dao.AdminRole.Ctx(ctx).Where("id", child.Id).Data("level", child.Level, "tree", child.Tree).Update()
|
||||
if err != nil {
|
||||
return err
|
||||
if _, err = dao.AdminRole.Ctx(ctx).Where("id", child.Id).Data("level", child.Level, "tree", child.Tree).Update(); err != nil {
|
||||
return
|
||||
}
|
||||
err = updateRoleChildrenTree(ctx, child.Id, child.Level, child.Tree)
|
||||
if err != nil {
|
||||
|
||||
if err = updateRoleChildrenTree(ctx, child.Id, child.Level, child.Tree); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
@ -6,95 +6,73 @@
|
||||
package adminin
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"hotgo/internal/model"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
)
|
||||
|
||||
// MenuMaxSortReq 菜单最大排序
|
||||
type MenuMaxSortReq struct {
|
||||
g.Meta `path:"/menu/maxSort" method:"get" tags:"菜单" summary:"菜单最大排序"`
|
||||
Id int64 `json:"id" dc:"菜单ID"`
|
||||
}
|
||||
type MenuMaxSortRes struct {
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
}
|
||||
|
||||
// MenuCodeUniqueReq 菜单编码是否唯一
|
||||
type MenuCodeUniqueReq struct {
|
||||
g.Meta `path:"/menu/code_unique" method:"get" tags:"菜单" summary:"菜单编码是否唯一"`
|
||||
Code string `json:"code" v:"required#菜单编码不能为空" dc:"菜单编码"`
|
||||
Id int64 `json:"id" dc:"菜单ID"`
|
||||
}
|
||||
type MenuCodeUniqueRes struct {
|
||||
IsUnique bool `json:"is_unique" dc:"是否唯一"`
|
||||
}
|
||||
|
||||
// MenuNameUniqueReq 菜单名称是否唯一
|
||||
type MenuNameUniqueReq struct {
|
||||
g.Meta `path:"/menu/name_unique" method:"get" tags:"菜单" summary:"菜单名称是否唯一"`
|
||||
Name string `json:"name" v:"required#菜单名称不能为空" dc:"菜单名称"`
|
||||
Id int64 `json:"id" dc:"菜单ID"`
|
||||
}
|
||||
type MenuNameUniqueRes struct {
|
||||
IsUnique bool `json:"is_unique" dc:"是否唯一"`
|
||||
}
|
||||
|
||||
// MenuEditReq 修改/新增菜单
|
||||
type MenuEditReq struct {
|
||||
g.Meta `path:"/menu/edit" method:"post" tags:"菜单" summary:"修改/新增菜单"`
|
||||
// MenuEditInp 修改/新增菜单
|
||||
type MenuEditInp struct {
|
||||
entity.AdminMenu
|
||||
}
|
||||
type MenuEditRes struct{}
|
||||
|
||||
// MenuDeleteReq 删除菜单
|
||||
type MenuDeleteReq struct {
|
||||
g.Meta `path:"/menu/delete" method:"post" tags:"菜单" summary:"删除菜单"`
|
||||
Id interface{} `json:"id" v:"required#菜单ID不能为空" dc:"菜单ID"`
|
||||
}
|
||||
type MenuDeleteRes struct{}
|
||||
|
||||
// MenuViewReq 获取指定菜单信息
|
||||
type MenuViewReq struct {
|
||||
g.Meta `path:"/menu/view" method:"get" tags:"菜单" summary:"获取指定菜单信息"`
|
||||
Id string `json:"id" v:"required#菜单ID不能为空" dc:"菜单ID"`
|
||||
}
|
||||
type MenuViewRes struct {
|
||||
*entity.AdminMenu
|
||||
func (in *MenuEditInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Title == "" {
|
||||
err = gerror.New("菜单名称不能为空")
|
||||
return
|
||||
}
|
||||
if in.Type != 3 && in.Path == "" {
|
||||
err = gerror.New("路由地址不能为空")
|
||||
return
|
||||
}
|
||||
if in.Name == "" {
|
||||
err = gerror.New("路由名称不能为空")
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// MenuListReq 获取菜单列表
|
||||
type MenuListReq struct {
|
||||
g.Meta `path:"/menu/list" method:"get" tags:"菜单" summary:"获取菜单列表"`
|
||||
type MenuEditModel struct{}
|
||||
|
||||
// MenuDeleteInp 删除菜单
|
||||
type MenuDeleteInp struct {
|
||||
Id interface{} `json:"id" v:"required#菜单ID不能为空" dc:"菜单ID"`
|
||||
}
|
||||
|
||||
func (in *MenuDeleteInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type MenuDeleteModel struct{}
|
||||
|
||||
// MenuListInp 获取菜单列表
|
||||
type MenuListInp struct {
|
||||
form.PageReq
|
||||
Pid int64 `json:"pid" dc:"父ID"`
|
||||
}
|
||||
|
||||
type MenuListRes struct {
|
||||
func (in *MenuListInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type MenuListModel struct {
|
||||
List []*entity.AdminMenu `json:"list" dc:"数据列表"`
|
||||
form.PageRes
|
||||
}
|
||||
|
||||
// MenuSearchListReq 查询菜单列表
|
||||
type MenuSearchListReq struct {
|
||||
g.Meta `path:"/menu/search_list" method:"get" tags:"菜单" summary:"获取菜单列表"`
|
||||
Name string `json:"name" dc:"菜单名称"`
|
||||
// MenuSearchListInp 查询菜单列表
|
||||
type MenuSearchListInp struct {
|
||||
Name string `json:"name" dc:"菜单名称"`
|
||||
form.StatusReq
|
||||
}
|
||||
|
||||
type MenuSearchListRes []*model.TreeMenu
|
||||
|
||||
// MenuRoleListReq 查询角色菜单列表
|
||||
type MenuRoleListReq struct {
|
||||
g.Meta `path:"/menu/role_list" method:"get" tags:"菜单" summary:"查询角色菜单列表"`
|
||||
RoleId string `json:"role_id" dc:"角色ID"`
|
||||
func (in *MenuSearchListInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type MenuRoleListRes struct {
|
||||
Menus []*model.LabelTreeMenu `json:"menus" dc:"菜单列表"`
|
||||
CheckedKeys []int64 `json:"checkedKeys" dc:"选择的菜单ID"`
|
||||
}
|
||||
type MenuSearchListModel []*model.TreeMenu
|
||||
|
||||
// MenuTree 菜单树结构
|
||||
type MenuTree struct {
|
||||
|
@ -7,7 +7,6 @@ package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/api/admin/menu"
|
||||
"hotgo/api/admin/role"
|
||||
"hotgo/internal/library/hgorm/handler"
|
||||
"hotgo/internal/model"
|
||||
@ -19,18 +18,26 @@ import (
|
||||
)
|
||||
|
||||
type (
|
||||
IAdminOrder interface {
|
||||
IAdminCreditsLog interface {
|
||||
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
|
||||
AcceptRefund(ctx context.Context, in adminin.OrderAcceptRefundInp) (err error)
|
||||
ApplyRefund(ctx context.Context, in adminin.OrderApplyRefundInp) (err error)
|
||||
PayNotify(ctx context.Context, in payin.NotifyCallFuncInp) (err error)
|
||||
Create(ctx context.Context, in adminin.OrderCreateInp) (res *adminin.OrderCreateModel, err error)
|
||||
List(ctx context.Context, in adminin.OrderListInp) (list []*adminin.OrderListModel, totalCount int, err error)
|
||||
Export(ctx context.Context, in adminin.OrderListInp) (err error)
|
||||
Edit(ctx context.Context, in adminin.OrderEditInp) (err error)
|
||||
Delete(ctx context.Context, in adminin.OrderDeleteInp) (err error)
|
||||
View(ctx context.Context, in adminin.OrderViewInp) (res *adminin.OrderViewModel, err error)
|
||||
Status(ctx context.Context, in adminin.OrderStatusInp) (err error)
|
||||
SaveBalance(ctx context.Context, in adminin.CreditsLogSaveBalanceInp) (res *adminin.CreditsLogSaveBalanceModel, err error)
|
||||
SaveIntegral(ctx context.Context, in adminin.CreditsLogSaveIntegralInp) (res *adminin.CreditsLogSaveIntegralModel, err error)
|
||||
List(ctx context.Context, in adminin.CreditsLogListInp) (list []*adminin.CreditsLogListModel, totalCount int, err error)
|
||||
Export(ctx context.Context, in adminin.CreditsLogListInp) (err error)
|
||||
}
|
||||
IAdminNotice interface {
|
||||
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
|
||||
Delete(ctx context.Context, in adminin.NoticeDeleteInp) (err error)
|
||||
Edit(ctx context.Context, in adminin.NoticeEditInp) (err error)
|
||||
Status(ctx context.Context, in adminin.NoticeStatusInp) (err error)
|
||||
MaxSort(ctx context.Context, in adminin.NoticeMaxSortInp) (res *adminin.NoticeMaxSortModel, err error)
|
||||
View(ctx context.Context, in adminin.NoticeViewInp) (res *adminin.NoticeViewModel, err error)
|
||||
List(ctx context.Context, in adminin.NoticeListInp) (list []*adminin.NoticeListModel, totalCount int, err error)
|
||||
PullMessages(ctx context.Context, in adminin.PullMessagesInp) (res *adminin.PullMessagesModel, err error)
|
||||
UnreadCount(ctx context.Context, in adminin.NoticeUnreadCountInp) (res *adminin.NoticeUnreadCountModel, err error)
|
||||
UpRead(ctx context.Context, in adminin.NoticeUpReadInp) (err error)
|
||||
ReadAll(ctx context.Context, in adminin.NoticeReadAllInp) (err error)
|
||||
MessageList(ctx context.Context, in adminin.NoticeMessageListInp) (list []*adminin.NoticeMessageListModel, totalCount int, err error)
|
||||
}
|
||||
IAdminSite interface {
|
||||
Register(ctx context.Context, in adminin.RegisterInp) (err error)
|
||||
@ -53,54 +60,6 @@ type (
|
||||
List(ctx context.Context, in adminin.DeptListInp) (res *adminin.DeptListModel, err error)
|
||||
GetName(ctx context.Context, id int64) (name string, err error)
|
||||
}
|
||||
IAdminMonitor interface {
|
||||
StartMonitor(ctx context.Context)
|
||||
GetMeta(ctx context.Context) *model.MonitorData
|
||||
}
|
||||
IAdminNotice interface {
|
||||
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
|
||||
Delete(ctx context.Context, in adminin.NoticeDeleteInp) (err error)
|
||||
Edit(ctx context.Context, in adminin.NoticeEditInp) (err error)
|
||||
Status(ctx context.Context, in adminin.NoticeStatusInp) (err error)
|
||||
MaxSort(ctx context.Context, in adminin.NoticeMaxSortInp) (res *adminin.NoticeMaxSortModel, err error)
|
||||
View(ctx context.Context, in adminin.NoticeViewInp) (res *adminin.NoticeViewModel, err error)
|
||||
List(ctx context.Context, in adminin.NoticeListInp) (list []*adminin.NoticeListModel, totalCount int, err error)
|
||||
PullMessages(ctx context.Context, in adminin.PullMessagesInp) (res *adminin.PullMessagesModel, err error)
|
||||
UnreadCount(ctx context.Context, in adminin.NoticeUnreadCountInp) (res *adminin.NoticeUnreadCountModel, err error)
|
||||
UpRead(ctx context.Context, in adminin.NoticeUpReadInp) (err error)
|
||||
ReadAll(ctx context.Context, in adminin.NoticeReadAllInp) (err error)
|
||||
MessageList(ctx context.Context, in adminin.NoticeMessageListInp) (list []*adminin.NoticeMessageListModel, totalCount int, err error)
|
||||
}
|
||||
IAdminPost interface {
|
||||
Delete(ctx context.Context, in adminin.PostDeleteInp) (err error)
|
||||
Edit(ctx context.Context, in adminin.PostEditInp) (err error)
|
||||
MaxSort(ctx context.Context, in adminin.PostMaxSortInp) (res *adminin.PostMaxSortModel, err error)
|
||||
NameUnique(ctx context.Context, in adminin.PostNameUniqueInp) (res *adminin.PostNameUniqueModel, err error)
|
||||
CodeUnique(ctx context.Context, in adminin.PostCodeUniqueInp) (res *adminin.PostCodeUniqueModel, err error)
|
||||
View(ctx context.Context, in adminin.PostViewInp) (res *adminin.PostViewModel, err error)
|
||||
List(ctx context.Context, in adminin.PostListInp) (list []*adminin.PostListModel, totalCount int, err error)
|
||||
GetMemberByStartName(ctx context.Context, memberId int64) (name string, err error)
|
||||
Status(ctx context.Context, in adminin.PostStatusInp) (err error)
|
||||
}
|
||||
IAdminRole interface {
|
||||
Verify(ctx context.Context, path, method string) bool
|
||||
List(ctx context.Context, in adminin.RoleListInp) (res *adminin.RoleListModel, totalCount int, err error)
|
||||
GetName(ctx context.Context, id int64) (name string, err error)
|
||||
GetMemberList(ctx context.Context, id int64) (list []*adminin.RoleListModel, err error)
|
||||
GetPermissions(ctx context.Context, in adminin.GetPermissionsInp) (res *adminin.GetPermissionsModel, err error)
|
||||
UpdatePermissions(ctx context.Context, in adminin.UpdatePermissionsInp) (err error)
|
||||
Edit(ctx context.Context, in adminin.RoleEditInp) (err error)
|
||||
Delete(ctx context.Context, in adminin.RoleDeleteInp) (err error)
|
||||
DataScopeSelect() (res form.Selects)
|
||||
DataScopeEdit(ctx context.Context, in *adminin.DataScopeEditInp) (err error)
|
||||
}
|
||||
IAdminCreditsLog interface {
|
||||
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
|
||||
SaveBalance(ctx context.Context, in adminin.CreditsLogSaveBalanceInp) (res *adminin.CreditsLogSaveBalanceModel, err error)
|
||||
SaveIntegral(ctx context.Context, in adminin.CreditsLogSaveIntegralInp) (res *adminin.CreditsLogSaveIntegralModel, err error)
|
||||
List(ctx context.Context, in adminin.CreditsLogListInp) (list []*adminin.CreditsLogListModel, totalCount int, err error)
|
||||
Export(ctx context.Context, in adminin.CreditsLogListInp) (err error)
|
||||
}
|
||||
IAdminMember interface {
|
||||
AddBalance(ctx context.Context, in adminin.MemberAddBalanceInp) (err error)
|
||||
AddIntegral(ctx context.Context, in adminin.MemberAddIntegralInp) (err error)
|
||||
@ -128,33 +87,81 @@ type (
|
||||
UpdatePostIds(ctx context.Context, memberId int64, postIds []int64) (err error)
|
||||
}
|
||||
IAdminMenu interface {
|
||||
MaxSort(ctx context.Context, req *menu.MaxSortReq) (res *menu.MaxSortRes, err error)
|
||||
NameUnique(ctx context.Context, req *menu.NameUniqueReq) (res *menu.NameUniqueRes, err error)
|
||||
CodeUnique(ctx context.Context, req *menu.CodeUniqueReq) (res *menu.CodeUniqueRes, err error)
|
||||
Delete(ctx context.Context, req *menu.DeleteReq) (err error)
|
||||
Edit(ctx context.Context, req *menu.EditReq) (err error)
|
||||
View(ctx context.Context, req *menu.ViewReq) (res *menu.ViewRes, err error)
|
||||
List(ctx context.Context, req *menu.ListReq) (lists []map[string]interface{}, err error)
|
||||
Delete(ctx context.Context, in adminin.MenuDeleteInp) (err error)
|
||||
VerifyUnique(ctx context.Context, in adminin.VerifyUniqueInp) (err error)
|
||||
Edit(ctx context.Context, in adminin.MenuEditInp) (err error)
|
||||
List(ctx context.Context, in adminin.MenuListInp) (lists []map[string]interface{}, err error)
|
||||
GetMenuList(ctx context.Context, memberId int64) (res *role.DynamicRes, err error)
|
||||
LoginPermissions(ctx context.Context, memberId int64) (lists adminin.MemberLoginPermissions, err error)
|
||||
}
|
||||
IAdminMonitor interface {
|
||||
StartMonitor(ctx context.Context)
|
||||
GetMeta(ctx context.Context) *model.MonitorData
|
||||
}
|
||||
IAdminOrder interface {
|
||||
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
|
||||
AcceptRefund(ctx context.Context, in adminin.OrderAcceptRefundInp) (err error)
|
||||
ApplyRefund(ctx context.Context, in adminin.OrderApplyRefundInp) (err error)
|
||||
PayNotify(ctx context.Context, in payin.NotifyCallFuncInp) (err error)
|
||||
Create(ctx context.Context, in adminin.OrderCreateInp) (res *adminin.OrderCreateModel, err error)
|
||||
List(ctx context.Context, in adminin.OrderListInp) (list []*adminin.OrderListModel, totalCount int, err error)
|
||||
Export(ctx context.Context, in adminin.OrderListInp) (err error)
|
||||
Edit(ctx context.Context, in adminin.OrderEditInp) (err error)
|
||||
Delete(ctx context.Context, in adminin.OrderDeleteInp) (err error)
|
||||
View(ctx context.Context, in adminin.OrderViewInp) (res *adminin.OrderViewModel, err error)
|
||||
Status(ctx context.Context, in adminin.OrderStatusInp) (err error)
|
||||
}
|
||||
IAdminPost interface {
|
||||
Delete(ctx context.Context, in adminin.PostDeleteInp) (err error)
|
||||
Edit(ctx context.Context, in adminin.PostEditInp) (err error)
|
||||
MaxSort(ctx context.Context, in adminin.PostMaxSortInp) (res *adminin.PostMaxSortModel, err error)
|
||||
NameUnique(ctx context.Context, in adminin.PostNameUniqueInp) (res *adminin.PostNameUniqueModel, err error)
|
||||
CodeUnique(ctx context.Context, in adminin.PostCodeUniqueInp) (res *adminin.PostCodeUniqueModel, err error)
|
||||
View(ctx context.Context, in adminin.PostViewInp) (res *adminin.PostViewModel, err error)
|
||||
List(ctx context.Context, in adminin.PostListInp) (list []*adminin.PostListModel, totalCount int, err error)
|
||||
GetMemberByStartName(ctx context.Context, memberId int64) (name string, err error)
|
||||
Status(ctx context.Context, in adminin.PostStatusInp) (err error)
|
||||
}
|
||||
IAdminRole interface {
|
||||
Verify(ctx context.Context, path, method string) bool
|
||||
List(ctx context.Context, in adminin.RoleListInp) (res *adminin.RoleListModel, totalCount int, err error)
|
||||
GetName(ctx context.Context, id int64) (name string, err error)
|
||||
GetMemberList(ctx context.Context, id int64) (list []*adminin.RoleListModel, err error)
|
||||
GetPermissions(ctx context.Context, in adminin.GetPermissionsInp) (res *adminin.GetPermissionsModel, err error)
|
||||
UpdatePermissions(ctx context.Context, in adminin.UpdatePermissionsInp) (err error)
|
||||
Edit(ctx context.Context, in adminin.RoleEditInp) (err error)
|
||||
Delete(ctx context.Context, in adminin.RoleDeleteInp) (err error)
|
||||
DataScopeSelect() (res form.Selects)
|
||||
DataScopeEdit(ctx context.Context, in *adminin.DataScopeEditInp) (err error)
|
||||
}
|
||||
)
|
||||
|
||||
var (
|
||||
localAdminCreditsLog IAdminCreditsLog
|
||||
localAdminMonitor IAdminMonitor
|
||||
localAdminOrder IAdminOrder
|
||||
localAdminPost IAdminPost
|
||||
localAdminCash IAdminCash
|
||||
localAdminDept IAdminDept
|
||||
localAdminMember IAdminMember
|
||||
localAdminMemberPost IAdminMemberPost
|
||||
localAdminMenu IAdminMenu
|
||||
localAdminPost IAdminPost
|
||||
localAdminRole IAdminRole
|
||||
localAdminCash IAdminCash
|
||||
localAdminDept IAdminDept
|
||||
localAdminMonitor IAdminMonitor
|
||||
localAdminCreditsLog IAdminCreditsLog
|
||||
localAdminNotice IAdminNotice
|
||||
localAdminOrder IAdminOrder
|
||||
localAdminSite IAdminSite
|
||||
)
|
||||
|
||||
func AdminSite() IAdminSite {
|
||||
if localAdminSite == nil {
|
||||
panic("implement not found for interface IAdminSite, forgot register?")
|
||||
}
|
||||
return localAdminSite
|
||||
}
|
||||
|
||||
func RegisterAdminSite(i IAdminSite) {
|
||||
localAdminSite = i
|
||||
}
|
||||
|
||||
func AdminCreditsLog() IAdminCreditsLog {
|
||||
if localAdminCreditsLog == nil {
|
||||
panic("implement not found for interface IAdminCreditsLog, forgot register?")
|
||||
@ -166,6 +173,17 @@ func RegisterAdminCreditsLog(i IAdminCreditsLog) {
|
||||
localAdminCreditsLog = i
|
||||
}
|
||||
|
||||
func AdminNotice() IAdminNotice {
|
||||
if localAdminNotice == nil {
|
||||
panic("implement not found for interface IAdminNotice, forgot register?")
|
||||
}
|
||||
return localAdminNotice
|
||||
}
|
||||
|
||||
func RegisterAdminNotice(i IAdminNotice) {
|
||||
localAdminNotice = i
|
||||
}
|
||||
|
||||
func AdminMember() IAdminMember {
|
||||
if localAdminMember == nil {
|
||||
panic("implement not found for interface IAdminMember, forgot register?")
|
||||
@ -199,6 +217,28 @@ func RegisterAdminMenu(i IAdminMenu) {
|
||||
localAdminMenu = i
|
||||
}
|
||||
|
||||
func AdminMonitor() IAdminMonitor {
|
||||
if localAdminMonitor == nil {
|
||||
panic("implement not found for interface IAdminMonitor, forgot register?")
|
||||
}
|
||||
return localAdminMonitor
|
||||
}
|
||||
|
||||
func RegisterAdminMonitor(i IAdminMonitor) {
|
||||
localAdminMonitor = i
|
||||
}
|
||||
|
||||
func AdminOrder() IAdminOrder {
|
||||
if localAdminOrder == nil {
|
||||
panic("implement not found for interface IAdminOrder, forgot register?")
|
||||
}
|
||||
return localAdminOrder
|
||||
}
|
||||
|
||||
func RegisterAdminOrder(i IAdminOrder) {
|
||||
localAdminOrder = i
|
||||
}
|
||||
|
||||
func AdminPost() IAdminPost {
|
||||
if localAdminPost == nil {
|
||||
panic("implement not found for interface IAdminPost, forgot register?")
|
||||
@ -210,17 +250,6 @@ func RegisterAdminPost(i IAdminPost) {
|
||||
localAdminPost = i
|
||||
}
|
||||
|
||||
func AdminRole() IAdminRole {
|
||||
if localAdminRole == nil {
|
||||
panic("implement not found for interface IAdminRole, forgot register?")
|
||||
}
|
||||
return localAdminRole
|
||||
}
|
||||
|
||||
func RegisterAdminRole(i IAdminRole) {
|
||||
localAdminRole = i
|
||||
}
|
||||
|
||||
func AdminCash() IAdminCash {
|
||||
if localAdminCash == nil {
|
||||
panic("implement not found for interface IAdminCash, forgot register?")
|
||||
@ -243,46 +272,13 @@ func RegisterAdminDept(i IAdminDept) {
|
||||
localAdminDept = i
|
||||
}
|
||||
|
||||
func AdminMonitor() IAdminMonitor {
|
||||
if localAdminMonitor == nil {
|
||||
panic("implement not found for interface IAdminMonitor, forgot register?")
|
||||
func AdminRole() IAdminRole {
|
||||
if localAdminRole == nil {
|
||||
panic("implement not found for interface IAdminRole, forgot register?")
|
||||
}
|
||||
return localAdminMonitor
|
||||
return localAdminRole
|
||||
}
|
||||
|
||||
func RegisterAdminMonitor(i IAdminMonitor) {
|
||||
localAdminMonitor = i
|
||||
}
|
||||
|
||||
func AdminNotice() IAdminNotice {
|
||||
if localAdminNotice == nil {
|
||||
panic("implement not found for interface IAdminNotice, forgot register?")
|
||||
}
|
||||
return localAdminNotice
|
||||
}
|
||||
|
||||
func RegisterAdminNotice(i IAdminNotice) {
|
||||
localAdminNotice = i
|
||||
}
|
||||
|
||||
func AdminOrder() IAdminOrder {
|
||||
if localAdminOrder == nil {
|
||||
panic("implement not found for interface IAdminOrder, forgot register?")
|
||||
}
|
||||
return localAdminOrder
|
||||
}
|
||||
|
||||
func RegisterAdminOrder(i IAdminOrder) {
|
||||
localAdminOrder = i
|
||||
}
|
||||
|
||||
func AdminSite() IAdminSite {
|
||||
if localAdminSite == nil {
|
||||
panic("implement not found for interface IAdminSite, forgot register?")
|
||||
}
|
||||
return localAdminSite
|
||||
}
|
||||
|
||||
func RegisterAdminSite(i IAdminSite) {
|
||||
localAdminSite = i
|
||||
func RegisterAdminRole(i IAdminRole) {
|
||||
localAdminRole = i
|
||||
}
|
||||
|
@ -17,81 +17,6 @@ import (
|
||||
)
|
||||
|
||||
type (
|
||||
ISysProvinces interface {
|
||||
Tree(ctx context.Context) (list []g.Map, err error)
|
||||
Delete(ctx context.Context, in sysin.ProvincesDeleteInp) (err error)
|
||||
Edit(ctx context.Context, in sysin.ProvincesEditInp) (err error)
|
||||
Status(ctx context.Context, in sysin.ProvincesStatusInp) (err error)
|
||||
MaxSort(ctx context.Context, in sysin.ProvincesMaxSortInp) (res *sysin.ProvincesMaxSortModel, err error)
|
||||
View(ctx context.Context, in sysin.ProvincesViewInp) (res *sysin.ProvincesViewModel, err error)
|
||||
List(ctx context.Context, in sysin.ProvincesListInp) (list []*sysin.ProvincesListModel, totalCount int, err error)
|
||||
ChildrenList(ctx context.Context, in sysin.ProvincesChildrenListInp) (list []*sysin.ProvincesChildrenListModel, totalCount int, err error)
|
||||
UniqueId(ctx context.Context, in sysin.ProvincesUniqueIdInp) (res *sysin.ProvincesUniqueIdModel, err error)
|
||||
Select(ctx context.Context, in sysin.ProvincesSelectInp) (res *sysin.ProvincesSelectModel, err error)
|
||||
}
|
||||
ISysSmsLog interface {
|
||||
Delete(ctx context.Context, in sysin.SmsLogDeleteInp) (err error)
|
||||
Edit(ctx context.Context, in sysin.SmsLogEditInp) (err error)
|
||||
Status(ctx context.Context, in sysin.SmsLogStatusInp) (err error)
|
||||
MaxSort(ctx context.Context, in sysin.SmsLogMaxSortInp) (res *sysin.SmsLogMaxSortModel, err error)
|
||||
View(ctx context.Context, in sysin.SmsLogViewInp) (res *sysin.SmsLogViewModel, err error)
|
||||
List(ctx context.Context, in sysin.SmsLogListInp) (list []*sysin.SmsLogListModel, totalCount int, err error)
|
||||
SendCode(ctx context.Context, in sysin.SendCodeInp) (err error)
|
||||
GetTemplate(ctx context.Context, template string, config *model.SmsConfig) (val string, err error)
|
||||
AllowSend(ctx context.Context, models *entity.SysSmsLog, config *model.SmsConfig) (err error)
|
||||
VerifyCode(ctx context.Context, in sysin.VerifyCodeInp) (err error)
|
||||
}
|
||||
ISysAddons interface {
|
||||
List(ctx context.Context, in sysin.AddonsListInp) (list []*sysin.AddonsListModel, totalCount int, err error)
|
||||
Selects(ctx context.Context, in sysin.AddonsSelectsInp) (res *sysin.AddonsSelectsModel, err error)
|
||||
Build(ctx context.Context, in sysin.AddonsBuildInp) (err error)
|
||||
Install(ctx context.Context, in sysin.AddonsInstallInp) (err error)
|
||||
Upgrade(ctx context.Context, in sysin.AddonsUpgradeInp) (err error)
|
||||
UnInstall(ctx context.Context, in sysin.AddonsUnInstallInp) (err error)
|
||||
}
|
||||
ISysLoginLog interface {
|
||||
Model(ctx context.Context) *gdb.Model
|
||||
List(ctx context.Context, in sysin.LoginLogListInp) (list []*sysin.LoginLogListModel, totalCount int, err error)
|
||||
Export(ctx context.Context, in sysin.LoginLogListInp) (err error)
|
||||
Delete(ctx context.Context, in sysin.LoginLogDeleteInp) (err error)
|
||||
View(ctx context.Context, in sysin.LoginLogViewInp) (res *sysin.LoginLogViewModel, err error)
|
||||
Push(ctx context.Context, in sysin.LoginLogPushInp)
|
||||
RealWrite(ctx context.Context, models entity.SysLoginLog) (err error)
|
||||
}
|
||||
ISysLog interface {
|
||||
Export(ctx context.Context, in sysin.LogListInp) (err error)
|
||||
RealWrite(ctx context.Context, log entity.SysLog) (err error)
|
||||
AutoLog(ctx context.Context) error
|
||||
AnalysisLog(ctx context.Context) entity.SysLog
|
||||
View(ctx context.Context, in sysin.LogViewInp) (res *sysin.LogViewModel, err error)
|
||||
Delete(ctx context.Context, in sysin.LogDeleteInp) (err error)
|
||||
List(ctx context.Context, in sysin.LogListInp) (list []*sysin.LogListModel, totalCount int, err error)
|
||||
}
|
||||
ISysCronGroup interface {
|
||||
Delete(ctx context.Context, in sysin.CronGroupDeleteInp) (err error)
|
||||
Edit(ctx context.Context, in sysin.CronGroupEditInp) (err error)
|
||||
Status(ctx context.Context, in sysin.CronGroupStatusInp) (err error)
|
||||
MaxSort(ctx context.Context, in sysin.CronGroupMaxSortInp) (res *sysin.CronGroupMaxSortModel, err error)
|
||||
View(ctx context.Context, in sysin.CronGroupViewInp) (res *sysin.CronGroupViewModel, err error)
|
||||
List(ctx context.Context, in sysin.CronGroupListInp) (list []*sysin.CronGroupListModel, totalCount int, err error)
|
||||
Select(ctx context.Context, in sysin.CronGroupSelectInp) (res *sysin.CronGroupSelectModel, err error)
|
||||
}
|
||||
ISysDictData interface {
|
||||
Delete(ctx context.Context, in sysin.DictDataDeleteInp) error
|
||||
Edit(ctx context.Context, in sysin.DictDataEditInp) (err error)
|
||||
List(ctx context.Context, in sysin.DictDataListInp) (list []*sysin.DictDataListModel, totalCount int, err error)
|
||||
Select(ctx context.Context, in sysin.DataSelectInp) (list sysin.DataSelectModel, err error)
|
||||
}
|
||||
ISysCron interface {
|
||||
StartCron(ctx context.Context)
|
||||
Delete(ctx context.Context, in sysin.CronDeleteInp) (err error)
|
||||
Edit(ctx context.Context, in sysin.CronEditInp) (err error)
|
||||
Status(ctx context.Context, in sysin.CronStatusInp) (err error)
|
||||
MaxSort(ctx context.Context, in sysin.CronMaxSortInp) (res *sysin.CronMaxSortModel, err error)
|
||||
View(ctx context.Context, in sysin.CronViewInp) (res *sysin.CronViewModel, err error)
|
||||
List(ctx context.Context, in sysin.CronListInp) (list []*sysin.CronListModel, totalCount int, err error)
|
||||
OnlineExec(ctx context.Context, in sysin.OnlineExecInp) (err error)
|
||||
}
|
||||
ISysGenCodes interface {
|
||||
Delete(ctx context.Context, in sysin.GenCodesDeleteInp) (err error)
|
||||
Edit(ctx context.Context, in sysin.GenCodesEditInp) (res *sysin.GenCodesEditModel, err error)
|
||||
@ -106,20 +31,49 @@ type (
|
||||
Preview(ctx context.Context, in sysin.GenCodesPreviewInp) (res *sysin.GenCodesPreviewModel, err error)
|
||||
Build(ctx context.Context, in sysin.GenCodesBuildInp) (err error)
|
||||
}
|
||||
ISysAddonsConfig interface {
|
||||
GetConfigByGroup(ctx context.Context, in sysin.GetAddonsConfigInp) (res *sysin.GetAddonsConfigModel, err error)
|
||||
ConversionType(ctx context.Context, models *entity.SysAddonsConfig) (value interface{}, err error)
|
||||
UpdateConfigByGroup(ctx context.Context, in sysin.UpdateAddonsConfigInp) (err error)
|
||||
ISysProvinces interface {
|
||||
Tree(ctx context.Context) (list []g.Map, err error)
|
||||
Delete(ctx context.Context, in sysin.ProvincesDeleteInp) (err error)
|
||||
Edit(ctx context.Context, in sysin.ProvincesEditInp) (err error)
|
||||
Status(ctx context.Context, in sysin.ProvincesStatusInp) (err error)
|
||||
MaxSort(ctx context.Context, in sysin.ProvincesMaxSortInp) (res *sysin.ProvincesMaxSortModel, err error)
|
||||
View(ctx context.Context, in sysin.ProvincesViewInp) (res *sysin.ProvincesViewModel, err error)
|
||||
List(ctx context.Context, in sysin.ProvincesListInp) (list []*sysin.ProvincesListModel, totalCount int, err error)
|
||||
ChildrenList(ctx context.Context, in sysin.ProvincesChildrenListInp) (list []*sysin.ProvincesChildrenListModel, totalCount int, err error)
|
||||
UniqueId(ctx context.Context, in sysin.ProvincesUniqueIdInp) (res *sysin.ProvincesUniqueIdModel, err error)
|
||||
Select(ctx context.Context, in sysin.ProvincesSelectInp) (res *sysin.ProvincesSelectModel, err error)
|
||||
}
|
||||
ISysBlacklist interface {
|
||||
Delete(ctx context.Context, in sysin.BlacklistDeleteInp) (err error)
|
||||
Edit(ctx context.Context, in sysin.BlacklistEditInp) (err error)
|
||||
Status(ctx context.Context, in sysin.BlacklistStatusInp) (err error)
|
||||
MaxSort(ctx context.Context, in sysin.BlacklistMaxSortInp) (res *sysin.BlacklistMaxSortModel, err error)
|
||||
View(ctx context.Context, in sysin.BlacklistViewInp) (res *sysin.BlacklistViewModel, err error)
|
||||
List(ctx context.Context, in sysin.BlacklistListInp) (list []*sysin.BlacklistListModel, totalCount int, err error)
|
||||
VariableLoad(ctx context.Context, err error)
|
||||
Load(ctx context.Context)
|
||||
ISysServeLog interface {
|
||||
Model(ctx context.Context) *gdb.Model
|
||||
List(ctx context.Context, in sysin.ServeLogListInp) (list []*sysin.ServeLogListModel, totalCount int, err error)
|
||||
Export(ctx context.Context, in sysin.ServeLogListInp) (err error)
|
||||
Delete(ctx context.Context, in sysin.ServeLogDeleteInp) (err error)
|
||||
View(ctx context.Context, in sysin.ServeLogViewInp) (res *sysin.ServeLogViewModel, err error)
|
||||
RealWrite(ctx context.Context, models entity.SysServeLog) (err error)
|
||||
}
|
||||
ISysSmsLog interface {
|
||||
Delete(ctx context.Context, in sysin.SmsLogDeleteInp) (err error)
|
||||
Edit(ctx context.Context, in sysin.SmsLogEditInp) (err error)
|
||||
Status(ctx context.Context, in sysin.SmsLogStatusInp) (err error)
|
||||
MaxSort(ctx context.Context, in sysin.SmsLogMaxSortInp) (res *sysin.SmsLogMaxSortModel, err error)
|
||||
View(ctx context.Context, in sysin.SmsLogViewInp) (res *sysin.SmsLogViewModel, err error)
|
||||
List(ctx context.Context, in sysin.SmsLogListInp) (list []*sysin.SmsLogListModel, totalCount int, err error)
|
||||
SendCode(ctx context.Context, in sysin.SendCodeInp) (err error)
|
||||
GetTemplate(ctx context.Context, template string, config *model.SmsConfig) (val string, err error)
|
||||
AllowSend(ctx context.Context, models *entity.SysSmsLog, config *model.SmsConfig) (err error)
|
||||
VerifyCode(ctx context.Context, in sysin.VerifyCodeInp) (err error)
|
||||
}
|
||||
ISysDictData interface {
|
||||
Delete(ctx context.Context, in sysin.DictDataDeleteInp) error
|
||||
Edit(ctx context.Context, in sysin.DictDataEditInp) (err error)
|
||||
List(ctx context.Context, in sysin.DictDataListInp) (list []*sysin.DictDataListModel, totalCount int, err error)
|
||||
Select(ctx context.Context, in sysin.DataSelectInp) (list sysin.DataSelectModel, err error)
|
||||
}
|
||||
ISysDictType interface {
|
||||
Tree(ctx context.Context) (list []*sysin.DictTypeTree, err error)
|
||||
Delete(ctx context.Context, in sysin.DictTypeDeleteInp) (err error)
|
||||
Edit(ctx context.Context, in sysin.DictTypeEditInp) (err error)
|
||||
TreeSelect(ctx context.Context, in sysin.DictTreeSelectInp) (list []*sysin.DictTypeTree, err error)
|
||||
}
|
||||
ISysCurdDemo interface {
|
||||
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
|
||||
@ -132,12 +86,6 @@ type (
|
||||
Status(ctx context.Context, in sysin.CurdDemoStatusInp) (err error)
|
||||
Switch(ctx context.Context, in sysin.CurdDemoSwitchInp) (err error)
|
||||
}
|
||||
ISysDictType interface {
|
||||
Tree(ctx context.Context) (list []*sysin.DictTypeTree, err error)
|
||||
Delete(ctx context.Context, in sysin.DictTypeDeleteInp) (err error)
|
||||
Edit(ctx context.Context, in sysin.DictTypeEditInp) (err error)
|
||||
TreeSelect(ctx context.Context, in sysin.DictTreeSelectInp) (list []*sysin.DictTypeTree, err error)
|
||||
}
|
||||
ISysEmsLog interface {
|
||||
Delete(ctx context.Context, in sysin.EmsLogDeleteInp) (err error)
|
||||
Edit(ctx context.Context, in sysin.EmsLogEditInp) (err error)
|
||||
@ -149,20 +97,72 @@ type (
|
||||
AllowSend(ctx context.Context, models *entity.SysEmsLog, config *model.EmailConfig) (err error)
|
||||
VerifyCode(ctx context.Context, in sysin.VerifyEmsCodeInp) (err error)
|
||||
}
|
||||
ISysServeLog interface {
|
||||
Model(ctx context.Context) *gdb.Model
|
||||
List(ctx context.Context, in sysin.ServeLogListInp) (list []*sysin.ServeLogListModel, totalCount int, err error)
|
||||
Export(ctx context.Context, in sysin.ServeLogListInp) (err error)
|
||||
Delete(ctx context.Context, in sysin.ServeLogDeleteInp) (err error)
|
||||
View(ctx context.Context, in sysin.ServeLogViewInp) (res *sysin.ServeLogViewModel, err error)
|
||||
RealWrite(ctx context.Context, models entity.SysServeLog) (err error)
|
||||
}
|
||||
ISysAttachment interface {
|
||||
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
|
||||
Delete(ctx context.Context, in sysin.AttachmentDeleteInp) (err error)
|
||||
View(ctx context.Context, in sysin.AttachmentViewInp) (res *sysin.AttachmentViewModel, err error)
|
||||
List(ctx context.Context, in sysin.AttachmentListInp) (list []*sysin.AttachmentListModel, totalCount int, err error)
|
||||
}
|
||||
ISysCron interface {
|
||||
StartCron(ctx context.Context)
|
||||
Delete(ctx context.Context, in sysin.CronDeleteInp) (err error)
|
||||
Edit(ctx context.Context, in sysin.CronEditInp) (err error)
|
||||
Status(ctx context.Context, in sysin.CronStatusInp) (err error)
|
||||
MaxSort(ctx context.Context, in sysin.CronMaxSortInp) (res *sysin.CronMaxSortModel, err error)
|
||||
View(ctx context.Context, in sysin.CronViewInp) (res *sysin.CronViewModel, err error)
|
||||
List(ctx context.Context, in sysin.CronListInp) (list []*sysin.CronListModel, totalCount int, err error)
|
||||
OnlineExec(ctx context.Context, in sysin.OnlineExecInp) (err error)
|
||||
}
|
||||
ISysLog interface {
|
||||
Export(ctx context.Context, in sysin.LogListInp) (err error)
|
||||
RealWrite(ctx context.Context, log entity.SysLog) (err error)
|
||||
AutoLog(ctx context.Context) error
|
||||
AnalysisLog(ctx context.Context) entity.SysLog
|
||||
View(ctx context.Context, in sysin.LogViewInp) (res *sysin.LogViewModel, err error)
|
||||
Delete(ctx context.Context, in sysin.LogDeleteInp) (err error)
|
||||
List(ctx context.Context, in sysin.LogListInp) (list []*sysin.LogListModel, totalCount int, err error)
|
||||
}
|
||||
ISysAddons interface {
|
||||
List(ctx context.Context, in sysin.AddonsListInp) (list []*sysin.AddonsListModel, totalCount int, err error)
|
||||
Selects(ctx context.Context, in sysin.AddonsSelectsInp) (res *sysin.AddonsSelectsModel, err error)
|
||||
Build(ctx context.Context, in sysin.AddonsBuildInp) (err error)
|
||||
Install(ctx context.Context, in sysin.AddonsInstallInp) (err error)
|
||||
Upgrade(ctx context.Context, in sysin.AddonsUpgradeInp) (err error)
|
||||
UnInstall(ctx context.Context, in sysin.AddonsUnInstallInp) (err error)
|
||||
}
|
||||
ISysAddonsConfig interface {
|
||||
GetConfigByGroup(ctx context.Context, in sysin.GetAddonsConfigInp) (res *sysin.GetAddonsConfigModel, err error)
|
||||
ConversionType(ctx context.Context, models *entity.SysAddonsConfig) (value interface{}, err error)
|
||||
UpdateConfigByGroup(ctx context.Context, in sysin.UpdateAddonsConfigInp) (err error)
|
||||
}
|
||||
ISysCronGroup interface {
|
||||
Delete(ctx context.Context, in sysin.CronGroupDeleteInp) (err error)
|
||||
Edit(ctx context.Context, in sysin.CronGroupEditInp) (err error)
|
||||
Status(ctx context.Context, in sysin.CronGroupStatusInp) (err error)
|
||||
MaxSort(ctx context.Context, in sysin.CronGroupMaxSortInp) (res *sysin.CronGroupMaxSortModel, err error)
|
||||
View(ctx context.Context, in sysin.CronGroupViewInp) (res *sysin.CronGroupViewModel, err error)
|
||||
List(ctx context.Context, in sysin.CronGroupListInp) (list []*sysin.CronGroupListModel, totalCount int, err error)
|
||||
Select(ctx context.Context, in sysin.CronGroupSelectInp) (res *sysin.CronGroupSelectModel, err error)
|
||||
}
|
||||
ISysLoginLog interface {
|
||||
Model(ctx context.Context) *gdb.Model
|
||||
List(ctx context.Context, in sysin.LoginLogListInp) (list []*sysin.LoginLogListModel, totalCount int, err error)
|
||||
Export(ctx context.Context, in sysin.LoginLogListInp) (err error)
|
||||
Delete(ctx context.Context, in sysin.LoginLogDeleteInp) (err error)
|
||||
View(ctx context.Context, in sysin.LoginLogViewInp) (res *sysin.LoginLogViewModel, err error)
|
||||
Push(ctx context.Context, in sysin.LoginLogPushInp)
|
||||
RealWrite(ctx context.Context, models entity.SysLoginLog) (err error)
|
||||
}
|
||||
ISysBlacklist interface {
|
||||
Delete(ctx context.Context, in sysin.BlacklistDeleteInp) (err error)
|
||||
Edit(ctx context.Context, in sysin.BlacklistEditInp) (err error)
|
||||
Status(ctx context.Context, in sysin.BlacklistStatusInp) (err error)
|
||||
MaxSort(ctx context.Context, in sysin.BlacklistMaxSortInp) (res *sysin.BlacklistMaxSortModel, err error)
|
||||
View(ctx context.Context, in sysin.BlacklistViewInp) (res *sysin.BlacklistViewModel, err error)
|
||||
List(ctx context.Context, in sysin.BlacklistListInp) (list []*sysin.BlacklistListModel, totalCount int, err error)
|
||||
VariableLoad(ctx context.Context, err error)
|
||||
Load(ctx context.Context)
|
||||
}
|
||||
ISysConfig interface {
|
||||
InitConfig(ctx context.Context)
|
||||
GetLogin(ctx context.Context) (conf *model.LoginConfig, err error)
|
||||
@ -186,80 +186,25 @@ type (
|
||||
)
|
||||
|
||||
var (
|
||||
localSysAddons ISysAddons
|
||||
localSysLoginLog ISysLoginLog
|
||||
localSysProvinces ISysProvinces
|
||||
localSysSmsLog ISysSmsLog
|
||||
localSysCronGroup ISysCronGroup
|
||||
localSysDictData ISysDictData
|
||||
localSysLog ISysLog
|
||||
localSysAddonsConfig ISysAddonsConfig
|
||||
localSysBlacklist ISysBlacklist
|
||||
localSysCron ISysCron
|
||||
localSysGenCodes ISysGenCodes
|
||||
localSysAttachment ISysAttachment
|
||||
localSysConfig ISysConfig
|
||||
localSysCurdDemo ISysCurdDemo
|
||||
localSysDictType ISysDictType
|
||||
localSysEmsLog ISysEmsLog
|
||||
localSysGenCodes ISysGenCodes
|
||||
localSysProvinces ISysProvinces
|
||||
localSysServeLog ISysServeLog
|
||||
localSysSmsLog ISysSmsLog
|
||||
localSysDictData ISysDictData
|
||||
localSysEmsLog ISysEmsLog
|
||||
localSysCurdDemo ISysCurdDemo
|
||||
localSysAddonsConfig ISysAddonsConfig
|
||||
localSysAttachment ISysAttachment
|
||||
localSysCron ISysCron
|
||||
localSysLog ISysLog
|
||||
localSysAddons ISysAddons
|
||||
localSysConfig ISysConfig
|
||||
localSysCronGroup ISysCronGroup
|
||||
localSysLoginLog ISysLoginLog
|
||||
localSysBlacklist ISysBlacklist
|
||||
)
|
||||
|
||||
func SysBlacklist() ISysBlacklist {
|
||||
if localSysBlacklist == nil {
|
||||
panic("implement not found for interface ISysBlacklist, forgot register?")
|
||||
}
|
||||
return localSysBlacklist
|
||||
}
|
||||
|
||||
func RegisterSysBlacklist(i ISysBlacklist) {
|
||||
localSysBlacklist = i
|
||||
}
|
||||
|
||||
func SysCron() ISysCron {
|
||||
if localSysCron == nil {
|
||||
panic("implement not found for interface ISysCron, forgot register?")
|
||||
}
|
||||
return localSysCron
|
||||
}
|
||||
|
||||
func RegisterSysCron(i ISysCron) {
|
||||
localSysCron = i
|
||||
}
|
||||
|
||||
func SysGenCodes() ISysGenCodes {
|
||||
if localSysGenCodes == nil {
|
||||
panic("implement not found for interface ISysGenCodes, forgot register?")
|
||||
}
|
||||
return localSysGenCodes
|
||||
}
|
||||
|
||||
func RegisterSysGenCodes(i ISysGenCodes) {
|
||||
localSysGenCodes = i
|
||||
}
|
||||
|
||||
func SysAddonsConfig() ISysAddonsConfig {
|
||||
if localSysAddonsConfig == nil {
|
||||
panic("implement not found for interface ISysAddonsConfig, forgot register?")
|
||||
}
|
||||
return localSysAddonsConfig
|
||||
}
|
||||
|
||||
func RegisterSysAddonsConfig(i ISysAddonsConfig) {
|
||||
localSysAddonsConfig = i
|
||||
}
|
||||
|
||||
func SysConfig() ISysConfig {
|
||||
if localSysConfig == nil {
|
||||
panic("implement not found for interface ISysConfig, forgot register?")
|
||||
}
|
||||
return localSysConfig
|
||||
}
|
||||
|
||||
func RegisterSysConfig(i ISysConfig) {
|
||||
localSysConfig = i
|
||||
}
|
||||
|
||||
func SysCurdDemo() ISysCurdDemo {
|
||||
if localSysCurdDemo == nil {
|
||||
panic("implement not found for interface ISysCurdDemo, forgot register?")
|
||||
@ -271,17 +216,6 @@ func RegisterSysCurdDemo(i ISysCurdDemo) {
|
||||
localSysCurdDemo = i
|
||||
}
|
||||
|
||||
func SysDictType() ISysDictType {
|
||||
if localSysDictType == nil {
|
||||
panic("implement not found for interface ISysDictType, forgot register?")
|
||||
}
|
||||
return localSysDictType
|
||||
}
|
||||
|
||||
func RegisterSysDictType(i ISysDictType) {
|
||||
localSysDictType = i
|
||||
}
|
||||
|
||||
func SysEmsLog() ISysEmsLog {
|
||||
if localSysEmsLog == nil {
|
||||
panic("implement not found for interface ISysEmsLog, forgot register?")
|
||||
@ -293,15 +227,26 @@ func RegisterSysEmsLog(i ISysEmsLog) {
|
||||
localSysEmsLog = i
|
||||
}
|
||||
|
||||
func SysServeLog() ISysServeLog {
|
||||
if localSysServeLog == nil {
|
||||
panic("implement not found for interface ISysServeLog, forgot register?")
|
||||
func SysAddons() ISysAddons {
|
||||
if localSysAddons == nil {
|
||||
panic("implement not found for interface ISysAddons, forgot register?")
|
||||
}
|
||||
return localSysServeLog
|
||||
return localSysAddons
|
||||
}
|
||||
|
||||
func RegisterSysServeLog(i ISysServeLog) {
|
||||
localSysServeLog = i
|
||||
func RegisterSysAddons(i ISysAddons) {
|
||||
localSysAddons = i
|
||||
}
|
||||
|
||||
func SysAddonsConfig() ISysAddonsConfig {
|
||||
if localSysAddonsConfig == nil {
|
||||
panic("implement not found for interface ISysAddonsConfig, forgot register?")
|
||||
}
|
||||
return localSysAddonsConfig
|
||||
}
|
||||
|
||||
func RegisterSysAddonsConfig(i ISysAddonsConfig) {
|
||||
localSysAddonsConfig = i
|
||||
}
|
||||
|
||||
func SysAttachment() ISysAttachment {
|
||||
@ -315,59 +260,15 @@ func RegisterSysAttachment(i ISysAttachment) {
|
||||
localSysAttachment = i
|
||||
}
|
||||
|
||||
func SysLoginLog() ISysLoginLog {
|
||||
if localSysLoginLog == nil {
|
||||
panic("implement not found for interface ISysLoginLog, forgot register?")
|
||||
func SysCron() ISysCron {
|
||||
if localSysCron == nil {
|
||||
panic("implement not found for interface ISysCron, forgot register?")
|
||||
}
|
||||
return localSysLoginLog
|
||||
return localSysCron
|
||||
}
|
||||
|
||||
func RegisterSysLoginLog(i ISysLoginLog) {
|
||||
localSysLoginLog = i
|
||||
}
|
||||
|
||||
func SysProvinces() ISysProvinces {
|
||||
if localSysProvinces == nil {
|
||||
panic("implement not found for interface ISysProvinces, forgot register?")
|
||||
}
|
||||
return localSysProvinces
|
||||
}
|
||||
|
||||
func RegisterSysProvinces(i ISysProvinces) {
|
||||
localSysProvinces = i
|
||||
}
|
||||
|
||||
func SysSmsLog() ISysSmsLog {
|
||||
if localSysSmsLog == nil {
|
||||
panic("implement not found for interface ISysSmsLog, forgot register?")
|
||||
}
|
||||
return localSysSmsLog
|
||||
}
|
||||
|
||||
func RegisterSysSmsLog(i ISysSmsLog) {
|
||||
localSysSmsLog = i
|
||||
}
|
||||
|
||||
func SysAddons() ISysAddons {
|
||||
if localSysAddons == nil {
|
||||
panic("implement not found for interface ISysAddons, forgot register?")
|
||||
}
|
||||
return localSysAddons
|
||||
}
|
||||
|
||||
func RegisterSysAddons(i ISysAddons) {
|
||||
localSysAddons = i
|
||||
}
|
||||
|
||||
func SysDictData() ISysDictData {
|
||||
if localSysDictData == nil {
|
||||
panic("implement not found for interface ISysDictData, forgot register?")
|
||||
}
|
||||
return localSysDictData
|
||||
}
|
||||
|
||||
func RegisterSysDictData(i ISysDictData) {
|
||||
localSysDictData = i
|
||||
func RegisterSysCron(i ISysCron) {
|
||||
localSysCron = i
|
||||
}
|
||||
|
||||
func SysLog() ISysLog {
|
||||
@ -381,6 +282,28 @@ func RegisterSysLog(i ISysLog) {
|
||||
localSysLog = i
|
||||
}
|
||||
|
||||
func SysBlacklist() ISysBlacklist {
|
||||
if localSysBlacklist == nil {
|
||||
panic("implement not found for interface ISysBlacklist, forgot register?")
|
||||
}
|
||||
return localSysBlacklist
|
||||
}
|
||||
|
||||
func RegisterSysBlacklist(i ISysBlacklist) {
|
||||
localSysBlacklist = i
|
||||
}
|
||||
|
||||
func SysConfig() ISysConfig {
|
||||
if localSysConfig == nil {
|
||||
panic("implement not found for interface ISysConfig, forgot register?")
|
||||
}
|
||||
return localSysConfig
|
||||
}
|
||||
|
||||
func RegisterSysConfig(i ISysConfig) {
|
||||
localSysConfig = i
|
||||
}
|
||||
|
||||
func SysCronGroup() ISysCronGroup {
|
||||
if localSysCronGroup == nil {
|
||||
panic("implement not found for interface ISysCronGroup, forgot register?")
|
||||
@ -391,3 +314,80 @@ func SysCronGroup() ISysCronGroup {
|
||||
func RegisterSysCronGroup(i ISysCronGroup) {
|
||||
localSysCronGroup = i
|
||||
}
|
||||
|
||||
func SysLoginLog() ISysLoginLog {
|
||||
if localSysLoginLog == nil {
|
||||
panic("implement not found for interface ISysLoginLog, forgot register?")
|
||||
}
|
||||
return localSysLoginLog
|
||||
}
|
||||
|
||||
func RegisterSysLoginLog(i ISysLoginLog) {
|
||||
localSysLoginLog = i
|
||||
}
|
||||
|
||||
func SysSmsLog() ISysSmsLog {
|
||||
if localSysSmsLog == nil {
|
||||
panic("implement not found for interface ISysSmsLog, forgot register?")
|
||||
}
|
||||
return localSysSmsLog
|
||||
}
|
||||
|
||||
func RegisterSysSmsLog(i ISysSmsLog) {
|
||||
localSysSmsLog = i
|
||||
}
|
||||
|
||||
func SysDictData() ISysDictData {
|
||||
if localSysDictData == nil {
|
||||
panic("implement not found for interface ISysDictData, forgot register?")
|
||||
}
|
||||
return localSysDictData
|
||||
}
|
||||
|
||||
func RegisterSysDictData(i ISysDictData) {
|
||||
localSysDictData = i
|
||||
}
|
||||
|
||||
func SysDictType() ISysDictType {
|
||||
if localSysDictType == nil {
|
||||
panic("implement not found for interface ISysDictType, forgot register?")
|
||||
}
|
||||
return localSysDictType
|
||||
}
|
||||
|
||||
func RegisterSysDictType(i ISysDictType) {
|
||||
localSysDictType = i
|
||||
}
|
||||
|
||||
func SysGenCodes() ISysGenCodes {
|
||||
if localSysGenCodes == nil {
|
||||
panic("implement not found for interface ISysGenCodes, forgot register?")
|
||||
}
|
||||
return localSysGenCodes
|
||||
}
|
||||
|
||||
func RegisterSysGenCodes(i ISysGenCodes) {
|
||||
localSysGenCodes = i
|
||||
}
|
||||
|
||||
func SysProvinces() ISysProvinces {
|
||||
if localSysProvinces == nil {
|
||||
panic("implement not found for interface ISysProvinces, forgot register?")
|
||||
}
|
||||
return localSysProvinces
|
||||
}
|
||||
|
||||
func RegisterSysProvinces(i ISysProvinces) {
|
||||
localSysProvinces = i
|
||||
}
|
||||
|
||||
func SysServeLog() ISysServeLog {
|
||||
if localSysServeLog == nil {
|
||||
panic("implement not found for interface ISysServeLog, forgot register?")
|
||||
}
|
||||
return localSysServeLog
|
||||
}
|
||||
|
||||
func RegisterSysServeLog(i ISysServeLog) {
|
||||
localSysServeLog = i
|
||||
}
|
||||
|
@ -10,12 +10,6 @@ import (
|
||||
)
|
||||
|
||||
type (
|
||||
IAuthClient interface {
|
||||
Start(ctx context.Context)
|
||||
Stop(ctx context.Context)
|
||||
IsLogin() bool
|
||||
OnResponseAuthSummary(ctx context.Context, args ...interface{})
|
||||
}
|
||||
ICronClient interface {
|
||||
Start(ctx context.Context)
|
||||
Stop(ctx context.Context)
|
||||
@ -25,6 +19,12 @@ type (
|
||||
OnCronStatus(ctx context.Context, args ...interface{})
|
||||
OnCronOnlineExec(ctx context.Context, args ...interface{})
|
||||
}
|
||||
IAuthClient interface {
|
||||
Start(ctx context.Context)
|
||||
Stop(ctx context.Context)
|
||||
IsLogin() bool
|
||||
OnResponseAuthSummary(ctx context.Context, args ...interface{})
|
||||
}
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hotgo",
|
||||
"version": "2.7.3",
|
||||
"version": "2.7.6",
|
||||
"author": {
|
||||
"name": "MengShuai",
|
||||
"email": "133814250@qq.com",
|
||||
|
Loading…
Reference in New Issue
Block a user