调整接口
This commit is contained in:
5
internal/controller/statistic/statistic.go
Normal file
5
internal/controller/statistic/statistic.go
Normal file
@ -0,0 +1,5 @@
|
||||
// =================================================================================
|
||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
||||
// =================================================================================
|
||||
|
||||
package statistic
|
||||
15
internal/controller/statistic/statistic_new.go
Normal file
15
internal/controller/statistic/statistic_new.go
Normal 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{}
|
||||
}
|
||||
@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user