// Code generated by thriftgo (0.2.8). DO NOT EDIT.

package pay

import (
	"context"
	"fmt"
	"github.com/apache/thrift/lib/go/thrift"
	"github.com/cqqqq777/go-kitex-mall/shared/kitex_gen/common"
	"strings"
)

type MallCreatePayRequest struct {
	OrderId int64 `thrift:"order_id,1" frugal:"1,default,i64" json:"order_id"`
	UserId  int64 `thrift:"user_id,2" frugal:"2,default,i64" json:"user_id"`
	Amount  int64 `thrift:"amount,3" frugal:"3,default,i64" json:"amount"`
}

func NewMallCreatePayRequest() *MallCreatePayRequest {
	return &MallCreatePayRequest{}
}

func (p *MallCreatePayRequest) InitDefault() {
	*p = MallCreatePayRequest{}
}

func (p *MallCreatePayRequest) GetOrderId() (v int64) {
	return p.OrderId
}

func (p *MallCreatePayRequest) GetUserId() (v int64) {
	return p.UserId
}

func (p *MallCreatePayRequest) GetAmount() (v int64) {
	return p.Amount
}
func (p *MallCreatePayRequest) SetOrderId(val int64) {
	p.OrderId = val
}
func (p *MallCreatePayRequest) SetUserId(val int64) {
	p.UserId = val
}
func (p *MallCreatePayRequest) SetAmount(val int64) {
	p.Amount = val
}

var fieldIDToName_MallCreatePayRequest = map[int16]string{
	1: "order_id",
	2: "user_id",
	3: "amount",
}

func (p *MallCreatePayRequest) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.I64 {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 2:
			if fieldTypeId == thrift.I64 {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 3:
			if fieldTypeId == thrift.I64 {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MallCreatePayRequest[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *MallCreatePayRequest) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return err
	} else {
		p.OrderId = v
	}
	return nil
}

func (p *MallCreatePayRequest) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return err
	} else {
		p.UserId = v
	}
	return nil
}

func (p *MallCreatePayRequest) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return err
	} else {
		p.Amount = v
	}
	return nil
}

func (p *MallCreatePayRequest) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("mall_create_pay_request"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *MallCreatePayRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("order_id", thrift.I64, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI64(p.OrderId); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *MallCreatePayRequest) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("user_id", thrift.I64, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI64(p.UserId); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *MallCreatePayRequest) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("amount", thrift.I64, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI64(p.Amount); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *MallCreatePayRequest) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("MallCreatePayRequest(%+v)", *p)
}

func (p *MallCreatePayRequest) DeepEqual(ano *MallCreatePayRequest) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.OrderId) {
		return false
	}
	if !p.Field2DeepEqual(ano.UserId) {
		return false
	}
	if !p.Field3DeepEqual(ano.Amount) {
		return false
	}
	return true
}

func (p *MallCreatePayRequest) Field1DeepEqual(src int64) bool {

	if p.OrderId != src {
		return false
	}
	return true
}
func (p *MallCreatePayRequest) Field2DeepEqual(src int64) bool {

	if p.UserId != src {
		return false
	}
	return true
}
func (p *MallCreatePayRequest) Field3DeepEqual(src int64) bool {

	if p.Amount != src {
		return false
	}
	return true
}

type MallCreatePayResponse struct {
	CommonResp *common.CommonResponse `thrift:"common_resp,1" frugal:"1,default,common.CommonResponse" json:"common_resp"`
	PayId      int64                  `thrift:"pay_id,2" frugal:"2,default,i64" json:"pay_id"`
	Url        string                 `thrift:"url,3" frugal:"3,default,string" json:"url"`
}

func NewMallCreatePayResponse() *MallCreatePayResponse {
	return &MallCreatePayResponse{}
}

func (p *MallCreatePayResponse) InitDefault() {
	*p = MallCreatePayResponse{}
}

var MallCreatePayResponse_CommonResp_DEFAULT *common.CommonResponse

func (p *MallCreatePayResponse) GetCommonResp() (v *common.CommonResponse) {
	if !p.IsSetCommonResp() {
		return MallCreatePayResponse_CommonResp_DEFAULT
	}
	return p.CommonResp
}

func (p *MallCreatePayResponse) GetPayId() (v int64) {
	return p.PayId
}

func (p *MallCreatePayResponse) GetUrl() (v string) {
	return p.Url
}
func (p *MallCreatePayResponse) SetCommonResp(val *common.CommonResponse) {
	p.CommonResp = val
}
func (p *MallCreatePayResponse) SetPayId(val int64) {
	p.PayId = val
}
func (p *MallCreatePayResponse) SetUrl(val string) {
	p.Url = val
}

var fieldIDToName_MallCreatePayResponse = map[int16]string{
	1: "common_resp",
	2: "pay_id",
	3: "url",
}

func (p *MallCreatePayResponse) IsSetCommonResp() bool {
	return p.CommonResp != nil
}

func (p *MallCreatePayResponse) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 2:
			if fieldTypeId == thrift.I64 {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 3:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MallCreatePayResponse[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *MallCreatePayResponse) ReadField1(iprot thrift.TProtocol) error {
	p.CommonResp = common.NewCommonResponse()
	if err := p.CommonResp.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *MallCreatePayResponse) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return err
	} else {
		p.PayId = v
	}
	return nil
}

func (p *MallCreatePayResponse) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Url = v
	}
	return nil
}

func (p *MallCreatePayResponse) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("mall_create_pay_response"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *MallCreatePayResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("common_resp", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.CommonResp.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *MallCreatePayResponse) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("pay_id", thrift.I64, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI64(p.PayId); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *MallCreatePayResponse) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("url", thrift.STRING, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Url); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *MallCreatePayResponse) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("MallCreatePayResponse(%+v)", *p)
}

