waitempowerdetaillogic.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. if req.AppId == "" {
  25. resp.Error_msg = "无效的参数appid"
  26. l.Error(fmt.Sprintf("%+v", req), resp.Error_msg)
  27. return resp, nil
  28. } else if req.Function_code == "" {
  29. resp.Error_msg = "无效的参数function_code"
  30. l.Error(fmt.Sprintf("%+v", req), resp.Error_msg)
  31. return resp, nil
  32. } else if req.Ent_id == 0 {
  33. resp.Error_msg = "无效的参数ent_id"
  34. l.Error(fmt.Sprintf("%+v", req), resp.Error_msg)
  35. return resp, nil
  36. }
  37. resp.Error_code = 0
  38. resp.Data = WaitEmpowerDetail(req.AppId, req.Function_code, req.Ent_id)
  39. return
  40. }