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

package operate

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

type MallFavoriteProductRequest struct {
	UserId    int64 `thrift:"user_id,1" frugal:"1,default,i64" json:"user_id"`
	ProductId int64 `thrift:"product_id,2" frugal:"2,default,i64" json:"product_id"`
}

func NewMallFavoriteProductRequest() *MallFavoriteProductRequest {
	return &MallFavoriteProductRequest{}
}

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

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

func (p *MallFavoriteProductRequest) GetProductId() (v int64) {
	return p.ProductId
}
func (p *MallFavoriteProductRequest) SetUserId(val int64) {
	p.UserId = val
}
func (p *MallFavoriteProductRequest) SetProductId(val int64) {
	p.ProductId = val
}

var fieldIDToName_MallFavoriteProductRequest = map[int16]string{
	1: "user_id",
	2: "product_id",
}

func (p *MallFavoriteProductRequest) 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
				}
			}
		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_MallFavoriteProductRequest[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 *MallFavoriteProductRequest) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return err
	} else {
		p.UserId = v
	}
	return nil
}

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

func (p *MallFavoriteProductRequest) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("mall_favorite_product_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 = 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 *MallFavoriteProductRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("user_id", thrift.I64, 1); 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 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *MallFavoriteProductRequest) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("product_id", thrift.I64, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI64(p.ProductId); 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 *MallFavoriteProductRequest) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("MallFavoriteProductRequest(%+v)", *p)
}

func (p *MallFavoriteProductRequest) DeepEqual(ano *MallFavoriteProductRequest) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.UserId) {
		return false
	}
	if !p.Field2DeepEqual(ano.ProductId) {
		return false
	}
	return true
}

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

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

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

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

func NewMallFavoriteProductResponse() *MallFavoriteProductResponse {
	return &MallFavoriteProductResponse{}
}

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

var MallFavoriteProductResponse_CommonResp_DEFAULT *common.CommonResponse

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

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

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

func (p *MallFavoriteProductResponse) 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_MallFavoriteProductResponse[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 *MallFavoriteProductResponse) ReadField1(iprot thrift.TProtocol) error {
	p.CommonResp = common.NewCommonResponse()
	if err := p.CommonResp.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *MallFavoriteProductResponse) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("mall_favorite_product_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 *MallFavoriteProductResponse) 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 *MallFavoriteProductResponse) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("MallFavoriteProductResponse(%+v)", *p)
}

func (p *MallFavoriteProductResponse) DeepEqual(ano *MallFavoriteProductResponse) 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 *MallFavoriteProductResponse) Field1DeepEqual(src *common.CommonResponse) bool {

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

type MallGetProductOperateInfoRequest struct {
	UserId    int64 `thrift:"user_id,1" frugal:"1,default,i64" json:"user_id"`
	ProductId int64 `thrift:"product_id,2" frugal:"2,default,i64" json:"product_id"`
}

func NewMallGetProductOperateInfoRequest() *MallGetProductOperateInfoRequest {
	return &MallGetProductOperateInfoRequest{}
}

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

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

func (p *MallGetProductOperateInfoRequest) GetProductId() (v int64) {
	return p.ProductId
}
func (p *MallGetProductOperateInfoRequest) SetUserId(val int64) {
	p.UserId = val
}
func (p *MallGetProductOperateInfoRequest) SetProductId(val int64) {
	p.ProductId = val
}

var fieldIDToName_MallGetProductOperateInfoRequest = map[int16]string{
	1: "user_id",
	2: "product_id",
}

func (p *MallGetProductOperateInfoRequest) 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
				}
			}
		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_MallGetProductOperateInfoRequest[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 *MallGetProductOperateInfoRequest) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return err
	} else {
		p.UserId = v
	}
	return nil
}

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

func (p *MallGetProductOperateInfoRequest) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("mall_get_product_operate_info_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 = 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 *MallGetProductOperateInfoRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("user_id", thrift.I64, 1); 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 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *MallGetProductOperateInfoRequest) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("product_id", thrift.I64, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI64(p.ProductId); 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 *MallGetProductOperateInfoRequest) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("MallGetProductOperateInfoRequest(%+v)", *p)
}