func (p *MallCreatePayResponse) DeepEqual(ano *MallCreatePayResponse) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.CommonResp) {
		return false
	}
	if !p.Field2DeepEqual(ano.PayId) {
		return false
	}
	if !p.Field3DeepEqual(ano.Url) {
		return false
	}
	return true
}

func (p *MallCreatePayResponse) Field1DeepEqual(src *common.CommonResponse) bool {

	if !p.CommonResp.DeepEqual(src) {
		return false
	}
	return true
}
func (p *MallCreatePayResponse) Field2DeepEqual(src int64) bool {

	if p.PayId != src {
		return false
	}
	return true
}
func (p *MallCreatePayResponse) Field3DeepEqual(src string) bool {

	if strings.Compare(p.Url, src) != 0 {
		return false
	}
	return true
}

type MallPayDetailRequest struct {
	PayId int64 `thrift:"pay_id,1" frugal:"1,default,i64" json:"pay_id"`
}

func NewMallPayDetailRequest() *MallPayDetailRequest {
	return &MallPayDetailRequest{}
}

func (p *MallPayDetailRequest) InitDefault() {
	*p = MallPayDetailRequest{}
}

func (p *MallPayDetailRequest) GetPayId() (v int64) {
	return p.PayId
}
func (p *MallPayDetailRequest) SetPayId(val int64) {
	p.PayId = val
}

var fieldIDToName_MallPayDetailRequest = map[int16]string{
	1: "pay_id",
}

func (p *MallPayDetailRequest) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.I64 {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MallPayDetailRequest[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *MallPayDetailRequest) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return err
	} else {
		p.PayId = v
	}
	return nil
}

func (p *MallPayDetailRequest) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("mall_pay_detail_request"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *MallPayDetailRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("pay_id", thrift.I64, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI64(p.PayId); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *MallPayDetailRequest) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("MallPayDetailRequest(%+v)", *p)
}

func (p *MallPayDetailRequest) DeepEqual(ano *MallPayDetailRequest) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.PayId) {
		return false
	}
	return true
}

func (p *MallPayDetailRequest) Field1DeepEqual(src int64) bool {

	if p.PayId != src {
		return false
	}
	return true
}

type MallPayDetailResponse struct {
	CommonResp *common.CommonResponse `thrift:"common_resp,1" frugal:"1,default,common.CommonResponse" json:"common_resp"`
	Pay        *common.Pay            `thrift:"pay,2" frugal:"2,default,common.Pay" json:"pay"`
}

func NewMallPayDetailResponse() *MallPayDetailResponse {
	return &MallPayDetailResponse{}
}

func (p *MallPayDetailResponse) InitDefault() {
	*p = MallPayDetailResponse{}
}

var MallPayDetailResponse_CommonResp_DEFAULT *common.CommonResponse

func (p *MallPayDetailResponse) GetCommonResp() (v *common.CommonResponse) {
	if !p.IsSetCommonResp() {
		return MallPayDetailResponse_CommonResp_DEFAULT
	}
	return p.CommonResp
}

var MallPayDetailResponse_Pay_DEFAULT *common.Pay

func (p *MallPayDetailResponse) GetPay() (v *common.Pay) {
	if !p.IsSetPay() {
		return MallPayDetailResponse_Pay_DEFAULT
	}
	return p.Pay
}
func (p *MallPayDetailResponse) SetCommonResp(val *common.CommonResponse) {
	p.CommonResp = val
}
func (p *MallPayDetailResponse) SetPay(val *common.Pay) {
	p.Pay = val
}

var fieldIDToName_MallPayDetailResponse = map[int16]string{
	1: "common_resp",
	2: "pay",
}

func (p *MallPayDetailResponse) IsSetCommonResp() bool {
	return p.CommonResp != nil
}

func (p *MallPayDetailResponse) IsSetPay() bool {
	return p.Pay != nil
}

func (p *MallPayDetailResponse) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MallPayDetailResponse[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *MallPayDetailResponse) ReadField1(iprot thrift.TProtocol) error {
	p.CommonResp = common.NewCommonResponse()
	if err := p.CommonResp.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *MallPayDetailResponse) ReadField2(iprot thrift.TProtocol) error {
	p.Pay = common.NewPay()
	if err := p.Pay.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *MallPayDetailResponse) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("mall_pay_detail_response"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *MallPayDetailResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("common_resp", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.CommonResp.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *MallPayDetailResponse) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("pay", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Pay.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *MallPayDetailResponse) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("MallPayDetailResponse(%+v)", *p)
}

func (p *MallPayDetailResponse) DeepEqual(ano *MallPayDetailResponse) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.CommonResp) {
		return false
	}
	if !p.Field2DeepEqual(ano.Pay) {
		return false
	}
	return true
}

func (p *MallPayDetailResponse) Field1DeepEqual(src *common.CommonResponse) bool {

	if !p.CommonResp.DeepEqual(src) {
		return false
	}
	return true
}
func (p *MallPayDetailResponse) Field2DeepEqual(src *common.Pay) bool {

	if !p.Pay.DeepEqual(src) {
		return false
	}
	return true
}

type MallPayReturnRequest struct {
	PayId   int64 `thrift:"pay_id,1" frugal:"1,default,i64" json:"pay_id"`
	OrderId int64 `thrift:"order_id,2" frugal:"2,default,i64" json:"order_id"`
	UserId  int64 `thrift:"user_id,3" frugal:"3,default,i64" json:"user_id"`
	Amount  int64 `thrift:"amount,4" frugal:"4,default,i64" json:"amount"`
	Status  int8  `thrift:"status,5" frugal:"5,default,i8" json:"status"`
}

func NewMallPayReturnRequest() *MallPayReturnRequest {
	return &MallPayReturnRequest{}
}

