This commit is contained in:
2026-03-18 10:19:42 +08:00
parent 2526ad4414
commit e58dd3529d
267 changed files with 25279 additions and 2 deletions

19
api/v1/common/captcha.go Normal file
View File

@@ -0,0 +1,19 @@
/*
* @desc:验证码参数
* @company:云南奇讯科技有限公司
* @Author: yixiaohu
* @Date: 2022/3/2 17:47
*/
package common
import "github.com/gogf/gf/v2/frame/g"
type CaptchaReq struct {
g.Meta `path:"/get" tags:"验证码" method:"get" summary:"获取验证码"`
}
type CaptchaRes struct {
g.Meta `mime:"application/json"`
Key string `json:"key"`
Img string `json:"img"`
}

19
api/v1/common/req.go Normal file
View File

@@ -0,0 +1,19 @@
/*
* @desc:公共接口相关
* @company:云南奇讯科技有限公司
* @Author: yixiaohu<yxh669@qq.com>
* @Date: 2022/3/30 9:28
*/
package common
import "github.com/tiger1103/gfast/v3/internal/app/common/model"
// PageReq 公共请求参数
type PageReq struct {
model.PageReq
}
type Author struct {
Authorization string `p:"Authorization" in:"header" dc:"Bearer {{token}}"`
}

21
api/v1/common/res.go Normal file
View File

@@ -0,0 +1,21 @@
/*
* @desc:返回响应公共参数
* @company:云南奇讯科技有限公司
* @Author: yixiaohu<yxh669@qq.com>
* @Date: 2022/10/27 16:30
*/
package common
import "github.com/gogf/gf/v2/frame/g"
// EmptyRes 不响应任何数据
type EmptyRes struct {
g.Meta `mime:"application/json"`
}
// ListRes 列表公共返回
type ListRes struct {
CurrentPage int `json:"currentPage"`
Total interface{} `json:"total"`
}

View File

@@ -0,0 +1,20 @@
package system
import (
"github.com/gogf/gf/v2/frame/g"
commonApi "github.com/tiger1103/gfast/v3/api/v1/common"
"github.com/tiger1103/gfast/v3/internal/app/system/model"
)
// AreaDictListReq 地区搜索请求参数
type AreaDictListReq struct {
g.Meta `path:"/areaDict/list" tags:"地区管理" method:"get" summary:"地区列表"`
commonApi.PageReq
commonApi.Author
}
type AreaDictListRes struct {
g.Meta `mime:"application/json"`
List []*model.AreaDictRes `json:"list"`
commonApi.ListRes
}

22
api/v1/system/cache.go Normal file
View File

@@ -0,0 +1,22 @@
/*
* @desc:缓存处理
* @company:云南奇讯科技有限公司
* @Author: yixiaohu<yxh669@qq.com>
* @Date: 2023/2/1 18:12
*/
package system
import (
"github.com/gogf/gf/v2/frame/g"
commonApi "github.com/tiger1103/gfast/v3/api/v1/common"
)
type CacheRemoveReq struct {
g.Meta `path:"/cache/remove" tags:"缓存管理" method:"delete" summary:"清除缓存"`
commonApi.Author
}
type CacheRemoveRes struct {
commonApi.EmptyRes
}

View File

@@ -0,0 +1,69 @@
/*
* @desc:模块租户关系
* @company:云南奇讯科技有限公司
* @Author: system
* @Date: 2026/1/6
*/
package system
import (
"gitea.com/red-future/common/beans"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
commonApi "github.com/tiger1103/gfast/v3/api/v1/common"
"github.com/tiger1103/gfast/v3/internal/app/system/consts"
"github.com/tiger1103/gfast/v3/internal/app/system/model"
"go.mongodb.org/mongo-driver/v2/bson"
)
// ModuleTenantAddReq 添加模块租户关系参数
type ModuleTenantAddReq struct {
g.Meta `path:"/moduleTenant/add" tags:"模块租户关系管理" method:"post" summary:"添加模块租户关系"`
TenantModuleType beans.TenantModuleType `p:"tenantModuleType"`
AssetSkuId *bson.ObjectID `p:"assetSkuId" v:"required#资产SKU ID不能为空"`
commonApi.Author
}
type ModuleTenantAddRes struct {
}
// ModuleTenantCheckReq 检查模块开通状态请求参数
type ModuleTenantCheckReq struct {
g.Meta `path:"/moduleTenant/check" tags:"模块租户关系管理" method:"get" summary:"检查模块开通状态"`
ModuleKey string `p:"moduleKey" v:"required#模块Key不能为空"`
TenantId uint64 `p:"tenantId" v:"required#租户ID不能为空"`
commonApi.Author
}
// ModuleTenantCheckCertificationReq 检查模块认证状态请求参数
type ModuleTenantCheckCertificationReq struct {
g.Meta `path:"/moduleTenant/check" tags:"模块租户关系管理" method:"get" summary:"检查模块认证状态"`
CertificationStatus consts.CertificationStatus `p:"certificationStatus" v:"required#认证状态不能为空"`
commonApi.Author
}
type ModuleTenantCheckRes struct {
g.Meta `mime:"application/json"`
Status bool `json:"status"`
CertificationStatus bool `json:"certificationStatus"`
Message string `json:"message"` // 状态描述
}
// AddRedisByTenantIdReq 根据租户ID设置模块租户关系到redis请求参数
type AddRedisByTenantIdReq struct {
g.Meta `path:"/moduleTenant/addRedisByTenantId" tags:"模块租户关系管理" method:"post" summary:"根据租户ID设置模块租户关系到redis"`
TenantId interface{} `p:"tenantId" v:"required#租户ID不能为空"`
commonApi.Author
}
type AddRedisByTenantIdRes struct {
g.Meta `mime:"application/json"`
List *model.ModuleTenantRes `json:"list"`
}
// AssetSku 资产SKU实体
type AssetSku struct {
AssetId *bson.ObjectID `bson:"assetId" json:"assetId"` // 关联资产ID
ExpireAt *gtime.Time `bson:"expireAt" json:"expireAt"` // 到期时间
}

