1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- package dtgateway
- import (
- "GtDataStore/app/cmd/dtgateway/internal/svc"
- "GtDataStore/app/cmd/dtgateway/internal/types"
- "GtDataStore/app/cmd/organization/pb"
- "GtDataStore/common/xerr"
- "context"
- "fmt"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type ItemHistoryDataInfoLogic struct {
- logx.Logger
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- func NewItemHistoryDataInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ItemHistoryDataInfoLogic {
- return &ItemHistoryDataInfoLogic{
- Logger: logx.WithContext(ctx),
- ctx: ctx,
- svcCtx: svcCtx,
- }
- }
- func (l *ItemHistoryDataInfoLogic) ItemHistoryDataInfo(req *types.ItemHistoryDataByTimeReq) (resp *types.CommonResponse, err error) {
- dataList, err := l.svcCtx.OrganizationRpc.ItemHistoryDataByTime(l.ctx, &pb.ItemHistoryDataByTimeReq{
- ProjectId: req.ProjectId,
- ItemName: req.ItemName,
- Stime: req.STime,
- Etime: req.ETime,
- })
- fmt.Println("rpc:", dataList)
- if err != nil {
- return nil, err
- }
- return &types.CommonResponse{
- Code: xerr.OK,
- Msg: xerr.MapErrMsg(xerr.OK),
- Data: dataList,
- }, nil
- }
|