mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-13 04:33:44 +08:00
发布v2.8.4版本,更新内容请查看:https://github.com/bufanyun/hotgo/tree/v2.0/docs/guide-zh-CN/addon-version-upgrade.md
This commit is contained in:
@@ -23,7 +23,6 @@ type CashViewModel struct {
|
||||
// CashListInp 获取列表
|
||||
type CashListInp struct {
|
||||
form.PageReq
|
||||
form.RangeDateReq
|
||||
form.StatusReq
|
||||
MemberId int64 `json:"memberId"`
|
||||
CreatedAt []int64 `json:"created_at"`
|
||||
|
||||
@@ -23,10 +23,10 @@ import (
|
||||
type CreditsLogSaveBalanceInp struct {
|
||||
MemberId int64 `json:"memberId" dc:"管理员ID"`
|
||||
AppId string `json:"appId" dc:"应用id"`
|
||||
AddonsName string `json:"addonsName" description:"插件名称"`
|
||||
AddonsName string `json:"addonsName" dc:"插件名称"`
|
||||
CreditGroup string `json:"creditGroup" dc:"变动的组别"`
|
||||
Num float64 `json:"num" dc:"变动数据"`
|
||||
Ip string `json:"ip" description:"操作人IP"`
|
||||
Ip string `json:"ip" dc:"操作人IP"`
|
||||
MapId int64 `json:"mapId" dc:"关联ID"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
}
|
||||
@@ -51,7 +51,6 @@ func (in *CreditsLogSaveBalanceInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Ip == "" {
|
||||
in.Ip = location.GetClientIp(ghttp.RequestFromCtx(ctx))
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@@ -62,10 +61,10 @@ type CreditsLogSaveBalanceModel struct {
|
||||
type CreditsLogSaveIntegralInp struct {
|
||||
MemberId int64 `json:"memberId" dc:"管理员ID"`
|
||||
AppId string `json:"appId" dc:"应用id"`
|
||||
AddonsName string `json:"addonsName" description:"插件名称"`
|
||||
AddonsName string `json:"addonsName" dc:"插件名称"`
|
||||
CreditGroup string `json:"creditGroup" dc:"变动的组别"`
|
||||
Num float64 `json:"num" dc:"变动数据"`
|
||||
Ip string `json:"ip" description:"操作人IP"`
|
||||
Ip string `json:"ip" dc:"操作人IP"`
|
||||
MapId int64 `json:"mapId" dc:"关联ID"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
}
|
||||
@@ -90,7 +89,6 @@ func (in *CreditsLogSaveIntegralInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Ip == "" {
|
||||
in.Ip = location.GetClientIp(ghttp.RequestFromCtx(ctx))
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ package adminin
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
@@ -16,7 +17,7 @@ import (
|
||||
|
||||
// DeptMaxSortInp 最大排序
|
||||
type DeptMaxSortInp struct {
|
||||
Id int64
|
||||
Id int64 `json:"id" dc:"部门ID"`
|
||||
}
|
||||
|
||||
type DeptMaxSortModel struct {
|
||||
@@ -77,13 +78,13 @@ type DeptInsertFields struct {
|
||||
|
||||
// DeptDeleteInp 删除部门类型
|
||||
type DeptDeleteInp struct {
|
||||
Id interface{}
|
||||
Id interface{} `json:"id" v:"required#部门ID不能为空" dc:"部门ID"`
|
||||
}
|
||||
type DeptDeleteModel struct{}
|
||||
|
||||
// DeptViewInp 获取信息
|
||||
type DeptViewInp struct {
|
||||
Id int64
|
||||
Id int64 `json:"id" v:"required#部门ID不能为空" dc:"部门ID"`
|
||||
}
|
||||
|
||||
type DeptViewModel struct {
|
||||
@@ -92,8 +93,14 @@ type DeptViewModel struct {
|
||||
|
||||
// DeptListInp 获取列表
|
||||
type DeptListInp struct {
|
||||
Name string
|
||||
Code string
|
||||
Name string `json:"name" dc:"部门名称"`
|
||||
Code string `json:"code" dc:"部门编码"`
|
||||
Leader string `json:"leader" dc:"负责人"`
|
||||
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
}
|
||||
|
||||
func (in *DeptListInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// DeptTree 树
|
||||
|
||||
@@ -72,7 +72,7 @@ type MemberUpdateProfileInp struct {
|
||||
|
||||
// MemberUpdatePwdInp 修改登录密码
|
||||
type MemberUpdatePwdInp struct {
|
||||
Id int64
|
||||
Id int64 `json:"id" dc:"用户ID"`
|
||||
OldPassword string `json:"oldPassword" v:"required#原密码不能为空" dc:"原密码"`
|
||||
NewPassword string `json:"newPassword" v:"required|length:6,16#新密码不能为空#新密码需在6~16之间" dc:"新密码"`
|
||||
}
|
||||
@@ -134,7 +134,7 @@ type MemberEditInp struct {
|
||||
}
|
||||
|
||||
type MemberAddInp struct {
|
||||
MemberEditInp
|
||||
*MemberEditInp
|
||||
Salt string `json:"salt" dc:"密码盐"`
|
||||
Pid int64 `json:"pid" dc:"上级ID"`
|
||||
Level int `json:"level" dc:"等级"`
|
||||
@@ -182,7 +182,6 @@ type MemberViewModel struct {
|
||||
// MemberListInp 获取列表
|
||||
type MemberListInp struct {
|
||||
form.PageReq
|
||||
form.RangeDateReq
|
||||
form.StatusReq
|
||||
RoleId int `json:"roleId" dc:"角色ID"`
|
||||
DeptId int `json:"deptId" dc:"部门ID"`
|
||||
@@ -250,13 +249,13 @@ type MemberAddBalanceInp struct {
|
||||
Id int64 `json:"id" v:"required#用户ID不能为空" dc:"管理员ID"`
|
||||
OperateMode int64 `json:"operateMode" v:"in:1,2#输入的操作方式是无效的" dc:"操作方式"`
|
||||
Num float64 `json:"num" dc:"操作数量"`
|
||||
AppId string `json:"-"`
|
||||
AddonsName string `json:"-"`
|
||||
SelfNum float64 `json:"-"`
|
||||
SelfCreditGroup string `json:"-"`
|
||||
OtherNum float64 `json:"-"`
|
||||
OtherCreditGroup string `json:"-"`
|
||||
Remark string `json:"-"`
|
||||
AppId string `json:"appId"`
|
||||
AddonsName string `json:"addonsName"`
|
||||
SelfNum float64 `json:"selfNum"`
|
||||
SelfCreditGroup string `json:"selfCreditGroup"`
|
||||
OtherNum float64 `json:"otherNum"`
|
||||
OtherCreditGroup string `json:"otherCreditGroup"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
func (in *MemberAddBalanceInp) Filter(ctx context.Context) (err error) {
|
||||
@@ -293,13 +292,13 @@ type MemberAddIntegralInp struct {
|
||||
Id int64 `json:"id" v:"required#用户ID不能为空" dc:"管理员ID"`
|
||||
OperateMode int64 `json:"operateMode" dc:"操作方式"`
|
||||
Num float64 `json:"num" dc:"操作数量"`
|
||||
AppId string `json:"-"`
|
||||
AddonsName string `json:"-"`
|
||||
SelfNum float64 `json:"-"`
|
||||
SelfCreditGroup string `json:"-"`
|
||||
OtherNum float64 `json:"-"`
|
||||
OtherCreditGroup string `json:"-"`
|
||||
Remark string `json:"-"`
|
||||
AppId string `json:"appId"`
|
||||
AddonsName string `json:"addonsName"`
|
||||
SelfNum float64 `json:"selfNum"`
|
||||
SelfCreditGroup string `json:"selfCreditGroup"`
|
||||
OtherNum float64 `json:"otherNum"`
|
||||
OtherCreditGroup string `json:"otherCreditGroup"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
func (in *MemberAddIntegralInp) Filter(ctx context.Context) (err error) {
|
||||
|
||||
@@ -103,16 +103,45 @@ type MenuRouteMeta struct {
|
||||
}
|
||||
|
||||
type MenuRoute struct {
|
||||
Name string `json:"name"`
|
||||
Path string `json:"path"`
|
||||
Redirect string `json:"redirect"`
|
||||
Component string `json:"component"`
|
||||
Meta MenuRouteMeta `json:"meta"`
|
||||
Children []MenuRoute `json:"children,omitempty" dc:"子路由"`
|
||||
Name string `json:"name"`
|
||||
Path string `json:"path"`
|
||||
Redirect string `json:"redirect"`
|
||||
Component string `json:"component"`
|
||||
Meta *MenuRouteMeta `json:"meta"`
|
||||
Children []*MenuRoute `json:"children,omitempty" dc:"子路由"`
|
||||
}
|
||||
|
||||
// MenuRouteSummary 菜单树结构
|
||||
type MenuRouteSummary struct {
|
||||
entity.AdminMenu
|
||||
Children []MenuRouteSummary
|
||||
Children []*MenuRouteSummary
|
||||
}
|
||||
|
||||
// DynamicMeta 动态路由元数据
|
||||
type DynamicMeta struct {
|
||||
Title string `json:"title" description:"菜单标题"`
|
||||
Icon string `json:"icon" description:"菜单图标"`
|
||||
NoCache bool `json:"noCache" description:"是否缓存"`
|
||||
Remark string `json:"remark" description:"备注"`
|
||||
}
|
||||
|
||||
// DynamicBase 动态路由
|
||||
type DynamicBase struct {
|
||||
Id int64 `json:"id" description:"菜单ID"`
|
||||
Pid int64 `json:"pid" description:"父ID"`
|
||||
Name string `json:"name" description:"菜单名称"`
|
||||
Code string `json:"code" description:"菜单编码"`
|
||||
Path string `json:"path" description:"路由地址"`
|
||||
Hidden bool `json:"hidden" description:"是否隐藏"`
|
||||
Redirect string `json:"redirect" description:"重定向"`
|
||||
Component string `json:"component" description:"组件路径"`
|
||||
AlwaysShow bool `json:"alwaysShow" description:"暂时不知道干啥"`
|
||||
IsFrame string `json:"isFrame" description:"是否为外链(0是 1否)"`
|
||||
Meta *DynamicMeta `json:"meta" description:"配置数据集"`
|
||||
}
|
||||
|
||||
// DynamicMenu 动态路由菜单
|
||||
type DynamicMenu struct {
|
||||
DynamicBase
|
||||
Children []*DynamicBase `json:"children" description:"子菜单"`
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package adminin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
@@ -47,7 +47,6 @@ type NoticeViewModel struct {
|
||||
// NoticeListInp 获取列表
|
||||
type NoticeListInp struct {
|
||||
form.PageReq
|
||||
form.RangeDateReq
|
||||
form.StatusReq
|
||||
Title string
|
||||
Content string
|
||||
@@ -81,6 +80,13 @@ type PullMessagesInp struct {
|
||||
Limit int `json:"limit" dc:"拉取最大数量限制"`
|
||||
}
|
||||
|
||||
func (in *PullMessagesInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Limit == 0 {
|
||||
in.Limit = 100
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type PullMessagesRow struct {
|
||||
Id int64 `json:"id" dc:"消息ID"`
|
||||
Type int64 `json:"type" dc:"消息类型"`
|
||||
|
||||
@@ -3,21 +3,29 @@
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package adminin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/utility/validate"
|
||||
)
|
||||
|
||||
// PostListInp 获取列表
|
||||
type PostListInp struct {
|
||||
form.PageReq
|
||||
form.RangeDateReq
|
||||
form.StatusReq
|
||||
Name string
|
||||
Code string
|
||||
Name string `json:"name" dc:"岗位名称"`
|
||||
Code string `json:"code" dc:"岗位编码"`
|
||||
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
}
|
||||
|
||||
func (in *PostListInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type PostListModel struct {
|
||||
@@ -26,56 +34,69 @@ type PostListModel struct {
|
||||
|
||||
// PostViewInp 获取信息
|
||||
type PostViewInp struct {
|
||||
Id string
|
||||
Id string `json:"id" v:"required#岗位ID不能为空" description:"岗位ID"`
|
||||
}
|
||||
|
||||
type PostViewModel struct {
|
||||
entity.AdminPost
|
||||
}
|
||||
|
||||
// PostCodeUniqueInp 编码是否唯一
|
||||
type PostCodeUniqueInp struct {
|
||||
Code string
|
||||
Id int64
|
||||
}
|
||||
|
||||
type PostCodeUniqueModel struct {
|
||||
IsUnique bool
|
||||
}
|
||||
|
||||
// PostNameUniqueInp 名称是否唯一
|
||||
type PostNameUniqueInp struct {
|
||||
Name string
|
||||
Id int64
|
||||
}
|
||||
|
||||
type PostNameUniqueModel struct {
|
||||
IsUnique bool
|
||||
}
|
||||
|
||||
// PostMaxSortInp 最大排序
|
||||
type PostMaxSortInp struct {
|
||||
Id int64
|
||||
Id int64 `json:"id" description:"岗位ID"`
|
||||
}
|
||||
|
||||
type PostMaxSortModel struct {
|
||||
Sort int
|
||||
Sort int `json:"sort" description:"排序"`
|
||||
}
|
||||
|
||||
// PostEditInp 修改/新增字典数据
|
||||
type PostEditInp struct {
|
||||
entity.AdminPost
|
||||
}
|
||||
|
||||
func (in *PostEditInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Name == "" {
|
||||
err = gerror.New("名称不能为空")
|
||||
return
|
||||
}
|
||||
if in.Code == "" {
|
||||
err = gerror.New("编码不能为空")
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type PostEditModel struct{}
|
||||
|
||||
// PostDeleteInp 删除字典类型
|
||||
type PostDeleteInp struct {
|
||||
Id interface{}
|
||||
Id interface{} `json:"id" v:"required#岗位ID不能为空" description:"岗位ID"`
|
||||
}
|
||||
|
||||
type PostDeleteModel struct{}
|
||||
|
||||
// PostStatusInp 更新状态
|
||||
type PostStatusInp struct {
|
||||
entity.AdminPost
|
||||
}
|
||||
|
||||
func (in *PostStatusInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Id <= 0 {
|
||||
err = gerror.New("ID不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
if in.Status <= 0 {
|
||||
err = gerror.New("状态不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
if !validate.InSlice(consts.StatusSlice, in.Status) {
|
||||
err = gerror.New("状态不正确")
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type PostStatusModel struct{}
|
||||
|
||||
@@ -115,7 +115,7 @@ type RoleListModel struct {
|
||||
// RoleMemberListInp 查询列表
|
||||
type RoleMemberListInp struct {
|
||||
form.PageReq
|
||||
form.RangeDateReq
|
||||
|
||||
form.StatusReq
|
||||
Role int `json:"role" dc:"角色ID"`
|
||||
DeptId int `json:"deptId" dc:"部门ID"`
|
||||
|
||||
Reference in New Issue
Block a user