61
api/v1/system/personal.go Normal file
View File

@@ -0,0 +1,61 @@
/*
* @desc:xxxx功能描述
* @company:云南奇讯科技有限公司
* @Author: yixiaohu<yxh669@qq.com>
* @Date: 2022/11/3 10:04
*/
package system
import (
"github.com/gogf/gf/v2/frame/g"
commonApi "github.com/tiger1103/gfast/v3/api/v1/common"
"github.com/tiger1103/gfast/v3/internal/app/system/model"
"github.com/tiger1103/gfast/v3/internal/app/system/model/entity"
)
type PersonalInfoReq struct {
g.Meta `path:"/personal/getPersonalInfo" tags:"用户管理" method:"get" summary:"登录用户信息"`
commonApi.Author
}
type PersonalInfoRes struct {
g.Meta `mime:"application/json"`
User *entity.SysUser `json:"user"`
Roles []string `json:"roles"`
DeptName string `json:"deptName"`
}
// SetPersonalReq 添加修改用户公用请求字段
type SetPersonalReq struct {
Nickname string `p:"nickname" v:"required#用户昵称不能为空"`
Mobile string `p:"mobile" v:"required|phone#手机号不能为空|手机号格式错误"`
Remark string `p:"remark"`
Sex int `p:"sex"`
UserEmail string `p:"userEmail" v:"required|email#邮箱不能为空|邮箱格式错误"`
Describe string `p:"describe"` //签名
Avatar string `p:"avatar"` //签名
}
// PersonalEditReq 修改个人
type PersonalEditReq struct {
g.Meta `path:"/personal/edit" tags:"用户管理" method:"put" summary:"修改个人资料"`
*SetPersonalReq
commonApi.Author
}
type PersonalEditRes struct {
commonApi.EmptyRes
UserInfo *model.LoginUserRes `json:"userInfo"`
Token string `json:"token"`
}
type PersonalResetPwdReq struct {
g.Meta `path:"/personal/resetPwd" tags:"用户管理" method:"put" summary:"重置个人密码"`
Password string `p:"password" v:"required|password#密码不能为空|密码以字母开头只能包含字母、数字和下划线长度在6~18之间"`
commonApi.Author
}
type PersonalResetPwdRes struct {
}

View File

@@ -0,0 +1,112 @@
/*
* @desc:菜单api
* @company:云南奇讯科技有限公司
* @Author: yixiaohu<yxh669@qq.com>
* @Date: 2022/3/18 10:27
*/
package system
import (
"github.com/gogf/gf/v2/frame/g"
commonApi "github.com/tiger1103/gfast/v3/api/v1/common"
"github.com/tiger1103/gfast/v3/internal/app/system/model"
"github.com/tiger1103/gfast/v3/internal/app/system/model/entity"
)
type RuleSearchReq struct {
g.Meta `path:"/menu/list" tags:"菜单管理" method:"get" summary:"菜单列表"`
commonApi.Author
Title string `p:"menuName" `
Component string `p:"component"`
}
type RuleListRes struct {
g.Meta `mime:"application/json"`
Rules []*model.SysAuthRuleTreeRes `json:"rules"`
}
type RuleAddReq struct {
g.Meta `path:"/menu/add" tags:"菜单管理" method:"post" summary:"添加菜单"`
commonApi.Author
MenuType uint `p:"menuType" v:"min:0|max:2#菜单类型最小值为:min|菜单类型最大值为:max"`
Pid uint `p:"parentId" v:"min:0"`
Name string `p:"name" v:"required#请填写规则名称"`
Title string `p:"menuName" v:"required|length:1,100#请填写标题|标题长度在:min到:max位"`
Icon string `p:"icon"`
Weigh int `p:"menuSort" `
Condition string `p:"condition" `
Remark string `p:"remark" `
IsHide uint `p:"isHide"`
Path string `p:"path"`
Redirect string `p:"redirect"` // 路由重定向
Roles []uint `p:"roles"` // 角色ids
Component string `p:"component" v:"required-if:menuType,1#组件路径不能为空"`
IsLink uint `p:"isLink"`
IsIframe uint `p:"isIframe"`
IsCached uint `p:"isKeepAlive"`
IsAffix uint `p:"isAffix"`
LinkUrl string `p:"linkUrl"`
}
type RuleAddRes struct {
}
type RuleGetParamsReq struct {
g.Meta `path:"/menu/getParams" tags:"菜单管理" method:"get" summary:"获取添加、编辑菜单相关参数"`
commonApi.Author
}
type RuleGetParamsRes struct {
g.Meta `mime:"application/json"`
Roles []*entity.SysRole `json:"roles"`
Menus []*model.SysAuthRuleInfoRes `json:"menus"`
}
type RuleInfoReq struct {
g.Meta `path:"/menu/get" tags:"菜单管理" method:"get" summary:"获取菜单信息"`
commonApi.Author
Id uint `p:"id" v:"required#菜单id必须"`
}
type RuleInfoRes struct {
g.Meta `mime:"application/json"`
Rule *entity.SysAuthRule `json:"rule"`
RoleIds []uint `json:"roleIds"`
}
type RuleUpdateReq struct {
g.Meta `path:"/menu/update" tags:"菜单管理" method:"put" summary:"修改菜单"`
commonApi.Author
Id uint `p:"id" v:"required#id必须"`
MenuType uint `p:"menuType" v:"min:0|max:2#菜单类型最小值为:min|菜单类型最大值为:max"`
Pid uint `p:"parentId" v:"min:0"`
Name string `p:"name" v:"required#请填写规则名称"`
Title string `p:"menuName" v:"required|length:1,100#请填写标题|标题长度在:min到:max位"`
Icon string `p:"icon"`
Weigh int `p:"menuSort" `
Condition string `p:"condition" `
Remark string `p:"remark" `
IsHide uint `p:"isHide"`
Path string `p:"path"`
Redirect string `p:"redirect"` // 路由重定向
Roles []uint `p:"roles"` // 角色ids
Component string `p:"component" v:"required-if:menuType,1#组件路径不能为空"`
IsLink uint `p:"isLink"`
IsIframe uint `p:"isIframe"`
IsCached uint `p:"isKeepAlive"`
IsAffix uint `p:"isAffix"`
LinkUrl string `p:"linkUrl"`
}
type RuleUpdateRes struct {
}
type RuleDeleteReq struct {
g.Meta `path:"/menu/delete" tags:"菜单管理" method:"delete" summary:"删除菜单"`
commonApi.Author
Ids []int `p:"ids" v:"required#菜单id必须"`
}
type RuleDeleteRes struct {
}