func (p *MallPayReturnRequest) InitDefault() {
	*p = MallPayReturnRequest{}
}

func (p *MallPayReturnRequest) GetPayId() (v int64) {
	return p.PayId
}

func (p *MallPayReturnRequest) GetOrderId() (v int64) {
	return p.OrderId
}

func (p *MallPayReturnRequest) GetUserId() (v int64) {
	return p.UserId
}

func (p *MallPayReturnRequest) GetAmount() (v int64) {
	return p.Amount
}

func (p *MallPayReturnRequest) GetStatus() (v int8) {
	return p.Status
}
func (p *MallPayReturnRequest) SetPayId(val int64) {
	p.PayId = val
}
func (p *MallPayReturnRequest) SetOrderId(val int64) {
	p.OrderId = val
}
func (p *MallPayReturnRequest) SetUserId(val int64) {
	p.UserId = val
}
func (p *MallPayReturnRequest) SetAmount(val int64) {
	p.Amount = val
}
func (p *MallPayReturnRequest) SetStatus(val int8) {
	p.Status = val
}

var fieldIDToName_MallPayReturnRequest = map[int16]string{
	1: "pay_id",
	2: "order_id",
	3: "user_id",
	4: "amount",
	5: "status",
}

func (p *MallPayReturnRequest) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.I64 {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 2:
			if fieldTypeId == thrift.I64 {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 3:
			if fieldTypeId == thrift.I64 {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 4:
			if fieldTypeId == thrift.I64 {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 5:
			if fieldTypeId == thrift.BYTE {
				if err = p.ReadField5(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MallPayReturnRequest[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *MallPayReturnRequest) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return err
	} else {
		p.PayId = v
	}
	return nil
}

func (p *MallPayReturnRequest) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return err
	} else {
		p.OrderId = v
	}
	return nil
}

func (p *MallPayReturnRequest) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return err
	} else {
		p.UserId = v
	}
	return nil
}

func (p *MallPayReturnRequest) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return err
	} else {
		p.Amount = v
	}
	return nil
}

func (p *MallPayReturnRequest) ReadField5(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadByte(); err != nil {
		return err
	} else {
		p.Status = v
	}
	return nil
}

func (p *MallPayReturnRequest) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("mall_pay_return_request"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
		if err = p.writeField4(oprot); err != nil {
			fieldId = 4
			goto WriteFieldError
		}
		if err = p.writeField5(oprot); err != nil {
			fieldId = 5
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *MallPayReturnRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("pay_id", thrift.I64, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI64(p.PayId); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *MallPayReturnRequest) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("order_id", thrift.I64, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI64(p.OrderId); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *MallPayReturnRequest) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("user_id", thrift.I64, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI64(p.UserId); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *MallPayReturnRequest) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("amount", thrift.I64, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI64(p.Amount); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *MallPayReturnRequest) writeField5(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("status", thrift.BYTE, 5); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteByte(p.Status); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
}

func (p *MallPayReturnRequest) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("MallPayReturnRequest(%+v)", *p)
}

func (p *MallPayReturnRequest) DeepEqual(ano *MallPayReturnRequest) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.PayId) {
		return false
	}
	if !p.Field2DeepEqual(ano.OrderId) {
		return false
	}
	if !p.Field3DeepEqual(ano.UserId) {
		return false
	}
	if !p.Field4DeepEqual(ano.Amount) {
		return false
	}
	if !p.Field5DeepEqual(ano.Status) {
		return false
	}
	return true
}

func (p *MallPayReturnRequest) Field1DeepEqual(src int64) bool {

	if p.PayId != src {
		return false
	}
	return true
}
func (p *MallPayReturnRequest) Field2DeepEqual(src int64) bool {

	if p.OrderId != src {
		return false
	}
	return true
}
func (p *MallPayReturnRequest) Field3DeepEqual(src int64) bool {

	if p.UserId != src {
		return false
	}
	return true
}
func (p *MallPayReturnRequest) Field4DeepEqual(src int64) bool {

	if p.Amount != src {
		return false
	}
	return true
}
func (p *MallPayReturnRequest) Field5DeepEqual(src int8) bool {

	if p.Status != src {
		return false
	}
	return true
}

type MallPayReturnResponse struct {
	CommonResp *common.CommonResponse `thrift:"common_resp,1" frugal:"1,default,common.CommonResponse" json:"common_resp"`
}

func NewMallPayReturnResponse() *MallPayReturnResponse {
	return &MallPayReturnResponse{}
}

func (p *MallPayReturnResponse) InitDefault() {
	*p = MallPayReturnResponse{}
}

var MallPayReturnResponse_CommonResp_DEFAULT *common.CommonResponse

func (p *MallPayReturnResponse) GetCommonResp() (v *common.CommonResponse) {
	if !p.IsSetCommonResp() {
		return MallPayReturnResponse_CommonResp_DEFAULT
	}
	return p.CommonResp
}
func (p *MallPayReturnResponse) SetCommonResp(val *common.CommonResponse) {
	p.CommonResp = val
}

var fieldIDToName_MallPayReturnResponse = map[int16]string{
	1: "common_resp",
}

func (p *MallPayReturnResponse) IsSetCommonResp() bool {
	return p.CommonResp != nil
}

func (p *MallPayReturnResponse) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MallPayReturnResponse[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *MallPayReturnResponse) ReadField1(iprot thrift.TProtocol) error {
	p.CommonResp = common.NewCommonResponse()
	if err := p.CommonResp.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *MallPayReturnResponse) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("mall_pay_return_response"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *MallPayReturnResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("common_resp", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.CommonResp.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *MallPayReturnResponse) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("MallPayReturnResponse(%+v)", *p)
}

func (p *MallPayReturnResponse) DeepEqual(ano *MallPayReturnResponse) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.CommonResp) {
		return false
	}
	return true
}

