This commit is contained in:
孟帅
2022-11-24 23:37:34 +08:00
parent 4ffe54b6ac
commit 29bda0dcdd
1487 changed files with 97869 additions and 96539 deletions

View File

@@ -0,0 +1,16 @@
// Package member
// @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 member
import "github.com/gogf/gf/v2/frame/g"
// GetIdByCodeReq 通过邀请码获取会员ID
type GetIdByCodeReq struct {
g.Meta `path:"/member/getIdByCode" method:"post" tags:"会员" summary:"通过邀请码获取会员ID"`
Code string `json:"code" dc:"邀请码"`
}
type GetIdByCodeRes struct{}

View File

@@ -0,0 +1,18 @@
// Package user
// @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 user
import (
"github.com/gogf/gf/v2/frame/g"
)
type HelloReq struct {
g.Meta `path:"/hello" tags:"Hello" method:"get" summary:"You first hello api"`
}
type HelloRes struct {
g.Meta `mime:"text/html" example:"string"`
}

View File

@@ -0,0 +1,68 @@
// Package attachment
// @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 attachment
import (
"github.com/gogf/gf/v2/frame/g"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
"hotgo/internal/model/input/sysin"
)
// ListReq 查询列表
type ListReq struct {
form.PageReq
form.RangeDateReq
form.StatusReq
MemberId int64 `json:"member_id"`
Drive string `json:"drive"`
g.Meta `path:"/attachment/list" method:"get" tags:"附件" summary:"获取附件列表"`
}
type ListRes struct {
List []*sysin.AttachmentListModel `json:"list" dc:"数据列表"`
form.PageRes
}
// ViewReq 获取信息
type ViewReq struct {
Id int64 `json:"id" v:"required#附件ID不能为空" dc:"附件ID"`
g.Meta `path:"/attachment/view" method:"get" tags:"附件" summary:"获取指定信息"`
}
type ViewRes struct {
*sysin.AttachmentViewModel
}
// EditReq 修改/新增
type EditReq struct {
entity.AdminNotice
g.Meta `path:"/attachment/edit" method:"post" tags:"附件" summary:"修改/新增附件"`
}
type EditRes struct{}
// DeleteReq 删除
type DeleteReq struct {
Id interface{} `json:"id" v:"required#附件ID不能为空" dc:"附件ID"`
g.Meta `path:"/attachment/delete" method:"post" tags:"附件" summary:"删除附件"`
}
type DeleteRes struct{}
// MaxSortReq 最大排序
type MaxSortReq struct {
Id int64 `json:"id" dc:"附件ID"`
g.Meta `path:"/attachment/max_sort" method:"get" tags:"附件" summary:"附件最大排序"`
}
type MaxSortRes struct {
Sort int `json:"sort" dc:"排序"`
}
// StatusReq 更新状态
type StatusReq struct {
entity.AdminNotice
g.Meta `path:"/attachment/status" method:"post" tags:"附件" summary:"更新附件状态"`
}
type StatusRes struct{}

View File

@@ -0,0 +1,68 @@
// Package blacklist
// @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 blacklist
import (
"github.com/gogf/gf/v2/frame/g"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
"hotgo/internal/model/input/sysin"
)
// ListReq 查询列表
type ListReq struct {
form.PageReq
form.RangeDateReq
form.StatusReq
Title string `json:"title"`
Content string `json:"content"`
g.Meta `path:"/blacklist/list" method:"get" tags:"黑名单" summary:"获取黑名单列表"`
}
type ListRes struct {
List []*sysin.BlacklistListModel `json:"list" dc:"数据列表"`
form.PageRes
}
// ViewReq 获取信息
type ViewReq struct {
Id int64 `json:"id" v:"required#黑名单ID不能为空" dc:"黑名单ID"`
g.Meta `path:"/blacklist/view" method:"get" tags:"黑名单" summary:"获取指定信息"`
}
type ViewRes struct {
*sysin.BlacklistViewModel
}
// EditReq 修改/新增
type EditReq struct {
entity.SysBlacklist
g.Meta `path:"/blacklist/edit" method:"post" tags:"黑名单" summary:"修改/新增黑名单"`
}
type EditRes struct{}
// DeleteReq 删除
type DeleteReq struct {
Id interface{} `json:"id" v:"required#黑名单ID不能为空" dc:"黑名单ID"`
g.Meta `path:"/blacklist/delete" method:"post" tags:"黑名单" summary:"删除黑名单"`
}
type DeleteRes struct{}
// MaxSortReq 最大排序
type MaxSortReq struct {
Id int64 `json:"id" dc:"黑名单ID"`
g.Meta `path:"/blacklist/max_sort" method:"get" tags:"黑名单" summary:"黑名单最大排序"`
}
type MaxSortRes struct {
Sort int `json:"sort" dc:"排序"`
}
// StatusReq 更新状态
type StatusReq struct {
entity.SysBlacklist
g.Meta `path:"/blacklist/status" method:"post" tags:"黑名单" summary:"更新黑名单状态"`
}
type StatusRes struct{}

View File

@@ -0,0 +1,39 @@
// Package common
// @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 common
import "github.com/gogf/gf/v2/frame/g"
// ConsoleStatReq 控制台统计
type ConsoleStatReq struct {
g.Meta `path:"/console/stat" method:"get" tags:"控制台" summary:"综合数据统计"`
}
type ConsoleStatRes struct {
Visits struct {
DayVisits float64 `json:"dayVisits"`
Rise float64 `json:"rise"`
Decline float64 `json:"decline"`
Amount float64 `json:"amount"`
} `json:"visits"`
Saleroom struct {
WeekSaleroom float64 `json:"weekSaleroom"`
Amount float64 `json:"amount"`
Degree float64 `json:"degree"`
} `json:"saleroom"`
OrderLarge struct {
WeekLarge float64 `json:"weekLarge"`
Rise float64 `json:"rise"`
Decline float64 `json:"decline"`
Amount float64 `json:"amount"`
} `json:"orderLarge"`
Volume struct {
WeekLarge float64 `json:"weekLarge"`
Rise float64 `json:"rise"`
Decline float64 `json:"decline"`
Amount float64 `json:"amount"`
} `json:"volume"`
}