View File

@@ -0,0 +1,71 @@
/*
* @desc:系统参数配置
* @company:云南奇讯科技有限公司
* @Author: yixiaohu
* @Date: 2022/4/18 21:11
*/
package system
import (
"github.com/gogf/gf/v2/frame/g"
commonApi "github.com/tiger1103/gfast/v3/api/v1/common"
commonEntity "github.com/tiger1103/gfast/v3/internal/app/common/model/entity"
)
type ConfigSearchReq struct {
g.Meta `path:"/config/list" tags:"系统参数管理" method:"get" summary:"系统参数列表"`
ConfigName string `p:"configName"` //参数名称
ConfigKey string `p:"configKey"` //参数键名
ConfigType string `p:"configType"` //状态
commonApi.PageReq
}
type ConfigSearchRes struct {
g.Meta `mime:"application/json"`
List []*commonEntity.SysConfig `json:"list"`
commonApi.ListRes
}
type ConfigReq struct {
ConfigName string `p:"configName" v:"required#参数名称不能为空"`
ConfigKey string `p:"configKey" v:"required#参数键名不能为空"`
ConfigValue string `p:"configValue" v:"required#参数键值不能为空"`
ConfigType int `p:"configType" v:"required|in:0,1#系统内置不能为空|系统内置类型只能为0或1"`
Remark string `p:"remark"`
}
type ConfigAddReq struct {
g.Meta `path:"/config/add" tags:"系统参数管理" method:"post" summary:"添加系统参数"`
*ConfigReq
}
type ConfigAddRes struct {
}
type ConfigGetReq struct {
g.Meta `path:"/config/get" tags:"系统参数管理" method:"get" summary:"获取系统参数"`
Id int `p:"id"`
}
type ConfigGetRes struct {
g.Meta `mime:"application/json"`
Data *commonEntity.SysConfig `json:"data"`
}
type ConfigEditReq struct {
g.Meta `path:"/config/edit" tags:"系统参数管理" method:"put" summary:"修改系统参数"`
ConfigId int64 `p:"configId" v:"required|min:1#主键ID不能为空|主键ID参数错误"`
*ConfigReq
}
type ConfigEditRes struct {
}
type ConfigDeleteReq struct {
g.Meta `path:"/config/delete" tags:"系统参数管理" method:"delete" summary:"删除系统参数"`
Ids []int `p:"ids"`
}
type ConfigDeleteRes struct {
}

72
api/v1/system/sys_dept.go Normal file
View File

@@ -0,0 +1,72 @@
/*
* @desc:部门管理参数
* @company:云南奇讯科技有限公司
* @Author: yixiaohu<yxh669@qq.com>
* @Date: 2022/4/6 15:07
*/
package system
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/tiger1103/gfast/v3/internal/app/system/model"
"github.com/tiger1103/gfast/v3/internal/app/system/model/entity"
)
type DeptSearchReq struct {
g.Meta `path:"/dept/list" tags:"部门管理" method:"get" summary:"部门列表"`
DeptName string `p:"deptName"`
Status string `p:"status"`
}
type DeptSearchRes struct {
g.Meta `mime:"application/json"`
DeptList []*entity.SysDept `json:"deptList"`
}
type DeptAddReq struct {
g.Meta `path:"/dept/add" tags:"部门管理" method:"post" summary:"添加部门"`
ParentID int `p:"parentId" v:"required#父级不能为空"`
DeptName string `p:"deptName" v:"required#部门名称不能为空"`
OrderNum int `p:"orderNum" v:"required#排序不能为空"`
Leader string `p:"leader"`
Phone string `p:"phone"`
Email string `p:"email" v:"email#邮箱格式不正确"`
Status uint `p:"status" v:"required#状态必须"`
TenantId uint64 `p:"tenantId"`
}
type DeptAddRes struct {
}
type DeptEditReq struct {
g.Meta `path:"/dept/edit" tags:"部门管理" method:"put" summary:"修改部门"`
DeptId int `p:"deptId" v:"required#deptId不能为空"`
ParentID int `p:"parentId" v:"required#父级不能为空"`
DeptName string `p:"deptName" v:"required#部门名称不能为空"`
OrderNum int `p:"orderNum" v:"required#排序不能为空"`
Leader string `p:"leader"`
Phone string `p:"phone"`
Email string `p:"email" v:"email#邮箱格式不正确"`
Status uint `p:"status" v:"required#状态必须"`
}
type DeptEditRes struct {
}
type DeptDeleteReq struct {
g.Meta `path:"/dept/delete" tags:"部门管理" method:"delete" summary:"删除部门"`
Id uint64 `p:"id" v:"required#id不能为空"`
}
type DeptDeleteRes struct {
}
type DeptTreeSelectReq struct {
g.Meta `path:"/dept/treeSelect" tags:"部门管理" method:"get" summary:"获取部门树形菜单"`
}
type DeptTreeSelectRes struct {
g.Meta `mime:"application/json"`
Deps []*model.SysDeptTreeRes `json:"deps"`
}

View File