func (p *MallPayReturnResponse) Field1DeepEqual(src *common.CommonResponse) bool {

	if !p.CommonResp.DeepEqual(src) {
		return false
	}
	return true
}

type MallPayNotifyRequest struct {
	OrderId int64 `thrift:"order_id,1" frugal:"1,default,i64" json:"order_id"`
	PayId   int64 `thrift:"pay_id,2" frugal:"2,default,i64" json:"pay_id"`
	Status  int8  `thrift:"status,3" frugal:"3,default,i8" json:"status"`
}

func NewMallPayNotifyRequest() *MallPayNotifyRequest {
	return &MallPayNotifyRequest{}
}

func (p *MallPayNotifyRequest) InitDefault() {
	*p = MallPayNotifyRequest{}
}

func (p *MallPayNotifyRequest) GetOrderId() (v int64) {
	return p.OrderId
}

func (p *MallPayNotifyRequest) GetPayId() (v int64) {
	return p.PayId
}

func (p *MallPayNotifyRequest) GetStatus() (v int8) {
	return p.Status
}
func (p *MallPayNotifyRequest) SetOrderId(val int64) {
	p.OrderId = val
}
func (p *MallPayNotifyRequest) SetPayId(val int64) {
	p.PayId = val
}
func (p *MallPayNotifyRequest) SetStatus(val int8) {
	p.Status = val
}

var fieldIDToName_MallPayNotifyRequest = map[int16]string{
	1: "order_id",
	2: "pay_id",
	3: "status",
}

func (p *MallPayNotifyRequest) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.I64 {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 2:
			if fieldTypeId == thrift.I64 {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 3:
			if fieldTypeId == thrift.BYTE {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MallPayNotifyRequest[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *MallPayNotifyRequest) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return err
	} else {
		p.OrderId = v
	}
	return nil
}

func (p *MallPayNotifyRequest) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return err
	} else {
		p.PayId = v
	}
	return nil
}

func (p *MallPayNotifyRequest) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadByte(); err != nil {
		return err
	} else {
		p.Status = v
	}
	return nil
}

func (p *MallPayNotifyRequest) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("mall_pay_notify_request"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *MallPayNotifyRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("order_id", thrift.I64, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI64(p.OrderId); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *MallPayNotifyRequest) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("pay_id", thrift.I64, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI64(p.PayId); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *MallPayNotifyRequest) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("status", thrift.BYTE, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteByte(p.Status); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *MallPayNotifyRequest) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("MallPayNotifyRequest(%+v)", *p)
}

func (p *MallPayNotifyRequest) DeepEqual(ano *MallPayNotifyRequest) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.OrderId) {
		return false
	}
	if !p.Field2DeepEqual(ano.PayId) {
		return false
	}
	if !p.Field3DeepEqual(ano.Status) {
		return false
	}
	return true
}

func (p *MallPayNotifyRequest) Field1DeepEqual(src int64) bool {

	if p.OrderId != src {
		return false
	}
	return true
}
func (p *MallPayNotifyRequest) Field2DeepEqual(src int64) bool {

	if p.PayId != src {
		return false
	}
	return true
}
func (p *MallPayNotifyRequest) Field3DeepEqual(src int8) bool {

	if p.Status != src {
		return false
	}
	return true
}

type MallPayNotifyResponse struct {
	CommonResp *common.CommonResponse `thrift:"common_resp,1" frugal:"1,default,common.CommonResponse" json:"common_resp"`
}

func NewMallPayNotifyResponse() *MallPayNotifyResponse {
	return &MallPayNotifyResponse{}
}

func (p *MallPayNotifyResponse) InitDefault() {
	*p = MallPayNotifyResponse{}
}

var MallPayNotifyResponse_CommonResp_DEFAULT *common.CommonResponse

func (p *MallPayNotifyResponse) GetCommonResp() (v *common.CommonResponse) {
	if !p.IsSetCommonResp() {
		return MallPayNotifyResponse_CommonResp_DEFAULT
	}
	return p.CommonResp
}
func (p *MallPayNotifyResponse) SetCommonResp(val *common.CommonResponse) {
	p.CommonResp = val
}

var fieldIDToName_MallPayNotifyResponse = map[int16]string{
	1: "common_resp",
}

func (p *MallPayNotifyResponse) IsSetCommonResp() bool {
	return p.CommonResp != nil
}

func (p *MallPayNotifyResponse) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MallPayNotifyResponse[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *MallPayNotifyResponse) ReadField1(iprot thrift.TProtocol) error {
	p.CommonResp = common.NewCommonResponse()
	if err := p.CommonResp.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *MallPayNotifyResponse) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("mall_pay_notify_response"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *MallPayNotifyResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("common_resp", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.CommonResp.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *MallPayNotifyResponse) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("MallPayNotifyResponse(%+v)", *p)
}

func (p *MallPayNotifyResponse) DeepEqual(ano *MallPayNotifyResponse) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.CommonResp) {
		return false
	}
	return true
}

func (p *MallPayNotifyResponse) Field1DeepEqual(src *common.CommonResponse) bool {

	if !p.CommonResp.DeepEqual(src) {
		return false
	}
	return true
}

type PayService interface {
	CreatePay(ctx context.Context, req *MallCreatePayRequest) (r *MallCreatePayResponse, err error)

	PayDetail(ctx context.Context, req *MallPayDetailRequest) (r *MallPayDetailResponse, err error)

	PayReturn(ctx context.Context, req *MallPayReturnRequest) (r *MallPayReturnResponse, err error)

	PayNotify(ctx context.Context, req *MallPayNotifyRequest) (r *MallPayNotifyResponse, err error)
}

type PayServiceClient struct {
	c thrift.TClient
}

func NewPayServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *PayServiceClient {
	return &PayServiceClient{
		c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)),
	}
}

func NewPayServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *PayServiceClient {
	return &PayServiceClient{
		c: thrift.NewTStandardClient(iprot, oprot),
	}
}

func NewPayServiceClient(c thrift.TClient) *PayServiceClient {
	return &PayServiceClient{
		c: c,
	}
}

func (p *PayServiceClient) Client_() thrift.TClient {
	return p.c
}

func (p *PayServiceClient) CreatePay(ctx context.Context, req *MallCreatePayRequest) (r *MallCreatePayResponse, err error) {
	var _args PayServiceCreatePayArgs
	_args.Req = req
	var _result PayServiceCreatePayResult
	if err = p.Client_().Call(ctx, "CreatePay", &_args, &_result); err != nil {
		return
	}
	return _result.GetSuccess(), nil
}
func (p *PayServiceClient) PayDetail(ctx context.Context, req *MallPayDetailRequest) (r *MallPayDetailResponse, err error) {
	var _args PayServicePayDetailArgs
	_args.Req = req
	var _result PayServicePayDetailResult
	if err = p.Client_().Call(ctx, "PayDetail", &_args, &_result); err != nil {
		return
	}
	return _result.GetSuccess(), nil
}
func (p *PayServiceClient) PayReturn(ctx context.Context, req *MallPayReturnRequest) (r *MallPayReturnResponse, err error) {
	var _args PayServicePayReturnArgs
	_args.Req = req
	var _result PayServicePayReturnResult
	if err = p.Client_().Call(ctx, "PayReturn", &_args, &_result); err != nil {
		return
	}
	return _result.GetSuccess(), nil
}
func (p *PayServiceClient) PayNotify(ctx context.Context, req *MallPayNotifyRequest) (r *MallPayNotifyResponse, err error) {
	var _args PayServicePayNotifyArgs
	_args.Req = req
	var _result PayServicePayNotifyResult
	if err = p.Client_().Call(ctx, "PayNotify", &_args, &_result); err != nil {
		return
	}
	return _result.GetSuccess(), nil
}

type PayServiceProcessor struct {
	processorMap map[string]thrift.TProcessorFunction
	handler      PayService
}

func (p *PayServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) {
	p.processorMap[key] = processor
}

func (p *PayServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) {
	processor, ok = p.processorMap[key]
	return processor, ok
}

func (p *PayServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction {
	return p.processorMap
}

func NewPayServiceProcessor(handler PayService) *PayServiceProcessor {
	self := &PayServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)}
	self.AddToProcessorMap("CreatePay", &payServiceProcessorCreatePay{handler: handler})
	self.AddToProcessorMap("PayDetail", &payServiceProcessorPayDetail{handler: handler})
	self.AddToProcessorMap("PayReturn", &payServiceProcessorPayReturn{handler: handler})
	self.AddToProcessorMap("PayNotify", &payServiceProcessorPayNotify{handler: handler})
	return self
}
func (p *PayServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	name, _, seqId, err := iprot.ReadMessageBegin()
	if err != nil {
		return false, err
	}
	if processor, ok := p.GetProcessorFunction(name); ok {
		return processor.Process(ctx, seqId, iprot, oprot)
	}
	iprot.Skip(thrift.STRUCT)
	iprot.ReadMessageEnd()
	x := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name)
	oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId)
	x.Write(oprot)
	oprot.WriteMessageEnd()
	oprot.Flush(ctx)
	return false, x
}

type payServiceProcessorCreatePay struct {
	handler PayService
}

func (p *payServiceProcessorCreatePay) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	args := PayServiceCreatePayArgs{}
	if err = args.Read(iprot); err != nil {
		iprot.ReadMessageEnd()
		x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
		oprot.WriteMessageBegin("CreatePay", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return false, err
	}

	iprot.ReadMessageEnd()
	var err2 error
	result := PayServiceCreatePayResult{}
	var retval *MallCreatePayResponse
	if retval, err2 = p.handler.CreatePay(ctx, args.Req); err2 != nil {
		x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CreatePay: "+err2.Error())
		oprot.WriteMessageBegin("CreatePay", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return true, err2
	} else {
		result.Success = retval
	}
	if err2 = oprot.WriteMessageBegin("CreatePay", thrift.REPLY, seqId); err2 != nil {
		err = err2
	}
	if err2 = result.Write(oprot); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
		err = err2
	}
	if err != nil {
		return
	}
	return true, err
}

type payServiceProcessorPayDetail struct {
	handler PayService
}

func (p *payServiceProcessorPayDetail) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	args := PayServicePayDetailArgs{}
	if err = args.Read(iprot); err != nil {
		iprot.ReadMessageEnd()
		x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
		oprot.WriteMessageBegin("PayDetail", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return false, err
	}

	iprot.ReadMessageEnd()
	var err2 error
	result := PayServicePayDetailResult{}
	var retval *MallPayDetailResponse
	if retval, err2 = p.handler.PayDetail(ctx, args.Req); err2 != nil {
		x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing PayDetail: "+err2.Error())
		oprot.WriteMessageBegin("PayDetail", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return true, err2
	} else {
		result.Success = retval
	}
	if err2 = oprot.WriteMessageBegin("PayDetail", thrift.REPLY, seqId); err2 != nil {
		err = err2
	}
	if err2 = result.Write(oprot); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
		err = err2
	}
	if err != nil {
		return
	}
	return true, err
}

type payServiceProcessorPayReturn struct {
	handler PayService
}