View File

@@ -0,0 +1,19 @@
// Package common
// @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 common
import (
"github.com/gogf/gf/v2/frame/g"
)
// SendTestEmailReq 发送测试邮件
type SendTestEmailReq struct {
To string `json:"to" v:"required#接收者邮件不能为空" dc:"接收者邮件,多个用;隔开"`
g.Meta `path:"/ems/sendTest" tags:"邮件" method:"post" summary:"发送测试邮件"`
}
type SendTestEmailRes struct {
}

View File

@@ -0,0 +1,56 @@
// Package common
// @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 common
import (
"github.com/gogf/gf/v2/frame/g"
"hotgo/internal/model/input/adminin"
)
// LoginLogoutReq 注销登录
type LoginLogoutReq struct {
g.Meta `path:"/site/logout" method:"get" tags:"后台基础" summary:"注销登录"`
}
type LoginLogoutRes struct{}
// LoginCaptchaReq 获取登录验证码
type LoginCaptchaReq struct {
g.Meta `path:"/site/captcha" method:"get" tags:"后台基础" summary:"获取登录验证码"`
}
type LoginCaptchaRes struct {
Cid string `json:"cid" dc:"验证码ID"`
Base64 string `json:"base64" dc:"验证码"`
}
// LoginReq 提交登录
type LoginReq struct {
g.Meta `path:"/site/login" method:"post" tags:"后台基础" summary:"账号登录"`
Username string `json:"username" v:"required#用户名不能为空" dc:"用户名"`
Password string `json:"password" v:"required#密码不能为空" dc:"密码"`
//Cid string `json:"cid" v:"required#验证码ID不能为空" dc:"验证码ID"`
//Code string `json:"code" v:"required#验证码不能为空" dc:"验证码"`
//Device string `json:"device" dc:"登录设备"`
}
type LoginRes struct {
adminin.MemberLoginModel
}
// SiteConfigReq 获取配置
type SiteConfigReq struct {
g.Meta `path:"/site/config" method:"get" tags:"后台基础" summary:"获取配置"`
}
type SiteConfigRes struct {
Version string `json:"version" dc:"系统版本"`
WsAddr string `json:"wsAddr" dc:"客户端websocket地址"`
}
// SitePingReq ping
type SitePingReq struct {
g.Meta `path:"/site/ping" method:"get" tags:"后台基础" summary:"ping"`
}
type SitePingRes struct{}

View File

@@ -0,0 +1,19 @@
// Package common
// @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 common
import (
"github.com/gogf/gf/v2/frame/g"
"hotgo/internal/model/input/sysin"
)
// UploadImageReq 上传图片
type UploadImageReq struct {
g.Meta `path:"/upload/image" tags:"上传" method:"post" summary:"上传图片"`
}
type UploadImageRes *sysin.AttachmentListModel

View File

@@ -0,0 +1,30 @@
// Package config
// @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 config
import (
"github.com/gogf/gf/v2/frame/g"
"hotgo/internal/model/input/sysin"
)
// GetReq 获取指定分组的配置
type GetReq struct {
Group string `json:"group" dc:"分组名称" v:"required#分组名称不能为空" `
g.Meta `path:"/config/get" method:"get" tags:"配置" summary:"获取指定分组的配置"`
}
type GetRes struct {
*sysin.GetConfigModel
}
// UpdateReq 获取指定分组的配置
type UpdateReq struct {
Group string `json:"group" dc:"分组名称" v:"required#分组名称不能为空" `
List g.Map `json:"list" dc:"更新配置列表" `
g.Meta `path:"/config/update" method:"post" tags:"配置" summary:"获取指定分组的配置"`
}
type UpdateRes struct {
}

View File

@@ -0,0 +1,68 @@
// Package cron
// @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 cron
import (
"github.com/gogf/gf/v2/frame/g"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
"hotgo/internal/model/input/sysin"
)
// ListReq 查询列表
type ListReq struct {
form.PageReq
form.RangeDateReq
form.StatusReq
Title string `json:"title"`
Content string `json:"content"`
g.Meta `path:"/cron/list" method:"get" tags:"定时任务" summary:"获取定时任务列表"`
}
type ListRes struct {
List []*sysin.CronListModel `json:"list" dc:"数据列表"`
form.PageRes
}
// ViewReq 获取信息
type ViewReq struct {
Id int64 `json:"id" v:"required#定时任务ID不能为空" dc:"定时任务ID"`
g.Meta `path:"/cron/view" method:"get" tags:"定时任务" summary:"获取指定信息"`
}
type ViewRes struct {
*sysin.CronViewModel
}
// EditReq 修改/新增
type EditReq struct {
entity.SysCron
g.Meta `path:"/cron/edit" method:"post" tags:"定时任务" summary:"修改/新增定时任务"`
}
type EditRes struct{}
// DeleteReq 删除
type DeleteReq struct {
Id interface{} `json:"id" v:"required#定时任务ID不能为空" dc:"定时任务ID"`
g.Meta `path:"/cron/delete" method:"post" tags:"定时任务" summary:"删除定时任务"`
}
type DeleteRes struct{}
// MaxSortReq 最大排序
type MaxSortReq struct {
Id int64 `json:"id" dc:"定时任务ID"`
g.Meta `path:"/cron/max_sort" method:"get" tags:"定时任务" summary:"定时任务最大排序"`
}
type MaxSortRes struct {
Sort int `json:"sort" dc:"排序"`
}
// StatusReq 更新状态
type StatusReq struct {
entity.SysCron
g.Meta `path:"/cron/status" method:"post" tags:"定时任务" summary:"更新定时任务状态"`
}
type StatusRes struct{}

View File