@@ -0,0 +1,105 @@
/*
* @desc:字典数据api
* @company:云南奇讯科技有限公司
* @Author: yixiaohu<yxh669@qq.com>
* @Date: 2022/3/18 11:59
*/
package system
import (
"github.com/gogf/gf/v2/frame/g"
commonApi "github.com/tiger1103/gfast/v3/api/v1/common"
commonModel "github.com/tiger1103/gfast/v3/internal/app/common/model"
commonEntity "github.com/tiger1103/gfast/v3/internal/app/common/model/entity"
)
// GetDictTreeReq 获取字典信息请求参数
type GetDictTreeReq struct {
g.Meta `path:"/dict/data/getDictDataTree" tags:"字典管理" method:"get" summary:"获取字典数据树"`
commonApi.Author
Remark string `p:"dictType"`
}
type GetDictTreeRes struct {
g.Meta `mime:"application/json"`
List []*GetDictRes `json:"list"`
}
// GetDictReq 获取字典信息请求参数
type GetDictReq struct {
g.Meta `path:"/dict/data/getDictData" tags:"字典管理" method:"get" summary:"获取字典数据公共方法"`
commonApi.Author
DictType string `p:"dictType" v:"required#字典类型不能为空"`
DefaultValue string `p:"defaultValue"`
}
// GetDictRes 完整的一个字典信息
type GetDictRes struct {
g.Meta `mime:"application/json"`
Info *commonModel.DictTypeRes `json:"info"`
Values []*commonModel.DictDataRes `json:"values"`
}
// DictDataSearchReq 分页请求参数
type DictDataSearchReq struct {
g.Meta `path:"/dict/data/list" tags:"字典管理" method:"get" summary:"字典数据列表"`
DictType string `p:"dictType"` //字典类型
DictLabel string `p:"dictLabel"` //字典标签
Status string `p:"status"` //状态
commonApi.PageReq
}
// DictDataSearchRes 字典数据结果
type DictDataSearchRes struct {
g.Meta `mime:"application/json"`
List []*commonEntity.SysDictData `json:"list"`
commonApi.ListRes
}
type DictDataReq struct {
DictLabel string `p:"dictLabel" v:"required#字典标签不能为空"`
DictValue string `p:"dictValue" v:"required#字典键值不能为空"`
DictType string `p:"dictType" v:"required#字典类型不能为空"`
DictSort int `p:"dictSort" v:"integer#排序只能为整数"`
CssClass string `p:"cssClass"`
ListClass string `p:"listClass"`
IsDefault int `p:"isDefault" v:"required|in:0,1#系统默认不能为空|默认值只能为0或1"`
Status int `p:"status" v:"required|in:0,1#状态不能为空|状态只能为0或1"`
Remark string `p:"remark"`
}
type DictDataAddReq struct {
g.Meta `path:"/dict/data/add" tags:"字典管理" method:"post" summary:"添加字典数据"`
*DictDataReq
}
type DictDataAddRes struct {
}
type DictDataGetReq struct {
g.Meta `path:"/dict/data/get" tags:"字典管理" method:"get" summary:"获取字典数据"`
DictCode uint `p:"dictCode"`
}
type DictDataGetRes struct {
g.Meta `mime:"application/json"`
Dict *commonEntity.SysDictData `json:"dict"`
}
type DictDataEditReq struct {
g.Meta `path:"/dict/data/edit" tags:"字典管理" method:"put" summary:"修改字典数据"`
DictCode int64 `p:"dictCode" v:"required|min:1#主键ID不能为空|主键ID不能小于1"`
*DictDataReq
}
type DictDataEditRes struct {
}
type DictDataDeleteReq struct {
g.Meta `path:"/dict/data/delete" tags:"字典管理" method:"delete" summary:"删除字典数据"`
Ids []int `p:"ids"`
}
type DictDataDeleteRes struct {
}

View File

@@ -0,0 +1,79 @@
/*
* @desc:字典类型
* @company:云南奇讯科技有限公司
* @Author: yixiaohu
* @Date: 2022/4/14 21:30
*/
package system
import (
"github.com/gogf/gf/v2/frame/g"
commonApi "github.com/tiger1103/gfast/v3/api/v1/common"
commonModel "github.com/tiger1103/gfast/v3/internal/app/common/model"
commonEntity "github.com/tiger1103/gfast/v3/internal/app/common/model/entity"
)
type DictTypeSearchReq struct {
g.Meta `path:"/dict/type/list" tags:"字典管理" method:"get" summary:"字典类型列表"`
DictName string `p:"dictName"` //字典名称
DictType string `p:"dictType"` //字典类型
Status string `p:"status"` //字典状态
commonApi.PageReq
}
type DictTypeSearchRes struct {
g.Meta `mime:"application/json"`
DictTypeList []*commonModel.SysDictTypeInfoRes `json:"dictTypeList"`
commonApi.ListRes
}
type DictTypeAddReq struct {
g.Meta `path:"/dict/type/add" tags:"字典管理" method:"post" summary:"添加字典类型"`
DictName string `p:"dictName" v:"required#字典名称不能为空"`
DictType string `p:"dictType" v:"required#字典类型不能为空"`
Status uint `p:"status" v:"required|in:0,1#状态不能为空|状态只能为0或1"`
Remark string `p:"remark"`
}
type DictTypeAddRes struct {
}
type DictTypeGetReq struct {
g.Meta `path:"/dict/type/get" tags:"字典管理" method:"get" summary:"获取字典类型"`
DictId uint `p:"dictId" v:"required#类型id不能为空"`
}
type DictTypeGetRes struct {
g.Meta `mime:"application/json"`
DictType *commonEntity.SysDictType `json:"dictType"`
}
type DictTypeEditReq struct {
g.Meta `path:"/dict/type/edit" tags:"字典管理" method:"put" summary:"修改字典类型"`
DictId int64 `p:"dictId" v:"required|min:1#主键ID不能为空|主键ID必须为大于0的值"`
DictName string `p:"dictName" v:"required#字典名称不能为空"`
DictType string `p:"dictType" v:"required#字典类型不能为空"`
Status uint `p:"status" v:"required|in:0,1#状态不能为空|状态只能为0或1"`
Remark string `p:"remark"`
}
type DictTypeEditRes struct {
}
type DictTypeDeleteReq struct {
g.Meta `path:"/dict/type/delete" tags:"字典管理" method:"delete" summary:"删除字典类型"`
DictIds []int `p:"dictIds" v:"required#字典类型id不能为空"`
}
type DictTypeDeleteRes struct {
}
type DictTypeAllReq struct {
g.Meta `path:"/dict/type/optionSelect" tags:"字典管理" method:"get" summary:"获取字典选择框列表"`
}
type DictTYpeAllRes struct {
g.Meta `mime:"application/json"`
DictType []*commonEntity.SysDictType `json:"dictType"`
}

