empowerlistlogic.go 980 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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 EmpowerListLogic struct {
  11. logx.Logger
  12. ctx context.Context
  13. svcCtx *svc.ServiceContext
  14. }
  15. func NewEmpowerListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *EmpowerListLogic {
  16. return &EmpowerListLogic{
  17. Logger: logx.WithContext(ctx),
  18. ctx: ctx,
  19. svcCtx: svcCtx,
  20. }
  21. }
  22. func (l *EmpowerListLogic) EmpowerList(req *types.Req) (resp *types.Reply, err error) {
  23. resp = &types.Reply{}
  24. count, datas, err := EmpowerList(req.AppId, req.Function_code, req.Ent_id, 0, 0)
  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. "count": count,
  32. "list": datas,
  33. }
  34. return
  35. }