@@ -0,0 +1,75 @@
// Package cron
// @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 cron
import (
"github.com/gogf/gf/v2/frame/g"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
"hotgo/internal/model/input/sysin"
)
// GroupListReq 查询列表
type GroupListReq struct {
form.PageReq
form.RangeDateReq
form.StatusReq
Title string `json:"title"`
Content string `json:"content"`
g.Meta `path:"/cron_group/list" method:"get" tags:"定时任务分组" summary:"获取定时任务分组列表"`
}
type GroupListRes struct {
List []*sysin.CronGroupListModel `json:"list" dc:"数据列表"`
form.PageRes
}
// GroupViewReq 获取信息
type GroupViewReq struct {
Id int64 `json:"id" v:"required#定时任务分组ID不能为空" dc:"定时任务分组ID"`
g.Meta `path:"/cron_group/view" method:"get" tags:"定时任务分组" summary:"获取指定信息"`
}
type GroupViewRes struct {
*sysin.CronGroupViewModel
}
// GroupEditReq 修改/新增
type GroupEditReq struct {
entity.SysCronGroup
g.Meta `path:"/cron_group/edit" method:"post" tags:"定时任务分组" summary:"修改/新增定时任务分组"`
}
type GroupEditRes struct{}
// GroupDeleteReq 删除
type GroupDeleteReq struct {
Id interface{} `json:"id" v:"required#定时任务分组ID不能为空" dc:"定时任务分组ID"`
g.Meta `path:"/cron_group/delete" method:"post" tags:"定时任务分组" summary:"删除定时任务分组"`
}
type GroupDeleteRes struct{}
// GroupMaxSortReq 最大排序
type GroupMaxSortReq struct {
Id int64 `json:"id" dc:"定时任务分组ID"`
g.Meta `path:"/cron_group/max_sort" method:"get" tags:"定时任务分组" summary:"定时任务分组最大排序"`
}
type GroupMaxSortRes struct {
Sort int `json:"sort" dc:"排序"`
}
// GroupStatusReq 更新状态
type GroupStatusReq struct {
entity.SysCronGroup
g.Meta `path:"/cron_group/status" method:"post" tags:"定时任务分组" summary:"更新定时任务分组状态"`
}
type GroupStatusRes struct{}
// GroupSelectReq 定时任务分组选项
type GroupSelectReq struct {
g.Meta `path:"/cron_group/select" method:"get" tags:"定时任务分组" summary:"定时任务分组选项"`
}
type GroupSelectRes sysin.DictTypeSelectModel

View File

@@ -0,0 +1,79 @@
// Package dept
// @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 dept
import (
"github.com/gogf/gf/v2/frame/g"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/adminin"
)
// NameUniqueReq 名称是否唯一
type NameUniqueReq struct {
Name string `json:"name" v:"required#部门名称不能为空" dc:"部门名称"`
Id int64 `json:"id" dc:"部门ID"`
g.Meta `path:"/dept/name_unique" method:"get" tags:"部门" summary:"部门名称是否唯一"`
}
type NameUniqueRes struct {
IsUnique bool `json:"is_unique" dc:"是否唯一"`
}
// ListTreeReq 查询列表树
type ListTreeReq struct {
Id int64 `json:"id" dc:"部门ID"`
g.Meta `path:"/dept/list_tree" method:"get" tags:"部门" summary:"获取部门列表树"`
}
type ListTreeRes []*adminin.DeptListTreeModel
// ListReq 查询列表
type ListReq struct {
Name string `json:"name" dc:"部门名称"`
Code string `json:"code" dc:"部门编码"`
g.Meta `path:"/dept/list" method:"get" tags:"部门" summary:"获取部门列表"`
}
type ListRes []*g.Map
// ViewReq 获取指定信息
type ViewReq struct {
Id int64 `json:"id" v:"required#部门ID不能为空" dc:"部门ID"`
g.Meta `path:"/dept/view" method:"get" tags:"部门" summary:"获取指定信息"`
}
type ViewRes struct {
*adminin.DeptViewModel
}
// EditReq 修改/新增字典数据
type EditReq struct {
entity.AdminDept
g.Meta `path:"/dept/edit" method:"post" tags:"部门" summary:"修改/新增部门"`
}
type EditRes struct{}
// DeleteReq 删除字典类型
type DeleteReq struct {
Id interface{} `json:"id" v:"required#部门ID不能为空" dc:"部门ID"`
g.Meta `path:"/dept/delete" method:"post" tags:"部门" summary:"删除部门"`
}
type DeleteRes struct{}
// MaxSortReq 最大排序
type MaxSortReq struct {
Id int64 `json:"id" dc:"部门ID"`
g.Meta `path:"/dept/max_sort" method:"get" tags:"部门" summary:"部门最大排序"`
}
type MaxSortRes struct {
Sort int `json:"sort" dc:"排序"`
}
// StatusReq 更新部门状态
type StatusReq struct {
entity.AdminDept
g.Meta `path:"/dept/status" method:"post" tags:"部门" summary:"更新部门状态"`
}
type StatusRes struct{}

View File

@@ -0,0 +1,46 @@
// Package dict
// @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 dict
import (
"github.com/gogf/gf/v2/frame/g"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
"hotgo/internal/model/input/sysin"
)
// DataEditReq 修改/新增字典数据
type DataEditReq struct {
entity.SysDictData
TypeID int64 `json:"typeID" dc:"字典类型ID"`
g.Meta `path:"/dict_data/edit" method:"post" tags:"字典数据" summary:"修改/新增字典数据"`
}
type DataEditRes struct{}
// DataDeleteReq 删除字典数据
type DataDeleteReq struct {
Id interface{} `json:"id" v:"required#字典数据ID不能为空" dc:"字典数据ID"`
g.Meta `path:"/dict_data/delete" method:"post" tags:"字典数据" summary:"删除字典数据"`
}
type DataDeleteRes struct{}
// DataListReq 查询列表
type DataListReq struct {
form.PageReq
form.RangeDateReq
form.StatusReq
TypeID int64 `json:"typeId" v:"required#字典类型ID不能为空" dc:"字典类型ID"` //
Type string `json:"type"`
Label string `json:"label"`
g.Meta `path:"/dict_data/list" method:"get" tags:"字典数据" summary:"获取字典数据列表"`
}
type DataListRes struct {
List []*sysin.DictDataListModel `json:"list" dc:"数据列表"`
form.PageRes
}