66
api/v1/system/sys_init.go Normal file
View File

@@ -0,0 +1,66 @@
package system
import (
"fmt"
"github.com/gogf/gf/v2/frame/g"
"github.com/tiger1103/gfast/v3/internal/app/system/model"
)
type DbInitIsInitReq struct {
g.Meta `path:"/dbInit/isInit" tags:"系统初始化" method:"get" summary:"系统初始化"`
}
type DbInitIsInitRes bool
type DbInitGetEnvInfoReq struct {
g.Meta `path:"/dbInit/getEnvInfo" tags:"系统初始化" method:"get" summary:"获取环境信息"`
}
type DbInitGetEnvInfoRes g.Map
type DbInitCreateDbReq struct {
g.Meta `path:"/dbInit/createDb" tags:"系统初始化" method:"post" summary:"创建配置文件"`
DbHost string `json:"dbHost" p:"dbHost" v:"required#数据库地址必须"`
DbPort int `json:"dbPort" p:"dbPort" v:"required#数据库端口必须"`
DbUser string `json:"dbUser" p:"dbUser" v:"required#数据库用户名称必须"`
DbPass string `json:"dbPass"`
DbName string `json:"dbName" p:"dbName" v:"required#数据库名称必须"`
DbCharset string `json:"dbCharset" p:"dbCharset" v:"required#数据库编码必须"`
RedisAddress string `json:"redisAddress" p:"redisAddress" v:"required#Redis地址必须"`
RedisPort int `json:"redisPort" p:"redisPort" v:"required#Redis端口必须"`
RedisDb int `json:"redisDb" p:"redisDb" v:"required#Redis索引必须"`
RedisPass string `json:"redisPass"`
}
type DbInitCreateDbRes bool
func (req *DbInitCreateDbReq) ToDbInitConfig() *model.DbInitConfig {
return &model.DbInitConfig{
Database: model.Database{
Default: model.DbDefault{
Host: req.DbHost,
Port: req.DbPort,
User: req.DbUser,
Pass: req.DbPass,
Name: req.DbName,
Type: "mysql",
Role: "master",
Debug: true,
Charset: req.DbCharset,
DryRun: false,
MaxIdle: 10,
MaxOpen: 10,
MaxLifetime: 10,
},
},
Redis: model.Redis{
Default: model.RedisDefault{
Address: fmt.Sprintf("%s:%d", req.RedisAddress, req.RedisPort),
Db: req.RedisDb,
Pass: req.RedisPass,
IdleTimeout: 600,
MaxActive: 100,
},
},
}
}

View File

@@ -0,0 +1,38 @@
/*
* @desc:登录
* @company:云南奇讯科技有限公司
* @Author: yixiaohu
* @Date: 2022/4/27 21:51
*/
package system
import (
"github.com/gogf/gf/v2/frame/g"
commonApi "github.com/tiger1103/gfast/v3/api/v1/common"
"github.com/tiger1103/gfast/v3/internal/app/system/model"
)
type UserLoginReq struct {
g.Meta `path:"/login" tags:"登录" method:"post" summary:"用户登录"`
Username string `p:"username" v:"required#用户名不能为空"`
Password string `p:"password" v:"required#密码不能为空"`
VerifyCode string `p:"verifyCode" v:"required#验证码不能为空"`
VerifyKey string `p:"verifyKey"`
}
type UserLoginRes struct {
g.Meta `mime:"application/json"`
UserInfo *model.LoginUserRes `json:"userInfo"`
Token string `json:"token"`
MenuList []*model.UserMenus `json:"menuList"`
Permissions []string `json:"permissions"`
}
type UserLoginOutReq struct {
g.Meta `path:"/logout" tags:"登录" method:"get" summary:"退出登录"`
commonApi.Author
}
type UserLoginOutRes struct {
}

View File

@@ -0,0 +1,47 @@
/*
* @desc:登录日志
* @company:云南奇讯科技有限公司
* @Author: yixiaohu
* @Date: 2022/4/24 22:09
*/
package system
import (
"github.com/gogf/gf/v2/frame/g"
commonApi "github.com/tiger1103/gfast/v3/api/v1/common"
"github.com/tiger1103/gfast/v3/internal/app/system/model/entity"
)
// LoginLogSearchReq 查询列表请求参数
type LoginLogSearchReq struct {
g.Meta `path:"/loginLog/list" tags:"登录日志管理" method:"get" summary:"日志列表"`
LoginName string `p:"userName"` //登陆名
Status string `p:"status"` //状态
Ipaddr string `p:"ipaddr"` //登录地址
SortName string `p:"orderByColumn"` //排序字段
SortOrder string `p:"isAsc"` //排序方式
LoginLocation string `p:"loginLocation"` //登录地点
commonApi.PageReq
}
type LoginLogSearchRes struct {
g.Meta `mime:"application/json"`
commonApi.ListRes
List []*entity.SysLoginLog `json:"list"`
}
type LoginLogDelReq struct {
g.Meta `path:"/loginLog/delete" tags:"登录日志管理" method:"delete" summary:"删除日志"`
Ids []int `p:"ids" v:"required#ids必须"`
}
type LoginLogDelRes struct {
}
type LoginLogClearReq struct {
g.Meta `path:"/loginLog/clear" tags:"登录日志管理" method:"delete" summary:"清除日志"`
}
type LoginLogClearRes struct {
}

View File

@@ -0,0 +1,11 @@
package system
import (
"github.com/gogf/gf/v2/frame/g"
)
type MonitorSearchReq struct {
g.Meta `path:"/monitor/server" tags:"服务监控" method:"get" summary:"服务监控"`
}
type MonitorSearchRes g.Map