func (p *payServiceProcessorPayReturn) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	args := PayServicePayReturnArgs{}
	if err = args.Read(iprot); err != nil {
		iprot.ReadMessageEnd()
		x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
		oprot.WriteMessageBegin("PayReturn", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return false, err
	}

	iprot.ReadMessageEnd()
	var err2 error
	result := PayServicePayReturnResult{}
	var retval *MallPayReturnResponse
	if retval, err2 = p.handler.PayReturn(ctx, args.Req); err2 != nil {
		x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing PayReturn: "+err2.Error())
		oprot.WriteMessageBegin("PayReturn", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return true, err2
	} else {
		result.Success = retval
	}
	if err2 = oprot.WriteMessageBegin("PayReturn", thrift.REPLY, seqId); err2 != nil {
		err = err2
	}
	if err2 = result.Write(oprot); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
		err = err2
	}
	if err != nil {
		return
	}
	return true, err
}

type payServiceProcessorPayNotify struct {
	handler PayService
}

func (p *payServiceProcessorPayNotify) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	args := PayServicePayNotifyArgs{}
	if err = args.Read(iprot); err != nil {
		iprot.ReadMessageEnd()
		x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
		oprot.WriteMessageBegin("PayNotify", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return false, err
	}

	iprot.ReadMessageEnd()
	var err2 error
	result := PayServicePayNotifyResult{}
	var retval *MallPayNotifyResponse
	if retval, err2 = p.handler.PayNotify(ctx, args.Req); err2 != nil {
		x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing PayNotify: "+err2.Error())
		oprot.WriteMessageBegin("PayNotify", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return true, err2
	} else {
		result.Success = retval
	}
	if err2 = oprot.WriteMessageBegin("PayNotify", thrift.REPLY, seqId); err2 != nil {
		err = err2
	}
	if err2 = result.Write(oprot); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
		err = err2
	}
	if err != nil {
		return
	}
	return true, err
}

type PayServiceCreatePayArgs struct {
	Req *MallCreatePayRequest `thrift:"req,1" frugal:"1,default,MallCreatePayRequest" json:"req"`
}

func NewPayServiceCreatePayArgs() *PayServiceCreatePayArgs {
	return &PayServiceCreatePayArgs{}
}

func (p *PayServiceCreatePayArgs) InitDefault() {
	*p = PayServiceCreatePayArgs{}
}

var PayServiceCreatePayArgs_Req_DEFAULT *MallCreatePayRequest

func (p *PayServiceCreatePayArgs) GetReq() (v *MallCreatePayRequest) {
	if !p.IsSetReq() {
		return PayServiceCreatePayArgs_Req_DEFAULT
	}
	return p.Req
}
func (p *PayServiceCreatePayArgs) SetReq(val *MallCreatePayRequest) {
	p.Req = val
}

var fieldIDToName_PayServiceCreatePayArgs = map[int16]string{
	1: "req",
}

func (p *PayServiceCreatePayArgs) IsSetReq() bool {
	return p.Req != nil
}

func (p *PayServiceCreatePayArgs) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PayServiceCreatePayArgs[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *PayServiceCreatePayArgs) ReadField1(iprot thrift.TProtocol) error {
	p.Req = NewMallCreatePayRequest()
	if err := p.Req.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *PayServiceCreatePayArgs) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("CreatePay_args"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *PayServiceCreatePayArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Req.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *PayServiceCreatePayArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("PayServiceCreatePayArgs(%+v)", *p)
}

func (p *PayServiceCreatePayArgs) DeepEqual(ano *PayServiceCreatePayArgs) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Req) {
		return false
	}
	return true
}

func (p *PayServiceCreatePayArgs) Field1DeepEqual(src *MallCreatePayRequest) bool {

	if !p.Req.DeepEqual(src) {
		return false
	}
	return true
}

type PayServiceCreatePayResult struct {
	Success *MallCreatePayResponse `thrift:"success,0,optional" frugal:"0,optional,MallCreatePayResponse" json:"success,omitempty"`
}

func NewPayServiceCreatePayResult() *PayServiceCreatePayResult {
	return &PayServiceCreatePayResult{}
}

func (p *PayServiceCreatePayResult) InitDefault() {
	*p = PayServiceCreatePayResult{}
}

var PayServiceCreatePayResult_Success_DEFAULT *MallCreatePayResponse

func (p *PayServiceCreatePayResult) GetSuccess() (v *MallCreatePayResponse) {
	if !p.IsSetSuccess() {
		return PayServiceCreatePayResult_Success_DEFAULT
	}
	return p.Success
}
func (p *PayServiceCreatePayResult) SetSuccess(x interface{}) {
	p.Success = x.(*MallCreatePayResponse)
}

var fieldIDToName_PayServiceCreatePayResult = map[int16]string{
	0: "success",
}

func (p *PayServiceCreatePayResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *PayServiceCreatePayResult) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 0:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField0(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PayServiceCreatePayResult[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *PayServiceCreatePayResult) ReadField0(iprot thrift.TProtocol) error {
	p.Success = NewMallCreatePayResponse()
	if err := p.Success.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *PayServiceCreatePayResult) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("CreatePay_result"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField0(oprot); err != nil {
			fieldId = 0
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *PayServiceCreatePayResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Success.Write(oprot); err != nil {
			return err
		}
		if err = oprot.WriteFieldEnd(); err != nil {
			goto WriteFieldEndError
		}
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err)
}

func (p *PayServiceCreatePayResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("PayServiceCreatePayResult(%+v)", *p)
}

func (p *PayServiceCreatePayResult) DeepEqual(ano *PayServiceCreatePayResult) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field0DeepEqual(ano.Success) {
		return false
	}
	return true
}

func (p *PayServiceCreatePayResult) Field0DeepEqual(src *MallCreatePayResponse) bool {

	if !p.Success.DeepEqual(src) {
		return false
	}
	return true
}

type PayServicePayDetailArgs struct {
	Req *MallPayDetailRequest `thrift:"req,1" frugal:"1,default,MallPayDetailRequest" json:"req"`
}