View File

@@ -0,0 +1,43 @@
// Package dict
// @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 dict
import (
"github.com/gogf/gf/v2/frame/g"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/sysin"
)
// TypeTreeReq 字典类型树
type TypeTreeReq struct {
g.Meta `path:"/dict_type/tree" tags:"字典类型" method:"get" summary:"字典类型树列表"`
}
type TypeTreeRes struct {
List []map[string]interface{} `json:"list" dc:"数据列表"`
}
// TypeEditReq 修改/新增字典数据
type TypeEditReq struct {
entity.AdminDept
g.Meta `path:"/dict_type/edit" method:"post" tags:"字典类型" summary:"修改/新增字典类型"`
}
type TypeEditRes struct{}
// TypeDeleteReq 删除字典类型
type TypeDeleteReq struct {
Id interface{} `json:"id" v:"required#字典类型ID不能为空" dc:"字典类型ID"`
g.Meta `path:"/dict_type/delete" method:"post" tags:"字典类型" summary:"删除字典类型"`
}
type TypeDeleteRes struct{}
// TypeSelectReq 修改/新增字典数据
type TypeSelectReq struct {
g.Meta `path:"/dict_type/select" method:"get" tags:"字典类型" summary:"字典类型选项"`
}
type TypeSelectRes sysin.DictTypeSelectModel

View File

@@ -0,0 +1,70 @@
// Package log
// @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 log
import (
"github.com/gogf/gf/v2/frame/g"
"hotgo/internal/model/input/form"
"hotgo/internal/model/input/sysin"
)
// ClearReq 清空日志
type ClearReq struct {
g.Meta `path:"/log/clear" method:"post" tags:"日志" summary:"清空日志"`
}
type ClearRes struct{}
// ExportReq 导出
type ExportReq struct {
g.Meta `path:"/log/export" method:"get" tags:"日志" summary:"导出日志"`
form.PageReq
form.RangeDateReq
Module string `json:"module" dc:"应用端口"`
MemberId int `json:"member_id" dc:"用户ID"`
TakeUpTime int `json:"take_up_time" dc:"请求耗时"`
Method string `json:"method" dc:"请求方式"`
Url string `json:"url" dc:"请求路径"`
Ip string `json:"ip" dc:"访问IP"`
ErrorCode string `json:"error_code" dc:"状态码"`
}
type ExportRes struct{}
// ListReq 获取菜单列表
type ListReq struct {
g.Meta `path:"/log/list" method:"get" tags:"日志" summary:"获取日志列表"`
form.PageReq
form.RangeDateReq
Module string `json:"module" dc:"应用端口"`
MemberId int `json:"member_id" dc:"用户ID"`
TakeUpTime int `json:"take_up_time" dc:"请求耗时"`
Method string `json:"method" dc:"请求方式"`
Url string `json:"url" dc:"请求路径"`
Ip string `json:"ip" dc:"访问IP"`
ErrorCode string `json:"error_code" dc:"状态码"`
CreatedAt []int64 `json:"created_at " dc:"访问时间区间"`
}
type ListRes struct {
List []*sysin.LogListModel `json:"list" dc:"数据列表"`
form.PageRes
}
// DeleteReq 删除
type DeleteReq struct {
g.Meta `path:"/log/delete" method:"post" tags:"日志" summary:"删除日志"`
Id interface{} `json:"id" v:"required#日志ID不能为空" description:"日志ID"`
}
type DeleteRes struct{}
// ViewReq 获取指定信息
type ViewReq struct {
g.Meta `path:"/log/view" method:"get" tags:"日志" summary:"获取指定信息"`
Id string `json:"id" v:"required#日志ID不能为空" description:"日志ID"`
}
type ViewRes struct {
*sysin.LogViewModel
}

View File