func (p *MallGetProductOperateInfoRequest) DeepEqual(ano *MallGetProductOperateInfoRequest) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.UserId) {
		return false
	}
	if !p.Field2DeepEqual(ano.ProductId) {
		return false
	}
	return true
}

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

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

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

type MallGetProductOperateInfoResponse struct {
	CommonResp  *common.CommonResponse     `thrift:"common_resp,1" frugal:"1,default,common.CommonResponse" json:"common_resp"`
	OperateInfo *common.ProductOperateInfo `thrift:"operate_info,2" frugal:"2,default,common.ProductOperateInfo" json:"operate_info"`
}

func NewMallGetProductOperateInfoResponse() *MallGetProductOperateInfoResponse {
	return &MallGetProductOperateInfoResponse{}
}

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

var MallGetProductOperateInfoResponse_CommonResp_DEFAULT *common.CommonResponse

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

var MallGetProductOperateInfoResponse_OperateInfo_DEFAULT *common.ProductOperateInfo

func (p *MallGetProductOperateInfoResponse) GetOperateInfo() (v *common.ProductOperateInfo) {
	if !p.IsSetOperateInfo() {
		return MallGetProductOperateInfoResponse_OperateInfo_DEFAULT
	}
	return p.OperateInfo
}
func (p *MallGetProductOperateInfoResponse) SetCommonResp(val *common.CommonResponse) {
	p.CommonResp = val
}
func (p *MallGetProductOperateInfoResponse) SetOperateInfo(val *common.ProductOperateInfo) {
	p.OperateInfo = val
}

var fieldIDToName_MallGetProductOperateInfoResponse = map[int16]string{
	1: "common_resp",
	2: "operate_info",
}

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

func (p *MallGetProductOperateInfoResponse) IsSetOperateInfo() bool {
	return p.OperateInfo != nil
}

func (p *MallGetProductOperateInfoResponse) 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_MallGetProductOperateInfoResponse[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 *MallGetProductOperateInfoResponse) ReadField1(iprot thrift.TProtocol) error {
	p.CommonResp = common.NewCommonResponse()
	if err := p.CommonResp.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *MallGetProductOperateInfoResponse) ReadField2(iprot thrift.TProtocol) error {
	p.OperateInfo = common.NewProductOperateInfo()
	if err := p.OperateInfo.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *MallGetProductOperateInfoResponse) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("mall_get_product_operate_info_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 *MallGetProductOperateInfoResponse) 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 *MallGetProductOperateInfoResponse) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("operate_info", thrift.STRUCT, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.OperateInfo.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 *MallGetProductOperateInfoResponse) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("MallGetProductOperateInfoResponse(%+v)", *p)
}

func (p *MallGetProductOperateInfoResponse) DeepEqual(ano *MallGetProductOperateInfoResponse) 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.OperateInfo) {
		return false
	}
	return true
}

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

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

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

type OperateService interface {
	FavoriteProduct(ctx context.Context, req *MallFavoriteProductRequest) (r *MallFavoriteProductResponse, err error)

	GetProductOperateInfo(ctx context.Context, req *MallGetProductOperateInfoRequest) (r *MallGetProductOperateInfoResponse, err error)
}

type OperateServiceClient struct {
	c thrift.TClient
}

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

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

func NewOperateServiceClient(c thrift.TClient) *OperateServiceClient {
	return &OperateServiceClient{
		c: c,
	}
}

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

func (p *OperateServiceClient) FavoriteProduct(ctx context.Context, req *MallFavoriteProductRequest) (r *MallFavoriteProductResponse, err error) {
	var _args OperateServiceFavoriteProductArgs
	_args.Req = req
	var _result OperateServiceFavoriteProductResult
	if err = p.Client_().Call(ctx, "FavoriteProduct", &_args, &_result); err != nil {
		return
	}
	return _result.GetSuccess(), nil
}
func (p *OperateServiceClient) GetProductOperateInfo(ctx context.Context, req *MallGetProductOperateInfoRequest) (r *MallGetProductOperateInfoResponse, err error) {
	var _args OperateServiceGetProductOperateInfoArgs
	_args.Req = req
	var _result OperateServiceGetProductOperateInfoResult
	if err = p.Client_().Call(ctx, "GetProductOperateInfo", &_args, &_result); err != nil {
		return
	}
	return _result.GetSuccess(), nil
}

