searchCriteriaLogic.go 845 B

123456789101112131415161718192021222324252627282930313233343536
  1. package logic
  2. import (
  3. "context"
  4. "github.com/gogf/gf/v2/util/gconv"
  5. "jyBXCore/rpc/type/bxcore"
  6. "jyBXCore/api/internal/svc"
  7. "jyBXCore/api/internal/types"
  8. "github.com/zeromicro/go-zero/core/logx"
  9. )
  10. type SearchCriteriaLogic struct {
  11. logx.Logger
  12. ctx context.Context
  13. svcCtx *svc.ServiceContext
  14. }
  15. func NewSearchCriteriaLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SearchCriteriaLogic {
  16. return &SearchCriteriaLogic{
  17. Logger: logx.WithContext(ctx),
  18. ctx: ctx,
  19. svcCtx: svcCtx,
  20. }
  21. }
  22. func (l *SearchCriteriaLogic) SearchCriteria() (resp *types.CommonResp, err error) {
  23. // todo: add your logic here and delete this line
  24. res, err := l.svcCtx.BxCore.PropertySearchCriteria(l.ctx, &bxcore.SearchReq{})
  25. return &types.CommonResp{
  26. Err_code: res.ErrCode,
  27. Err_msg: res.ErrMsg,
  28. Data: gconv.Map(res.Data),
  29. }, nil
  30. }