Skip to content

Commit 76c27ea

Browse files
committed
📝 docs(trend_handler): 添加TrendHandler函数注释
- 添加函数注释文档,包含参数、返回值、作者和更新时间信息 ♻️ refactor(trend_handler): 移除graph的SetStack调用 - 移除TrendHandler中graph对象的SetStack方法调用 ✨ feat(vadvisor): 扩展LegentConf结构体 - 在LegentConf结构体中新增Orient和Pager字段 - 新增PagerStruct结构体定义 - 在NewMultiSeriesLineGraph中设置Legends的Orient为"right"
1 parent feeb909 commit 76c27ea

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

handler/larkhandler/lark_command/handlers/trend_handler.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ import (
1717
"go.opentelemetry.io/otel/attribute"
1818
)
1919

20+
// TrendHandler to be filled
21+
//
22+
// @param ctx context.Context
23+
// @param data *larkim.P2MessageReceiveV1
24+
// @param args ...string
25+
// @return err error
26+
// @author kevinmatthe
27+
// @update 2025-05-30 15:19:56
2028
func TrendHandler(ctx context.Context, data *larkim.P2MessageReceiveV1, args ...string) (err error) {
2129
ctx, span := otel.LarkRobotOtelTracer.Start(ctx, reflecting.GetCurrentFunc())
2230
span.SetAttributes(attribute.Key("event").String(larkcore.Prettify(data)))
@@ -78,8 +86,7 @@ func TrendHandler(ctx context.Context, data *larkim.P2MessageReceiveV1, args ...
7886
title := fmt.Sprintf("[%s]水群频率表-%ddays", larkutils.GetChatName(ctx, *data.Event.Message.ChatId), days)
7987
graph.
8088
SetTitle(title).
81-
SetRange(*min, *max).
82-
SetStack()
89+
SetRange(*min, *max)
8390
err = larkutils.ReplyCardTextGraph(
8491
ctx,
8592
"",

utility/vadvisor/v.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ type PointStyle struct {
3939
Size int `json:"size"`
4040
}
4141
type LegentConf struct {
42-
Type string `json:"type"`
43-
Visible bool `json:"visible"`
42+
Type string `json:"type"`
43+
Visible bool `json:"visible"`
44+
Orient string `json:"orient"`
45+
Pager *PagerStruct `json:"pager"`
4446
}
4547
type AxesStruct[Y Numeric] struct {
4648
Orient string `json:"orient"`
@@ -51,6 +53,10 @@ type AxesStruct[Y Numeric] struct {
5153
} `json:"range"`
5254
}
5355

56+
type PagerStruct struct {
57+
Type string `json:"type"`
58+
}
59+
5460
type DataStruct[X, Y Numeric] struct {
5561
Values []*DataValue[X, Y] `json:"values"`
5662
}
@@ -86,6 +92,7 @@ func NewMultiSeriesLineGraph[X, Y Numeric]() *MultiSeriesLineGraph[X, Y] {
8692
Legends: &LegentConf{
8793
Type: "discrete",
8894
Visible: true,
95+
Orient: "right",
8996
},
9097
Data: &DataStruct[X, Y]{
9198
make([]*DataValue[X, Y], 0),

0 commit comments

Comments
 (0)