mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-01-23 10:50:24 +08:00
add golangci-lint.
This commit is contained in:
parent
46604b51b2
commit
fdc48b9335
3
server/.golangci.yml
Normal file
3
server/.golangci.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
run:
|
||||||
|
skip-dirs: # 设置要忽略的目录
|
||||||
|
- internal/library/hggen/internal
|
@ -5,9 +5,11 @@
|
|||||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||||
package consts
|
package consts
|
||||||
|
|
||||||
|
type CtxKey string
|
||||||
|
|
||||||
// ContextKey 上下文
|
// ContextKey 上下文
|
||||||
const (
|
const (
|
||||||
ContextKey = "HotGoContext" // http上下文变量名称
|
ContextHTTPKey CtxKey = "httpContext" // http上下文变量名称
|
||||||
ContextKeyCronArgs = "cronArgs" // 定时任务参数上下文变量名称
|
ContextKeyCronArgs CtxKey = "cronArgs" // 定时任务参数上下文变量名称
|
||||||
ContextTCPKey = "HotGoTCPContext" // tcp上下文变量名称
|
ContextTCPKey CtxKey = "tcpContext" // tcp上下文变量名称
|
||||||
)
|
)
|
||||||
|
@ -15,12 +15,12 @@ import (
|
|||||||
|
|
||||||
// Init 初始化上下文对象指针到上下文对象中,以便后续的请求流程中可以修改
|
// Init 初始化上下文对象指针到上下文对象中,以便后续的请求流程中可以修改
|
||||||
func Init(r *ghttp.Request, customCtx *model.Context) {
|
func Init(r *ghttp.Request, customCtx *model.Context) {
|
||||||
r.SetCtxVar(consts.ContextKey, customCtx)
|
r.SetCtxVar(consts.ContextHTTPKey, customCtx)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get 获得上下文变量,如果没有设置,那么返回nil
|
// Get 获得上下文变量,如果没有设置,那么返回nil
|
||||||
func Get(ctx context.Context) *model.Context {
|
func Get(ctx context.Context) *model.Context {
|
||||||
value := ctx.Value(consts.ContextKey)
|
value := ctx.Value(consts.ContextHTTPKey)
|
||||||
if value == nil {
|
if value == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,6 @@ func (s *sAdminCash) List(ctx context.Context, in adminin.CashListInp) (list []*
|
|||||||
v.MemberUser = member.Username
|
v.MemberUser = member.Username
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -250,7 +249,6 @@ func (s *sAdminCash) Apply(ctx context.Context, in adminin.CashApplyInp) (err er
|
|||||||
err = gerror.Newf("申请提现失败, %+v", err)
|
err = gerror.Newf("申请提现失败, %+v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ package admin
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/gogf/gf/v2/errors/gerror"
|
"github.com/gogf/gf/v2/errors/gerror"
|
||||||
"hotgo/internal/consts"
|
|
||||||
"hotgo/internal/dao"
|
"hotgo/internal/dao"
|
||||||
"hotgo/internal/model/entity"
|
"hotgo/internal/model/entity"
|
||||||
"hotgo/internal/service"
|
"hotgo/internal/service"
|
||||||
@ -24,40 +23,22 @@ func init() {
|
|||||||
service.RegisterAdminMemberPost(NewAdminMemberPost())
|
service.RegisterAdminMemberPost(NewAdminMemberPost())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UpdatePostIds 更新用户岗位
|
||||||
func (s *sAdminMemberPost) UpdatePostIds(ctx context.Context, memberId int64, postIds []int64) (err error) {
|
func (s *sAdminMemberPost) UpdatePostIds(ctx context.Context, memberId int64, postIds []int64) (err error) {
|
||||||
_, err = dao.AdminMemberPost.Ctx(ctx).Where("member_id", memberId).Delete()
|
if _, err = dao.AdminMemberPost.Ctx(ctx).Where(dao.AdminMemberPost.Columns().MemberId, memberId).Delete(); err != nil {
|
||||||
if err != nil {
|
err = gerror.Wrap(err, "清理用户旧岗位数据失败,请稍后重试!")
|
||||||
err = gerror.Wrap(err, "删除失败")
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := 0; i < len(postIds); i++ {
|
for i := 0; i < len(postIds); i++ {
|
||||||
_, err = dao.AdminMemberPost.Ctx(ctx).
|
_, err = dao.AdminMemberPost.Ctx(ctx).Insert(entity.AdminMemberPost{
|
||||||
Insert(entity.AdminMemberPost{
|
|
||||||
MemberId: memberId,
|
MemberId: memberId,
|
||||||
PostId: postIds[i],
|
PostId: postIds[i],
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = gerror.Wrap(err, "插入用户岗位失败")
|
err = gerror.Wrap(err, "加入用户岗位数据失败,请稍后重试!")
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetMemberByIds 获取指定用户的岗位ids
|
|
||||||
func (s *sAdminMemberPost) GetMemberByIds(ctx context.Context, memberId int64) (postIds []int64, err error) {
|
|
||||||
var list []*entity.AdminMemberPost
|
|
||||||
err = dao.AdminMemberPost.Ctx(ctx).Fields("post_id").Where("member_id", memberId).Scan(&list)
|
|
||||||
if err != nil {
|
|
||||||
err = gerror.Wrap(err, consts.ErrorORM)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
for i := 0; i < len(list); i++ {
|
|
||||||
postIds = append(postIds, list[i].PostId)
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -260,6 +260,5 @@ func (s *sAdminSite) handleLogin(ctx context.Context, mb *entity.AdminMember) (r
|
|||||||
Token: loginToken,
|
Token: loginToken,
|
||||||
Expires: expires,
|
Expires: expires,
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -144,7 +144,6 @@ func (s *sSysAttachment) List(ctx context.Context, in sysin.AttachmentListInp) (
|
|||||||
v.SizeFormat = format.FileSize(v.Size)
|
v.SizeFormat = format.FileSize(v.Size)
|
||||||
v.FileUrl = service.CommonUpload().LastUrl(ctx, conf, v.FileUrl, v.Drive)
|
v.FileUrl = service.CommonUpload().LastUrl(ctx, conf, v.FileUrl, v.Drive)
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,33 +25,6 @@ import (
|
|||||||
"hotgo/utility/simple"
|
"hotgo/utility/simple"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MaskDemoField 演示环境下需要隐藏的配置
|
|
||||||
var MaskDemoField = []string{
|
|
||||||
// 邮箱
|
|
||||||
"smtpUser", "smtpPass",
|
|
||||||
|
|
||||||
// 云存储
|
|
||||||
"uploadUCloudPublicKey", "uploadUCloudPrivateKey",
|
|
||||||
"uploadCosSecretId", "uploadCosSecretKey",
|
|
||||||
"uploadOssSecretId", "uploadOssSecretKey",
|
|
||||||
"uploadQiNiuAccessKey", "uploadQiNiuSecretKey",
|
|
||||||
|
|
||||||
// 地图
|
|
||||||
"geoAmapWebKey",
|
|
||||||
|
|
||||||
// 短信
|
|
||||||
"smsAliYunAccessKeyID", "smsAliYunAccessKeySecret",
|
|
||||||
"smsTencentSecretId", "smsTencentSecretKey",
|
|
||||||
|
|
||||||
// 支付
|
|
||||||
"payWxPayMchId", "payWxPaySerialNo", "payWxPayAPIv3Key",
|
|
||||||
"payWxPayPrivateKey", "payQQPayMchId", "payQQPayApiKey",
|
|
||||||
|
|
||||||
// 微信
|
|
||||||
"officialAccountAppSecret", "officialAccountToken", "officialAccountEncodingAESKey",
|
|
||||||
"openPlatformAppSecret", "openPlatformToken", "openPlatformEncodingAESKey",
|
|
||||||
}
|
|
||||||
|
|
||||||
type sSysConfig struct{}
|
type sSysConfig struct{}
|
||||||
|
|
||||||
func NewSysConfig() *sSysConfig {
|
func NewSysConfig() *sSysConfig {
|
||||||
|
@ -291,7 +291,8 @@ func (s *sSysGenCodes) Preview(ctx context.Context, in sysin.GenCodesPreviewInp)
|
|||||||
// Build 提交生成
|
// Build 提交生成
|
||||||
func (s *sSysGenCodes) Build(ctx context.Context, in sysin.GenCodesBuildInp) (err error) {
|
func (s *sSysGenCodes) Build(ctx context.Context, in sysin.GenCodesBuildInp) (err error) {
|
||||||
// 先保存配置
|
// 先保存配置
|
||||||
if _, err = s.Edit(ctx, sysin.GenCodesEditInp{SysGenCodes: in.SysGenCodes}); err != nil {
|
ein := in.SysGenCodes
|
||||||
|
if _, err = s.Edit(ctx, sysin.GenCodesEditInp{SysGenCodes: ein}); err != nil {
|
||||||
err = gerror.Wrap(err, consts.ErrorORM)
|
err = gerror.Wrap(err, consts.ErrorORM)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -19,15 +19,44 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
IAdminDept interface {
|
IAdminCreditsLog interface {
|
||||||
Delete(ctx context.Context, in adminin.DeptDeleteInp) (err error)
|
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
|
||||||
Edit(ctx context.Context, in adminin.DeptEditInp) (err error)
|
SaveBalance(ctx context.Context, in adminin.CreditsLogSaveBalanceInp) (res *adminin.CreditsLogSaveBalanceModel, err error)
|
||||||
Status(ctx context.Context, in adminin.DeptStatusInp) (err error)
|
SaveIntegral(ctx context.Context, in adminin.CreditsLogSaveIntegralInp) (res *adminin.CreditsLogSaveIntegralModel, err error)
|
||||||
MaxSort(ctx context.Context, in adminin.DeptMaxSortInp) (res *adminin.DeptMaxSortModel, err error)
|
List(ctx context.Context, in adminin.CreditsLogListInp) (list []*adminin.CreditsLogListModel, totalCount int, err error)
|
||||||
View(ctx context.Context, in adminin.DeptViewInp) (res *adminin.DeptViewModel, err error)
|
Export(ctx context.Context, in adminin.CreditsLogListInp) (err error)
|
||||||
Option(ctx context.Context, in adminin.DeptOptionInp) (res *adminin.DeptOptionModel, totalCount int, err error)
|
}
|
||||||
List(ctx context.Context, in adminin.DeptListInp) (res *adminin.DeptListModel, err error)
|
IAdminMemberPost interface {
|
||||||
|
UpdatePostIds(ctx context.Context, memberId int64, postIds []int64) (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)
|
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)
|
||||||
|
}
|
||||||
|
IAdminCash interface {
|
||||||
|
View(ctx context.Context, in adminin.CashViewInp) (res *adminin.CashViewModel, err error)
|
||||||
|
List(ctx context.Context, in adminin.CashListInp) (list []*adminin.CashListModel, totalCount int, err error)
|
||||||
|
Apply(ctx context.Context, in adminin.CashApplyInp) (err error)
|
||||||
|
Payment(ctx context.Context, in adminin.CashPaymentInp) (err error)
|
||||||
}
|
}
|
||||||
IAdminMember interface {
|
IAdminMember interface {
|
||||||
AddBalance(ctx context.Context, in adminin.MemberAddBalanceInp) (err error)
|
AddBalance(ctx context.Context, in adminin.MemberAddBalanceInp) (err error)
|
||||||
@ -63,30 +92,6 @@ type (
|
|||||||
GetMenuList(ctx context.Context, memberId int64) (res *role.DynamicRes, err error)
|
GetMenuList(ctx context.Context, memberId int64) (res *role.DynamicRes, err error)
|
||||||
LoginPermissions(ctx context.Context, memberId int64) (lists adminin.MemberLoginPermissions, err error)
|
LoginPermissions(ctx context.Context, memberId int64) (lists adminin.MemberLoginPermissions, err error)
|
||||||
}
|
}
|
||||||
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)
|
|
||||||
}
|
|
||||||
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)
|
|
||||||
}
|
|
||||||
IAdminMemberPost interface {
|
|
||||||
UpdatePostIds(ctx context.Context, memberId int64, postIds []int64) (err error)
|
|
||||||
GetMemberByIds(ctx context.Context, memberId int64) (postIds []int64, err error)
|
|
||||||
}
|
|
||||||
IAdminMonitor interface {
|
IAdminMonitor interface {
|
||||||
StartMonitor(ctx context.Context)
|
StartMonitor(ctx context.Context)
|
||||||
GetMeta(ctx context.Context) *model.MonitorData
|
GetMeta(ctx context.Context) *model.MonitorData
|
||||||
@ -105,57 +110,62 @@ type (
|
|||||||
ReadAll(ctx context.Context, in adminin.NoticeReadAllInp) (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)
|
MessageList(ctx context.Context, in adminin.NoticeMessageListInp) (list []*adminin.NoticeMessageListModel, totalCount int, err error)
|
||||||
}
|
}
|
||||||
IAdminPost interface {
|
IAdminOrder interface {
|
||||||
Delete(ctx context.Context, in adminin.PostDeleteInp) (err error)
|
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
|
||||||
Edit(ctx context.Context, in adminin.PostEditInp) (err error)
|
AcceptRefund(ctx context.Context, in adminin.OrderAcceptRefundInp) (err error)
|
||||||
MaxSort(ctx context.Context, in adminin.PostMaxSortInp) (res *adminin.PostMaxSortModel, err error)
|
ApplyRefund(ctx context.Context, in adminin.OrderApplyRefundInp) (err error)
|
||||||
NameUnique(ctx context.Context, in adminin.PostNameUniqueInp) (res *adminin.PostNameUniqueModel, err error)
|
PayNotify(ctx context.Context, in payin.NotifyCallFuncInp) (err error)
|
||||||
CodeUnique(ctx context.Context, in adminin.PostCodeUniqueInp) (res *adminin.PostCodeUniqueModel, err error)
|
Create(ctx context.Context, in adminin.OrderCreateInp) (res *adminin.OrderCreateModel, err error)
|
||||||
View(ctx context.Context, in adminin.PostViewInp) (res *adminin.PostViewModel, err error)
|
List(ctx context.Context, in adminin.OrderListInp) (list []*adminin.OrderListModel, totalCount int, err error)
|
||||||
List(ctx context.Context, in adminin.PostListInp) (list []*adminin.PostListModel, totalCount int, err error)
|
Export(ctx context.Context, in adminin.OrderListInp) (err error)
|
||||||
GetMemberByStartName(ctx context.Context, memberId int64) (name string, err error)
|
Edit(ctx context.Context, in adminin.OrderEditInp) (err error)
|
||||||
Status(ctx context.Context, in adminin.PostStatusInp) (err error)
|
Delete(ctx context.Context, in adminin.OrderDeleteInp) (err error)
|
||||||
}
|
View(ctx context.Context, in adminin.OrderViewInp) (res *adminin.OrderViewModel, err error)
|
||||||
IAdminRole interface {
|
Status(ctx context.Context, in adminin.OrderStatusInp) (err error)
|
||||||
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)
|
|
||||||
}
|
}
|
||||||
IAdminSite interface {
|
IAdminSite interface {
|
||||||
Register(ctx context.Context, in adminin.RegisterInp) (err error)
|
Register(ctx context.Context, in adminin.RegisterInp) (err error)
|
||||||
AccountLogin(ctx context.Context, in adminin.AccountLoginInp) (res *adminin.LoginModel, err error)
|
AccountLogin(ctx context.Context, in adminin.AccountLoginInp) (res *adminin.LoginModel, err error)
|
||||||
MobileLogin(ctx context.Context, in adminin.MobileLoginInp) (res *adminin.LoginModel, err error)
|
MobileLogin(ctx context.Context, in adminin.MobileLoginInp) (res *adminin.LoginModel, err error)
|
||||||
}
|
}
|
||||||
IAdminCash interface {
|
IAdminDept interface {
|
||||||
View(ctx context.Context, in adminin.CashViewInp) (res *adminin.CashViewModel, err error)
|
Delete(ctx context.Context, in adminin.DeptDeleteInp) (err error)
|
||||||
List(ctx context.Context, in adminin.CashListInp) (list []*adminin.CashListModel, totalCount int, err error)
|
Edit(ctx context.Context, in adminin.DeptEditInp) (err error)
|
||||||
Apply(ctx context.Context, in adminin.CashApplyInp) (err error)
|
Status(ctx context.Context, in adminin.DeptStatusInp) (err error)
|
||||||
Payment(ctx context.Context, in adminin.CashPaymentInp) (err error)
|
MaxSort(ctx context.Context, in adminin.DeptMaxSortInp) (res *adminin.DeptMaxSortModel, err error)
|
||||||
|
View(ctx context.Context, in adminin.DeptViewInp) (res *adminin.DeptViewModel, err error)
|
||||||
|
Option(ctx context.Context, in adminin.DeptOptionInp) (res *adminin.DeptOptionModel, totalCount int, err error)
|
||||||
|
List(ctx context.Context, in adminin.DeptListInp) (res *adminin.DeptListModel, err error)
|
||||||
|
GetName(ctx context.Context, id int64) (name string, err error)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
localAdminCash IAdminCash
|
||||||
localAdminCreditsLog IAdminCreditsLog
|
localAdminCreditsLog IAdminCreditsLog
|
||||||
|
localAdminMemberPost IAdminMemberPost
|
||||||
|
localAdminPost IAdminPost
|
||||||
|
localAdminRole IAdminRole
|
||||||
localAdminDept IAdminDept
|
localAdminDept IAdminDept
|
||||||
localAdminMember IAdminMember
|
localAdminMember IAdminMember
|
||||||
localAdminMenu IAdminMenu
|
localAdminMenu IAdminMenu
|
||||||
localAdminOrder IAdminOrder
|
|
||||||
localAdminRole IAdminRole
|
|
||||||
localAdminSite IAdminSite
|
|
||||||
localAdminCash IAdminCash
|
|
||||||
localAdminMemberPost IAdminMemberPost
|
|
||||||
localAdminMonitor IAdminMonitor
|
localAdminMonitor IAdminMonitor
|
||||||
localAdminNotice IAdminNotice
|
localAdminNotice IAdminNotice
|
||||||
localAdminPost IAdminPost
|
localAdminOrder IAdminOrder
|
||||||
|
localAdminSite IAdminSite
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func AdminCash() IAdminCash {
|
||||||
|
if localAdminCash == nil {
|
||||||
|
panic("implement not found for interface IAdminCash, forgot register?")
|
||||||
|
}
|
||||||
|
return localAdminCash
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterAdminCash(i IAdminCash) {
|
||||||
|
localAdminCash = i
|
||||||
|
}
|
||||||
|
|
||||||
func AdminCreditsLog() IAdminCreditsLog {
|
func AdminCreditsLog() IAdminCreditsLog {
|
||||||
if localAdminCreditsLog == nil {
|
if localAdminCreditsLog == nil {
|
||||||
panic("implement not found for interface IAdminCreditsLog, forgot register?")
|
panic("implement not found for interface IAdminCreditsLog, forgot register?")
|
||||||
@ -167,6 +177,39 @@ func RegisterAdminCreditsLog(i IAdminCreditsLog) {
|
|||||||
localAdminCreditsLog = i
|
localAdminCreditsLog = i
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func AdminMemberPost() IAdminMemberPost {
|
||||||
|
if localAdminMemberPost == nil {
|
||||||
|
panic("implement not found for interface IAdminMemberPost, forgot register?")
|
||||||
|
}
|
||||||
|
return localAdminMemberPost
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterAdminMemberPost(i IAdminMemberPost) {
|
||||||
|
localAdminMemberPost = i
|
||||||
|
}
|
||||||
|
|
||||||
|
func AdminPost() IAdminPost {
|
||||||
|
if localAdminPost == nil {
|
||||||
|
panic("implement not found for interface IAdminPost, forgot register?")
|
||||||
|
}
|
||||||
|
return localAdminPost
|
||||||
|
}
|
||||||
|
|
||||||
|
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 AdminDept() IAdminDept {
|
func AdminDept() IAdminDept {
|
||||||
if localAdminDept == nil {
|
if localAdminDept == nil {
|
||||||
panic("implement not found for interface IAdminDept, forgot register?")
|
panic("implement not found for interface IAdminDept, forgot register?")
|
||||||
@ -200,61 +243,6 @@ func RegisterAdminMenu(i IAdminMenu) {
|
|||||||
localAdminMenu = i
|
localAdminMenu = 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 AdminRole() IAdminRole {
|
|
||||||
if localAdminRole == nil {
|
|
||||||
panic("implement not found for interface IAdminRole, forgot register?")
|
|
||||||
}
|
|
||||||
return localAdminRole
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterAdminRole(i IAdminRole) {
|
|
||||||
localAdminRole = 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 AdminCash() IAdminCash {
|
|
||||||
if localAdminCash == nil {
|
|
||||||
panic("implement not found for interface IAdminCash, forgot register?")
|
|
||||||
}
|
|
||||||
return localAdminCash
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterAdminCash(i IAdminCash) {
|
|
||||||
localAdminCash = i
|
|
||||||
}
|
|
||||||
|
|
||||||
func AdminMemberPost() IAdminMemberPost {
|
|
||||||
if localAdminMemberPost == nil {
|
|
||||||
panic("implement not found for interface IAdminMemberPost, forgot register?")
|
|
||||||
}
|
|
||||||
return localAdminMemberPost
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterAdminMemberPost(i IAdminMemberPost) {
|
|
||||||
localAdminMemberPost = i
|
|
||||||
}
|
|
||||||
|
|
||||||
func AdminMonitor() IAdminMonitor {
|
func AdminMonitor() IAdminMonitor {
|
||||||
if localAdminMonitor == nil {
|
if localAdminMonitor == nil {
|
||||||
panic("implement not found for interface IAdminMonitor, forgot register?")
|
panic("implement not found for interface IAdminMonitor, forgot register?")
|
||||||
@ -277,13 +265,24 @@ func RegisterAdminNotice(i IAdminNotice) {
|
|||||||
localAdminNotice = i
|
localAdminNotice = i
|
||||||
}
|
}
|
||||||
|
|
||||||
func AdminPost() IAdminPost {
|
func AdminOrder() IAdminOrder {
|
||||||
if localAdminPost == nil {
|
if localAdminOrder == nil {
|
||||||
panic("implement not found for interface IAdminPost, forgot register?")
|
panic("implement not found for interface IAdminOrder, forgot register?")
|
||||||
}
|
}
|
||||||
return localAdminPost
|
return localAdminOrder
|
||||||
}
|
}
|
||||||
|
|
||||||
func RegisterAdminPost(i IAdminPost) {
|
func RegisterAdminOrder(i IAdminOrder) {
|
||||||
localAdminPost = i
|
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
|
||||||
}
|
}
|
||||||
|
@ -17,10 +17,52 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
ISysAddonsConfig interface {
|
ISysDictData interface {
|
||||||
GetConfigByGroup(ctx context.Context, in sysin.GetAddonsConfigInp) (res *sysin.GetAddonsConfigModel, err error)
|
Delete(ctx context.Context, in sysin.DictDataDeleteInp) error
|
||||||
ConversionType(ctx context.Context, models *entity.SysAddonsConfig) (value interface{}, err error)
|
Edit(ctx context.Context, in sysin.DictDataEditInp) (err error)
|
||||||
UpdateConfigByGroup(ctx context.Context, in sysin.UpdateAddonsConfigInp) (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)
|
||||||
|
}
|
||||||
|
ISysGenCodes interface {
|
||||||
|
Delete(ctx context.Context, in sysin.GenCodesDeleteInp) (err error)
|
||||||
|
Edit(ctx context.Context, in sysin.GenCodesEditInp) (res *sysin.GenCodesEditModel, err error)
|
||||||
|
Status(ctx context.Context, in sysin.GenCodesStatusInp) (err error)
|
||||||
|
MaxSort(ctx context.Context, in sysin.GenCodesMaxSortInp) (res *sysin.GenCodesMaxSortModel, err error)
|
||||||
|
View(ctx context.Context, in sysin.GenCodesViewInp) (res *sysin.GenCodesViewModel, err error)
|
||||||
|
List(ctx context.Context, in sysin.GenCodesListInp) (list []*sysin.GenCodesListModel, totalCount int, err error)
|
||||||
|
Selects(ctx context.Context, in sysin.GenCodesSelectsInp) (res *sysin.GenCodesSelectsModel, err error)
|
||||||
|
TableSelect(ctx context.Context, in sysin.GenCodesTableSelectInp) (res []*sysin.GenCodesTableSelectModel, err error)
|
||||||
|
ColumnSelect(ctx context.Context, in sysin.GenCodesColumnSelectInp) (res []*sysin.GenCodesColumnSelectModel, err error)
|
||||||
|
ColumnList(ctx context.Context, in sysin.GenCodesColumnListInp) (res []*sysin.GenCodesColumnListModel, err error)
|
||||||
|
Preview(ctx context.Context, in sysin.GenCodesPreviewInp) (res *sysin.GenCodesPreviewModel, err error)
|
||||||
|
Build(ctx context.Context, in sysin.GenCodesBuildInp) (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)
|
||||||
|
}
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
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)
|
||||||
}
|
}
|
||||||
ISysBlacklist interface {
|
ISysBlacklist interface {
|
||||||
Delete(ctx context.Context, in sysin.BlacklistDeleteInp) (err error)
|
Delete(ctx context.Context, in sysin.BlacklistDeleteInp) (err error)
|
||||||
@ -32,14 +74,26 @@ type (
|
|||||||
VariableLoad(ctx context.Context, err error)
|
VariableLoad(ctx context.Context, err error)
|
||||||
Load(ctx context.Context)
|
Load(ctx context.Context)
|
||||||
}
|
}
|
||||||
ISysLoginLog interface {
|
ISysConfig interface {
|
||||||
Model(ctx context.Context) *gdb.Model
|
InitConfig(ctx context.Context)
|
||||||
List(ctx context.Context, in sysin.LoginLogListInp) (list []*sysin.LoginLogListModel, totalCount int, err error)
|
GetLogin(ctx context.Context) (conf *model.LoginConfig, err error)
|
||||||
Export(ctx context.Context, in sysin.LoginLogListInp) (err error)
|
GetWechat(ctx context.Context) (conf *model.WechatConfig, err error)
|
||||||
Delete(ctx context.Context, in sysin.LoginLogDeleteInp) (err error)
|
GetPay(ctx context.Context) (conf *model.PayConfig, err error)
|
||||||
View(ctx context.Context, in sysin.LoginLogViewInp) (res *sysin.LoginLogViewModel, err error)
|
GetSms(ctx context.Context) (conf *model.SmsConfig, err error)
|
||||||
Push(ctx context.Context, in sysin.LoginLogPushInp)
|
GetGeo(ctx context.Context) (conf *model.GeoConfig, err error)
|
||||||
RealWrite(ctx context.Context, models entity.SysLoginLog) (err error)
|
GetUpload(ctx context.Context) (conf *model.UploadConfig, err error)
|
||||||
|
GetSmtp(ctx context.Context) (conf *model.EmailConfig, err error)
|
||||||
|
GetBasic(ctx context.Context) (conf *model.BasicConfig, err error)
|
||||||
|
GetLoadTCP(ctx context.Context) (conf *model.TCPConfig, err error)
|
||||||
|
GetLoadCache(ctx context.Context) (conf *model.CacheConfig, err error)
|
||||||
|
GetLoadGenerate(ctx context.Context) (conf *model.GenerateConfig, err error)
|
||||||
|
GetLoadToken(ctx context.Context) (conf *model.TokenConfig, err error)
|
||||||
|
GetLoadSSL(ctx context.Context) (conf *model.SSLConfig, err error)
|
||||||
|
GetLoadLog(ctx context.Context) (conf *model.LogConfig, err error)
|
||||||
|
GetLoadServeLog(ctx context.Context) (conf *model.ServeLogConfig, err error)
|
||||||
|
GetConfigByGroup(ctx context.Context, in sysin.GetConfigInp) (res *sysin.GetConfigModel, err error)
|
||||||
|
ConversionType(ctx context.Context, models *entity.SysConfig) (value interface{}, err error)
|
||||||
|
UpdateConfigByGroup(ctx context.Context, in sysin.UpdateConfigInp) (err error)
|
||||||
}
|
}
|
||||||
ISysCurdDemo interface {
|
ISysCurdDemo interface {
|
||||||
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
|
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
|
||||||
@ -52,11 +106,35 @@ type (
|
|||||||
Status(ctx context.Context, in sysin.CurdDemoStatusInp) (err error)
|
Status(ctx context.Context, in sysin.CurdDemoStatusInp) (err error)
|
||||||
Switch(ctx context.Context, in sysin.CurdDemoSwitchInp) (err error)
|
Switch(ctx context.Context, in sysin.CurdDemoSwitchInp) (err error)
|
||||||
}
|
}
|
||||||
ISysDictData interface {
|
ISysDictType interface {
|
||||||
Delete(ctx context.Context, in sysin.DictDataDeleteInp) error
|
Tree(ctx context.Context) (list []*sysin.DictTypeTree, err error)
|
||||||
Edit(ctx context.Context, in sysin.DictDataEditInp) (err error)
|
Delete(ctx context.Context, in sysin.DictTypeDeleteInp) (err error)
|
||||||
List(ctx context.Context, in sysin.DictDataListInp) (list []*sysin.DictDataListModel, totalCount int, err error)
|
Edit(ctx context.Context, in sysin.DictTypeEditInp) (err error)
|
||||||
Select(ctx context.Context, in sysin.DataSelectInp) (list sysin.DataSelectModel, err error)
|
TreeSelect(ctx context.Context, in sysin.DictTreeSelectInp) (list []*sysin.DictTypeTree, err error)
|
||||||
|
}
|
||||||
|
ISysAttachment interface {
|
||||||
|
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
|
||||||
|
Delete(ctx context.Context, in sysin.AttachmentDeleteInp) (err error)
|
||||||
|
Edit(ctx context.Context, in sysin.AttachmentEditInp) (err error)
|
||||||
|
Status(ctx context.Context, in sysin.AttachmentStatusInp) (err error)
|
||||||
|
MaxSort(ctx context.Context, in sysin.AttachmentMaxSortInp) (res *sysin.AttachmentMaxSortModel, 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)
|
||||||
|
Add(ctx context.Context, meta *sysin.UploadFileMeta, fullPath, drive string) (models *entity.SysAttachment, 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)
|
||||||
}
|
}
|
||||||
ISysEmsLog interface {
|
ISysEmsLog interface {
|
||||||
Delete(ctx context.Context, in sysin.EmsLogDeleteInp) (err error)
|
Delete(ctx context.Context, in sysin.EmsLogDeleteInp) (err error)
|
||||||
@ -81,13 +159,13 @@ type (
|
|||||||
UniqueId(ctx context.Context, in sysin.ProvincesUniqueIdInp) (res *sysin.ProvincesUniqueIdModel, 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)
|
Select(ctx context.Context, in sysin.ProvincesSelectInp) (res *sysin.ProvincesSelectModel, err error)
|
||||||
}
|
}
|
||||||
ISysServeLog interface {
|
ISysAddons interface {
|
||||||
Model(ctx context.Context) *gdb.Model
|
List(ctx context.Context, in sysin.AddonsListInp) (list []*sysin.AddonsListModel, totalCount int, err error)
|
||||||
List(ctx context.Context, in sysin.ServeLogListInp) (list []*sysin.ServeLogListModel, totalCount int, err error)
|
Selects(ctx context.Context, in sysin.AddonsSelectsInp) (res *sysin.AddonsSelectsModel, err error)
|
||||||
Export(ctx context.Context, in sysin.ServeLogListInp) (err error)
|
Build(ctx context.Context, in sysin.AddonsBuildInp) (err error)
|
||||||
Delete(ctx context.Context, in sysin.ServeLogDeleteInp) (err error)
|
Install(ctx context.Context, in sysin.AddonsInstallInp) (err error)
|
||||||
View(ctx context.Context, in sysin.ServeLogViewInp) (res *sysin.ServeLogViewModel, err error)
|
Upgrade(ctx context.Context, in sysin.AddonsUpgradeInp) (err error)
|
||||||
RealWrite(ctx context.Context, models entity.SysServeLog) (err error)
|
UnInstall(ctx context.Context, in sysin.AddonsUnInstallInp) (err error)
|
||||||
}
|
}
|
||||||
ISysSmsLog interface {
|
ISysSmsLog interface {
|
||||||
Delete(ctx context.Context, in sysin.SmsLogDeleteInp) (err error)
|
Delete(ctx context.Context, in sysin.SmsLogDeleteInp) (err error)
|
||||||
@ -101,225 +179,37 @@ type (
|
|||||||
AllowSend(ctx context.Context, models *entity.SysSmsLog, config *model.SmsConfig) (err error)
|
AllowSend(ctx context.Context, models *entity.SysSmsLog, config *model.SmsConfig) (err error)
|
||||||
VerifyCode(ctx context.Context, in sysin.VerifyCodeInp) (err error)
|
VerifyCode(ctx context.Context, in sysin.VerifyCodeInp) (err error)
|
||||||
}
|
}
|
||||||
ISysAddons interface {
|
ISysLoginLog interface {
|
||||||
List(ctx context.Context, in sysin.AddonsListInp) (list []*sysin.AddonsListModel, totalCount int, err error)
|
Model(ctx context.Context) *gdb.Model
|
||||||
Selects(ctx context.Context, in sysin.AddonsSelectsInp) (res *sysin.AddonsSelectsModel, err error)
|
List(ctx context.Context, in sysin.LoginLogListInp) (list []*sysin.LoginLogListModel, totalCount int, err error)
|
||||||
Build(ctx context.Context, in sysin.AddonsBuildInp) (err error)
|
Export(ctx context.Context, in sysin.LoginLogListInp) (err error)
|
||||||
Install(ctx context.Context, in sysin.AddonsInstallInp) (err error)
|
Delete(ctx context.Context, in sysin.LoginLogDeleteInp) (err error)
|
||||||
Upgrade(ctx context.Context, in sysin.AddonsUpgradeInp) (err error)
|
View(ctx context.Context, in sysin.LoginLogViewInp) (res *sysin.LoginLogViewModel, err error)
|
||||||
UnInstall(ctx context.Context, in sysin.AddonsUnInstallInp) (err error)
|
Push(ctx context.Context, in sysin.LoginLogPushInp)
|
||||||
}
|
RealWrite(ctx context.Context, models entity.SysLoginLog) (err error)
|
||||||
ISysConfig interface {
|
|
||||||
InitConfig(ctx context.Context)
|
|
||||||
GetLogin(ctx context.Context) (conf *model.LoginConfig, err error)
|
|
||||||
GetWechat(ctx context.Context) (conf *model.WechatConfig, err error)
|
|
||||||
GetPay(ctx context.Context) (conf *model.PayConfig, err error)
|
|
||||||
GetSms(ctx context.Context) (conf *model.SmsConfig, err error)
|
|
||||||
GetGeo(ctx context.Context) (conf *model.GeoConfig, err error)
|
|
||||||
GetUpload(ctx context.Context) (conf *model.UploadConfig, err error)
|
|
||||||
GetSmtp(ctx context.Context) (conf *model.EmailConfig, err error)
|
|
||||||
GetBasic(ctx context.Context) (conf *model.BasicConfig, err error)
|
|
||||||
GetLoadTCP(ctx context.Context) (conf *model.TCPConfig, err error)
|
|
||||||
GetLoadCache(ctx context.Context) (conf *model.CacheConfig, err error)
|
|
||||||
GetLoadGenerate(ctx context.Context) (conf *model.GenerateConfig, err error)
|
|
||||||
GetLoadToken(ctx context.Context) (conf *model.TokenConfig, err error)
|
|
||||||
GetLoadSSL(ctx context.Context) (conf *model.SSLConfig, err error)
|
|
||||||
GetLoadLog(ctx context.Context) (conf *model.LogConfig, err error)
|
|
||||||
GetLoadServeLog(ctx context.Context) (conf *model.ServeLogConfig, err error)
|
|
||||||
GetConfigByGroup(ctx context.Context, in sysin.GetConfigInp) (res *sysin.GetConfigModel, err error)
|
|
||||||
ConversionType(ctx context.Context, models *entity.SysConfig) (value interface{}, err error)
|
|
||||||
UpdateConfigByGroup(ctx context.Context, in sysin.UpdateConfigInp) (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)
|
|
||||||
}
|
|
||||||
ISysGenCodes interface {
|
|
||||||
Delete(ctx context.Context, in sysin.GenCodesDeleteInp) (err error)
|
|
||||||
Edit(ctx context.Context, in sysin.GenCodesEditInp) (res *sysin.GenCodesEditModel, err error)
|
|
||||||
Status(ctx context.Context, in sysin.GenCodesStatusInp) (err error)
|
|
||||||
MaxSort(ctx context.Context, in sysin.GenCodesMaxSortInp) (res *sysin.GenCodesMaxSortModel, err error)
|
|
||||||
View(ctx context.Context, in sysin.GenCodesViewInp) (res *sysin.GenCodesViewModel, err error)
|
|
||||||
List(ctx context.Context, in sysin.GenCodesListInp) (list []*sysin.GenCodesListModel, totalCount int, err error)
|
|
||||||
Selects(ctx context.Context, in sysin.GenCodesSelectsInp) (res *sysin.GenCodesSelectsModel, err error)
|
|
||||||
TableSelect(ctx context.Context, in sysin.GenCodesTableSelectInp) (res []*sysin.GenCodesTableSelectModel, err error)
|
|
||||||
ColumnSelect(ctx context.Context, in sysin.GenCodesColumnSelectInp) (res []*sysin.GenCodesColumnSelectModel, err error)
|
|
||||||
ColumnList(ctx context.Context, in sysin.GenCodesColumnListInp) (res []*sysin.GenCodesColumnListModel, err error)
|
|
||||||
Preview(ctx context.Context, in sysin.GenCodesPreviewInp) (res *sysin.GenCodesPreviewModel, err error)
|
|
||||||
Build(ctx context.Context, in sysin.GenCodesBuildInp) (err error)
|
|
||||||
}
|
|
||||||
ISysAttachment interface {
|
|
||||||
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
|
|
||||||
Delete(ctx context.Context, in sysin.AttachmentDeleteInp) (err error)
|
|
||||||
Edit(ctx context.Context, in sysin.AttachmentEditInp) (err error)
|
|
||||||
Status(ctx context.Context, in sysin.AttachmentStatusInp) (err error)
|
|
||||||
MaxSort(ctx context.Context, in sysin.AttachmentMaxSortInp) (res *sysin.AttachmentMaxSortModel, 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)
|
|
||||||
Add(ctx context.Context, meta *sysin.UploadFileMeta, fullPath, drive string) (models *entity.SysAttachment, 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)
|
|
||||||
}
|
|
||||||
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)
|
|
||||||
}
|
|
||||||
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)
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
localSysDictData ISysDictData
|
localSysDictData ISysDictData
|
||||||
|
localSysGenCodes ISysGenCodes
|
||||||
|
localSysLog ISysLog
|
||||||
|
localSysServeLog ISysServeLog
|
||||||
|
localSysCron ISysCron
|
||||||
|
localSysBlacklist ISysBlacklist
|
||||||
|
localSysConfig ISysConfig
|
||||||
|
localSysCurdDemo ISysCurdDemo
|
||||||
|
localSysDictType ISysDictType
|
||||||
|
localSysAttachment ISysAttachment
|
||||||
|
localSysAddonsConfig ISysAddonsConfig
|
||||||
|
localSysCronGroup ISysCronGroup
|
||||||
localSysEmsLog ISysEmsLog
|
localSysEmsLog ISysEmsLog
|
||||||
localSysProvinces ISysProvinces
|
localSysProvinces ISysProvinces
|
||||||
localSysCurdDemo ISysCurdDemo
|
|
||||||
localSysConfig ISysConfig
|
|
||||||
localSysDictType ISysDictType
|
|
||||||
localSysGenCodes ISysGenCodes
|
|
||||||
localSysServeLog ISysServeLog
|
|
||||||
localSysSmsLog ISysSmsLog
|
|
||||||
localSysAddons ISysAddons
|
localSysAddons ISysAddons
|
||||||
localSysCron ISysCron
|
localSysSmsLog ISysSmsLog
|
||||||
localSysCronGroup ISysCronGroup
|
|
||||||
localSysLog ISysLog
|
|
||||||
localSysAttachment ISysAttachment
|
|
||||||
localSysBlacklist ISysBlacklist
|
|
||||||
localSysLoginLog ISysLoginLog
|
localSysLoginLog ISysLoginLog
|
||||||
localSysAddonsConfig ISysAddonsConfig
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func SysAttachment() ISysAttachment {
|
|
||||||
if localSysAttachment == nil {
|
|
||||||
panic("implement not found for interface ISysAttachment, forgot register?")
|
|
||||||
}
|
|
||||||
return localSysAttachment
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterSysAttachment(i ISysAttachment) {
|
|
||||||
localSysAttachment = 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 SysCronGroup() ISysCronGroup {
|
|
||||||
if localSysCronGroup == nil {
|
|
||||||
panic("implement not found for interface ISysCronGroup, forgot register?")
|
|
||||||
}
|
|
||||||
return localSysCronGroup
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterSysCronGroup(i ISysCronGroup) {
|
|
||||||
localSysCronGroup = i
|
|
||||||
}
|
|
||||||
|
|
||||||
func SysLog() ISysLog {
|
|
||||||
if localSysLog == nil {
|
|
||||||
panic("implement not found for interface ISysLog, forgot register?")
|
|
||||||
}
|
|
||||||
return localSysLog
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterSysLog(i ISysLog) {
|
|
||||||
localSysLog = 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 SysBlacklist() ISysBlacklist {
|
|
||||||
if localSysBlacklist == nil {
|
|
||||||
panic("implement not found for interface ISysBlacklist, forgot register?")
|
|
||||||
}
|
|
||||||
return localSysBlacklist
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterSysBlacklist(i ISysBlacklist) {
|
|
||||||
localSysBlacklist = 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 SysCurdDemo() ISysCurdDemo {
|
|
||||||
if localSysCurdDemo == nil {
|
|
||||||
panic("implement not found for interface ISysCurdDemo, forgot register?")
|
|
||||||
}
|
|
||||||
return localSysCurdDemo
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterSysCurdDemo(i ISysCurdDemo) {
|
|
||||||
localSysCurdDemo = 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 SysEmsLog() ISysEmsLog {
|
|
||||||
if localSysEmsLog == nil {
|
|
||||||
panic("implement not found for interface ISysEmsLog, forgot register?")
|
|
||||||
}
|
|
||||||
return localSysEmsLog
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterSysEmsLog(i ISysEmsLog) {
|
|
||||||
localSysEmsLog = i
|
|
||||||
}
|
|
||||||
|
|
||||||
func SysProvinces() ISysProvinces {
|
func SysProvinces() ISysProvinces {
|
||||||
if localSysProvinces == nil {
|
if localSysProvinces == nil {
|
||||||
panic("implement not found for interface ISysProvinces, forgot register?")
|
panic("implement not found for interface ISysProvinces, forgot register?")
|
||||||
@ -331,17 +221,6 @@ func RegisterSysProvinces(i ISysProvinces) {
|
|||||||
localSysProvinces = i
|
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 {
|
func SysAddons() ISysAddons {
|
||||||
if localSysAddons == nil {
|
if localSysAddons == nil {
|
||||||
panic("implement not found for interface ISysAddons, forgot register?")
|
panic("implement not found for interface ISysAddons, forgot register?")
|
||||||
@ -353,26 +232,92 @@ func RegisterSysAddons(i ISysAddons) {
|
|||||||
localSysAddons = i
|
localSysAddons = i
|
||||||
}
|
}
|
||||||
|
|
||||||
func SysConfig() ISysConfig {
|
func SysAddonsConfig() ISysAddonsConfig {
|
||||||
if localSysConfig == nil {
|
if localSysAddonsConfig == nil {
|
||||||
panic("implement not found for interface ISysConfig, forgot register?")
|
panic("implement not found for interface ISysAddonsConfig, forgot register?")
|
||||||
}
|
}
|
||||||
return localSysConfig
|
return localSysAddonsConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
func RegisterSysConfig(i ISysConfig) {
|
func RegisterSysAddonsConfig(i ISysAddonsConfig) {
|
||||||
localSysConfig = i
|
localSysAddonsConfig = i
|
||||||
}
|
}
|
||||||
|
|
||||||
func SysDictType() ISysDictType {
|
func SysCronGroup() ISysCronGroup {
|
||||||
if localSysDictType == nil {
|
if localSysCronGroup == nil {
|
||||||
panic("implement not found for interface ISysDictType, forgot register?")
|
panic("implement not found for interface ISysCronGroup, forgot register?")
|
||||||
}
|
}
|
||||||
return localSysDictType
|
return localSysCronGroup
|
||||||
}
|
}
|
||||||
|
|
||||||
func RegisterSysDictType(i ISysDictType) {
|
func RegisterSysCronGroup(i ISysCronGroup) {
|
||||||
localSysDictType = i
|
localSysCronGroup = i
|
||||||
|
}
|
||||||
|
|
||||||
|
func SysEmsLog() ISysEmsLog {
|
||||||
|
if localSysEmsLog == nil {
|
||||||
|
panic("implement not found for interface ISysEmsLog, forgot register?")
|
||||||
|
}
|
||||||
|
return localSysEmsLog
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterSysEmsLog(i ISysEmsLog) {
|
||||||
|
localSysEmsLog = 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 SysServeLog() ISysServeLog {
|
||||||
|
if localSysServeLog == nil {
|
||||||
|
panic("implement not found for interface ISysServeLog, forgot register?")
|
||||||
|
}
|
||||||
|
return localSysServeLog
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterSysServeLog(i ISysServeLog) {
|
||||||
|
localSysServeLog = 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 SysDictData() ISysDictData {
|
||||||
|
if localSysDictData == nil {
|
||||||
|
panic("implement not found for interface ISysDictData, forgot register?")
|
||||||
|
}
|
||||||
|
return localSysDictData
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterSysDictData(i ISysDictData) {
|
||||||
|
localSysDictData = i
|
||||||
}
|
}
|
||||||
|
|
||||||
func SysGenCodes() ISysGenCodes {
|
func SysGenCodes() ISysGenCodes {
|
||||||
@ -386,13 +331,68 @@ func RegisterSysGenCodes(i ISysGenCodes) {
|
|||||||
localSysGenCodes = i
|
localSysGenCodes = i
|
||||||
}
|
}
|
||||||
|
|
||||||
func SysServeLog() ISysServeLog {
|
func SysLog() ISysLog {
|
||||||
if localSysServeLog == nil {
|
if localSysLog == nil {
|
||||||
panic("implement not found for interface ISysServeLog, forgot register?")
|
panic("implement not found for interface ISysLog, forgot register?")
|
||||||
}
|
}
|
||||||
return localSysServeLog
|
return localSysLog
|
||||||
}
|
}
|
||||||
|
|
||||||
func RegisterSysServeLog(i ISysServeLog) {
|
func RegisterSysLog(i ISysLog) {
|
||||||
localSysServeLog = i
|
localSysLog = 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 SysAttachment() ISysAttachment {
|
||||||
|
if localSysAttachment == nil {
|
||||||
|
panic("implement not found for interface ISysAttachment, forgot register?")
|
||||||
|
}
|
||||||
|
return localSysAttachment
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterSysAttachment(i ISysAttachment) {
|
||||||
|
localSysAttachment = 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 SysCurdDemo() ISysCurdDemo {
|
||||||
|
if localSysCurdDemo == nil {
|
||||||
|
panic("implement not found for interface ISysCurdDemo, forgot register?")
|
||||||
|
}
|
||||||
|
return localSysCurdDemo
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterSysCurdDemo(i ISysCurdDemo) {
|
||||||
|
localSysCurdDemo = i
|
||||||
}
|
}
|
||||||
|
@ -32,17 +32,6 @@ var (
|
|||||||
localCronClient ICronClient
|
localCronClient ICronClient
|
||||||
)
|
)
|
||||||
|
|
||||||
func AuthClient() IAuthClient {
|
|
||||||
if localAuthClient == nil {
|
|
||||||
panic("implement not found for interface IAuthClient, forgot register?")
|
|
||||||
}
|
|
||||||
return localAuthClient
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterAuthClient(i IAuthClient) {
|
|
||||||
localAuthClient = i
|
|
||||||
}
|
|
||||||
|
|
||||||
func CronClient() ICronClient {
|
func CronClient() ICronClient {
|
||||||
if localCronClient == nil {
|
if localCronClient == nil {
|
||||||
panic("implement not found for interface ICronClient, forgot register?")
|
panic("implement not found for interface ICronClient, forgot register?")
|
||||||
@ -53,3 +42,14 @@ func CronClient() ICronClient {
|
|||||||
func RegisterCronClient(i ICronClient) {
|
func RegisterCronClient(i ICronClient) {
|
||||||
localCronClient = i
|
localCronClient = i
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func AuthClient() IAuthClient {
|
||||||
|
if localAuthClient == nil {
|
||||||
|
panic("implement not found for interface IAuthClient, forgot register?")
|
||||||
|
}
|
||||||
|
return localAuthClient
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterAuthClient(i IAuthClient) {
|
||||||
|
localAuthClient = i
|
||||||
|
}
|
||||||
|
@ -51,7 +51,6 @@ func WalkDir(dirname string) (error, []fileInfo) {
|
|||||||
fileInfos = append(fileInfos, fi) //slice 中添加成员
|
fileInfos = append(fileInfos, fi) //slice 中添加成员
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, fileInfos
|
return nil, fileInfos
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,7 +63,6 @@ func DirSize(dirname string) string {
|
|||||||
for _, n := range files {
|
for _, n := range files {
|
||||||
ss += n.size
|
ss += n.size
|
||||||
}
|
}
|
||||||
|
|
||||||
return format.FileSize(ss)
|
return format.FileSize(ss)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,15 +133,10 @@ func Ext(baseName string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UploadFileByte 获取上传文件的byte
|
// UploadFileByte 获取上传文件的byte
|
||||||
func UploadFileByte(file *ghttp.UploadFile) (b []byte, err error) {
|
func UploadFileByte(file *ghttp.UploadFile) ([]byte, error) {
|
||||||
open, err := file.Open()
|
open, err := file.Open()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return nil, err
|
||||||
}
|
}
|
||||||
all, err := io.ReadAll(open)
|
return io.ReadAll(open)
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
return all, nil
|
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,6 @@ func DecryptText(text string) (string, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
return string(str), nil
|
return string(str), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,6 @@ func GetIds(tree string) (ids []int64) {
|
|||||||
ids = append(ids, newId)
|
ids = append(ids, newId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,7 +64,7 @@ func GenTree(menus []map[string]interface{}) (realMenu []map[string]interface{})
|
|||||||
// GenTreeWithField 生成关系树 自定义生成属性
|
// GenTreeWithField 生成关系树 自定义生成属性
|
||||||
func GenTreeWithField(menus []map[string]interface{}, op GenOption) (realMenu []map[string]interface{}) {
|
func GenTreeWithField(menus []map[string]interface{}, op GenOption) (realMenu []map[string]interface{}) {
|
||||||
if len(menus) < 1 {
|
if len(menus) < 1 {
|
||||||
return nil
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
minPid := GetMinPid(menus, op.PidField)
|
minPid := GetMinPid(menus, op.PidField)
|
||||||
|
@ -7,6 +7,7 @@ package useragent
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/gogf/gf/v2/text/gstr"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
@ -18,7 +19,7 @@ func GetOs(userAgent string) string {
|
|||||||
return osName
|
return osName
|
||||||
}
|
}
|
||||||
|
|
||||||
strRe, _ := regexp.Compile(`(?i:((.*?)))`)
|
strRe, _ := regexp.Compile(`(?i:\((.*?)\))`)
|
||||||
userAgent = strRe.FindString(userAgent)
|
userAgent = strRe.FindString(userAgent)
|
||||||
|
|
||||||
levelNames := ":micromessenger:dart:Windows NT:Windows Mobile:Windows Phone:Windows Phone OS:Macintosh|Macintosh:Mac OS:CrOS|CrOS:iPhone OS:iPad|iPad:OS:Android:Linux:blackberry:hpwOS:Series:Symbian:PalmOS:SymbianOS:J2ME:Sailfish:Bada:MeeGo:webOS|hpwOS:Maemo:"
|
levelNames := ":micromessenger:dart:Windows NT:Windows Mobile:Windows Phone:Windows Phone OS:Macintosh|Macintosh:Mac OS:CrOS|CrOS:iPhone OS:iPad|iPad:OS:Android:Linux:blackberry:hpwOS:Series:Symbian:PalmOS:SymbianOS:J2ME:Sailfish:Bada:MeeGo:webOS|hpwOS:Maemo:"
|
||||||
@ -41,9 +42,8 @@ func GetOs(userAgent string) string {
|
|||||||
} else if strings.Contains(name, s) {
|
} else if strings.Contains(name, s) {
|
||||||
name = strings.TrimSpace(s)
|
name = strings.TrimSpace(s)
|
||||||
} else if !strings.Contains(s, name) {
|
} else if !strings.Contains(s, name) {
|
||||||
if strings.Contains(name, "iPhone") ||
|
if strings.Contains(name, "iPhone") || strings.Contains(name, "iPad") {
|
||||||
strings.Contains(name, "iPad") {
|
s = gstr.Trim(s, "Mac OS X")
|
||||||
s = strings.Trim(s, "Mac OS X")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if s != "" {
|
if s != "" {
|
||||||
|
Loading…
Reference in New Issue
Block a user