Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add font #37

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion control/web/controller/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 任务列表
Expand Down
3 changes: 1 addition & 2 deletions control/web/gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
Expand Down
7 changes: 4 additions & 3 deletions control/web/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 创建路由
Expand Down
18 changes: 18 additions & 0 deletions control/web/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
package types

// Response 包装返回体
//
// @Description 包装返回体
type Response struct {
Code int `json:"code"` // 错误码
Expand All @@ -11,39 +12,45 @@ 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
GroupID int64 `json:"groupId" form:"groupId"` // 群id
}

// 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
GroupID int64 `json:"groupId" form:"groupId"` // 群id, gid>0为群聊,gid<0为私聊,gid=0为全部群聊
}

// PluginParams GetPlugin的入参
//
// @Description GetPlugin的入参
type PluginParams struct {
GroupID int64 `json:"groupId" form:"groupId"` // 群id, gid>0为群聊,gid<0为私聊,gid=0为全部群聊
Name string `json:"name" form:"name"` // 插件名
}

// PluginStatusParams UpdatePluginStatus的入参
//
// @Description UpdatePluginStatus的入参
type PluginStatusParams struct {
GroupID int64 `json:"groupId" form:"groupId"` // 群id, gid>0为群聊,gid<0为私聊,gid=0为全部群聊
Expand All @@ -52,20 +59,23 @@ type PluginStatusParams struct {
}

// ResponseStatusParams UpdateResponseStatus的入参
//
// @Description UpdateResponseStatus的入参
type ResponseStatusParams struct {
GroupID int64 `json:"groupId" form:"groupId"` // 群id, gid>0为群聊,gid<0为私聊,gid=0为全部群聊
Status int `json:"status" form:"status"` // 响应状态,0=沉默,1=响应
}

// AllPluginStatusParams UpdateAllPluginStatus的入参
//
// @Description UpdateAllPluginStatus的入参
type AllPluginStatusParams struct {
GroupID int64 `json:"groupId" form:"groupId"` // 群id, gid>0为群聊,gid<0为私聊,gid=0为全部群聊
Status int `json:"status" form:"status"` // 插件状态,0=禁用,1=启用,2=还原
}

// HandleRequestParams 处理事件的入参
//
// @Description 处理事件的入参
type HandleRequestParams struct {
Flag string `json:"flag" form:"flag"` // 事件的flag
Expand All @@ -74,6 +84,7 @@ type HandleRequestParams struct {
}

// SendMsgParams 发送消息的入参
//
// @Description 处理事件的入参
type SendMsgParams struct {
SelfID int64 `json:"selfId" form:"selfId"` // 机器人qq
Expand All @@ -82,13 +93,15 @@ type SendMsgParams struct {
}

// LoginParams 登录参数
//
// @Description 登录参数
type LoginParams struct {
Username string `json:"username" form:"username"` // 用户名
Password string `json:"password" form:"password"` // 密码
}

// LoginResultVo 登录返回参数
//
// @Description 登录返回参数
type LoginResultVo struct {
UserID int `json:"userId"` // 用户id
Expand All @@ -100,13 +113,15 @@ type LoginResultVo struct {
}

// RoleInfo 角色参数
//
// @Description 角色参数
type RoleInfo struct {
RoleName string `json:"roleName"` // 角色名
Value string `json:"value"` // 角色值
}

// UserInfoVo 用户信息
//
// @Description 用户信息
type UserInfoVo struct {
UserID int `json:"userId"` // 用户id
Expand All @@ -121,6 +136,7 @@ type UserInfoVo struct {
}

// MessageInfo 消息信息
//
// @Description 消息信息
type MessageInfo struct {
MessageType string `json:"message_type"` // 消息类型, group为群聊,private为私聊
Expand All @@ -133,6 +149,7 @@ type MessageInfo struct {
}

// PluginVo 全部插件的返回
//
// @Description 全部插件的返回
type PluginVo struct {
ID int `json:"id"` // 插件序号
Expand All @@ -145,6 +162,7 @@ type PluginVo struct {
}

// RequestVo 请求返回
//
// @Description 请求返回
type RequestVo struct {
Flag string `json:"flag"` // 请求flag
Expand Down
2 changes: 2 additions & 0 deletions img/text/font.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Loading