调整接口

This commit is contained in:
2025-06-25 19:32:18 +08:00
parent 627aa8dcda
commit 853ee2190a
22 changed files with 189 additions and 40 deletions

View File

@ -0,0 +1,5 @@
// =================================================================================
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
// =================================================================================
package statistic

View File

@ -0,0 +1,15 @@
// =================================================================================
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
// =================================================================================
package statistic
import (
"server/api/statistic"
)
type ControllerV1 struct{}
func NewV1() statistic.IStatisticV1 {
return &ControllerV1{}
}

View File

@ -0,0 +1,15 @@
package statistic
import (
"context"
"fmt"
"github.com/gogf/gf/v2/frame/g"
"server/internal/consts"
"server/api/statistic/v1"
)
func (c *ControllerV1) GetOnlineDevice(ctx context.Context, req *v1.GetOnlineDeviceReq) (res *v1.GetOnlineDeviceRes, err error) {
card, err := g.Redis().SCard(ctx, fmt.Sprintf(consts.NetbarOnlineDeviceSetKey, req.NetbarAccount))
return &v1.GetOnlineDeviceRes{Total: card}, err
}