@@ -0,0 +1,218 @@
// Package member
// @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 member
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/adminin"
"hotgo/internal/model/input/form"
)
// UpdateProfileReq 更新会员资料
type UpdateProfileReq struct {
g.Meta `path:"/member/update_profile" method:"post" tags:"会员" summary:"更新会员资料"`
Mobile int `json:"mobile" dc:"手机号"`
Email string `json:"email" dc:"邮箱"`
RealName string `json:"realname" dc:"真实姓名"`
}
type UpdateProfileRes struct{}
// UpdatePwdReq 修改登录密码
type UpdatePwdReq struct {
g.Meta `path:"/member/update_pwd" method:"post" tags:"会员" summary:"重置密码"`
OldPassword string `json:"oldPassword" v:"required#原密码不能为空" dc:"原密码"`
NewPassword string `json:"newPassword" v:"required|length:6,16#新密码不能为空#新密码需在6~16之间" dc:"新密码"`
}
type UpdatePwdRes struct{}
// ProfileReq 获取登录用户的基本信息
type ProfileReq struct {
g.Meta `path:"/member/profile" method:"get" tags:"会员" summary:"获取登录用户的基本信息"`
}
type ProfileRes struct {
PostGroup string `json:"postGroup" dc:"岗位名称"`
RoleGroup string `json:"roleGroup" dc:"角色名称"`
User *adminin.MemberViewModel `json:"member" dc:"用户基本信息"`
SysDept *adminin.DeptViewModel `json:"sysDept" dc:"部门信息"`
SysRoles []*adminin.RoleListModel `json:"sysRoles" dc:"角色列表"`
PostIds int64 `json:"postIds" dc:"当前岗位"`
RoleIds int64 `json:"roleIds" dc:"当前角色"`
}
// ResetPwdReq 重置密码
type ResetPwdReq struct {
g.Meta `path:"/member/reset_pwd" method:"post" tags:"会员" summary:"重置密码"`
Password string `json:"password" v:"required#密码不能为空" dc:"密码"`
Id int64 `json:"id" dc:"会员ID"`
}
type ResetPwdRes struct{}
// EmailUniqueReq 邮箱是否唯一
type EmailUniqueReq struct {
g.Meta `path:"/member/email_unique" method:"get" tags:"会员" summary:"邮箱是否唯一"`
Email string `json:"email" v:"required#邮箱不能为空" dc:"邮箱"`
Id int64 `json:"id" dc:"会员ID"`
}
type EmailUniqueRes struct {
IsUnique bool `json:"is_unique" dc:"是否唯一"`
}
// MobileUniqueReq 手机号是否唯一
type MobileUniqueReq struct {
g.Meta `path:"/member/mobile_unique" method:"get" tags:"会员" summary:"手机号是否唯一"`
Mobile string `json:"mobile" v:"required#手机号不能为空" dc:"手机号"`
Id int64 `json:"id" dc:"会员ID"`
}
type MobileUniqueRes struct {
IsUnique bool `json:"is_unique" dc:"是否唯一"`
}
// NameUniqueReq 名称是否唯一
type NameUniqueReq struct {
g.Meta `path:"/member/name_unique" method:"get" tags:"会员" summary:"会员名称是否唯一"`
Username string `json:"username" v:"required#会员名称不能为空" dc:"会员名称"`
Id int64 `json:"id" dc:"会员ID"`
}
type NameUniqueRes struct {
IsUnique bool `json:"is_unique" dc:"是否唯一"`
}
// ListReq 查询列表
type ListReq struct {
g.Meta `path:"/member/list" method:"get" tags:"会员" summary:"获取会员列表"`
form.PageReq
form.RangeDateReq
form.StatusReq
DeptId int `json:"dept_id" dc:"部门ID"`
Mobile int `json:"mobile" dc:"手机号"`
Username string `json:"username" dc:"用户名"`
Realname string `json:"realname" dc:"真实姓名"`
Name string `json:"name" dc:"岗位名称"`
Code string `json:"code" dc:"岗位编码"`
CreatedAt []int64 `json:"created_at" dc:"创建时间"`
}
type ListRes struct {
List []*adminin.MemberListModel `json:"list" dc:"数据列表"`
form.PageRes
}
// ViewReq 获取指定信息
type ViewReq struct {
g.Meta `path:"/member/view" method:"get" tags:"会员" summary:"获取指定信息"`
Id int64 `json:"id" dc:"会员ID"` // v:"required#会员ID不能为空"
}
type ViewRes struct {
*adminin.MemberViewModel
Posts []*adminin.PostListModel `json:"posts" dc:"可选岗位"`
PostIds []int64 `json:"postIds" dc:"当前岗位"`
Roles []*adminin.RoleListModel `json:"roles" dc:"可选角色"`
RoleIds []int64 `json:"roleIds" dc:"当前角色"`
DeptName string `json:"dept_name" dc:"部门名称"`
}
// EditReq 修改/新增
type EditReq struct {
g.Meta `path:"/member/edit" method:"post" tags:"会员" summary:"修改/新增会员"`
adminin.MemberEditInp
}
type EditRes struct{}
// DeleteReq 删除
type DeleteReq struct {
g.Meta `path:"/member/delete" method:"post" tags:"会员" summary:"删除会员"`
Id interface{} `json:"id" v:"required#会员ID不能为空" dc:"会员ID"`
}
type DeleteRes struct{}
// MaxSortReq 最大排序
type MaxSortReq struct {
g.Meta `path:"/member/max_sort" method:"get" tags:"会员" summary:"会员最大排序"`
Id int64 `json:"id" dc:"会员ID"`
}
type MaxSortRes struct {
Sort int `json:"sort" dc:"排序"`
}
// InfoReq 获取登录用户信息
type InfoReq struct {
g.Meta `path:"/member/info" method:"get" tags:"会员" summary:"获取登录用户信息" dc:"获取管理后台的登录用户信息"`
}
type InfoRes struct {
adminin.MemberLoginModel
//DefaultPortalConfig []*PortalConfig `json:"defaultPortalConfig" dc:"默认用户配置"`
//LincenseInfo string `json:"lincenseInfo" dc:"应用版本号"`
//Permissions []string `json:"permissions" dc:"权限"`
//Roles []string `json:"roles" dc:"角色"`
//SysNoticeList []*entity.AdminNotice `json:"sysNoticeList" dc:"系统公告"`
//UserPortalConfig []*PortalConfig `json:"userPortalConfig" dc:"用户配置"`
//User model.Identity `json:"member" dc:"用户信息"`
}
type PortalConfigContentOptions struct {
TitleRequired bool `json:"titleRequired" titleRequired:""`
MoreUrl string `json:"moreUrl" dc:"模块地址"`
Refresh int `json:"refresh" dc:"刷新"`
}
type PortalConfigContent struct {
Id int `json:"id" dc:"内容ID"`
X int `json:"x" dc:""`
Y int `json:"y" dc:""`
W int `json:"w" dc:"宽"`
H int `json:"h" dc:"高"`
I int `json:"i" dc:""`
Key string `json:"key" dc:""`
IsShowTitle string `json:"isShowTitle" dc:""`
IsAllowDrag bool `json:"isAllowDrag" dc:""`
Name string `json:"name" dc:""`
Type string `json:"type" dc:""`
Url string `json:"url" dc:""`
Options []*PortalConfigContentOptions `json:"options" dc:""`
Moved bool `json:"moved" dc:""`
}
type PortalConfig struct {
CreateByName string `json:"createByName" dc:"创建者名称"`
CreateDeptName string `json:"createDeptName" dc:"创建部门名称"`
ImportErrInfo string `json:"importErrInfo" dc:"导出错误信息"`
Id string `json:"id" dc:"用户ID"`
SearchValue string `json:"searchValue" dc:"搜索内容"`
CreateBy string `json:"createBy" dc:"创建者名称"`
CreateDept string `json:"createDept" dc:"创建部门名称"`
CreateTime *gtime.Time `json:"createTime" dc:"创建时间"`
UpdateBy string `json:"updateBy" dc:"更新者名称"`
UpdateTime *gtime.Time `json:"updateTime" dc:"更新时间"`
UpdateIp string `json:"updateIp" dc:"更新iP"`
Remark string `json:"remark" dc:"备注"`
Version string `json:"version" dc:"版本号"`
DelFlag string `json:"delFlag" dc:"删除标签"`
HandleType string `json:"handleType" dc:""`
Params string `json:"params" dc:""`
Name string `json:"name" dc:"配置名称"`
Code string `json:"code" dc:"配置代码"`
ApplicationRange string `json:"applicationRange" dc:""`
IsDefault string `json:"isDefault" dc:"是否默认"`
ResourceId string `json:"resourceId" dc:""`
ResourceName string `json:"resourceName" dc:""`
SystemDefinedId string `json:"systemDefinedId" dc:""`
Sort string `json:"sort" dc:"排序"`
SaveType string `json:"saveType" dc:""`
Status string `json:"status" dc:"状态"`
RecordLog string `json:"recordLog" dc:""`
PortalConfigContent string `json:"content" dc:"配置内容"`
}
// StatusReq 更新岗位状态
type StatusReq struct {
entity.AdminPost
g.Meta `path:"/member/status" method:"post" tags:"会员" summary:"更新会员状态"`
}
type StatusRes struct{}

