webui

package
v0.0.0-...-8228301 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2024 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DBName          = "cookie.db"
	CookieBucket    = "cookies"
	ExpirationKey   = "expiration"
	ExpirationHours = 24 // Cookie 有效期为24小时
)

Variables

View Source
var ErrCookieExpired = errors.New("cookie has expired")
View Source
var ErrCookieNotFound = errors.New("cookie not found")

Functions

func AccountConfigReadHandler

func AccountConfigReadHandler(c *gin.Context)

AccountConfigReadHandler 是用来处理读取配置文件的HTTP请求的

func CloseDB

func CloseDB()

func CombinedMiddleware

func CombinedMiddleware(Token string, BaseUrl string) gin.HandlerFunc

NewCombinedMiddleware 创建并返回一个带有依赖的中间件闭包

func FetchGuildsWebUI

func FetchGuildsWebUI(api *helper.ApiHelper, params map[string]string) ([]handlers.GuildData, error)

FetchGuildsWebUI 用于获取当前用户加入的服务器列表,接受自定义参数

func GenerateCookie

func GenerateCookie() (string, error)

func HandleAccountsRequest

func HandleAccountsRequest(c *gin.Context)

func HandleAppIDRequest

func HandleAppIDRequest(c *gin.Context)

func HandleCheckLoginStatusRequest

func HandleCheckLoginStatusRequest(c *gin.Context)

HandleCheckLoginStatusRequest 检查登录状态的处理函数

func HandleLoginRequest

func HandleLoginRequest(c *gin.Context)

HandleLoginRequest处理登录请求

func HandleProcessStatusRequest

func HandleProcessStatusRequest(c *gin.Context)

func InitializeDB

func InitializeDB()

func ValidateCookie

func ValidateCookie(cookie string) (bool, error)

Types

type RequestData

type RequestData struct {
	Password string `json:"password"`
}

type RequestParams

type RequestParams struct {
	Page     string `json:"page"`
	PageSize string `json:"page_size"`
	Sort     string `json:"sort"`
}

type ResponseData

type ResponseData struct {
	UIN      int64  `json:"uin"`
	Password string `json:"password"`
	Protocol int    `json:"protocol"`
}

type SendMessageRequest

type SendMessageRequest struct {
	Message string `json:"message"`
	ID      string `json:"id"`
}

SendMessageRequest 定义了发送消息请求的数据结构

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL