增加用户上下文自动刷新,修复上传组件传参问题

This commit is contained in:
孟帅 2023-08-09 10:53:15 +08:00
parent 5538d9b720
commit 4069411156
10 changed files with 608 additions and 534 deletions

View File

@ -26,7 +26,7 @@ type UserOnlineListReq struct {
form.PageReq form.PageReq
UserId int64 `json:"userId" description:"用户ID"` UserId int64 `json:"userId" description:"用户ID"`
Username string `json:"username" description:"用户名"` Username string `json:"username" description:"用户名"`
Addr string `json:"addr" description:"登录地址"` IP string `json:"ip" description:"登录IP"`
FirstTime []*gtime.Time `json:"firstTime" description:"登录时间"` FirstTime []*gtime.Time `json:"firstTime" description:"登录时间"`
} }
@ -37,7 +37,7 @@ type UserOnlineListRes struct {
type UserOnlineModel struct { type UserOnlineModel struct {
ID string `json:"id"` // 连接唯一标识 ID string `json:"id"` // 连接唯一标识
Addr string `json:"addr"` // 客户端地址 IP string `json:"ip"` // 客户端IP
Os string `json:"os"` // 客户端系统名称 Os string `json:"os"` // 客户端系统名称
Browser string `json:"browser"` // 浏览器 Browser string `json:"browser"` // 浏览器
FirstTime int64 `json:"firstTime"` // 首次连接时间 FirstTime int64 `json:"firstTime"` // 首次连接时间

View File

@ -71,7 +71,7 @@ func (c *cMonitor) UserOnlineList(ctx context.Context, req *monitor.UserOnlineLi
continue continue
} }
if req.Addr != "" && !gstr.Contains(conn.Addr, req.Addr) { if req.IP != "" && !gstr.Contains(conn.IP, req.IP) {
continue continue
} }
@ -81,7 +81,7 @@ func (c *cMonitor) UserOnlineList(ctx context.Context, req *monitor.UserOnlineLi
clients = append(clients, &monitor.UserOnlineModel{ clients = append(clients, &monitor.UserOnlineModel{
ID: conn.ID, ID: conn.ID,
Addr: conn.Addr, IP: conn.IP,
Os: useragent.GetOs(conn.UserAgent), Os: useragent.GetOs(conn.UserAgent),
Browser: useragent.GetBrowser(conn.UserAgent), Browser: useragent.GetBrowser(conn.UserAgent),
FirstTime: conn.User.LoginAt.Unix(), FirstTime: conn.User.LoginAt.Unix(),
@ -109,7 +109,7 @@ func (c *cMonitor) UserOnlineList(ctx context.Context, req *monitor.UserOnlineLi
for k, v := range clients { for k, v := range clients {
if k >= offset && i <= perPage { if k >= offset && i <= perPage {
if isDemo { if isDemo {
v.Addr = consts.DemoTips v.IP = consts.DemoTips
} }
res.List = append(res.List, v) res.List = append(res.List, v)
i++ i++

View File

@ -10,6 +10,7 @@ import (
"github.com/gogf/gf/v2/util/grand" "github.com/gogf/gf/v2/util/grand"
"hotgo/internal/consts" "hotgo/internal/consts"
"hotgo/internal/dao" "hotgo/internal/dao"
"hotgo/internal/library/contexts"
"hotgo/internal/library/token" "hotgo/internal/library/token"
"hotgo/internal/model" "hotgo/internal/model"
"hotgo/internal/model/entity" "hotgo/internal/model/entity"
@ -263,3 +264,51 @@ func (s *sAdminSite) handleLogin(ctx context.Context, mb *entity.AdminMember) (r
} }
return return
} }
// BindUserContext 绑定用户上下文
func (s *sAdminSite) BindUserContext(ctx context.Context, claims *model.Identity) (err error) {
var mb *entity.AdminMember
if err = g.Model("admin_member").Ctx(ctx).Where("id", claims.Id).Scan(&mb); err != nil {
err = gerror.Wrap(err, "获取用户信息失败,请稍后重试!")
return
}
if mb == nil {
err = gerror.Wrap(err, "账号不存在或已被删除!")
return
}
if mb.Status != consts.StatusEnabled {
err = gerror.New("账号已被禁用,如有疑问请联系管理员")
return
}
var role *entity.AdminRole
if err = g.Model("admin_role").Ctx(ctx).Fields("id,key,status").Where("id", mb.RoleId).Scan(&role); err != nil || role == nil {
err = gerror.Wrap(err, "获取角色信息失败,请稍后重试!")
return
}
if role.Status != consts.StatusEnabled {
err = gerror.New("角色已被禁用,如有疑问请联系管理员")
return
}
user := &model.Identity{
Id: mb.Id,
Pid: mb.Pid,
DeptId: mb.DeptId,
RoleId: mb.RoleId,
RoleKey: role.Key,
Username: mb.Username,
RealName: mb.RealName,
Avatar: mb.Avatar,
Email: mb.Email,
Mobile: mb.Mobile,
App: claims.App,
LoginAt: claims.LoginAt,
}
contexts.SetUser(ctx, user)
return
}

View File

@ -155,7 +155,15 @@ func (s *sMiddleware) DeliverUserContext(r *ghttp.Request) (err error) {
if err != nil { if err != nil {
return return
} }
contexts.SetUser(r.Context(), user)
switch user.App {
case consts.AppAdmin:
if err = service.AdminSite().BindUserContext(r.Context(), user); err != nil {
return
}
default:
contexts.SetUser(r.Context(), user)
}
return return
} }

View File

@ -19,49 +19,47 @@ import (
) )
type ( type (
IAdminRole interface { IAdminOrder interface {
// Verify 验证权限 // Model 充值订单ORM模型
Verify(ctx context.Context, path, method string) bool
// List 获取列表
List(ctx context.Context, in *adminin.RoleListInp) (res *adminin.RoleListModel, totalCount int, err error)
// GetName 获取指定角色的名称
GetName(ctx context.Context, id int64) (name string, err error)
// GetMemberList 获取指定用户的岗位列表
GetMemberList(ctx context.Context, id int64) (list []*adminin.RoleListModel, err error)
// GetPermissions 更改角色菜单权限
GetPermissions(ctx context.Context, in *adminin.GetPermissionsInp) (res *adminin.GetPermissionsModel, err error)
// UpdatePermissions 更改角色菜单权限
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)
// VerifyRoleId 验证角色ID
VerifyRoleId(ctx context.Context, id int64) (err error)
// GetSubRoleIds 获取所有下级角色ID
GetSubRoleIds(ctx context.Context, roleId int64, isSuper bool) (ids []int64, err error)
}
IAdminCash interface {
// View 获取指定提现信息
View(ctx context.Context, in *adminin.CashViewInp) (res *adminin.CashViewModel, err error)
// List 获取列表
List(ctx context.Context, in *adminin.CashListInp) (list []*adminin.CashListModel, totalCount int, err error)
// Apply 申请提现
Apply(ctx context.Context, in *adminin.CashApplyInp) (err error)
// Payment 提现打款处理
Payment(ctx context.Context, in *adminin.CashPaymentInp) (err error)
}
IAdminCreditsLog interface {
// Model 资产变动ORM模型
Model(ctx context.Context, option ...*handler.Option) *gdb.Model Model(ctx context.Context, option ...*handler.Option) *gdb.Model
// SaveBalance 更新余额 // AcceptRefund 受理申请退款
SaveBalance(ctx context.Context, in *adminin.CreditsLogSaveBalanceInp) (res *adminin.CreditsLogSaveBalanceModel, err error) AcceptRefund(ctx context.Context, in *adminin.OrderAcceptRefundInp) (err error)
// SaveIntegral 更新积分 // ApplyRefund 申请退款
SaveIntegral(ctx context.Context, in *adminin.CreditsLogSaveIntegralInp) (res *adminin.CreditsLogSaveIntegralModel, err error) ApplyRefund(ctx context.Context, in *adminin.OrderApplyRefundInp) (err error)
// List 获取资产变动列表 // PayNotify 支付成功通知
List(ctx context.Context, in *adminin.CreditsLogListInp) (list []*adminin.CreditsLogListModel, totalCount int, err error) PayNotify(ctx context.Context, in *payin.NotifyCallFuncInp) (err error)
// Export 导出资产变动 // Create 创建充值订单
Export(ctx context.Context, in *adminin.CreditsLogListInp) (err error) Create(ctx context.Context, in *adminin.OrderCreateInp) (res *adminin.OrderCreateModel, err error)
// List 获取充值订单列表
List(ctx context.Context, in *adminin.OrderListInp) (list []*adminin.OrderListModel, totalCount int, err error)
// Export 导出充值订单
Export(ctx context.Context, in *adminin.OrderListInp) (err error)
// Edit 修改/新增充值订单
Edit(ctx context.Context, in *adminin.OrderEditInp) (err error)
// Delete 删除充值订单
Delete(ctx context.Context, in *adminin.OrderDeleteInp) (err error)
// View 获取充值订单指定信息
View(ctx context.Context, in *adminin.OrderViewInp) (res *adminin.OrderViewModel, err error)
// Status 更新充值订单状态
Status(ctx context.Context, in *adminin.OrderStatusInp) (err error)
}
IAdminPost interface {
// Delete 删除
Delete(ctx context.Context, in *adminin.PostDeleteInp) (err error)
// VerifyUnique 验证部门唯一属性
VerifyUnique(ctx context.Context, in *adminin.VerifyUniqueInp) (err error)
// Edit 修改/新增
Edit(ctx context.Context, in *adminin.PostEditInp) (err error)
// MaxSort 最大排序
MaxSort(ctx context.Context, in *adminin.PostMaxSortInp) (res *adminin.PostMaxSortModel, err error)
// View 获取指定岗位信息
View(ctx context.Context, in *adminin.PostViewInp) (res *adminin.PostViewModel, err error)
// List 获取列表
List(ctx context.Context, in *adminin.PostListInp) (list []*adminin.PostListModel, totalCount int, err error)
// GetMemberByStartName 获取指定用户的第一岗位
GetMemberByStartName(ctx context.Context, memberId int64) (name string, err error)
// Status 更新状态
Status(ctx context.Context, in *adminin.PostStatusInp) (err error)
} }
IAdminDept interface { IAdminDept interface {
// Delete 删除 // Delete 删除
@ -85,6 +83,110 @@ type (
// VerifyDeptId 验证部门ID // VerifyDeptId 验证部门ID
VerifyDeptId(ctx context.Context, id int64) (err error) VerifyDeptId(ctx context.Context, id int64) (err error)
} }
IAdminMenu interface {
// Delete 删除
Delete(ctx context.Context, in *adminin.MenuDeleteInp) (err error)
// VerifyUnique 验证菜单唯一属性
VerifyUnique(ctx context.Context, in *adminin.VerifyUniqueInp) (err error)
// Edit 修改/新增
Edit(ctx context.Context, in *adminin.MenuEditInp) (err error)
// List 获取菜单列表
List(ctx context.Context, in *adminin.MenuListInp) (res *adminin.MenuListModel, err error)
// GetMenuList 获取菜单列表
GetMenuList(ctx context.Context, memberId int64) (res *role.DynamicRes, err error)
// LoginPermissions 获取登录成功后的细粒度权限
LoginPermissions(ctx context.Context, memberId int64) (lists adminin.MemberLoginPermissions, err error)
}
IAdminMonitor interface {
// StartMonitor 启动服务监控
StartMonitor(ctx context.Context)
// GetMeta 获取监控元数据
GetMeta(ctx context.Context) *model.MonitorData
}
IAdminMemberPost interface {
// UpdatePostIds 更新用户岗位
UpdatePostIds(ctx context.Context, memberId int64, postIds []int64) (err error)
}
IAdminNotice interface {
// Model Orm模型
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
// Delete 删除
Delete(ctx context.Context, in *adminin.NoticeDeleteInp) (err error)
// Edit 修改/新增
Edit(ctx context.Context, in *adminin.NoticeEditInp) (err error)
// Status 更新部门状态
Status(ctx context.Context, in *adminin.NoticeStatusInp) (err error)
// MaxSort 最大排序
MaxSort(ctx context.Context, in *adminin.NoticeMaxSortInp) (res *adminin.NoticeMaxSortModel, err error)
// View 获取指定字典类型信息
View(ctx context.Context, in *adminin.NoticeViewInp) (res *adminin.NoticeViewModel, err error)
// List 获取列表
List(ctx context.Context, in *adminin.NoticeListInp) (list []*adminin.NoticeListModel, totalCount int, err error)
// PullMessages 拉取未读消息列表
PullMessages(ctx context.Context, in *adminin.PullMessagesInp) (res *adminin.PullMessagesModel, err error)
// UnreadCount 获取所有类型消息的未读数量
UnreadCount(ctx context.Context, in *adminin.NoticeUnreadCountInp) (res *adminin.NoticeUnreadCountModel, err error)
// UpRead 更新已读
UpRead(ctx context.Context, in *adminin.NoticeUpReadInp) (err error)
// ReadAll 已读全部
ReadAll(ctx context.Context, in *adminin.NoticeReadAllInp) (err error)
// MessageList 我的消息列表
MessageList(ctx context.Context, in *adminin.NoticeMessageListInp) (list []*adminin.NoticeMessageListModel, totalCount int, err error)
}
IAdminRole interface {
// Verify 验证权限
Verify(ctx context.Context, path, method string) bool
// List 获取列表
List(ctx context.Context, in *adminin.RoleListInp) (res *adminin.RoleListModel, totalCount int, err error)
// GetName 获取指定角色的名称
GetName(ctx context.Context, id int64) (name string, err error)
// GetMemberList 获取指定用户的岗位列表
GetMemberList(ctx context.Context, id int64) (list []*adminin.RoleListModel, err error)
// GetPermissions 更改角色菜单权限
GetPermissions(ctx context.Context, in *adminin.GetPermissionsInp) (res *adminin.GetPermissionsModel, err error)
// UpdatePermissions 更改角色菜单权限
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)
// VerifyRoleId 验证角色ID
VerifyRoleId(ctx context.Context, id int64) (err error)
// GetSubRoleIds 获取所有下级角色ID
GetSubRoleIds(ctx context.Context, roleId int64, isSuper bool) (ids []int64, err error)
}
IAdminSite interface {
// Register 账号注册
Register(ctx context.Context, in *adminin.RegisterInp) (err error)
// AccountLogin 账号登录
AccountLogin(ctx context.Context, in *adminin.AccountLoginInp) (res *adminin.LoginModel, err error)
// MobileLogin 手机号登录
MobileLogin(ctx context.Context, in *adminin.MobileLoginInp) (res *adminin.LoginModel, err error)
// BindUserContext 绑定用户上下文
BindUserContext(ctx context.Context, claims *model.Identity) (err error)
}
IAdminCash interface {
// View 获取指定提现信息
View(ctx context.Context, in *adminin.CashViewInp) (res *adminin.CashViewModel, err error)
// List 获取列表
List(ctx context.Context, in *adminin.CashListInp) (list []*adminin.CashListModel, totalCount int, err error)
// Apply 申请提现
Apply(ctx context.Context, in *adminin.CashApplyInp) (err error)
// Payment 提现打款处理
Payment(ctx context.Context, in *adminin.CashPaymentInp) (err error)
}
IAdminCreditsLog interface {
// Model 资产变动ORM模型
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
// SaveBalance 更新余额
SaveBalance(ctx context.Context, in *adminin.CreditsLogSaveBalanceInp) (res *adminin.CreditsLogSaveBalanceModel, err error)
// SaveIntegral 更新积分
SaveIntegral(ctx context.Context, in *adminin.CreditsLogSaveIntegralInp) (res *adminin.CreditsLogSaveIntegralModel, err error)
// List 获取资产变动列表
List(ctx context.Context, in *adminin.CreditsLogListInp) (list []*adminin.CreditsLogListModel, totalCount int, err error)
// Export 导出资产变动
Export(ctx context.Context, in *adminin.CreditsLogListInp) (err error)
}
IAdminMember interface { IAdminMember interface {
// AddBalance 增加余额 // AddBalance 增加余额
AddBalance(ctx context.Context, in *adminin.MemberAddBalanceInp) (err error) AddBalance(ctx context.Context, in *adminin.MemberAddBalanceInp) (err error)
@ -130,157 +232,58 @@ type (
LoadSuperAdmin(ctx context.Context) LoadSuperAdmin(ctx context.Context)
// ClusterSyncSuperAdmin 集群同步 // ClusterSyncSuperAdmin 集群同步
ClusterSyncSuperAdmin(ctx context.Context, message *gredis.Message) ClusterSyncSuperAdmin(ctx context.Context, message *gredis.Message)
// FilterAuthModel 过滤查询权限,如果不是超管则排除掉自己 // FilterAuthModel 过滤用户操作权限
// 非超管用户只能操作自己的下级角色用户,并且需要满足自身角色的数据权限设置
FilterAuthModel(ctx context.Context, memberId int64) *gdb.Model FilterAuthModel(ctx context.Context, memberId int64) *gdb.Model
} }
IAdminMemberPost interface {
// UpdatePostIds 更新用户岗位
UpdatePostIds(ctx context.Context, memberId int64, postIds []int64) (err error)
}
IAdminPost interface {
// Delete 删除
Delete(ctx context.Context, in *adminin.PostDeleteInp) (err error)
// VerifyUnique 验证部门唯一属性
VerifyUnique(ctx context.Context, in *adminin.VerifyUniqueInp) (err error)
// Edit 修改/新增
Edit(ctx context.Context, in *adminin.PostEditInp) (err error)
// MaxSort 最大排序
MaxSort(ctx context.Context, in *adminin.PostMaxSortInp) (res *adminin.PostMaxSortModel, err error)
// View 获取指定岗位信息
View(ctx context.Context, in *adminin.PostViewInp) (res *adminin.PostViewModel, err error)
// List 获取列表
List(ctx context.Context, in *adminin.PostListInp) (list []*adminin.PostListModel, totalCount int, err error)
// GetMemberByStartName 获取指定用户的第一岗位
GetMemberByStartName(ctx context.Context, memberId int64) (name string, err error)
// Status 更新状态
Status(ctx context.Context, in *adminin.PostStatusInp) (err error)
}
IAdminMenu interface {
// Delete 删除
Delete(ctx context.Context, in *adminin.MenuDeleteInp) (err error)
// VerifyUnique 验证菜单唯一属性
VerifyUnique(ctx context.Context, in *adminin.VerifyUniqueInp) (err error)
// Edit 修改/新增
Edit(ctx context.Context, in *adminin.MenuEditInp) (err error)
// List 获取菜单列表
List(ctx context.Context, in *adminin.MenuListInp) (res *adminin.MenuListModel, err error)
// GetMenuList 获取菜单列表
GetMenuList(ctx context.Context, memberId int64) (res *role.DynamicRes, err error)
// LoginPermissions 获取登录成功后的细粒度权限
LoginPermissions(ctx context.Context, memberId int64) (lists adminin.MemberLoginPermissions, err error)
}
IAdminMonitor interface {
// StartMonitor 启动服务监控
StartMonitor(ctx context.Context)
// GetMeta 获取监控元数据
GetMeta(ctx context.Context) *model.MonitorData
}
IAdminNotice interface {
// Model Orm模型
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
// Delete 删除
Delete(ctx context.Context, in *adminin.NoticeDeleteInp) (err error)
// Edit 修改/新增
Edit(ctx context.Context, in *adminin.NoticeEditInp) (err error)
// Status 更新部门状态
Status(ctx context.Context, in *adminin.NoticeStatusInp) (err error)
// MaxSort 最大排序
MaxSort(ctx context.Context, in *adminin.NoticeMaxSortInp) (res *adminin.NoticeMaxSortModel, err error)
// View 获取指定字典类型信息
View(ctx context.Context, in *adminin.NoticeViewInp) (res *adminin.NoticeViewModel, err error)
// List 获取列表
List(ctx context.Context, in *adminin.NoticeListInp) (list []*adminin.NoticeListModel, totalCount int, err error)
// PullMessages 拉取未读消息列表
PullMessages(ctx context.Context, in *adminin.PullMessagesInp) (res *adminin.PullMessagesModel, err error)
// UnreadCount 获取所有类型消息的未读数量
UnreadCount(ctx context.Context, in *adminin.NoticeUnreadCountInp) (res *adminin.NoticeUnreadCountModel, err error)
// UpRead 更新已读
UpRead(ctx context.Context, in *adminin.NoticeUpReadInp) (err error)
// ReadAll 已读全部
ReadAll(ctx context.Context, in *adminin.NoticeReadAllInp) (err error)
// MessageList 我的消息列表
MessageList(ctx context.Context, in *adminin.NoticeMessageListInp) (list []*adminin.NoticeMessageListModel, totalCount int, err error)
}
IAdminOrder interface {
// Model 充值订单ORM模型
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
// AcceptRefund 受理申请退款
AcceptRefund(ctx context.Context, in *adminin.OrderAcceptRefundInp) (err error)
// ApplyRefund 申请退款
ApplyRefund(ctx context.Context, in *adminin.OrderApplyRefundInp) (err error)
// PayNotify 支付成功通知
PayNotify(ctx context.Context, in *payin.NotifyCallFuncInp) (err error)
// Create 创建充值订单
Create(ctx context.Context, in *adminin.OrderCreateInp) (res *adminin.OrderCreateModel, err error)
// List 获取充值订单列表
List(ctx context.Context, in *adminin.OrderListInp) (list []*adminin.OrderListModel, totalCount int, err error)
// Export 导出充值订单
Export(ctx context.Context, in *adminin.OrderListInp) (err error)
// Edit 修改/新增充值订单
Edit(ctx context.Context, in *adminin.OrderEditInp) (err error)
// Delete 删除充值订单
Delete(ctx context.Context, in *adminin.OrderDeleteInp) (err error)
// View 获取充值订单指定信息
View(ctx context.Context, in *adminin.OrderViewInp) (res *adminin.OrderViewModel, err error)
// Status 更新充值订单状态
Status(ctx context.Context, in *adminin.OrderStatusInp) (err error)
}
IAdminSite interface {
// Register 账号注册
Register(ctx context.Context, in *adminin.RegisterInp) (err error)
// AccountLogin 账号登录
AccountLogin(ctx context.Context, in *adminin.AccountLoginInp) (res *adminin.LoginModel, err error)
// MobileLogin 手机号登录
MobileLogin(ctx context.Context, in *adminin.MobileLoginInp) (res *adminin.LoginModel, err error)
}
) )
var ( var (
localAdminCreditsLog IAdminCreditsLog
localAdminDept IAdminDept
localAdminMember IAdminMember
localAdminMemberPost IAdminMemberPost localAdminMemberPost IAdminMemberPost
localAdminPost IAdminPost
localAdminRole IAdminRole
localAdminCash IAdminCash
localAdminMonitor IAdminMonitor
localAdminNotice IAdminNotice localAdminNotice IAdminNotice
localAdminOrder IAdminOrder localAdminRole IAdminRole
localAdminSite IAdminSite localAdminSite IAdminSite
localAdminCash IAdminCash
localAdminCreditsLog IAdminCreditsLog
localAdminMember IAdminMember
localAdminOrder IAdminOrder
localAdminPost IAdminPost
localAdminDept IAdminDept
localAdminMenu IAdminMenu localAdminMenu IAdminMenu
localAdminMonitor IAdminMonitor
) )
func AdminRole() IAdminRole { func AdminMonitor() IAdminMonitor {
if localAdminRole == nil { if localAdminMonitor == nil {
panic("implement not found for interface IAdminRole, forgot register?") panic("implement not found for interface IAdminMonitor, forgot register?")
} }
return localAdminRole return localAdminMonitor
} }
func RegisterAdminRole(i IAdminRole) { func RegisterAdminMonitor(i IAdminMonitor) {
localAdminRole = i localAdminMonitor = i
} }
func AdminCash() IAdminCash { func AdminOrder() IAdminOrder {
if localAdminCash == nil { if localAdminOrder == nil {
panic("implement not found for interface IAdminCash, forgot register?") panic("implement not found for interface IAdminOrder, forgot register?")
} }
return localAdminCash return localAdminOrder
} }
func RegisterAdminCash(i IAdminCash) { func RegisterAdminOrder(i IAdminOrder) {
localAdminCash = i localAdminOrder = i
} }
func AdminCreditsLog() IAdminCreditsLog { func AdminPost() IAdminPost {
if localAdminCreditsLog == nil { if localAdminPost == nil {
panic("implement not found for interface IAdminCreditsLog, forgot register?") panic("implement not found for interface IAdminPost, forgot register?")
} }
return localAdminCreditsLog return localAdminPost
} }
func RegisterAdminCreditsLog(i IAdminCreditsLog) { func RegisterAdminPost(i IAdminPost) {
localAdminCreditsLog = i localAdminPost = i
} }
func AdminDept() IAdminDept { func AdminDept() IAdminDept {
@ -294,6 +297,17 @@ func RegisterAdminDept(i IAdminDept) {
localAdminDept = i localAdminDept = i
} }
func AdminMenu() IAdminMenu {
if localAdminMenu == nil {
panic("implement not found for interface IAdminMenu, forgot register?")
}
return localAdminMenu
}
func RegisterAdminMenu(i IAdminMenu) {
localAdminMenu = i
}
func AdminMember() IAdminMember { func AdminMember() IAdminMember {
if localAdminMember == nil { if localAdminMember == nil {
panic("implement not found for interface IAdminMember, forgot register?") panic("implement not found for interface IAdminMember, forgot register?")
@ -316,39 +330,6 @@ func RegisterAdminMemberPost(i IAdminMemberPost) {
localAdminMemberPost = i 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 AdminMenu() IAdminMenu {
if localAdminMenu == nil {
panic("implement not found for interface IAdminMenu, forgot register?")
}
return localAdminMenu
}
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 AdminNotice() IAdminNotice { func AdminNotice() IAdminNotice {
if localAdminNotice == nil { if localAdminNotice == nil {
panic("implement not found for interface IAdminNotice, forgot register?") panic("implement not found for interface IAdminNotice, forgot register?")
@ -360,15 +341,15 @@ func RegisterAdminNotice(i IAdminNotice) {
localAdminNotice = i localAdminNotice = i
} }
func AdminOrder() IAdminOrder { func AdminRole() IAdminRole {
if localAdminOrder == nil { if localAdminRole == nil {
panic("implement not found for interface IAdminOrder, forgot register?") panic("implement not found for interface IAdminRole, forgot register?")
} }
return localAdminOrder return localAdminRole
} }
func RegisterAdminOrder(i IAdminOrder) { func RegisterAdminRole(i IAdminRole) {
localAdminOrder = i localAdminRole = i
} }
func AdminSite() IAdminSite { func AdminSite() IAdminSite {
@ -381,3 +362,25 @@ func AdminSite() IAdminSite {
func RegisterAdminSite(i IAdminSite) { func RegisterAdminSite(i IAdminSite) {
localAdminSite = i 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 AdminCreditsLog() IAdminCreditsLog {
if localAdminCreditsLog == nil {
panic("implement not found for interface IAdminCreditsLog, forgot register?")
}
return localAdminCreditsLog
}
func RegisterAdminCreditsLog(i IAdminCreditsLog) {
localAdminCreditsLog = i
}

View File

@ -18,43 +18,97 @@ import (
) )
type ( type (
ISysServeLicense interface { ISysCronGroup interface {
// Model 服务许可证ORM模型
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
// List 获取服务许可证列表
List(ctx context.Context, in *sysin.ServeLicenseListInp) (list []*sysin.ServeLicenseListModel, totalCount int, err error)
// Export 导出服务许可证
Export(ctx context.Context, in *sysin.ServeLicenseListInp) (err error)
// Edit 修改/新增服务许可证
Edit(ctx context.Context, in *sysin.ServeLicenseEditInp) (err error)
// Delete 删除服务许可证
Delete(ctx context.Context, in *sysin.ServeLicenseDeleteInp) (err error)
// View 获取服务许可证指定信息
View(ctx context.Context, in *sysin.ServeLicenseViewInp) (res *sysin.ServeLicenseViewModel, err error)
// Status 更新服务许可证状态
Status(ctx context.Context, in *sysin.ServeLicenseStatusInp) (err error)
// AssignRouter 分配服务许可证路由
AssignRouter(ctx context.Context, in *sysin.ServeLicenseAssignRouterInp) (err error)
}
ISysSmsLog interface {
// Delete 删除 // Delete 删除
Delete(ctx context.Context, in *sysin.SmsLogDeleteInp) (err error) Delete(ctx context.Context, in *sysin.CronGroupDeleteInp) (err error)
// Edit 修改/新增 // Edit 修改/新增
Edit(ctx context.Context, in *sysin.SmsLogEditInp) (err error) Edit(ctx context.Context, in *sysin.CronGroupEditInp) (err error)
// Status 更新短信状态 // Status 更新状态
Status(ctx context.Context, in *sysin.SmsLogStatusInp) (err error) Status(ctx context.Context, in *sysin.CronGroupStatusInp) (err error)
// View 获取指定字典类型信息 // MaxSort 最大排序
View(ctx context.Context, in *sysin.SmsLogViewInp) (res *sysin.SmsLogViewModel, err error) MaxSort(ctx context.Context, in *sysin.CronGroupMaxSortInp) (res *sysin.CronGroupMaxSortModel, err error)
// View 获取指定信息
View(ctx context.Context, in *sysin.CronGroupViewInp) (res *sysin.CronGroupViewModel, err error)
// List 获取列表 // List 获取列表
List(ctx context.Context, in *sysin.SmsLogListInp) (list []*sysin.SmsLogListModel, totalCount int, err error) List(ctx context.Context, in *sysin.CronGroupListInp) (list []*sysin.CronGroupListModel, totalCount int, err error)
// SendCode 发送验证码 // Select 选项
SendCode(ctx context.Context, in *sysin.SendCodeInp) (err error) Select(ctx context.Context, in *sysin.CronGroupSelectInp) (res *sysin.CronGroupSelectModel, err error)
// GetTemplate 获取指定短信模板 }
GetTemplate(ctx context.Context, template string, config *model.SmsConfig) (val string, err error) ISysDictType interface {
// AllowSend 是否允许发送 // Tree 树
AllowSend(ctx context.Context, models *entity.SysSmsLog, config *model.SmsConfig) (err error) Tree(ctx context.Context) (list []*sysin.DictTypeTree, err error)
// VerifyCode 效验验证码 // Delete 删除
VerifyCode(ctx context.Context, in *sysin.VerifyCodeInp) (err error) Delete(ctx context.Context, in *sysin.DictTypeDeleteInp) (err error)
// Edit 修改/新增
Edit(ctx context.Context, in *sysin.DictTypeEditInp) (err error)
// TreeSelect 获取类型关系树选项
TreeSelect(ctx context.Context, in *sysin.DictTreeSelectInp) (list []*sysin.DictTypeTree, err error)
}
ISysLog interface {
// Export 导出
Export(ctx context.Context, in *sysin.LogListInp) (err error)
// RealWrite 真实写入
RealWrite(ctx context.Context, log entity.SysLog) (err error)
// AutoLog 根据配置自动记录请求日志
AutoLog(ctx context.Context) error
// AnalysisLog 解析日志数据
AnalysisLog(ctx context.Context) entity.SysLog
// View 获取指定字典类型信息
View(ctx context.Context, in *sysin.LogViewInp) (res *sysin.LogViewModel, err error)
// Delete 删除
Delete(ctx context.Context, in *sysin.LogDeleteInp) (err error)
// List 列表
List(ctx context.Context, in *sysin.LogListInp) (list []*sysin.LogListModel, totalCount int, err error)
}
ISysLoginLog interface {
// Model 登录日志Orm模型
Model(ctx context.Context) *gdb.Model
// List 获取登录日志列表
List(ctx context.Context, in *sysin.LoginLogListInp) (list []*sysin.LoginLogListModel, totalCount int, err error)
// Export 导出登录日志
Export(ctx context.Context, in *sysin.LoginLogListInp) (err error)
// Delete 删除登录日志
Delete(ctx context.Context, in *sysin.LoginLogDeleteInp) (err error)
// View 获取登录日志指定信息
View(ctx context.Context, in *sysin.LoginLogViewInp) (res *sysin.LoginLogViewModel, err error)
// Push 推送登录日志
Push(ctx context.Context, in *sysin.LoginLogPushInp)
// RealWrite 真实写入
RealWrite(ctx context.Context, models entity.SysLoginLog) (err error)
}
ISysProvinces interface {
// Tree 关系树选项列表
Tree(ctx context.Context) (list []*sysin.ProvincesTree, err error)
// Delete 删除省市区数据
Delete(ctx context.Context, in *sysin.ProvincesDeleteInp) (err error)
// Edit 修改/新增省市区数据
Edit(ctx context.Context, in *sysin.ProvincesEditInp) (err error)
// Status 更新省市区状态
Status(ctx context.Context, in *sysin.ProvincesStatusInp) (err error)
// MaxSort 最大排序
MaxSort(ctx context.Context, in *sysin.ProvincesMaxSortInp) (res *sysin.ProvincesMaxSortModel, err error)
// View 获取省市区信息
View(ctx context.Context, in *sysin.ProvincesViewInp) (res *sysin.ProvincesViewModel, err error)
// List 获取列表
List(ctx context.Context, in *sysin.ProvincesListInp) (list []*sysin.ProvincesListModel, totalCount int, err error)
// ChildrenList 获取省市区下级列表
ChildrenList(ctx context.Context, in *sysin.ProvincesChildrenListInp) (list []*sysin.ProvincesChildrenListModel, totalCount int, err error)
// UniqueId 获取省市区下级列表
UniqueId(ctx context.Context, in *sysin.ProvincesUniqueIdInp) (res *sysin.ProvincesUniqueIdModel, err error)
// Select 省市区选项
Select(ctx context.Context, in *sysin.ProvincesSelectInp) (res *sysin.ProvincesSelectModel, err error)
}
ISysAttachment interface {
// Model ORM模型
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
// Delete 删除附件
Delete(ctx context.Context, in *sysin.AttachmentDeleteInp) (err error)
// View 获取附件信息
View(ctx context.Context, in *sysin.AttachmentViewInp) (res *sysin.AttachmentViewModel, err error)
// List 获取附件列表
List(ctx context.Context, in *sysin.AttachmentListInp) (list []*sysin.AttachmentListModel, totalCount int, err error)
// ClearKind 清空上传类型
ClearKind(ctx context.Context, in *sysin.AttachmentClearKindInp) (err error)
} }
ISysConfig interface { ISysConfig interface {
// InitConfig 初始化系统配置 // InitConfig 初始化系统配置
@ -98,87 +152,58 @@ type (
// ClusterSync 集群同步 // ClusterSync 集群同步
ClusterSync(ctx context.Context, message *gredis.Message) ClusterSync(ctx context.Context, message *gredis.Message)
} }
ISysEmsLog interface { ISysCron interface {
StartCron(ctx context.Context)
// Delete 删除 // Delete 删除
Delete(ctx context.Context, in *sysin.EmsLogDeleteInp) (err error) Delete(ctx context.Context, in *sysin.CronDeleteInp) (err error)
// Edit 修改/新增 // Edit 修改/新增
Edit(ctx context.Context, in *sysin.EmsLogEditInp) (err error) Edit(ctx context.Context, in *sysin.CronEditInp) (err error)
// Status 更新部门状态 // Status 更新状态
Status(ctx context.Context, in *sysin.EmsLogStatusInp) (err error) Status(ctx context.Context, in *sysin.CronStatusInp) (err error)
// View 获取指定字典类型信息 // MaxSort 最大排序
View(ctx context.Context, in *sysin.EmsLogViewInp) (res *sysin.EmsLogViewModel, err error) MaxSort(ctx context.Context, in *sysin.CronMaxSortInp) (res *sysin.CronMaxSortModel, err error)
// View 获取指定信息
View(ctx context.Context, in *sysin.CronViewInp) (res *sysin.CronViewModel, err error)
// List 获取列表 // List 获取列表
List(ctx context.Context, in *sysin.EmsLogListInp) (list []*sysin.EmsLogListModel, totalCount int, err error) List(ctx context.Context, in *sysin.CronListInp) (list []*sysin.CronListModel, totalCount int, err error)
// Send 发送邮件 // GetName 获取分组名称
Send(ctx context.Context, in *sysin.SendEmsInp) (err error) GetName(ctx context.Context, id int64) (name string, err error)
// GetTemplate 获取指定邮件模板 // OnlineExec 在线执行
GetTemplate(ctx context.Context, template string, config *model.EmailConfig) (val string, err error) OnlineExec(ctx context.Context, in *sysin.OnlineExecInp) (err error)
// AllowSend 是否允许发送
AllowSend(ctx context.Context, models *entity.SysEmsLog, config *model.EmailConfig) (err error)
// VerifyCode 效验验证码
VerifyCode(ctx context.Context, in *sysin.VerifyEmsCodeInp) (err error)
} }
ISysLoginLog interface { ISysServeLicense interface {
// Model 登录日志Orm模型 // Model 服务许可证ORM模型
Model(ctx context.Context) *gdb.Model Model(ctx context.Context, option ...*handler.Option) *gdb.Model
// List 获取登录日志列表 // List 获取服务许可证列表
List(ctx context.Context, in *sysin.LoginLogListInp) (list []*sysin.LoginLogListModel, totalCount int, err error) List(ctx context.Context, in *sysin.ServeLicenseListInp) (list []*sysin.ServeLicenseListModel, totalCount int, err error)
// Export 导出登录日志 // Export 导出服务许可证
Export(ctx context.Context, in *sysin.LoginLogListInp) (err error) Export(ctx context.Context, in *sysin.ServeLicenseListInp) (err error)
// Delete 删除登录日志 // Edit 修改/新增服务许可证
Delete(ctx context.Context, in *sysin.LoginLogDeleteInp) (err error) Edit(ctx context.Context, in *sysin.ServeLicenseEditInp) (err error)
// View 获取登录日志指定信息 // Delete 删除服务许可证
View(ctx context.Context, in *sysin.LoginLogViewInp) (res *sysin.LoginLogViewModel, err error) Delete(ctx context.Context, in *sysin.ServeLicenseDeleteInp) (err error)
// Push 推送登录日志 // View 获取服务许可证指定信息
Push(ctx context.Context, in *sysin.LoginLogPushInp) View(ctx context.Context, in *sysin.ServeLicenseViewInp) (res *sysin.ServeLicenseViewModel, err error)
// RealWrite 真实写入 // Status 更新服务许可证状态
RealWrite(ctx context.Context, models entity.SysLoginLog) (err error) Status(ctx context.Context, in *sysin.ServeLicenseStatusInp) (err error)
// AssignRouter 分配服务许可证路由
AssignRouter(ctx context.Context, in *sysin.ServeLicenseAssignRouterInp) (err error)
} }
ISysAddons interface { ISysDictData interface {
// Delete 删除
Delete(ctx context.Context, in *sysin.DictDataDeleteInp) error
// Edit 修改/新增
Edit(ctx context.Context, in *sysin.DictDataEditInp) (err error)
// List 获取列表 // List 获取列表
List(ctx context.Context, in *sysin.AddonsListInp) (list []*sysin.AddonsListModel, totalCount int, err error) List(ctx context.Context, in *sysin.DictDataListInp) (list []*sysin.DictDataListModel, totalCount int, err error)
// Selects 选项 // GetId 获取指定类型的ID
Selects(ctx context.Context, in *sysin.AddonsSelectsInp) (res *sysin.AddonsSelectsModel, err error) GetId(ctx context.Context, t string) (id int64, err error)
// Build 提交生成 // GetType 获取指定ID的类型标识
Build(ctx context.Context, in *sysin.AddonsBuildInp) (err error) GetType(ctx context.Context, id int64) (types string, err error)
// Install 安装模块 // GetTypes 获取指定ID的所有类型标识包含下级
Install(ctx context.Context, in *sysin.AddonsInstallInp) (err error) GetTypes(ctx context.Context, id int64) (types []string, err error)
// Upgrade 更新模块 // Select 获取列表
Upgrade(ctx context.Context, in *sysin.AddonsUpgradeInp) (err error) Select(ctx context.Context, in *sysin.DataSelectInp) (list sysin.DataSelectModel, err error)
// UnInstall 卸载模块
UnInstall(ctx context.Context, in *sysin.AddonsUnInstallInp) (err error)
}
ISysAttachment interface {
// Model ORM模型
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
// Delete 删除附件
Delete(ctx context.Context, in *sysin.AttachmentDeleteInp) (err error)
// View 获取附件信息
View(ctx context.Context, in *sysin.AttachmentViewInp) (res *sysin.AttachmentViewModel, err error)
// List 获取附件列表
List(ctx context.Context, in *sysin.AttachmentListInp) (list []*sysin.AttachmentListModel, totalCount int, err error)
// ClearKind 清空上传类型
ClearKind(ctx context.Context, in *sysin.AttachmentClearKindInp) (err error)
}
ISysCurdDemo interface {
// Model 生成演示ORM模型
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
// List 获取生成演示列表
List(ctx context.Context, in *sysin.CurdDemoListInp) (list []*sysin.CurdDemoListModel, totalCount int, err error)
// Export 导出生成演示
Export(ctx context.Context, in *sysin.CurdDemoListInp) (err error)
// Edit 修改/新增生成演示
Edit(ctx context.Context, in *sysin.CurdDemoEditInp) (err error)
// Delete 删除生成演示
Delete(ctx context.Context, in *sysin.CurdDemoDeleteInp) (err error)
// MaxSort 获取生成演示最大排序
MaxSort(ctx context.Context, in *sysin.CurdDemoMaxSortInp) (res *sysin.CurdDemoMaxSortModel, err error)
// View 获取生成演示指定信息
View(ctx context.Context, in *sysin.CurdDemoViewInp) (res *sysin.CurdDemoViewModel, err error)
// Status 更新生成演示状态
Status(ctx context.Context, in *sysin.CurdDemoStatusInp) (err error)
// Switch 更新生成演示开关
Switch(ctx context.Context, in *sysin.CurdDemoSwitchInp) (err error)
} }
ISysGenCodes interface { ISysGenCodes interface {
// Delete 删除 // Delete 删除
@ -206,96 +231,49 @@ type (
// Build 提交生成 // Build 提交生成
Build(ctx context.Context, in *sysin.GenCodesBuildInp) (err error) Build(ctx context.Context, in *sysin.GenCodesBuildInp) (err error)
} }
ISysCron interface { ISysSmsLog interface {
StartCron(ctx context.Context)
// Delete 删除 // Delete 删除
Delete(ctx context.Context, in *sysin.CronDeleteInp) (err error) Delete(ctx context.Context, in *sysin.SmsLogDeleteInp) (err error)
// Edit 修改/新增 // Edit 修改/新增
Edit(ctx context.Context, in *sysin.CronEditInp) (err error) Edit(ctx context.Context, in *sysin.SmsLogEditInp) (err error)
// Status 更新状态 // Status 更新短信状态
Status(ctx context.Context, in *sysin.CronStatusInp) (err error) Status(ctx context.Context, in *sysin.SmsLogStatusInp) (err error)
// MaxSort 最大排序
MaxSort(ctx context.Context, in *sysin.CronMaxSortInp) (res *sysin.CronMaxSortModel, err error)
// View 获取指定信息
View(ctx context.Context, in *sysin.CronViewInp) (res *sysin.CronViewModel, err error)
// List 获取列表
List(ctx context.Context, in *sysin.CronListInp) (list []*sysin.CronListModel, totalCount int, err error)
// OnlineExec 在线执行
OnlineExec(ctx context.Context, in *sysin.OnlineExecInp) (err error)
}
ISysCronGroup interface {
// Delete 删除
Delete(ctx context.Context, in *sysin.CronGroupDeleteInp) (err error)
// Edit 修改/新增
Edit(ctx context.Context, in *sysin.CronGroupEditInp) (err error)
// Status 更新状态
Status(ctx context.Context, in *sysin.CronGroupStatusInp) (err error)
// MaxSort 最大排序
MaxSort(ctx context.Context, in *sysin.CronGroupMaxSortInp) (res *sysin.CronGroupMaxSortModel, err error)
// View 获取指定信息
View(ctx context.Context, in *sysin.CronGroupViewInp) (res *sysin.CronGroupViewModel, err error)
// List 获取列表
List(ctx context.Context, in *sysin.CronGroupListInp) (list []*sysin.CronGroupListModel, totalCount int, err error)
// Select 选项
Select(ctx context.Context, in *sysin.CronGroupSelectInp) (res *sysin.CronGroupSelectModel, err error)
}
ISysDictData interface {
// Delete 删除
Delete(ctx context.Context, in *sysin.DictDataDeleteInp) error
// Edit 修改/新增
Edit(ctx context.Context, in *sysin.DictDataEditInp) (err error)
// List 获取列表
List(ctx context.Context, in *sysin.DictDataListInp) (list []*sysin.DictDataListModel, totalCount int, err error)
// Select 获取列表
Select(ctx context.Context, in *sysin.DataSelectInp) (list sysin.DataSelectModel, err error)
}
ISysDictType interface {
// Tree 树
Tree(ctx context.Context) (list []*sysin.DictTypeTree, err error)
// Delete 删除
Delete(ctx context.Context, in *sysin.DictTypeDeleteInp) (err error)
// Edit 修改/新增
Edit(ctx context.Context, in *sysin.DictTypeEditInp) (err error)
// TreeSelect 获取类型关系树选项
TreeSelect(ctx context.Context, in *sysin.DictTreeSelectInp) (list []*sysin.DictTypeTree, err error)
}
ISysLog interface {
// Export 导出
Export(ctx context.Context, in *sysin.LogListInp) (err error)
// RealWrite 真实写入
RealWrite(ctx context.Context, log entity.SysLog) (err error)
// AutoLog 根据配置自动记录请求日志
AutoLog(ctx context.Context) error
// AnalysisLog 解析日志数据
AnalysisLog(ctx context.Context) entity.SysLog
// View 获取指定字典类型信息 // View 获取指定字典类型信息
View(ctx context.Context, in *sysin.LogViewInp) (res *sysin.LogViewModel, err error) View(ctx context.Context, in *sysin.SmsLogViewInp) (res *sysin.SmsLogViewModel, err error)
// Delete 删除
Delete(ctx context.Context, in *sysin.LogDeleteInp) (err error)
// List 列表
List(ctx context.Context, in *sysin.LogListInp) (list []*sysin.LogListModel, totalCount int, err error)
}
ISysProvinces interface {
// Tree 关系树选项列表
Tree(ctx context.Context) (list []*sysin.ProvincesTree, err error)
// Delete 删除省市区数据
Delete(ctx context.Context, in *sysin.ProvincesDeleteInp) (err error)
// Edit 修改/新增省市区数据
Edit(ctx context.Context, in *sysin.ProvincesEditInp) (err error)
// Status 更新省市区状态
Status(ctx context.Context, in *sysin.ProvincesStatusInp) (err error)
// MaxSort 最大排序
MaxSort(ctx context.Context, in *sysin.ProvincesMaxSortInp) (res *sysin.ProvincesMaxSortModel, err error)
// View 获取省市区信息
View(ctx context.Context, in *sysin.ProvincesViewInp) (res *sysin.ProvincesViewModel, err error)
// List 获取列表 // List 获取列表
List(ctx context.Context, in *sysin.ProvincesListInp) (list []*sysin.ProvincesListModel, totalCount int, err error) List(ctx context.Context, in *sysin.SmsLogListInp) (list []*sysin.SmsLogListModel, totalCount int, err error)
// ChildrenList 获取省市区下级列表 // SendCode 发送验证码
ChildrenList(ctx context.Context, in *sysin.ProvincesChildrenListInp) (list []*sysin.ProvincesChildrenListModel, totalCount int, err error) SendCode(ctx context.Context, in *sysin.SendCodeInp) (err error)
// UniqueId 获取省市区下级列表 // GetTemplate 获取指定短信模板
UniqueId(ctx context.Context, in *sysin.ProvincesUniqueIdInp) (res *sysin.ProvincesUniqueIdModel, err error) GetTemplate(ctx context.Context, template string, config *model.SmsConfig) (val string, err error)
// Select 省市区选项 // AllowSend 是否允许发送
Select(ctx context.Context, in *sysin.ProvincesSelectInp) (res *sysin.ProvincesSelectModel, err error) AllowSend(ctx context.Context, models *entity.SysSmsLog, config *model.SmsConfig) (err error)
// NowDayCount 当天发送次数
NowDayCount(ctx context.Context, event, mobile string) (count int, err error)
// VerifyCode 效验验证码
VerifyCode(ctx context.Context, in *sysin.VerifyCodeInp) (err error)
}
ISysAddons interface {
// List 获取列表
List(ctx context.Context, in *sysin.AddonsListInp) (list []*sysin.AddonsListModel, totalCount int, err error)
// Selects 选项
Selects(ctx context.Context, in *sysin.AddonsSelectsInp) (res *sysin.AddonsSelectsModel, err error)
// Build 提交生成
Build(ctx context.Context, in *sysin.AddonsBuildInp) (err error)
// Install 安装模块
Install(ctx context.Context, in *sysin.AddonsInstallInp) (err error)
// Upgrade 更新模块
Upgrade(ctx context.Context, in *sysin.AddonsUpgradeInp) (err error)
// UnInstall 卸载模块
UnInstall(ctx context.Context, in *sysin.AddonsUnInstallInp) (err error)
}
ISysAddonsConfig interface {
// GetConfigByGroup 获取指定分组的配置
GetConfigByGroup(ctx context.Context, in *sysin.GetAddonsConfigInp) (res *sysin.GetAddonsConfigModel, err error)
// ConversionType 转换类型
ConversionType(ctx context.Context, models *entity.SysAddonsConfig) (value interface{}, err error)
// UpdateConfigByGroup 更新指定分组的配置
UpdateConfigByGroup(ctx context.Context, in *sysin.UpdateAddonsConfigInp) (err error)
} }
ISysServeLog interface { ISysServeLog interface {
// Model 服务日志Orm模型 // Model 服务日志Orm模型
@ -311,14 +289,6 @@ type (
// RealWrite 真实写入 // RealWrite 真实写入
RealWrite(ctx context.Context, models entity.SysServeLog) (err error) RealWrite(ctx context.Context, models entity.SysServeLog) (err error)
} }
ISysAddonsConfig interface {
// GetConfigByGroup 获取指定分组的配置
GetConfigByGroup(ctx context.Context, in *sysin.GetAddonsConfigInp) (res *sysin.GetAddonsConfigModel, err error)
// ConversionType 转换类型
ConversionType(ctx context.Context, models *entity.SysAddonsConfig) (value interface{}, err error)
// UpdateConfigByGroup 更新指定分组的配置
UpdateConfigByGroup(ctx context.Context, in *sysin.UpdateAddonsConfigInp) (err error)
}
ISysBlacklist interface { ISysBlacklist interface {
// Delete 删除 // Delete 删除
Delete(ctx context.Context, in *sysin.BlacklistDeleteInp) (err error) Delete(ctx context.Context, in *sysin.BlacklistDeleteInp) (err error)
@ -339,93 +309,80 @@ type (
// ClusterSync 集群同步 // ClusterSync 集群同步
ClusterSync(ctx context.Context, message *gredis.Message) ClusterSync(ctx context.Context, message *gredis.Message)
} }
ISysCurdDemo interface {
// Model 生成演示ORM模型
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
// List 获取生成演示列表
List(ctx context.Context, in *sysin.CurdDemoListInp) (list []*sysin.CurdDemoListModel, totalCount int, err error)
// Export 导出生成演示
Export(ctx context.Context, in *sysin.CurdDemoListInp) (err error)
// Edit 修改/新增生成演示
Edit(ctx context.Context, in *sysin.CurdDemoEditInp) (err error)
// Delete 删除生成演示
Delete(ctx context.Context, in *sysin.CurdDemoDeleteInp) (err error)
// MaxSort 获取生成演示最大排序
MaxSort(ctx context.Context, in *sysin.CurdDemoMaxSortInp) (res *sysin.CurdDemoMaxSortModel, err error)
// View 获取生成演示指定信息
View(ctx context.Context, in *sysin.CurdDemoViewInp) (res *sysin.CurdDemoViewModel, err error)
// Status 更新生成演示状态
Status(ctx context.Context, in *sysin.CurdDemoStatusInp) (err error)
// Switch 更新生成演示开关
Switch(ctx context.Context, in *sysin.CurdDemoSwitchInp) (err error)
}
ISysEmsLog interface {
// Delete 删除
Delete(ctx context.Context, in *sysin.EmsLogDeleteInp) (err error)
// Edit 修改/新增
Edit(ctx context.Context, in *sysin.EmsLogEditInp) (err error)
// Status 更新部门状态
Status(ctx context.Context, in *sysin.EmsLogStatusInp) (err error)
// View 获取指定字典类型信息
View(ctx context.Context, in *sysin.EmsLogViewInp) (res *sysin.EmsLogViewModel, err error)
// List 获取列表
List(ctx context.Context, in *sysin.EmsLogListInp) (list []*sysin.EmsLogListModel, totalCount int, err error)
// Send 发送邮件
Send(ctx context.Context, in *sysin.SendEmsInp) (err error)
// GetTemplate 获取指定邮件模板
GetTemplate(ctx context.Context, template string, config *model.EmailConfig) (val string, err error)
// AllowSend 是否允许发送
AllowSend(ctx context.Context, models *entity.SysEmsLog, config *model.EmailConfig) (err error)
// NowDayCount 当天发送次数
NowDayCount(ctx context.Context, event, email string) (count int, err error)
// VerifyCode 效验验证码
VerifyCode(ctx context.Context, in *sysin.VerifyEmsCodeInp) (err error)
}
) )
var ( var (
localSysConfig ISysConfig
localSysEmsLog ISysEmsLog
localSysServeLicense ISysServeLicense
localSysSmsLog ISysSmsLog
localSysAddons ISysAddons
localSysAttachment ISysAttachment
localSysLoginLog ISysLoginLog
localSysCron ISysCron localSysCron ISysCron
localSysCronGroup ISysCronGroup localSysCronGroup ISysCronGroup
localSysCurdDemo ISysCurdDemo
localSysGenCodes ISysGenCodes
localSysProvinces ISysProvinces
localSysServeLog ISysServeLog
localSysAddonsConfig ISysAddonsConfig
localSysBlacklist ISysBlacklist
localSysDictData ISysDictData
localSysDictType ISysDictType localSysDictType ISysDictType
localSysLog ISysLog localSysLog ISysLog
localSysLoginLog ISysLoginLog
localSysProvinces ISysProvinces
localSysAttachment ISysAttachment
localSysConfig ISysConfig
localSysServeLicense ISysServeLicense
localSysSmsLog ISysSmsLog
localSysDictData ISysDictData
localSysGenCodes ISysGenCodes
localSysAddons ISysAddons
localSysAddonsConfig ISysAddonsConfig
localSysEmsLog ISysEmsLog
localSysServeLog ISysServeLog
localSysBlacklist ISysBlacklist
localSysCurdDemo ISysCurdDemo
) )
func SysAddons() ISysAddons { func SysDictData() ISysDictData {
if localSysAddons == nil { if localSysDictData == nil {
panic("implement not found for interface ISysAddons, forgot register?") panic("implement not found for interface ISysDictData, forgot register?")
} }
return localSysAddons return localSysDictData
} }
func RegisterSysAddons(i ISysAddons) { func RegisterSysDictData(i ISysDictData) {
localSysAddons = i localSysDictData = 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 SysLoginLog() ISysLoginLog {
if localSysLoginLog == nil {
panic("implement not found for interface ISysLoginLog, forgot register?")
}
return localSysLoginLog
}
func RegisterSysLoginLog(i ISysLoginLog) {
localSysLoginLog = 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 SysCurdDemo() ISysCurdDemo {
if localSysCurdDemo == nil {
panic("implement not found for interface ISysCurdDemo, forgot register?")
}
return localSysCurdDemo
}
func RegisterSysCurdDemo(i ISysCurdDemo) {
localSysCurdDemo = i
} }
func SysGenCodes() ISysGenCodes { func SysGenCodes() ISysGenCodes {
@ -439,26 +396,26 @@ func RegisterSysGenCodes(i ISysGenCodes) {
localSysGenCodes = i localSysGenCodes = i
} }
func SysProvinces() ISysProvinces { func SysSmsLog() ISysSmsLog {
if localSysProvinces == nil { if localSysSmsLog == nil {
panic("implement not found for interface ISysProvinces, forgot register?") panic("implement not found for interface ISysSmsLog, forgot register?")
} }
return localSysProvinces return localSysSmsLog
} }
func RegisterSysProvinces(i ISysProvinces) { func RegisterSysSmsLog(i ISysSmsLog) {
localSysProvinces = i localSysSmsLog = i
} }
func SysServeLog() ISysServeLog { func SysAddons() ISysAddons {
if localSysServeLog == nil { if localSysAddons == nil {
panic("implement not found for interface ISysServeLog, forgot register?") panic("implement not found for interface ISysAddons, forgot register?")
} }
return localSysServeLog return localSysAddons
} }
func RegisterSysServeLog(i ISysServeLog) { func RegisterSysAddons(i ISysAddons) {
localSysServeLog = i localSysAddons = i
} }
func SysAddonsConfig() ISysAddonsConfig { func SysAddonsConfig() ISysAddonsConfig {
@ -472,6 +429,17 @@ func RegisterSysAddonsConfig(i ISysAddonsConfig) {
localSysAddonsConfig = i localSysAddonsConfig = 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 SysBlacklist() ISysBlacklist { func SysBlacklist() ISysBlacklist {
if localSysBlacklist == nil { if localSysBlacklist == nil {
panic("implement not found for interface ISysBlacklist, forgot register?") panic("implement not found for interface ISysBlacklist, forgot register?")
@ -483,15 +451,37 @@ func RegisterSysBlacklist(i ISysBlacklist) {
localSysBlacklist = i localSysBlacklist = i
} }
func SysDictData() ISysDictData { func SysCurdDemo() ISysCurdDemo {
if localSysDictData == nil { if localSysCurdDemo == nil {
panic("implement not found for interface ISysDictData, forgot register?") panic("implement not found for interface ISysCurdDemo, forgot register?")
} }
return localSysDictData return localSysCurdDemo
} }
func RegisterSysDictData(i ISysDictData) { func RegisterSysCurdDemo(i ISysCurdDemo) {
localSysDictData = i localSysCurdDemo = 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 SysCronGroup() ISysCronGroup {
if localSysCronGroup == nil {
panic("implement not found for interface ISysCronGroup, forgot register?")
}
return localSysCronGroup
}
func RegisterSysCronGroup(i ISysCronGroup) {
localSysCronGroup = i
} }
func SysDictType() ISysDictType { func SysDictType() ISysDictType {
@ -516,6 +506,39 @@ func RegisterSysLog(i ISysLog) {
localSysLog = i localSysLog = 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 SysProvinces() ISysProvinces {
if localSysProvinces == nil {
panic("implement not found for interface ISysProvinces, forgot register?")
}
return localSysProvinces
}
func RegisterSysProvinces(i ISysProvinces) {
localSysProvinces = 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 SysConfig() ISysConfig { func SysConfig() ISysConfig {
if localSysConfig == nil { if localSysConfig == nil {
panic("implement not found for interface ISysConfig, forgot register?") panic("implement not found for interface ISysConfig, forgot register?")
@ -527,15 +550,15 @@ func RegisterSysConfig(i ISysConfig) {
localSysConfig = i localSysConfig = i
} }
func SysEmsLog() ISysEmsLog { func SysCron() ISysCron {
if localSysEmsLog == nil { if localSysCron == nil {
panic("implement not found for interface ISysEmsLog, forgot register?") panic("implement not found for interface ISysCron, forgot register?")
} }
return localSysEmsLog return localSysCron
} }
func RegisterSysEmsLog(i ISysEmsLog) { func RegisterSysCron(i ISysCron) {
localSysEmsLog = i localSysCron = i
} }
func SysServeLicense() ISysServeLicense { func SysServeLicense() ISysServeLicense {
@ -548,14 +571,3 @@ func SysServeLicense() ISysServeLicense {
func RegisterSysServeLicense(i ISysServeLicense) { func RegisterSysServeLicense(i ISysServeLicense) {
localSysServeLicense = i localSysServeLicense = i
} }
func SysSmsLog() ISysSmsLog {
if localSysSmsLog == nil {
panic("implement not found for interface ISysSmsLog, forgot register?")
}
return localSysSmsLog
}
func RegisterSysSmsLog(i ISysSmsLog) {
localSysSmsLog = i
}

View File

@ -36,6 +36,7 @@
const useUserStore = useUserStoreWidthOut(); const useUserStore = useUserStoreWidthOut();
const uploadHeaders = reactive({ const uploadHeaders = reactive({
Authorization: useUserStore.token, Authorization: useUserStore.token,
uploadType: 'default',
}); });
const emit = defineEmits(['update:value']); const emit = defineEmits(['update:value']);
const props = withDefaults(defineProps<Props>(), { value: '', maxNumber: 1, helpText: '' }); const props = withDefaults(defineProps<Props>(), { value: '', maxNumber: 1, helpText: '' });

View File

@ -1,6 +1,6 @@
<template> <template>
<BasicUpload <BasicUpload
:action="`${uploadUrl}${urlPrefix}/upload/image`" :action="`${uploadUrl}${urlPrefix}/upload/file`"
:headers="uploadHeaders" :headers="uploadHeaders"
:data="{ type: 0 }" :data="{ type: 0 }"
name="file" name="file"
@ -36,6 +36,7 @@
const useUserStore = useUserStoreWidthOut(); const useUserStore = useUserStoreWidthOut();
const uploadHeaders = reactive({ const uploadHeaders = reactive({
Authorization: useUserStore.token, Authorization: useUserStore.token,
uploadType: 'image',
}); });
function uploadChange(list: string | string[]) { function uploadChange(list: string | string[]) {

View File

@ -53,9 +53,9 @@ export const columns = [
}, },
}, },
{ {
title: '登录地址', title: '登录IP',
key: 'addr', key: 'ip',
width: 150, width: 120,
}, },
// { // {

View File

@ -57,11 +57,11 @@
rules: [{ trigger: ['blur'] }], rules: [{ trigger: ['blur'] }],
}, },
{ {
field: 'addr', field: 'ip',
component: 'NInput', component: 'NInput',
label: '登录地址', label: '登录IP',
componentProps: { componentProps: {
placeholder: '请输入登录地址', placeholder: '请输入登录IP',
onInput: (e: any) => { onInput: (e: any) => {
console.log(e); console.log(e);
}, },