handler

package
v1.0.16 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorList

func ErrorList(db *gorm.DB) gin.HandlerFunc

ErrorList 获取错误列表接口

func GetApps

func GetApps(cfg *config.Config) gin.HandlerFunc

GetApps 获取应用列表

func GetDailyEvents

func GetDailyEvents(db *gorm.DB) gin.HandlerFunc

GetDailyEvents 获取每日事件统计接口

func GetEventList

func GetEventList(db *gorm.DB) gin.HandlerFunc

GetEventList 获取事件列表接口

func GetEventOverview

func GetEventOverview(db *gorm.DB) gin.HandlerFunc

GetEventOverview 获取事件概览数据(用于 Dashboard 首页)

func GetEventStats

func GetEventStats(db *gorm.DB) gin.HandlerFunc

GetEventStats 获取事件统计接口

func GetEventStatsSummary

func GetEventStatsSummary(db *gorm.DB) gin.HandlerFunc

GetEventStatsSummary 获取事件统计摘要接口

func GetTopEvents

func GetTopEvents(db *gorm.DB) gin.HandlerFunc

GetTopEvents 获取 Top 事件排行接口

func Login

func Login(cfg *config.Config) gin.HandlerFunc

Login 登录接口

func Overview

func Overview(db *gorm.DB) gin.HandlerFunc

Overview 概览数据接口

func ReportError

func ReportError(db *gorm.DB) gin.HandlerFunc

ReportError 上报错误接口

func ReportEvent

func ReportEvent(db *gorm.DB, cfg *config.Config) gin.HandlerFunc

ReportEvent 上报事件接口

Types

type AppInfo

type AppInfo struct {
	AppID   string `json:"appId"`
	AppName string `json:"appName"`
}

AppInfo 应用信息(返回给前端,不包含敏感信息)

type DashboardOverview

type DashboardOverview struct {
	TodayPV     int64        `json:"todayPV"`     // 今日 PV
	TodayUV     int64        `json:"todayUV"`     // 今日 UV
	TotalErrors int64        `json:"totalErrors"` // 错误总数
	TodayErrors int64        `json:"todayErrors"` // 今日新增错误
	TopErrors   []TopError   `json:"topErrors"`   // Top 5 错误
	ErrorTrend  []ErrorTrend `json:"errorTrend"`  // 近 7 日错误趋势
}

DashboardOverview 概览数据响应

type ErrorRequest

type ErrorRequest struct {
	Type    string `json:"type" binding:"required"`
	Message string `json:"message" binding:"required"`
	Stack   string `json:"stack"`
	URL     string `json:"url"`
	AppID   string `json:"appId" binding:"required"`
}

ErrorRequest 错误上报请求

type ErrorTrend

type ErrorTrend struct {
	Date  string `json:"date"`
	Count int    `json:"count"`
}

ErrorTrend 错误趋势数据

type EventRequest

type EventRequest struct {
	EventName string                 `json:"eventName" binding:"required"`
	Metadata  map[string]interface{} `json:"metadata"`
	AppID     string                 `json:"appId" binding:"required"`
	UserID    string                 `json:"userId" binding:"required"`
}

EventRequest 事件上报请求

type LoginRequest

type LoginRequest struct {
	Username string `json:"username" binding:"required"`
	Password string `json:"password" binding:"required"`
}

LoginRequest 登录请求

type TopError

type TopError struct {
	Type    string `json:"type"`
	Message string `json:"message"`
	Count   int    `json:"count"`
}

TopError 顶部错误

Jump to

Keyboard shortcuts

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