func NewPayServicePayDetailArgs() *PayServicePayDetailArgs {
	return &PayServicePayDetailArgs{}
}

func (p *PayServicePayDetailArgs) InitDefault() {
	*p = PayServicePayDetailArgs{}
}

var PayServicePayDetailArgs_Req_DEFAULT *MallPayDetailRequest

func (p *PayServicePayDetailArgs) GetReq() (v *MallPayDetailRequest) {
	if !p.IsSetReq() {
		return PayServicePayDetailArgs_Req_DEFAULT
	}
	return p.Req
}
func (p *PayServicePayDetailArgs) SetReq(val *MallPayDetailRequest) {
	p.Req = val
}

var fieldIDToName_PayServicePayDetailArgs = map[int16]string{
	1: "req",
}

func (p *PayServicePayDetailArgs) IsSetReq() bool {
	return p.Req != nil
}

func (p *PayServicePayDetailArgs) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PayServicePayDetailArgs[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *PayServicePayDetailArgs) ReadField1(iprot thrift.TProtocol) error {
	p.Req = NewMallPayDetailRequest()
	if err := p.Req.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *PayServicePayDetailArgs) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("PayDetail_args"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *PayServicePayDetailArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Req.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *PayServicePayDetailArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("PayServicePayDetailArgs(%+v)", *p)
}

func (p *PayServicePayDetailArgs) DeepEqual(ano *PayServicePayDetailArgs) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Req) {
		return false
	}
	return true
}

func (p *PayServicePayDetailArgs) Field1DeepEqual(src *MallPayDetailRequest) bool {

	if !p.Req.DeepEqual(src) {
		return false
	}
	return true
}

type PayServicePayDetailResult struct {
	Success *MallPayDetailResponse `thrift:"success,0,optional" frugal:"0,optional,MallPayDetailResponse" json:"success,omitempty"`
}

func NewPayServicePayDetailResult() *PayServicePayDetailResult {
	return &PayServicePayDetailResult{}
}

func (p *PayServicePayDetailResult) InitDefault() {
	*p = PayServicePayDetailResult{}
}

var PayServicePayDetailResult_Success_DEFAULT *MallPayDetailResponse

func (p *PayServicePayDetailResult) GetSuccess() (v *MallPayDetailResponse) {
	if !p.IsSetSuccess() {
		return PayServicePayDetailResult_Success_DEFAULT
	}
	return p.Success
}
func (p *PayServicePayDetailResult) SetSuccess(x interface{}) {
	p.Success = x.(*MallPayDetailResponse)
}

var fieldIDToName_PayServicePayDetailResult = map[int16]string{
	0: "success",
}

func (p *PayServicePayDetailResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *PayServicePayDetailResult) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 0:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField0(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PayServicePayDetailResult[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *PayServicePayDetailResult) ReadField0(iprot thrift.TProtocol) error {
	p.Success = NewMallPayDetailResponse()
	if err := p.Success.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *PayServicePayDetailResult) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("PayDetail_result"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField0(oprot); err != nil {
			fieldId = 0
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *PayServicePayDetailResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Success.Write(oprot); err != nil {
			return err
		}
		if err = oprot.WriteFieldEnd(); err != nil {
			goto WriteFieldEndError
		}
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err)
}

func (p *PayServicePayDetailResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("PayServicePayDetailResult(%+v)", *p)
}

func (p *PayServicePayDetailResult) DeepEqual(ano *PayServicePayDetailResult) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field0DeepEqual(ano.Success) {
		return false
	}
	return true
}

func (p *PayServicePayDetailResult) Field0DeepEqual(src *MallPayDetailResponse) bool {

	if !p.Success.DeepEqual(src) {
		return false
	}
	return true
}

type PayServicePayReturnArgs struct {
	Req *MallPayReturnRequest `thrift:"req,1" frugal:"1,default,MallPayReturnRequest" json:"req"`
}

func NewPayServicePayReturnArgs() *PayServicePayReturnArgs {
	return &PayServicePayReturnArgs{}
}

func (p *PayServicePayReturnArgs) InitDefault() {
	*p = PayServicePayReturnArgs{}
}

var PayServicePayReturnArgs_Req_DEFAULT *MallPayReturnRequest

func (p *PayServicePayReturnArgs) GetReq() (v *MallPayReturnRequest) {
	if !p.IsSetReq() {
		return PayServicePayReturnArgs_Req_DEFAULT
	}
	return p.Req
}
func (p *PayServicePayReturnArgs) SetReq(val *MallPayReturnRequest) {
	p.Req = val
}

var fieldIDToName_PayServicePayReturnArgs = map[int16]string{
	1: "req",
}

func (p *PayServicePayReturnArgs) IsSetReq() bool {
	return p.Req != nil
}

func (p *PayServicePayReturnArgs) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PayServicePayReturnArgs[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *PayServicePayReturnArgs) ReadField1(iprot thrift.TProtocol) error {
	p.Req = NewMallPayReturnRequest()
	if err := p.Req.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *PayServicePayReturnArgs) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("PayReturn_args"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *PayServicePayReturnArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Req.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *PayServicePayReturnArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("PayServicePayReturnArgs(%+v)", *p)
}

func (p *PayServicePayReturnArgs) DeepEqual(ano *PayServicePayReturnArgs) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Req) {
		return false
	}
	return true
}

func (p *PayServicePayReturnArgs) Field1DeepEqual(src *MallPayReturnRequest) bool {

	if !p.Req.DeepEqual(src) {
		return false
	}
	return true
}

type PayServicePayReturnResult struct {
	Success *MallPayReturnResponse `thrift:"success,0,optional" frugal:"0,optional,MallPayReturnResponse" json:"success,omitempty"`
}

func NewPayServicePayReturnResult() *PayServicePayReturnResult {
	return &PayServicePayReturnResult{}
}