View File

@@ -0,0 +1,65 @@
/*
* @desc:操作日志
* @company:云南奇讯科技有限公司
* @Author: yixiaohu<yxh669@qq.com>
* @Date: 2022/12/21 14:37
*/
package system
import (
"github.com/gogf/gf/v2/frame/g"
commonApi "github.com/tiger1103/gfast/v3/api/v1/common"
"github.com/tiger1103/gfast/v3/internal/app/system/model"
)
// SysOperLogSearchReq 分页请求参数
type SysOperLogSearchReq struct {
g.Meta `path:"/operLog/list" tags:"操作日志" method:"get" summary:"操作日志列表"`
Title string `p:"title"` //系统模块
RequestMethod string `p:"requestMethod"` //请求方式
OperName string `p:"operName"` //操作人员
commonApi.PageReq
commonApi.Author
}
// SysOperLogSearchRes 列表返回结果
type SysOperLogSearchRes struct {
g.Meta `mime:"application/json"`
commonApi.ListRes
List []*model.SysOperLogListRes `json:"list"`
}
// SysOperLogGetReq 获取一条数据请求
type SysOperLogGetReq struct {
g.Meta `path:"/operLog/get" tags:"操作日志" method:"get" summary:"获取操作日志信息"`
commonApi.Author
OperId uint64 `p:"operId" v:"required#主键必须"` //通过主键获取
}
// SysOperLogGetRes 获取一条数据结果
type SysOperLogGetRes struct {
g.Meta `mime:"application/json"`
*model.SysOperLogInfoRes
}
// SysOperLogDeleteReq 删除数据请求
type SysOperLogDeleteReq struct {
g.Meta `path:"/operLog/delete" tags:"操作日志" method:"delete" summary:"删除操作日志"`
commonApi.Author
OperIds []uint64 `p:"operIds" v:"required#主键必须"` //通过主键删除
}
// SysOperLogDeleteRes 删除数据返回
type SysOperLogDeleteRes struct {
commonApi.EmptyRes
}
type SysOperLogClearReq struct {
g.Meta `path:"/operLog/clear" tags:"操作日志" method:"delete" summary:"清除日志"`
commonApi.Author
}
type SysOperLogClearRes struct {
commonApi.EmptyRes
}

61
api/v1/system/sys_post.go Normal file
View File

@@ -0,0 +1,61 @@
/*
* @desc:岗位相关参数
* @company:云南奇讯科技有限公司
* @Author: yixiaohu
* @Date: 2022/4/7 23:09
*/
package system
import (
"github.com/gogf/gf/v2/frame/g"
commonApi "github.com/tiger1103/gfast/v3/api/v1/common"
"github.com/tiger1103/gfast/v3/internal/app/system/model/entity"
)
type PostSearchReq struct {
g.Meta `path:"/post/list" tags:"岗位管理" method:"get" summary:"岗位列表"`
PostCode string `p:"postCode"` //岗位编码
PostName string `p:"postName"` //岗位名称
Status string `p:"status"` //状态
commonApi.PageReq
}
type PostSearchRes struct {
g.Meta `mime:"application/json"`
commonApi.ListRes
PostList []*entity.SysPost `json:"postList"`
}
type PostAddReq struct {
g.Meta `path:"/post/add" tags:"岗位管理" method:"post" summary:"添加岗位"`
PostCode string `p:"postCode" v:"required#岗位编码不能为空"`
PostName string `p:"postName" v:"required#岗位名称不能为空"`
PostSort int `p:"postSort" v:"required#岗位排序不能为空"`
Status uint `p:"status" v:"required#状态不能为空"`
Remark string `p:"remark"`
}
type PostAddRes struct {
}
type PostEditReq struct {
g.Meta `path:"/post/edit" tags:"岗位管理" method:"put" summary:"修改岗位"`
PostId int64 `p:"postId" v:"required#id必须"`
PostCode string `p:"postCode" v:"required#岗位编码不能为空"`
PostName string `p:"postName" v:"required#岗位名称不能为空"`
PostSort int `p:"postSort" v:"required#岗位排序不能为空"`
Status uint `p:"status" v:"required#状态不能为空"`
Remark string `p:"remark"`
}
type PostEditRes struct {
}
type PostDeleteReq struct {
g.Meta `path:"/post/delete" tags:"岗位管理" method:"delete" summary:"删除岗位"`
Ids []int `p:"ids"`
}
type PostDeleteRes struct {
}

86
api/v1/system/sys_role.go Normal file
View File

@@ -0,0 +1,86 @@
/*
* @desc:角色api
* @company:云南奇讯科技有限公司
* @Author: yixiaohu<yxh669@qq.com>
* @Date: 2022/3/30 9:16
*/
package system
import (
"github.com/gogf/gf/v2/frame/g"
commonApi "github.com/tiger1103/gfast/v3/api/v1/common"
"github.com/tiger1103/gfast/v3/internal/app/system/model"
"github.com/tiger1103/gfast/v3/internal/app/system/model/entity"
)
type RoleListReq struct {
g.Meta `path:"/role/list" tags:"角色管理" method:"get" summary:"角色列表"`
RoleName string `p:"roleName"` //参数名称
Status string `p:"roleStatus"` //状态
commonApi.PageReq
}
type RoleListRes struct {
g.Meta `mime:"application/json"`
commonApi.ListRes
List []*entity.SysRole `json:"list"`
}
type RoleGetParamsReq struct {
g.Meta `path:"/role/getParams" tags:"角色管理" method:"get" summary:"角色编辑参数"`
}
type RoleGetParamsInfoReq struct {
g.Meta `path:"/role/getParamsInfo" tags:"角色管理" method:"get" summary:"角色编辑参数信息"`
}
type RoleGetParamsRes struct {
g.Meta `mime:"application/json"`
Menu []*model.SysAuthRuleInfoRes `json:"menu"`
}
type RoleAddReq struct {
g.Meta `path:"/role/add" tags:"角色管理" method:"post" summary:"添加角色"`
Name string `p:"name" v:"required#角色名称不能为空"`
Status uint `p:"status" `
ListOrder uint `p:"listOrder" `
Remark string `p:"remark" `
MenuIds []uint `p:"menuIds"`
TenantId uint64 `p:"tenantId"`
}
type RoleAddRes struct {
}
type RoleGetReq struct {
g.Meta `path:"/role/get" tags:"角色管理" method:"get" summary:"获取角色信息"`
Id uint `p:"id" v:"required#角色id不能为空"`
}
type RoleGetRes struct {
g.Meta `mime:"application/json"`
Role *entity.SysRole `json:"role"`
MenuIds []int `json:"menuIds"`
}
type RoleEditReq struct {
g.Meta `path:"/role/edit" tags:"角色管理" method:"put" summary:"修改角色"`
Id int64 `p:"id" v:"required#角色id必须"`
Name string `p:"name" v:"required#角色名称不能为空"`
Status uint `p:"status" `
ListOrder uint `p:"listOrder" `
Remark string `p:"remark" `
MenuIds []uint `p:"menuIds"`
}
type RoleEditRes struct {
}
type RoleDeleteReq struct {
g.Meta `path:"/role/delete" tags:"角色管理" method:"delete" summary:"删除角色"`
Ids []int64 `p:"ids" v:"required#角色id不能为空"`
}
type RoleDeleteRes struct {
}

