confirmreceiptlogic.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 ConfirmReceiptLogic struct {
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. logx.Logger
  14. }
  15. func NewConfirmReceiptLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ConfirmReceiptLogic {
  16. return &ConfirmReceiptLogic{
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. Logger: logx.WithContext(ctx),
  20. }
  21. }
  22. // 确认收货
  23. func (l *ConfirmReceiptLogic) ConfirmReceipt(in *pb.ConfirmReceiptReq) (*pb.Resp, error) {
  24. // todo: add your logic here and delete this line
  25. resp := &pb.Resp{}
  26. tripartite_market_service := &entity.Tripartite_market_service_struct{
  27. Id: in.ServiceId,
  28. Appid: in.Appid,
  29. User_id: in.BaseUserId,
  30. Goods_code: in.GoodsCode,
  31. }
  32. status, err := tripartite_market_service.Finish()
  33. if err != nil {
  34. l.Error(fmt.Sprintf("%+v", in), err.Error())
  35. resp.ErrorMsg = err.Error()
  36. resp.ErrorCode = -1
  37. }
  38. resp.Status = status
  39. return resp, nil
  40. }