diff --git a/control/web/controller/job.go b/control/web/controller/job.go index a7788a2..9213059 100644 --- a/control/web/controller/job.go +++ b/control/web/controller/job.go @@ -3,9 +3,10 @@ package controller import ( "net/http" + "github.com/gin-gonic/gin" + "github.com/FloatTech/zbputils/control/web/types" "github.com/FloatTech/zbputils/job" - "github.com/gin-gonic/gin" ) // JobList 任务列表 diff --git a/control/web/gui.go b/control/web/gui.go index 6236b08..ee50dec 100644 --- a/control/web/gui.go +++ b/control/web/gui.go @@ -38,7 +38,6 @@ func init() { if zero.BotConfig.SuperUsers != nil && len(zero.BotConfig.SuperUsers) > 0 { ctx.SendPrivateMessage(zero.BotConfig.SuperUsers[0], message.Text("webui账号\n用户名: ", regexMatched[1], "\n密码: ", regexMatched[2])) } - }) zero.OnCommand("webui", zero.SuperUserPermission, zero.OnlyToMe).SetBlock(true). Handle(func(ctx *zero.Ctx) { @@ -51,11 +50,11 @@ func init() { } else { ctx.SendChain(message.Text("成功, webui停止")) } - }) } // RunGui 运行webui +// // @title zbp api // @version 1.0 // @description zbp restful api document diff --git a/control/web/router/router.go b/control/web/router/router.go index b618cd8..6ca563b 100644 --- a/control/web/router/router.go +++ b/control/web/router/router.go @@ -2,12 +2,13 @@ package router import ( - "github.com/FloatTech/zbputils/control/web/controller" - _ "github.com/FloatTech/zbputils/control/web/docs" // swagger数据 - "github.com/FloatTech/zbputils/control/web/middleware" "github.com/gin-gonic/gin" swaggerFiles "github.com/swaggo/files" ginSwagger "github.com/swaggo/gin-swagger" + + "github.com/FloatTech/zbputils/control/web/controller" + _ "github.com/FloatTech/zbputils/control/web/docs" // swagger数据 + "github.com/FloatTech/zbputils/control/web/middleware" ) // SetRouters 创建路由 diff --git a/control/web/types/types.go b/control/web/types/types.go index 3456a25..59ccbde 100644 --- a/control/web/types/types.go +++ b/control/web/types/types.go @@ -2,6 +2,7 @@ package types // Response 包装返回体 +// // @Description 包装返回体 type Response struct { Code int `json:"code"` // 错误码 @@ -11,12 +12,14 @@ type Response struct { } // BotParams GetGroupList,GetFriendList的入参 +// // @Description GetGroupList,GetFriendList的入参 type BotParams struct { SelfID int64 `json:"selfId" form:"selfId"` // 机器人qq } // GetGroupMemberListReq 获得群成员的入参 +// // @Description 获得群成员的入参 type GetGroupMemberListReq struct { SelfID int64 `json:"selfId" form:"selfId"` // 机器人qq @@ -24,12 +27,14 @@ type GetGroupMemberListReq struct { } // AllPluginParams GetAllPlugin的入参 +// // @Description GetAllPlugin的入参 type AllPluginParams struct { GroupID int64 `json:"groupId" form:"groupId"` // 群id, gid>0为群聊,gid<0为私聊,gid=0为全部群聊 } // DeleteGroupParams 退群或删除好友的入参 +// // @Description 退群或删除好友的入参 type DeleteGroupParams struct { SelfID int64 `json:"selfId" form:"selfId"` // 机器人qq @@ -37,6 +42,7 @@ type DeleteGroupParams struct { } // PluginParams GetPlugin的入参 +// // @Description GetPlugin的入参 type PluginParams struct { GroupID int64 `json:"groupId" form:"groupId"` // 群id, gid>0为群聊,gid<0为私聊,gid=0为全部群聊 @@ -44,6 +50,7 @@ type PluginParams struct { } // PluginStatusParams UpdatePluginStatus的入参 +// // @Description UpdatePluginStatus的入参 type PluginStatusParams struct { GroupID int64 `json:"groupId" form:"groupId"` // 群id, gid>0为群聊,gid<0为私聊,gid=0为全部群聊 @@ -52,6 +59,7 @@ type PluginStatusParams struct { } // ResponseStatusParams UpdateResponseStatus的入参 +// // @Description UpdateResponseStatus的入参 type ResponseStatusParams struct { GroupID int64 `json:"groupId" form:"groupId"` // 群id, gid>0为群聊,gid<0为私聊,gid=0为全部群聊 @@ -59,6 +67,7 @@ type ResponseStatusParams struct { } // AllPluginStatusParams UpdateAllPluginStatus的入参 +// // @Description UpdateAllPluginStatus的入参 type AllPluginStatusParams struct { GroupID int64 `json:"groupId" form:"groupId"` // 群id, gid>0为群聊,gid<0为私聊,gid=0为全部群聊 @@ -66,6 +75,7 @@ type AllPluginStatusParams struct { } // HandleRequestParams 处理事件的入参 +// // @Description 处理事件的入参 type HandleRequestParams struct { Flag string `json:"flag" form:"flag"` // 事件的flag @@ -74,6 +84,7 @@ type HandleRequestParams struct { } // SendMsgParams 发送消息的入参 +// // @Description 处理事件的入参 type SendMsgParams struct { SelfID int64 `json:"selfId" form:"selfId"` // 机器人qq @@ -82,6 +93,7 @@ type SendMsgParams struct { } // LoginParams 登录参数 +// // @Description 登录参数 type LoginParams struct { Username string `json:"username" form:"username"` // 用户名 @@ -89,6 +101,7 @@ type LoginParams struct { } // LoginResultVo 登录返回参数 +// // @Description 登录返回参数 type LoginResultVo struct { UserID int `json:"userId"` // 用户id @@ -100,6 +113,7 @@ type LoginResultVo struct { } // RoleInfo 角色参数 +// // @Description 角色参数 type RoleInfo struct { RoleName string `json:"roleName"` // 角色名 @@ -107,6 +121,7 @@ type RoleInfo struct { } // UserInfoVo 用户信息 +// // @Description 用户信息 type UserInfoVo struct { UserID int `json:"userId"` // 用户id @@ -121,6 +136,7 @@ type UserInfoVo struct { } // MessageInfo 消息信息 +// // @Description 消息信息 type MessageInfo struct { MessageType string `json:"message_type"` // 消息类型, group为群聊,private为私聊 @@ -133,6 +149,7 @@ type MessageInfo struct { } // PluginVo 全部插件的返回 +// // @Description 全部插件的返回 type PluginVo struct { ID int `json:"id"` // 插件序号 @@ -145,6 +162,7 @@ type PluginVo struct { } // RequestVo 请求返回 +// // @Description 请求返回 type RequestVo struct { Flag string `json:"flag"` // 请求flag diff --git a/img/text/font.go b/img/text/font.go index f4eb7c9..16e72df 100644 --- a/img/text/font.go +++ b/img/text/font.go @@ -33,4 +33,6 @@ const ( QiantuXiaotuFontFile = FontPath + "QiantuXiaotuTi.ttf" // GNUUnifontFontFile GNU Unifont https://unifoundry.com/unifont/index.html GNUUnifontFontFile = FontPath + "unifont-15.0.06.ttf" + // AiralFontFile ... + AiralFontFile = FontPath + "arial.ttf" )