type OperateServiceProcessor struct {
	processorMap map[string]thrift.TProcessorFunction
	handler      OperateService
}

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

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

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

func NewOperateServiceProcessor(handler OperateService) *OperateServiceProcessor {
	self := &OperateServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)}
	self.AddToProcessorMap("FavoriteProduct", &operateServiceProcessorFavoriteProduct{handler: handler})
	self.AddToProcessorMap("GetProductOperateInfo", &operateServiceProcessorGetProductOperateInfo{handler: handler})
	return self
}
func (p *OperateServiceProcessor) 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 operateServiceProcessorFavoriteProduct struct {
	handler OperateService
}

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

	iprot.ReadMessageEnd()
	var err2 error
	result := OperateServiceFavoriteProductResult{}
	var retval *MallFavoriteProductResponse
	if retval, err2 = p.handler.FavoriteProduct(ctx, args.Req); err2 != nil {
		x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing FavoriteProduct: "+err2.Error())
		oprot.WriteMessageBegin("FavoriteProduct", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return true, err2
	} else {
		result.Success = retval
	}
	if err2 = oprot.WriteMessageBegin("FavoriteProduct", 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 operateServiceProcessorGetProductOperateInfo struct {
	handler OperateService
}

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

	iprot.ReadMessageEnd()
	var err2 error
	result := OperateServiceGetProductOperateInfoResult{}
	var retval *MallGetProductOperateInfoResponse
	if retval, err2 = p.handler.GetProductOperateInfo(ctx, args.Req); err2 != nil {
		x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetProductOperateInfo: "+err2.Error())
		oprot.WriteMessageBegin("GetProductOperateInfo", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return true, err2
	} else {
		result.Success = retval
	}
	if err2 = oprot.WriteMessageBegin("GetProductOperateInfo", 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 OperateServiceFavoriteProductArgs struct {
	Req *MallFavoriteProductRequest `thrift:"req,1" frugal:"1,default,MallFavoriteProductRequest" json:"req"`
}

func NewOperateServiceFavoriteProductArgs() *OperateServiceFavoriteProductArgs {
	return &OperateServiceFavoriteProductArgs{}
}

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

var OperateServiceFavoriteProductArgs_Req_DEFAULT *MallFavoriteProductRequest

func (p *OperateServiceFavoriteProductArgs) GetReq() (v *MallFavoriteProductRequest) {
	if !p.IsSetReq() {
		return OperateServiceFavoriteProductArgs_Req_DEFAULT
	}
	return p.Req
}
func (p *OperateServiceFavoriteProductArgs) SetReq(val *MallFavoriteProductRequest) {
	p.Req = val
}

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

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

func (p *OperateServiceFavoriteProductArgs) 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_OperateServiceFavoriteProductArgs[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 *OperateServiceFavoriteProductArgs) ReadField1(iprot thrift.TProtocol) error {
	p.Req = NewMallFavoriteProductRequest()
	if err := p.Req.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *OperateServiceFavoriteProductArgs) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("FavoriteProduct_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 *OperateServiceFavoriteProductArgs) 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 *OperateServiceFavoriteProductArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("OperateServiceFavoriteProductArgs(%+v)", *p)
}

func (p *OperateServiceFavoriteProductArgs) DeepEqual(ano *OperateServiceFavoriteProductArgs) 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 *OperateServiceFavoriteProductArgs) Field1DeepEqual(src *MallFavoriteProductRequest) bool {

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

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

func NewOperateServiceFavoriteProductResult() *OperateServiceFavoriteProductResult {
	return &OperateServiceFavoriteProductResult{}
}

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

var OperateServiceFavoriteProductResult_Success_DEFAULT *MallFavoriteProductResponse

func (p *OperateServiceFavoriteProductResult) GetSuccess() (v *MallFavoriteProductResponse) {
	if !p.IsSetSuccess() {
		return OperateServiceFavoriteProductResult_Success_DEFAULT
	}
	return p.Success
}
func (p *OperateServiceFavoriteProductResult) SetSuccess(x interface{}) {
	p.Success = x.(*MallFavoriteProductResponse)
}

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

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

func (p *OperateServiceFavoriteProductResult) 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_OperateServiceFavoriteProductResult[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 *OperateServiceFavoriteProductResult) ReadField0(iprot thrift.TProtocol) error {
	p.Success = NewMallFavoriteProductResponse()
	if err := p.Success.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *OperateServiceFavoriteProductResult) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("FavoriteProduct_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 *OperateServiceFavoriteProductResult) 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 *OperateServiceFavoriteProductResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("OperateServiceFavoriteProductResult(%+v)", *p)
}

func (p *OperateServiceFavoriteProductResult) DeepEqual(ano *OperateServiceFavoriteProductResult) 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 *OperateServiceFavoriteProductResult) Field0DeepEqual(src *MallFavoriteProductResponse) bool {

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

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

func NewOperateServiceGetProductOperateInfoArgs() *OperateServiceGetProductOperateInfoArgs {
	return &OperateServiceGetProductOperateInfoArgs{}
}

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

var OperateServiceGetProductOperateInfoArgs_Req_DEFAULT *MallGetProductOperateInfoRequest

func (p *OperateServiceGetProductOperateInfoArgs) GetReq() (v *MallGetProductOperateInfoRequest) {
	if !p.IsSetReq() {
		return OperateServiceGetProductOperateInfoArgs_Req_DEFAULT
	}
	return p.Req
}
func (p *OperateServiceGetProductOperateInfoArgs) SetReq(val *MallGetProductOperateInfoRequest) {
	p.Req = val
}

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

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

func (p *OperateServiceGetProductOperateInfoArgs) 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_OperateServiceGetProductOperateInfoArgs[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 *OperateServiceGetProductOperateInfoArgs) ReadField1(iprot thrift.TProtocol) error {
	p.Req = NewMallGetProductOperateInfoRequest()
	if err := p.Req.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *OperateServiceGetProductOperateInfoArgs) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("GetProductOperateInfo_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 *OperateServiceGetProductOperateInfoArgs) 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 *OperateServiceGetProductOperateInfoArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("OperateServiceGetProductOperateInfoArgs(%+v)", *p)
}

func (p *OperateServiceGetProductOperateInfoArgs) DeepEqual(ano *OperateServiceGetProductOperateInfoArgs) 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 *OperateServiceGetProductOperateInfoArgs) Field1DeepEqual(src *MallGetProductOperateInfoRequest) bool {

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

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

func NewOperateServiceGetProductOperateInfoResult() *OperateServiceGetProductOperateInfoResult {
	return &OperateServiceGetProductOperateInfoResult{}
}

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

var OperateServiceGetProductOperateInfoResult_Success_DEFAULT *MallGetProductOperateInfoResponse

func (p *OperateServiceGetProductOperateInfoResult) GetSuccess() (v *MallGetProductOperateInfoResponse) {
	if !p.IsSetSuccess() {
		return OperateServiceGetProductOperateInfoResult_Success_DEFAULT
	}
	return p.Success
}
func (p *OperateServiceGetProductOperateInfoResult) SetSuccess(x interface{}) {
	p.Success = x.(*MallGetProductOperateInfoResponse)
}

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

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

func (p *OperateServiceGetProductOperateInfoResult) 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_OperateServiceGetProductOperateInfoResult[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 *OperateServiceGetProductOperateInfoResult) ReadField0(iprot thrift.TProtocol) error {
	p.Success = NewMallGetProductOperateInfoResponse()
	if err := p.Success.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *OperateServiceGetProductOperateInfoResult) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("GetProductOperateInfo_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 *OperateServiceGetProductOperateInfoResult) 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 *OperateServiceGetProductOperateInfoResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("OperateServiceGetProductOperateInfoResult(%+v)", *p)
}

func (p *OperateServiceGetProductOperateInfoResult) DeepEqual(ano *OperateServiceGetProductOperateInfoResult) 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 *OperateServiceGetProductOperateInfoResult) Field0DeepEqual(src *MallGetProductOperateInfoResponse) bool {

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