assesslistlogic.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package logic
  2. import (
  3. "context"
  4. "fmt"
  5. "bp.jydev.jianyu360.cn/ApplicationCenter/threeMarket/public/entity"
  6. "bp.jydev.jianyu360.cn/ApplicationCenter/threeMarket/rpc/internal/svc"
  7. "bp.jydev.jianyu360.cn/ApplicationCenter/threeMarket/rpc/pb"
  8. "github.com/zeromicro/go-zero/core/logx"
  9. )
  10. type AssessListLogic struct {
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. logx.Logger
  14. }
  15. func NewAssessListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AssessListLogic {
  16. return &AssessListLogic{
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. Logger: logx.WithContext(ctx),
  20. }
  21. }
  22. // 评价列表
  23. func (l *AssessListLogic) AssessList(in *pb.AssessListReq) (*pb.AssessListResp, error) {
  24. // todo: add your logic here and delete this line
  25. resp := &pb.AssessListResp{}
  26. tripartite_goods_assess := &entity.Tripartite_goods_assess_struct{
  27. Appid: in.Appid,
  28. Goods_code: in.GoodsCode,
  29. }
  30. list, assess, err := tripartite_goods_assess.List(in.PageNum, in.PageSize)
  31. if err != nil {
  32. l.Error(fmt.Sprintf("%+v", in), err.Error())
  33. resp.ErrorMsg = err.Error()
  34. resp.ErrorCode = -1
  35. } else {
  36. resp.Data = list
  37. resp.Assess = assess
  38. }
  39. return resp, nil
  40. }