func (p *PayServicePayReturnResult) InitDefault() {
	*p = PayServicePayReturnResult{}
}

var PayServicePayReturnResult_Success_DEFAULT *MallPayReturnResponse

func (p *PayServicePayReturnResult) GetSuccess() (v *MallPayReturnResponse) {
	if !p.IsSetSuccess() {
		return PayServicePayReturnResult_Success_DEFAULT
	}
	return p.Success
}
func (p *PayServicePayReturnResult) SetSuccess(x interface{}) {
	p.Success = x.(*MallPayReturnResponse)
}

var fieldIDToName_PayServicePayReturnResult = map[int16]string{
	0: "success",
}

func (p *PayServicePayReturnResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *PayServicePayReturnResult) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 0:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField0(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PayServicePayReturnResult[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *PayServicePayReturnResult) ReadField0(iprot thrift.TProtocol) error {
	p.Success = NewMallPayReturnResponse()
	if err := p.Success.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *PayServicePayReturnResult) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("PayReturn_result"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField0(oprot); err != nil {
			fieldId = 0
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *PayServicePayReturnResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Success.Write(oprot); err != nil {
			return err
		}
		if err = oprot.WriteFieldEnd(); err != nil {
			goto WriteFieldEndError
		}
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err)
}

func (p *PayServicePayReturnResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("PayServicePayReturnResult(%+v)", *p)
}

func (p *PayServicePayReturnResult) DeepEqual(ano *PayServicePayReturnResult) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field0DeepEqual(ano.Success) {
		return false
	}
	return true
}

func (p *PayServicePayReturnResult) Field0DeepEqual(src *MallPayReturnResponse) bool {

	if !p.Success.DeepEqual(src) {
		return false
	}
	return true
}

type PayServicePayNotifyArgs struct {
	Req *MallPayNotifyRequest `thrift:"req,1" frugal:"1,default,MallPayNotifyRequest" json:"req"`
}

func NewPayServicePayNotifyArgs() *PayServicePayNotifyArgs {
	return &PayServicePayNotifyArgs{}
}

func (p *PayServicePayNotifyArgs) InitDefault() {
	*p = PayServicePayNotifyArgs{}
}

var PayServicePayNotifyArgs_Req_DEFAULT *MallPayNotifyRequest

func (p *PayServicePayNotifyArgs) GetReq() (v *MallPayNotifyRequest) {
	if !p.IsSetReq() {
		return PayServicePayNotifyArgs_Req_DEFAULT
	}
	return p.Req
}
func (p *PayServicePayNotifyArgs) SetReq(val *MallPayNotifyRequest) {
	p.Req = val
}

var fieldIDToName_PayServicePayNotifyArgs = map[int16]string{
	1: "req",
}

func (p *PayServicePayNotifyArgs) IsSetReq() bool {
	return p.Req != nil
}

func (p *PayServicePayNotifyArgs) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PayServicePayNotifyArgs[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *PayServicePayNotifyArgs) ReadField1(iprot thrift.TProtocol) error {
	p.Req = NewMallPayNotifyRequest()
	if err := p.Req.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *PayServicePayNotifyArgs) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("PayNotify_args"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *PayServicePayNotifyArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Req.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *PayServicePayNotifyArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("PayServicePayNotifyArgs(%+v)", *p)
}

func (p *PayServicePayNotifyArgs) DeepEqual(ano *PayServicePayNotifyArgs) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Req) {
		return false
	}
	return true
}

func (p *PayServicePayNotifyArgs) Field1DeepEqual(src *MallPayNotifyRequest) bool {

	if !p.Req.DeepEqual(src) {
		return false
	}
	return true
}

type PayServicePayNotifyResult struct {
	Success *MallPayNotifyResponse `thrift:"success,0,optional" frugal:"0,optional,MallPayNotifyResponse" json:"success,omitempty"`
}

func NewPayServicePayNotifyResult() *PayServicePayNotifyResult {
	return &PayServicePayNotifyResult{}
}

func (p *PayServicePayNotifyResult) InitDefault() {
	*p = PayServicePayNotifyResult{}
}

var PayServicePayNotifyResult_Success_DEFAULT *MallPayNotifyResponse

func (p *PayServicePayNotifyResult) GetSuccess() (v *MallPayNotifyResponse) {
	if !p.IsSetSuccess() {
		return PayServicePayNotifyResult_Success_DEFAULT
	}
	return p.Success
}
func (p *PayServicePayNotifyResult) SetSuccess(x interface{}) {
	p.Success = x.(*MallPayNotifyResponse)
}

var fieldIDToName_PayServicePayNotifyResult = map[int16]string{
	0: "success",
}

func (p *PayServicePayNotifyResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *PayServicePayNotifyResult) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 0:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField0(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PayServicePayNotifyResult[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *PayServicePayNotifyResult) ReadField0(iprot thrift.TProtocol) error {
	p.Success = NewMallPayNotifyResponse()
	if err := p.Success.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *PayServicePayNotifyResult) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("PayNotify_result"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField0(oprot); err != nil {
			fieldId = 0
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *PayServicePayNotifyResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Success.Write(oprot); err != nil {
			return err
		}
		if err = oprot.WriteFieldEnd(); err != nil {
			goto WriteFieldEndError
		}
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err)
}

func (p *PayServicePayNotifyResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("PayServicePayNotifyResult(%+v)", *p)
}

func (p *PayServicePayNotifyResult) DeepEqual(ano *PayServicePayNotifyResult) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field0DeepEqual(ano.Success) {
		return false
	}
	return true
}

func (p *PayServicePayNotifyResult) Field0DeepEqual(src *MallPayNotifyResponse) bool {

	if !p.Success.DeepEqual(src) {
		return false
	}
	return true
}
