实现缓存+mqtt设备消息监听
This commit is contained in:
@ -20,13 +20,11 @@ func (c *ControllerV1) List(ctx context.Context, req *v1.ListReq) (res *v1.ListR
|
||||
)
|
||||
|
||||
out, err := service.RewardType().List(ctx, &model.RewardTypeListIn{
|
||||
Page: req.Page,
|
||||
Size: req.Size,
|
||||
OperatorId: operatorId,
|
||||
OperatorRole: operatorRole,
|
||||
StoreId: req.StoreId,
|
||||
Name: req.Name,
|
||||
Source: req.Source,
|
||||
Page: req.Page,
|
||||
Size: req.Size,
|
||||
StoreId: req.StoreId,
|
||||
Name: req.Name,
|
||||
Source: req.Source,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
|
||||
@ -10,6 +10,11 @@ import (
|
||||
)
|
||||
|
||||
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
|
||||
get, err := g.Redis().Get(ctx, fmt.Sprintf(consts.NetbarOnlineNumberKey, req.NetbarAccount))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.GetOnlineDeviceRes{
|
||||
Total: get.Int64(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user