View File

@@ -0,0 +1,97 @@
// Package menu
// @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 menu
import (
"github.com/gogf/gf/v2/frame/g"
"hotgo/internal/model"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
)
// MaxSortReq 菜单最大排序
type MaxSortReq struct {
g.Meta `path:"/menu/max_sort" method:"get" tags:"菜单" summary:"菜单最大排序"`
Id int64 `json:"id" dc:"菜单ID"`
}
type MaxSortRes struct {
Sort int `json:"sort" dc:"排序"`
}
// CodeUniqueReq 菜单编码是否唯一
type CodeUniqueReq struct {
g.Meta `path:"/menu/code_unique" method:"get" tags:"菜单" summary:"菜单编码是否唯一"`
Code string `json:"code" v:"required#菜单编码不能为空" dc:"菜单编码"`
Id int64 `json:"id" dc:"菜单ID"`
}
type CodeUniqueRes struct {
IsUnique bool `json:"is_unique" dc:"是否唯一"`
}
// NameUniqueReq 菜单名称是否唯一
type NameUniqueReq struct {
g.Meta `path:"/menu/name_unique" method:"get" tags:"菜单" summary:"菜单名称是否唯一"`
Name string `json:"name" v:"required#菜单名称不能为空" dc:"菜单名称"`
Id int64 `json:"id" dc:"菜单ID"`
}
type NameUniqueRes struct {
IsUnique bool `json:"is_unique" dc:"是否唯一"`
}
// EditReq 修改/新增菜单
type EditReq struct {
g.Meta `path:"/menu/edit" method:"post" tags:"菜单" summary:"修改/新增菜单"`
entity.AdminMenu
}
type EditRes struct{}
// DeleteReq 删除菜单
type DeleteReq struct {
g.Meta `path:"/menu/delete" method:"post" tags:"菜单" summary:"删除菜单"`
Id interface{} `json:"id" v:"required#菜单ID不能为空" dc:"菜单ID"`
}
type DeleteRes struct{}
// ViewReq 获取指定菜单信息
type ViewReq struct {
g.Meta `path:"/menu/view" method:"get" tags:"菜单" summary:"获取指定菜单信息"`
Id string `json:"id" v:"required#菜单ID不能为空" dc:"菜单ID"`
}
type ViewRes struct {
*entity.AdminMenu
}
// ListReq 获取菜单列表
type ListReq struct {
g.Meta `path:"/menu/list" method:"get" tags:"菜单" summary:"获取菜单列表"`
form.PageReq
Pid int64 `json:"pid" dc:"父ID"`
}
type ListRes struct {
List []map[string]interface{} `json:"list" dc:"数据列表"`
}
// SearchListReq 查询菜单列表
type SearchListReq struct {
g.Meta `path:"/menu/search_list" method:"get" tags:"菜单" summary:"获取菜单列表"`
Name string `json:"name" dc:"菜单名称"`
form.StatusReq
}
type SearchListRes []*model.TreeMenu
// RoleListReq 查询角色菜单列表
type RoleListReq struct {
g.Meta `path:"/menu/role_list" method:"get" tags:"菜单" summary:"查询角色菜单列表"`
RoleId string `json:"role_id" dc:"角色ID"`
}
type RoleListRes struct {
Menus []*model.LabelTreeMenu `json:"menus" dc:"菜单列表"`
CheckedKeys []int64 `json:"checkedKeys" dc:"选择的菜单ID"`
}

View File

@@ -0,0 +1,68 @@
// Package monitor
// @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 monitor
import (
"github.com/gogf/gf/v2/frame/g"
"hotgo/internal/model/input/form"
)
// OfflineReq 下线用户
type OfflineReq struct {
g.Meta `path:"/monitor/offline" method:"post" tags:"在线用户" summary:"下线用户"`
Id string `json:"id" v:"required#SID不能为空" description:"SID"`
}
type OfflineRes struct{}
// OnlineListReq 获取在线用户列表
type OnlineListReq struct {
g.Meta `path:"/monitor/onlineList" method:"get" tags:"在线用户" summary:"获取监控列表"`
form.PageReq
form.RangeDateReq
form.StatusReq
UserId int64 `json:"userId" description:"用户ID"`
}
type OnlineListRes struct {
List []*OnlineModel `json:"list" description:"数据列表"`
form.PageRes
}
// OnlineViewReq 获取指定信息
type OnlineViewReq struct {
g.Meta `path:"/monitor/onlineView" method:"get" tags:"在线用户" summary:"获取指定用户信息"`
Id string `json:"id" v:"required#SID不能为空" description:"SID"`
}
type OnlineViewRes struct {
*OnlineModel
}
type OnlineModel struct {
ID string `json:"id"` // 连接唯一标识
Addr string `json:"addr"` // 客户端地址
Os string `json:"os"` // 客户端系统名称
Browser string `json:"browser"` // 浏览器
FirstTime uint64 `json:"firstTime"` // 首次连接时间
HeartbeatTime uint64 `json:"heartbeatTime"` // 用户上次心跳时间
App string `json:"app"` // 应用名称
UserId int64 `json:"userId"` // 用户ID
Username string `json:"username"` // 用户名
Avatar string `json:"avatar"` // 头像
ExpTime int64 `json:"expTime"` // 过期时间
}
type OnlineModels []*OnlineModel
func (p OnlineModels) Len() int {
return len(p)
}
func (p OnlineModels) Swap(i, j int) {
p[i], p[j] = p[j], p[i]
}
func (p OnlineModels) Less(i, j int) bool {
return p[j].FirstTime < p[i].FirstTime
}

