waitempowerdetaillogic.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package logic
  2. import (
  3. "context"
  4. "fmt"
  5. "bp.jydev.jianyu360.cn/BaseService/resourceCenter/api/internal/svc"
  6. "bp.jydev.jianyu360.cn/BaseService/resourceCenter/api/internal/types"
  7. . "bp.jydev.jianyu360.cn/BaseService/resourceCenter/public/service"
  8. "github.com/zeromicro/go-zero/core/logx"
  9. )
  10. type WaitEmpowerDetailLogic struct {
  11. logx.Logger
  12. ctx context.Context
  13. svcCtx *svc.ServiceContext
  14. }
  15. func NewWaitEmpowerDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *WaitEmpowerDetailLogic {
  16. return &WaitEmpowerDetailLogic{
  17. Logger: logx.WithContext(ctx),
  18. ctx: ctx,
  19. svcCtx: svcCtx,
  20. }
  21. }
  22. func (l *WaitEmpowerDetailLogic) WaitEmpowerDetail(req *types.Req) (resp *types.Reply, err error) {
  23. resp = &types.Reply{}
  24. data, err := WaitEmpowerDetail(req.AppId, req.Function_code, req.Ent_id)
  25. if err != nil {
  26. resp.Error_msg = err.Error()
  27. l.Error(fmt.Sprintf("%+v", req), err)
  28. }
  29. resp.Error_code = 0
  30. resp.Data = map[string]interface{}{
  31. "start_time": data.StartTime,
  32. "end_time": data.EndTime,
  33. "empower_count": data.EmpowerCount,
  34. "use_count": data.UseCount,
  35. "limit_strategy": data.LimitStrategy,
  36. }
  37. return
  38. }