refactor: Refactor rpc call && auto gen rpc_call code (#2969)

* refactor: rpcclient

* chore: err

* fix: err

* fix: err

* fix: err

* feat: change api
This commit is contained in:
icey-yu
2024-12-17 18:48:08 +08:00
committed by GitHub
parent 5a8f82d459
commit 1c35db7601
60 changed files with 719 additions and 1500 deletions
+4 -4
View File
@@ -22,20 +22,20 @@ import (
"github.com/openimsdk/tools/errs"
)
func (s *groupServer) GroupCreateCount(ctx context.Context, req *group.GroupCreateCountReq) (*group.GroupCreateCountResp, error) {
func (g *groupServer) GroupCreateCount(ctx context.Context, req *group.GroupCreateCountReq) (*group.GroupCreateCountResp, error) {
if req.Start > req.End {
return nil, errs.ErrArgs.WrapMsg("start > end: %d > %d", req.Start, req.End)
}
total, err := s.db.CountTotal(ctx, nil)
total, err := g.db.CountTotal(ctx, nil)
if err != nil {
return nil, err
}
start := time.UnixMilli(req.Start)
before, err := s.db.CountTotal(ctx, &start)
before, err := g.db.CountTotal(ctx, &start)
if err != nil {
return nil, err
}
count, err := s.db.CountRangeEverydayTotal(ctx, start, time.UnixMilli(req.End))
count, err := g.db.CountRangeEverydayTotal(ctx, start, time.UnixMilli(req.End))
if err != nil {
return nil, err
}