161
api/v1/system/sys_user.go Normal file
View File

@@ -0,0 +1,161 @@
package system
import (
"github.com/gogf/gf/v2/frame/g"
commonApi "github.com/tiger1103/gfast/v3/api/v1/common"
"github.com/tiger1103/gfast/v3/internal/app/system/model"
"github.com/tiger1103/gfast/v3/internal/app/system/model/entity"
)
type UserMenusReq struct {
g.Meta `path:"/user/getUserMenus" tags:"用户管理" method:"get" summary:"获取用户菜单"`
commonApi.Author
}
type UserMenusRes struct {
g.Meta `mime:"application/json"`
MenuList []*model.UserMenus `json:"menuList"`
Permissions []string `json:"permissions"`
}
// UserSearchReq 用户搜索请求参数
type UserSearchReq struct {
g.Meta `path:"/user/list" tags:"用户管理" method:"get" summary:"用户列表"`
DeptId string `p:"deptId"` //部门id
Mobile string `p:"mobile"`
Status string `p:"status"`
KeyWords string `p:"keyWords"`
commonApi.PageReq
commonApi.Author
}
// GetUserSearchReq 用户搜索请求参数
type GetUserSearchReq struct {
g.Meta `path:"/user/getList" tags:"用户管理" method:"get" summary:"用户列表"`
DeptId string `p:"deptId"` //部门id
Mobile string `p:"mobile"`
Status string `p:"status"`
KeyWords string `p:"keyWords"`
commonApi.PageReq
commonApi.Author
}
type UserSearchRes struct {
g.Meta `mime:"application/json"`
UserList []*model.SysUserRoleDeptRes `json:"userList"`
commonApi.ListRes
}
type UserGetParamsReq struct {
g.Meta `path:"/user/params" tags:"用户管理" method:"get" summary:"用户维护参数获取"`
}
type UserGetParamsInfoReq struct {
g.Meta `path:"/user/paramsInfo" tags:"用户管理" method:"get" summary:"用户维护参数信息获取"`
}
type UserGetParamsRes struct {
g.Meta `mime:"application/json"`
RoleList []*entity.SysRole `json:"roleList"`
Posts []*entity.SysPost `json:"posts"`
}
// SetUserReq 添加修改用户公用请求字段
type SetUserReq struct {
DeptId uint64 `p:"deptId" v:"required#用户部门不能为空"` //所属部门
Email string `p:"email" v:"email#邮箱格式错误"` //邮箱
NickName string `p:"nickName" v:"required#用户昵称不能为空"`
Mobile string `p:"mobile" v:"required|phone#手机号不能为空|手机号格式错误"`
PostIds []int64 `p:"postIds"`
Remark string `p:"remark"`
RoleIds []int64 `p:"roleIds"`
Sex int `p:"sex"`
Status uint `p:"status"`
IsAdmin int `p:"isAdmin"` // 是否后台管理员 1 是 0 否
}
// UserAddReq 添加用户参数
type UserAddReq struct {
g.Meta `path:"/user/add" tags:"用户管理" method:"post" summary:"添加用户"`
*SetUserReq
UserName string `p:"userName" v:"required#用户账号不能为空"`
Password string `p:"password" v:"required|password#密码不能为空|密码以字母开头只能包含字母、数字和下划线长度在6~18之间"`
TenantId uint64 `p:"tenantId"`
UserSalt string
}
type UserAddRes struct {
g.Meta `mime:"application/json"`
UserId int64 `json:"userId"`
}
// UserEditReq 修改用户参数
type UserEditReq struct {
g.Meta `path:"/user/edit" tags:"用户管理" method:"put" summary:"修改用户"`
*SetUserReq
UserId int64 `p:"userId" v:"required#用户id不能为空"`
}
type UserEditRes struct {
}
type UserGetEditReq struct {
g.Meta `path:"/user/getEdit" tags:"用户管理" method:"get" summary:"获取用户信息"`
Id uint64 `p:"id"`
}
type UserGetEditRes struct {
g.Meta `mime:"application/json"`
User *entity.SysUser `json:"user"`
CheckedRoleIds []uint `json:"checkedRoleIds"`
CheckedPosts []int64 `json:"checkedPosts"`
}
// UserResetPwdReq 重置用户密码状态参数
type UserResetPwdReq struct {
g.Meta `path:"/user/resetPwd" tags:"用户管理" method:"put" summary:"重置用户密码"`
Id uint64 `p:"userId" v:"required#用户id不能为空"`
Password string `p:"password" v:"required|password#密码不能为空|密码以字母开头只能包含字母、数字和下划线长度在6~18之间"`
}
type UserResetPwdRes struct {
}
// UserStatusReq 设置用户状态参数
type UserStatusReq struct {
g.Meta `path:"/user/setStatus" tags:"用户管理" method:"put" summary:"设置用户状态"`
Id uint64 `p:"userId" v:"required#用户id不能为空"`
UserStatus uint `p:"status" v:"required#用户状态不能为空"`
}
type UserStatusRes struct {
}
type UserDeleteReq struct {
g.Meta `path:"/user/delete" tags:"用户管理" method:"delete" summary:"删除用户"`
Ids []int `p:"ids" v:"required#ids不能为空"`
}
type UserDeleteRes struct {
}
type UserGetByIdsReq struct {
g.Meta `path:"/user/getUsers" tags:"用户管理" method:"get" summary:"同时获取多个用户"`
commonApi.Author
Ids []int `p:"ids" v:"required#ids不能为空"`
}
type UserGetByIdsRes struct {
g.Meta `mime:"application/json"`
List []*model.SysUserSimpleRes `json:"list"`
}
type IsSuperAdminReq struct {
g.Meta `path:"/user/checkIsSuperAdmin" tags:"用户管理" method:"get" summary:"是否是超级管理员"`
commonApi.Author
}
type IsSuperAdminRes struct {
g.Meta `mime:"application/json"`
IsSuperAdmin bool `json:"isSuperAdmin"`
}

