mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-08-28 13:03:22 +08:00
更新2.1.2版本,优化部门、角色权限,增加上下级关系;增加登录、系统、短信日志;优化省市区编码
This commit is contained in:
@@ -46,7 +46,7 @@ func DefaultPage(ctx context.Context) int {
|
||||
// PageReq 分页
|
||||
type PageReq struct {
|
||||
Page int `json:"page" example:"10" d:"1" v:"min:1#页码最小值不能低于1" dc:"当前页码"`
|
||||
PerPage int `json:"pageSize" example:"1" d:"10" v:"min:1|max:100#|每页数量最小值不能低于1|最大值不能大于100" dc:"每页数量"`
|
||||
PerPage int `json:"pageSize" example:"1" d:"10" v:"min:1|max:200#|每页数量最小值不能低于1|最大值不能大于200" dc:"每页数量"`
|
||||
}
|
||||
type PageRes struct {
|
||||
PageReq
|
||||
|
@@ -59,3 +59,9 @@ type CronStatusInp struct {
|
||||
entity.SysCron
|
||||
}
|
||||
type CronStatusModel struct{}
|
||||
|
||||
// OnlineExecInp 在线执行
|
||||
type OnlineExecInp struct {
|
||||
entity.SysCron
|
||||
}
|
||||
type OnlineExecModel struct{}
|
||||
|
90
server/internal/model/input/sysin/login_log.go
Normal file
90
server/internal/model/input/sysin/login_log.go
Normal file
@@ -0,0 +1,90 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/adminin"
|
||||
"hotgo/internal/model/input/form"
|
||||
)
|
||||
|
||||
// LoginLogDeleteInp 删除登录日志
|
||||
type LoginLogDeleteInp struct {
|
||||
Id interface{} `json:"id" v:"required#日志ID不能为空" dc:"日志ID"`
|
||||
}
|
||||
|
||||
type LoginLogDeleteModel struct{}
|
||||
|
||||
// LoginLogViewInp 获取指定登录日志信息
|
||||
type LoginLogViewInp struct {
|
||||
Id int64 `json:"id" v:"required#日志ID不能为空" dc:"日志ID"`
|
||||
}
|
||||
|
||||
type LoginLogViewModel struct {
|
||||
entity.Test
|
||||
}
|
||||
|
||||
// LoginLogListInp 获取登录日志列表
|
||||
type LoginLogListInp struct {
|
||||
form.PageReq
|
||||
Username string `json:"username" dc:"用户名"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
LoginAt []*gtime.Time `json:"loginAt" dc:"登录时间"`
|
||||
SysLogIp string `json:"sysLogIp" dc:"IP地址"`
|
||||
}
|
||||
|
||||
type LoginLogListModel struct {
|
||||
Id int64 `json:"id" dc:"日志ID"`
|
||||
ReqId string `json:"reqId" dc:"请求ID"`
|
||||
MemberId int64 `json:"memberId" dc:"用户ID"`
|
||||
Username string `json:"username" dc:"用户名"`
|
||||
LoginAt *gtime.Time `json:"loginAt" dc:"登录时间"`
|
||||
ErrMsg string `json:"errMsg" dc:"错误提示"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" dc:"修改时间"`
|
||||
SysLogId int64 `json:"sysLogId" dc:"日志ID"`
|
||||
SysLogIp string `json:"sysLogIp" dc:"IP地址"`
|
||||
SysLogProvinceId int64 `json:"sysLogProvinceId" dc:"省编码"`
|
||||
SysLogCityId int64 `json:"sysLogCityId" dc:"市编码"`
|
||||
SysLogErrorCode int `json:"sysLogErrorCode" dc:"报错code"`
|
||||
SysLogUserAgent string `json:"sysLogUserAgent" dc:"UA信息"`
|
||||
Region string `json:"region" dc:"地区"`
|
||||
Os string `json:"os" dc:"系统信息"`
|
||||
Browser string `json:"browser" dc:"浏览器信息"`
|
||||
}
|
||||
|
||||
func (in *LoginLogListInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// LoginLogExportModel 导出登录日志
|
||||
type LoginLogExportModel struct {
|
||||
Id int64 `json:"id" dc:"日志ID"`
|
||||
ReqId string `json:"reqId" dc:"请求ID"`
|
||||
MemberId int64 `json:"memberId" dc:"用户ID"`
|
||||
Username string `json:"username" dc:"用户名"`
|
||||
LoginAt int64 `json:"loginAt" dc:"登录时间"`
|
||||
ErrMsg string `json:"errMsg" dc:"错误提示"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" dc:"修改时间"`
|
||||
SysLogIp string `json:"sysLogIp" dc:"IP地址"`
|
||||
SysLogProvinceId int64 `json:"sysLogProvinceId" dc:"省编码"`
|
||||
SysLogCityId int64 `json:"sysLogCityId" dc:"市编码"`
|
||||
SysLogErrorCode int `json:"sysLogErrorCode" dc:"报错code"`
|
||||
SysLogUserAgent string `json:"sysLogUserAgent" dc:"UA信息"`
|
||||
}
|
||||
|
||||
// LoginLogPushInp 解推送登录日志
|
||||
type LoginLogPushInp struct {
|
||||
Input adminin.MemberLoginInp
|
||||
Response *adminin.MemberLoginModel
|
||||
Err error
|
||||
}
|
@@ -13,11 +13,10 @@ import (
|
||||
|
||||
// ProvincesMaxSortInp 最大排序
|
||||
type ProvincesMaxSortInp struct {
|
||||
Id int64
|
||||
}
|
||||
|
||||
type ProvincesMaxSortModel struct {
|
||||
Sort int
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
}
|
||||
|
||||
// ProvincesEditInp 修改/新增字典数据
|
||||
@@ -28,7 +27,7 @@ type ProvincesEditModel struct{}
|
||||
|
||||
// ProvincesDeleteInp 删除字典类型
|
||||
type ProvincesDeleteInp struct {
|
||||
Id interface{}
|
||||
Id interface{} `json:"id" v:"required#省市区ID不能为空" dc:"省市区ID"`
|
||||
}
|
||||
type ProvincesDeleteModel struct{}
|
||||
|
||||
@@ -59,3 +58,26 @@ type ProvincesStatusInp struct {
|
||||
entity.SysProvinces
|
||||
}
|
||||
type ProvincesStatusModel struct{}
|
||||
|
||||
// ProvincesChildrenListInp 获取省市区下级列表
|
||||
type ProvincesChildrenListInp struct {
|
||||
form.PageReq
|
||||
form.StatusReq
|
||||
Pid int64 `json:"pid" dc:"上级ID"`
|
||||
Id int64 `json:"id" dc:"地区ID"`
|
||||
Title string `json:"title" dc:"地区名称"`
|
||||
}
|
||||
|
||||
type ProvincesChildrenListModel struct {
|
||||
entity.SysProvinces
|
||||
}
|
||||
|
||||
// ProvincesUniqueIdInp 获取省市区下级列表
|
||||
type ProvincesUniqueIdInp struct {
|
||||
OldId int64 `json:"oldId" dc:"原始ID"`
|
||||
NewId int64 `json:"newId" dc:"新的ID"`
|
||||
}
|
||||
|
||||
type ProvincesUniqueIdModel struct {
|
||||
IsUnique bool `json:"unique" dc:"是否唯一"`
|
||||
}
|
||||
|
69
server/internal/model/input/sysin/serve_log.go
Normal file
69
server/internal/model/input/sysin/serve_log.go
Normal file
@@ -0,0 +1,69 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
)
|
||||
|
||||
// ServeLogDeleteInp 删除服务日志
|
||||
type ServeLogDeleteInp struct {
|
||||
Id interface{} `json:"id" v:"required#日志ID不能为空" dc:"日志ID"`
|
||||
}
|
||||
|
||||
type ServeLogDeleteModel struct{}
|
||||
|
||||
// ServeLogViewInp 获取指定服务日志信息
|
||||
type ServeLogViewInp struct {
|
||||
Id int64 `json:"id" v:"required#日志ID不能为空" dc:"日志ID"`
|
||||
}
|
||||
|
||||
type ServeLogViewModel struct {
|
||||
entity.Test
|
||||
}
|
||||
|
||||
// ServeLogListInp 获取服务日志列表
|
||||
type ServeLogListInp struct {
|
||||
form.PageReq
|
||||
TraceId string `json:"traceId" dc:"链路ID"`
|
||||
LevelFormat string `json:"levelFormat" dc:"日志级别"`
|
||||
TriggerNs []int64 `json:"triggerNs" dc:"触发时间(ns)"`
|
||||
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
}
|
||||
|
||||
type ServeLogListModel struct {
|
||||
Id int64 `json:"id" dc:"日志ID"`
|
||||
TraceId string `json:"traceId" dc:"链路ID"`
|
||||
LevelFormat string `json:"levelFormat" dc:"日志级别"`
|
||||
Content string `json:"content" dc:"日志内容"`
|
||||
Stack string `json:"stack" dc:"堆栈"`
|
||||
Line string `json:"line" dc:"调用行"`
|
||||
TriggerNs int64 `json:"triggerNs" dc:"触发时间(ns)"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" dc:"修改时间"`
|
||||
SysLogId int64 `json:"sysLogId" dc:"访问日志ID"`
|
||||
}
|
||||
|
||||
func (in *ServeLogListInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// ServeLogExportModel 导出服务日志
|
||||
type ServeLogExportModel struct {
|
||||
Id int64 `json:"id" dc:"日志ID"`
|
||||
Env string `json:"env" dc:"环境"`
|
||||
TraceId string `json:"traceId" dc:"链路ID"`
|
||||
LevelFormat string `json:"levelFormat" dc:"日志级别"`
|
||||
Content string `json:"content" dc:"日志内容"`
|
||||
Line string `json:"line" dc:"调用行"`
|
||||
TriggerNs int64 `json:"triggerNs" dc:"触发时间(ns)"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" dc:"修改时间"`
|
||||
}
|
76
server/internal/model/input/sysin/sms_log.go
Normal file
76
server/internal/model/input/sysin/sms_log.go
Normal file
@@ -0,0 +1,76 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2022 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
)
|
||||
|
||||
// SmsLogMaxSortInp 最大排序
|
||||
type SmsLogMaxSortInp struct {
|
||||
Id int64
|
||||
}
|
||||
|
||||
type SmsLogMaxSortModel struct {
|
||||
Sort int
|
||||
}
|
||||
|
||||
// SmsLogEditInp 修改/新增数据
|
||||
type SmsLogEditInp struct {
|
||||
entity.SysSmsLog
|
||||
}
|
||||
type SmsLogEditModel struct{}
|
||||
|
||||
// SmsLogDeleteInp 删除
|
||||
type SmsLogDeleteInp struct {
|
||||
Id interface{}
|
||||
}
|
||||
type SmsLogDeleteModel struct{}
|
||||
|
||||
// SmsLogViewInp 获取信息
|
||||
type SmsLogViewInp struct {
|
||||
Id int64
|
||||
}
|
||||
|
||||
type SmsLogViewModel struct {
|
||||
entity.SysSmsLog
|
||||
}
|
||||
|
||||
// SmsLogListInp 获取列表
|
||||
type SmsLogListInp struct {
|
||||
form.PageReq
|
||||
form.RangeDateReq
|
||||
form.StatusReq
|
||||
Title string
|
||||
Content string
|
||||
}
|
||||
|
||||
type SmsLogListModel struct {
|
||||
entity.SysSmsLog
|
||||
}
|
||||
|
||||
// SmsLogStatusInp 更新状态
|
||||
type SmsLogStatusInp struct {
|
||||
entity.SysSmsLog
|
||||
}
|
||||
type SmsLogStatusModel struct{}
|
||||
|
||||
// SendCodeInp 发送验证码
|
||||
type SendCodeInp struct {
|
||||
Event string `json:"event" description:"事件"` // 必填
|
||||
Mobile string `json:"mobile" description:"手机号"` // 必填
|
||||
Code string `json:"code" description:"验证码或短信内容"`
|
||||
Template string `json:"-" description:"发信模板 "`
|
||||
}
|
||||
|
||||
// VerifyCodeInp 效验验证码
|
||||
type VerifyCodeInp struct {
|
||||
Event string `json:"event" description:"事件"` // 必填
|
||||
Mobile string `json:"mobile" description:"手机号"` // 必填
|
||||
Code string `json:"code" description:"验证码或短信内容"` // 必填
|
||||
}
|
Reference in New Issue
Block a user