View File

@@ -0,0 +1,68 @@
// Package notice
// @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 notice
import (
"github.com/gogf/gf/v2/frame/g"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/adminin"
"hotgo/internal/model/input/form"
)
// ListReq 查询列表
type ListReq struct {
form.PageReq
form.RangeDateReq
form.StatusReq
Title string `json:"title"`
Content string `json:"content"`
g.Meta `path:"/notice/list" method:"get" tags:"公告" summary:"获取公告列表"`
}
type ListRes struct {
List []*adminin.NoticeListModel `json:"list" dc:"数据列表"`
form.PageRes
}
// ViewReq 获取指定信息
type ViewReq struct {
Id int64 `json:"id" v:"required#公告ID不能为空" dc:"公告ID"`
g.Meta `path:"/notice/view" method:"get" tags:"公告" summary:"获取指定信息"`
}
type ViewRes struct {
*adminin.NoticeViewModel
}
// EditReq 修改/新增字典数据
type EditReq struct {
entity.AdminNotice
g.Meta `path:"/notice/edit" method:"post" tags:"公告" summary:"修改/新增公告"`
}
type EditRes struct{}
// DeleteReq 删除字典类型
type DeleteReq struct {
Id interface{} `json:"id" v:"required#公告ID不能为空" dc:"公告ID"`
g.Meta `path:"/notice/delete" method:"post" tags:"公告" summary:"删除公告"`
}
type DeleteRes struct{}
// MaxSortReq 最大排序
type MaxSortReq struct {
Id int64 `json:"id" dc:"公告ID"`
g.Meta `path:"/notice/max_sort" method:"get" tags:"公告" summary:"公告最大排序"`
}
type MaxSortRes struct {
Sort int `json:"sort" dc:"排序"`
}
// StatusReq 更新公告状态
type StatusReq struct {
entity.AdminNotice
g.Meta `path:"/notice/status" method:"post" tags:"公告" summary:"更新公告状态"`
}
type StatusRes struct{}

View File

@@ -0,0 +1,88 @@
// Package post
// @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 post
import (
"github.com/gogf/gf/v2/frame/g"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/adminin"
"hotgo/internal/model/input/form"
)
// EditReq 修改/新增岗位
type EditReq struct {
g.Meta `path:"/post/edit" method:"post" tags:"岗位" summary:"修改/新增岗位"`
entity.AdminPost
}
type EditRes struct{}
// DeleteReq 删除岗位
type DeleteReq struct {
g.Meta `path:"/post/delete" method:"post" tags:"岗位" summary:"删除岗位"`
Id interface{} `json:"id" v:"required#岗位ID不能为空" description:"岗位ID"`
}
type DeleteRes struct{}
// MaxSortReq 最大排序
type MaxSortReq struct {
g.Meta `path:"/post/max_sort" method:"get" tags:"岗位" summary:"岗位最大排序"`
Id int64 `json:"id" description:"岗位ID"`
}
type MaxSortRes struct {
Sort int `json:"sort" description:"排序"`
}
// ListReq 获取列表
type ListReq struct {
g.Meta `path:"/post/list" method:"get" tags:"岗位" summary:"获取岗位列表"`
form.PageReq
form.RangeDateReq
form.StatusReq
Name string `json:"name" description:"岗位名称"`
Code string `json:"code" description:"岗位编码"`
}
type ListRes struct {
List []*adminin.PostListModel `json:"list" description:"数据列表"`
form.PageRes
}
// ViewReq 获取指定信息
type ViewReq struct {
g.Meta `path:"/post/view" method:"get" tags:"岗位" summary:"获取指定信息"`
Id string `json:"id" v:"required#岗位ID不能为空" description:"岗位ID"`
}
type ViewRes struct {
*adminin.PostViewModel
}
// CodeUniqueReq 编码是否唯一
type CodeUniqueReq struct {
g.Meta `path:"/post/code_unique" method:"get" tags:"岗位" summary:"岗位编码是否唯一"`
Code string `json:"code" v:"required#岗位编码不能为空" description:"岗位编码"`
Id int64 `json:"id" description:"岗位ID"`
}
type CodeUniqueRes struct {
IsUnique bool `json:"is_unique" description:"是否唯一"`
}
// NameUniqueReq 名称是否唯一
type NameUniqueReq struct {
g.Meta `path:"/post/name_unique" method:"get" tags:"岗位" summary:"岗位名称是否唯一"`
Name string `json:"name" v:"required#岗位名称不能为空" description:"岗位名称"`
Id int64 `json:"id" description:"岗位ID"`
}
type NameUniqueRes struct {
IsUnique bool `json:"is_unique" description:"是否唯一"`
}
// StatusReq 更新状态
type StatusReq struct {
entity.AdminPost
g.Meta `path:"/post/status" method:"post" tags:"岗位" summary:"更新岗位状态"`
}
type StatusRes struct{}

View File