View File

@@ -0,0 +1,40 @@
/*
* @desc:在线用户
* @company:云南奇讯科技有限公司
* @Author: yixiaohu<yxh669@qq.com>
* @Date: 2023/1/10 16:57
*/
package system
import (
"github.com/gogf/gf/v2/frame/g"
commonApi "github.com/tiger1103/gfast/v3/api/v1/common"
"github.com/tiger1103/gfast/v3/internal/app/system/model/entity"
)
// SysUserOnlineSearchReq 列表搜索参数
type SysUserOnlineSearchReq struct {
g.Meta `path:"/online/list" tags:"在线用户管理" method:"get" summary:"列表"`
Username string `p:"userName"`
Ip string `p:"ipaddr"`
commonApi.PageReq
commonApi.Author
}
// SysUserOnlineSearchRes 列表结果
type SysUserOnlineSearchRes struct {
g.Meta `mime:"application/json"`
commonApi.ListRes
List []*entity.SysUserOnline `json:"list"`
}
type SysUserOnlineForceLogoutReq struct {
g.Meta `path:"/online/forceLogout" tags:"在线用户管理" method:"delete" summary:"强制用户退出登录"`
commonApi.Author
Ids []int `p:"ids" v:"required#ids不能为空"`
}
type SysUserOnlineForceLogoutRes struct {
commonApi.EmptyRes
}

94
api/v1/system/tenant.go Normal file
View File

@@ -0,0 +1,94 @@
package system
import (
"github.com/gogf/gf/v2/frame/g"
commonApi "github.com/tiger1103/gfast/v3/api/v1/common"
"github.com/tiger1103/gfast/v3/internal/app/system/consts"
"github.com/tiger1103/gfast/v3/internal/app/system/model"
"github.com/tiger1103/gfast/v3/internal/app/system/model/entity"
)
// TenantListReq 租户搜索请求参数
type TenantListReq struct {
g.Meta `path:"/tenant/list" tags:"租户管理" method:"get" summary:"租户列表"`
TenantType consts.TenantType `p:"tenantType"`
CityCode string `p:"cityCode"`
TenantName string `p:"tenantName"`
commonApi.PageReq
commonApi.Author
}
type TenantListRes struct {
g.Meta `mime:"application/json"`
List []*model.TenantUserRes `json:"list"`
ImgAddressPrefix string `json:"imgAddressPrefix"`
commonApi.ListRes
}
// TenantAddReq 添加租户参数
type TenantAddReq struct {
g.Meta `path:"/tenant/add" tags:"租户管理" method:"post" summary:"租户添加"`
UserNickname string `p:"userNickname"`
Mobile string `p:"mobile"`
UserName string `p:"userName"`
UserPassword string `p:"userPassword"`
TenantName string `p:"tenantName"`
TenantType consts.TenantType `p:"tenantType"`
CityCode string `p:"cityCode"`
BusinessLicense string `p:"businessLicense"`
UserSalt string `p:"-"`
commonApi.Author
}
type TenantAddRes struct {
}
// TenantEditReq 修改租户参数
type TenantEditReq struct {
g.Meta `path:"/tenant/edit" tags:"租户管理" method:"put" summary:"租户修改"`
Id int64 `p:"id" v:"required#租户id不能为空"`
TenantName string `p:"tenantName"`
TenantType consts.TenantType `p:"tenantType"`
CityCode string `p:"cityCode"`
BusinessLicense string `p:"businessLicense"`
commonApi.Author
}
type TenantEditRes struct {
}
// GetTenantDetailsByIdsReq 获取多个租户详情请求参数
type GetTenantDetailsByIdsReq struct {
g.Meta `path:"/tenant/getTenantDetailsByIds" tags:"租户管理" method:"get" summary:"获取多个租户详情"`
TenantIds []uint64 `p:"tenantIds"`
commonApi.Author
}
type GetTenantDetailsByIdsRes struct {
g.Meta `mime:"application/json"`
List []*model.TenantRes `json:"list"`
}
// GetTenantDetailsReq 获取租户详情请求参数
type GetTenantDetailsReq struct {
g.Meta `path:"/tenant/getTenantDetails" tags:"租户管理" method:"get" summary:"获取租户详情"`
TenantId uint64 `p:"tenantId"`
commonApi.Author
}
type GetTenantDetailsRes struct {
g.Meta `mime:"application/json"`
Tenant *entity.Tenant `json:"tenant"`
}
// GetTenantListReq 获取租户列表请求参数
type GetTenantListReq struct {
g.Meta `path:"/tenant/getTenantList" tags:"租户管理" method:"get" summary:"获取租户列表"`
TenantId uint64 `p:"tenantId"`
commonApi.Author
}
type GetTenantListRes struct {
g.Meta `mime:"application/json"`
List []entity.Tenant `json:"list"`
}