@@ -0,0 +1,68 @@
// Package provinces
// @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 provinces
import (
"github.com/gogf/gf/v2/frame/g"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
"hotgo/internal/model/input/sysin"
)
// ListReq 查询列表
type ListReq struct {
form.PageReq
form.RangeDateReq
form.StatusReq
Title string `json:"title"`
Content string `json:"content"`
g.Meta `path:"/provinces/list" method:"get" tags:"省市区" summary:"获取省市区列表"`
}
type ListRes struct {
List []*sysin.ProvincesListModel `json:"list" dc:"数据列表"`
form.PageRes
}
// ViewReq 获取信息
type ViewReq struct {
Id int64 `json:"id" v:"required#省市区ID不能为空" dc:"省市区ID"`
g.Meta `path:"/provinces/view" method:"get" tags:"省市区" summary:"获取指定信息"`
}
type ViewRes struct {
*sysin.ProvincesViewModel
}
// EditReq 修改/新增
type EditReq struct {
entity.SysProvinces
g.Meta `path:"/provinces/edit" method:"post" tags:"省市区" summary:"修改/新增省市区"`
}
type EditRes struct{}
// DeleteReq 删除
type DeleteReq struct {
Id interface{} `json:"id" v:"required#省市区ID不能为空" dc:"省市区ID"`
g.Meta `path:"/provinces/delete" method:"post" tags:"省市区" summary:"删除省市区"`
}
type DeleteRes struct{}
// MaxSortReq 最大排序
type MaxSortReq struct {
Id int64 `json:"id" dc:"省市区ID"`
g.Meta `path:"/provinces/max_sort" method:"get" tags:"省市区" summary:"省市区最大排序"`
}
type MaxSortRes struct {
Sort int `json:"sort" dc:"排序"`
}
// StatusReq 更新状态
type StatusReq struct {
entity.SysProvinces
g.Meta `path:"/provinces/status" method:"post" tags:"省市区" summary:"更新省市区状态"`
}
type StatusRes struct{}

View File

@@ -0,0 +1,131 @@
// Package role
// @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 role
import (
"github.com/gogf/gf/v2/frame/g"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/adminin"
"hotgo/internal/model/input/form"
)
// MemberListReq 查询列表
type MemberListReq struct {
g.Meta `path:"/role/member_list" method:"get" tags:"角色" summary:"获取角色下的会员列表"`
form.PageReq
form.RangeDateReq
form.StatusReq
Role int `json:"role" description:"角色ID"`
DeptId int `json:"dept_id" description:"部门ID"`
Mobile int `json:"mobile" description:"手机号"`
Username string `json:"username" description:"用户名"`
Realname string `json:"realname" description:"真实姓名"`
StartTime string `json:"start_time" description:"开始时间"`
EndTime string `json:"end_time" description:"结束时间"`
Name string `json:"name" description:"岗位名称"`
Code string `json:"code" description:"岗位编码"`
}
type MemberListRes struct {
List []*adminin.MemberListModel `json:"list" description:"数据列表"`
form.PageRes
}
// ListReq 查询列表
type ListReq struct {
g.Meta `path:"/role/list" method:"get" tags:"角色" summary:"获取角色列表"`
form.PageReq
form.RangeDateReq
form.StatusReq
DeptId int `json:"dept_id" description:"部门ID"`
Mobile int `json:"mobile" description:"手机号"`
Username string `json:"username" description:"用户名"`
Realname string `json:"realname" description:"真实姓名"`
StartTime string `json:"start_time" description:"开始时间"`
EndTime string `json:"end_time" description:"结束时间"`
Name string `json:"name" description:"岗位名称"`
Code string `json:"code" description:"岗位编码"`
}
type ListRes struct {
List []*adminin.RoleListModel `json:"list" description:"数据列表"`
form.PageRes
}
// DynamicReq 动态路由
type DynamicReq struct {
g.Meta `path:"/role/dynamic" method:"get" tags:"路由" summary:"获取动态路由" description:"获取登录用户动态路由"`
}
type DynamicMeta struct {
Title string `json:"title" description:"菜单标题"`
Icon string `json:"icon" description:"菜单图标"`
NoCache bool `json:"noCache" description:"是否缓存"`
Remark string `json:"remark" description:"备注"`
}
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:"配置数据集"`
}
type DynamicMenu struct {
DynamicBase
Children []*DynamicBase `json:"children" description:"子菜单"`
}
type DynamicRes struct {
List []adminin.MenuRoute `json:"list" description:"数据列表"`
}
type MenuEditReq struct {
g.Meta `path:"/role/edit" method:"post" tags:"角色" summary:"编辑角色"`
RoleId int64 `json:"id"`
MenuIds []int64 `json:"menuIds"`
}
type MenuEditRes struct{}
type UpdatePermissionsReq struct {
g.Meta `path:"/role/updatePermissions" method:"post" tags:"角色" summary:"编辑角色菜单权限"`
RoleId int64 `json:"id"`
MenuIds []int64 `json:"menuIds"`
}
type UpdatePermissionsRes struct{}
type GetPermissionsReq struct {
g.Meta `path:"/role/getPermissions" method:"get" tags:"角色" summary:"获取指定角色权限"`
RoleId int64 `json:"id"`
}
type GetPermissionsRes struct {
MenuIds []int64 `json:"menuIds"`
}
// EditReq 修改/新增角色
type EditReq struct {
g.Meta `path:"/role/edit" method:"post" tags:"角色" summary:"修改/新增角色"`
entity.AdminRole
}
type EditRes struct{}
// DeleteReq 删除角色
type DeleteReq struct {
g.Meta `path:"/role/delete" method:"post" tags:"角色" summary:"删除角色"`
Id int64 `json:"id" v:"required"`
}
type DeleteRes struct{}

View File

@@ -0,0 +1,18 @@
// Package user
// @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 user
import (
"github.com/gogf/gf/v2/frame/g"
)
type HelloReq struct {
g.Meta `path:"/hello" tags:"Hello" method:"get" summary:"You first hello api"`
}
type HelloRes struct {
g.Meta `mime:"text/html" example:"string"`
}