diff --git a/idl/author/author_api.thrift b/idl/author/author_api.thrift new file mode 100644 index 0000000..97ca6a4 --- /dev/null +++ b/idl/author/author_api.thrift @@ -0,0 +1,5 @@ +include "../base/base.thrift" +include "../base/pagination.thrift" +include "model/author_model.thrift" +namespace go sc_bff_api + diff --git a/idl/author/model/author_model.thrift b/idl/author/model/author_model.thrift new file mode 100644 index 0000000..765f033 --- /dev/null +++ b/idl/author/model/author_model.thrift @@ -0,0 +1,11 @@ +namespace go sc_bff_api + + +//作者模型 +struct AuthorDTO { + 1: i64 id //id + 2: i64 createTime //创建时间 + 3: i64 updateTime //编辑时间 + 4: string username //昵称 + 5: string realname //真名 +} diff --git a/idl/column/column_api.thrift b/idl/column/column_api.thrift new file mode 100644 index 0000000..f2837e2 --- /dev/null +++ b/idl/column/column_api.thrift @@ -0,0 +1,54 @@ +include "../base/base.thrift" +include "../base/pagination.thrift" +include "model/column_model.thrift" +namespace go sc_bff_api + +//请求体 +struct ColumnOmnibusRequest { + 1: string authorName //作者名 + 2: string columnName //专栏名 + 3: i64 columnPrice //专栏价格 + + 255: optional base.Base base //标准请求内容 +} + +//响应体 +struct ColumnOmnibusResponse { + + 255: base.BaseResp baseResp //标准返回内容 + + +} + +//专栏列表 请求体 +struct ColumnPageRequest { + 1: i64 pageNum //当前页码 1基 + 2: i64 pageSize //每页大小 + 4: optional string name //名称 + 5: optional i64 authorId //作者id + 6: optional i32 status //状态 + + 255: optional base.Base base //标准请求内容 +} + +//专栏列表 响应体 +struct ColumnPageResponse { + 1: list data //数据信息 + 2: pagination.Pagination pagination //分页指示器 + + 255: base.BaseResp baseResp //标准返回内容 +} + +//专栏详情 请求体 +struct ColumnDetailRequest { + 1: i64 id //专栏Id + + 255: optional base.Base base //标准请求内容 +} + +//专栏详情 响应体 +struct ColumnDetailResponse { + 1: column_model.ColumnDTO data //数据信息 + + 255: base.BaseResp baseResp //标准返回内容 +} diff --git a/idl/column/model/column_model.thrift b/idl/column/model/column_model.thrift new file mode 100644 index 0000000..c82d8b6 --- /dev/null +++ b/idl/column/model/column_model.thrift @@ -0,0 +1,24 @@ +include "../../author/model/author_model.thrift" +include "../../column_quote/model/column_quote_model.thrift" +include "../../subscription/model/subscription_model.thrift" +namespace go sc_bff_api + + +//专栏模型 +struct ColumnDTO { + 1: i64 id //id + 2: i64 createTime //创建时间 + 3: i64 updateTime //编辑时间 + 4: string name //名称 + 5: i64 authorId //作者id + 6: i32 status //状态 +} + + +//富专栏模型 +struct RickColumnDTO { + 1: ColumnDTO column //专栏本身 + 2: author_model.AuthorDTO author //关联的作者 + 3: column_quote_model.ColumnQuoteDTO columnQuote //关联的报价 + 4: subscription_model.SubscriptionDTO subscription //关联的订阅情况 +} \ No newline at end of file diff --git a/idl/column_quote/column_quote_api.thrift b/idl/column_quote/column_quote_api.thrift new file mode 100644 index 0000000..c9ec988 --- /dev/null +++ b/idl/column_quote/column_quote_api.thrift @@ -0,0 +1,5 @@ +include "../base/base.thrift" +include "../base/pagination.thrift" +include "model/column_quote_model.thrift" +namespace go sc_bff_api + diff --git a/idl/column_quote/model/column_quote_model.thrift b/idl/column_quote/model/column_quote_model.thrift new file mode 100644 index 0000000..3304061 --- /dev/null +++ b/idl/column_quote/model/column_quote_model.thrift @@ -0,0 +1,13 @@ +namespace go sc_bff_api + + +//专栏报价模型 +struct ColumnQuoteDTO { + 1: i64 id //id + 2: i64 createTime //创建时间 + 3: i64 updateTime //编辑时间 + 4: i64 columnId //专栏id + 5: i64 editor //编辑id + 6: i64 price //价格 + 7: i32 status //状态 +} diff --git a/idl/payment/model/payment_model.thrift b/idl/payment/model/payment_model.thrift new file mode 100644 index 0000000..c082f26 --- /dev/null +++ b/idl/payment/model/payment_model.thrift @@ -0,0 +1,15 @@ +namespace go sc_bff_api + + +//支付单模型 +struct PaymentDTO { + 1: i64 id //id + 2: i64 createTime //创建时间 + 3: i64 updateTime //编辑时间 + + 4: string orderNo //订单编号 + 5: string method //支付方式 ALIPAY/WEIXIN 支付宝/微信 + 6: string thirdTransactionNo //支付平台订单号 + 7: i64 amount //金额(单位:分) + 8: i32 status //支付状态 0/1/2 未支付/已支付/已关闭 +} diff --git a/idl/payment/payment_api.thrift b/idl/payment/payment_api.thrift new file mode 100644 index 0000000..199fe2b --- /dev/null +++ b/idl/payment/payment_api.thrift @@ -0,0 +1,19 @@ +include "../base/base.thrift" +include "../base/pagination.thrift" +include "model/payment_model.thrift" +namespace go sc_bff_api + + +// 请求体 +struct PaymentPaidCallbackRequest { + 1: string orderNo //订单编号 + + 255: optional base.Base base //标准请求内容 +} + +// 响应体 +struct PaymentPaidCallbackResponse { + 1: payment_model.PaymentDTO payment //数据信息 + + 255: base.BaseResp baseResp //标准返回内容 +} diff --git a/idl/reader/enums/enums.thrift b/idl/reader/enums/enums.thrift deleted file mode 100644 index 85a25ce..0000000 --- a/idl/reader/enums/enums.thrift +++ /dev/null @@ -1 +0,0 @@ -namespace go sc_misc_api diff --git a/idl/reader/model/model.thrift b/idl/reader/model/reader_model.thrift similarity index 86% rename from idl/reader/model/model.thrift rename to idl/reader/model/reader_model.thrift index defc576..88bb257 100644 --- a/idl/reader/model/model.thrift +++ b/idl/reader/model/reader_model.thrift @@ -1,5 +1,5 @@ -namespace go sc_misc_api +namespace go sc_bff_api //读者模型 diff --git a/idl/reader/reader_api.thrift b/idl/reader/reader_api.thrift index 76b17e6..083bc84 100644 --- a/idl/reader/reader_api.thrift +++ b/idl/reader/reader_api.thrift @@ -1,20 +1,19 @@ include "../base/base.thrift" include "../base/pagination.thrift" -include "enums/enums.thrift" -include "model/model.thrift" +include "model/reader_model.thrift" namespace go sc_misc_api //读者登录 请求体 struct ReaderLoginRequest { - 1: string username (go.tag="json:\"username\" query:\"username\"") //用户名 - 2: string password (go.tag="json:\"password\" query:\"password\"") //密码 + 1: string username //用户名 + 2: string password //密码 255: optional base.Base base //标准请求内容 } //读者登录 响应体 struct ReaderLoginResponse { - 1: model.ReaderDTO data //数据信息 + 1: reader_model.ReaderDTO data //数据信息 255: base.BaseResp baseResp //标准返回内容 diff --git a/idl/smart_classroom_misc.thrift b/idl/smart_classroom_misc.thrift index b615b2f..16aea3a 100644 --- a/idl/smart_classroom_misc.thrift +++ b/idl/smart_classroom_misc.thrift @@ -1,14 +1,52 @@ include "./reader/reader_api.thrift" include "./editor/editor_api.thrift" +include "./column/column_api.thrift" +include "./payment/payment_api.thrift" namespace go sc_misc_api //定义misc应用中的所有RPC服务 service MiscService { + + //**************** 专栏START ****************// + //演示接口 创建专栏等相关所有实体 + column_api.ColumnOmnibusResponse ColumnOmnibus(1: column_api.ColumnOmnibusRequest request) + + //查看专栏列表 + column_api.ColumnPageResponse ColumnPage(1: column_api.ColumnPageRequest request) + + //查看专栏详情 + column_api.ColumnDetailResponse ColumnDetail(1: column_api.ColumnDetailRequest request) + + + //**************** 专栏END ****************// + + + //**************** 小编START ****************// + + //小编登录 + editor_api.EditorLoginResponse EditorLogin(1: editor_api.EditorLoginRequest request) + + + + //**************** 小编END ****************// + + + + //**************** 读者START ****************// + //读者登录 reader_api.ReaderLoginResponse ReaderLogin(1: reader_api.ReaderLoginRequest request) - //编辑登录 - editor_api.EditorLoginResponse EditorLogin(1: editor_api.EditorLoginRequest request) + //**************** 读者END ****************// + + + //**************** 支付单START ****************// + + //第三方支付平台,支付成功后的回调接口。 + payment_api.PaymentPaidCallbackResponse PaymentPaidCallback(1: payment_api.PaymentPaidCallbackRequest request) + + + //**************** 支付单END ****************// } diff --git a/idl/subscription/enums/enums.thrift b/idl/subscription/enums/subscription_enums.thrift similarity index 83% rename from idl/subscription/enums/enums.thrift rename to idl/subscription/enums/subscription_enums.thrift index a47d8a5..5cec2c3 100644 --- a/idl/subscription/enums/enums.thrift +++ b/idl/subscription/enums/subscription_enums.thrift @@ -1,5 +1,4 @@ -namespace go sc_misc_api - +namespace go sc_bff_api //订阅状态 enum SubscriptionStatus { diff --git a/idl/subscription/model/model.thrift b/idl/subscription/model/subscription_model.thrift similarity index 64% rename from idl/subscription/model/model.thrift rename to idl/subscription/model/subscription_model.thrift index 10dd72a..18d15b6 100644 --- a/idl/subscription/model/model.thrift +++ b/idl/subscription/model/subscription_model.thrift @@ -1,5 +1,5 @@ -include "../enums/enums.thrift" -namespace go sc_misc_api +include "../enums/subscription_enums.thrift" +namespace go sc_bff_api //订阅模型 @@ -10,5 +10,6 @@ struct SubscriptionDTO { 4: i64 readerId, //读者id 5: i64 columnId, //专栏id 6: i64 orderId, //订单id - 7: enums.SubscriptionStatus status, //状态 + 7: subscription_enums.SubscriptionStatus status, //状态 } + diff --git a/idl/subscription/subscription_api.thrift b/idl/subscription/subscription_api.thrift index bc649ca..d8babd9 100644 --- a/idl/subscription/subscription_api.thrift +++ b/idl/subscription/subscription_api.thrift @@ -1,26 +1,2 @@ -include "../base/base.thrift" -include "../base/pagination.thrift" -include "enums/enums.thrift" -include "model/model.thrift" -namespace go sc_misc_api -//订阅列表 请求体 -struct SubscriptionListRequest { - 1: i64 pageNum //当前页码 1基 - 2: i64 pageSize //每页大小 - 3: optional i64 readerId //读者id - 4: optional i64 columnId //专栏id - 5: optional i64 orderId //订单id - 6: optional i32 status //状态 - - 255: optional base.Base base //标准请求内容 -} - -//订阅列表 响应体 -struct SubscriptionListResponse { - 1: list data //数据信息 - 2: pagination.Pagination pagination //分页指示器 - - 255: base.BaseResp baseResp //标准返回内容 - -} +namespace go sc_bff_api diff --git a/kitex_gen/sc_bff_api/author_model.go b/kitex_gen/sc_bff_api/author_model.go new file mode 100644 index 0000000..fea74de --- /dev/null +++ b/kitex_gen/sc_bff_api/author_model.go @@ -0,0 +1,409 @@ +// Code generated by thriftgo (0.3.12). DO NOT EDIT. + +package sc_bff_api + +import ( + "fmt" + "github.com/apache/thrift/lib/go/thrift" + "strings" +) + +type AuthorDTO struct { + Id int64 `thrift:"id,1" frugal:"1,default,i64" json:"id"` + CreateTime int64 `thrift:"createTime,2" frugal:"2,default,i64" json:"createTime"` + UpdateTime int64 `thrift:"updateTime,3" frugal:"3,default,i64" json:"updateTime"` + Username string `thrift:"username,4" frugal:"4,default,string" json:"username"` + Realname string `thrift:"realname,5" frugal:"5,default,string" json:"realname"` +} + +func NewAuthorDTO() *AuthorDTO { + return &AuthorDTO{} +} + +func (p *AuthorDTO) InitDefault() { + *p = AuthorDTO{} +} + +func (p *AuthorDTO) GetId() (v int64) { + return p.Id +} + +func (p *AuthorDTO) GetCreateTime() (v int64) { + return p.CreateTime +} + +func (p *AuthorDTO) GetUpdateTime() (v int64) { + return p.UpdateTime +} + +func (p *AuthorDTO) GetUsername() (v string) { + return p.Username +} + +func (p *AuthorDTO) GetRealname() (v string) { + return p.Realname +} +func (p *AuthorDTO) SetId(val int64) { + p.Id = val +} +func (p *AuthorDTO) SetCreateTime(val int64) { + p.CreateTime = val +} +func (p *AuthorDTO) SetUpdateTime(val int64) { + p.UpdateTime = val +} +func (p *AuthorDTO) SetUsername(val string) { + p.Username = val +} +func (p *AuthorDTO) SetRealname(val string) { + p.Realname = val +} + +var fieldIDToName_AuthorDTO = map[int16]string{ + 1: "id", + 2: "createTime", + 3: "updateTime", + 4: "username", + 5: "realname", +} + +func (p *AuthorDTO) 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.STRING { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.STRING { + 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_AuthorDTO[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 *AuthorDTO) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Id = _field + return nil +} +func (p *AuthorDTO) ReadField2(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.CreateTime = _field + return nil +} +func (p *AuthorDTO) ReadField3(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.UpdateTime = _field + return nil +} +func (p *AuthorDTO) ReadField4(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Username = _field + return nil +} +func (p *AuthorDTO) ReadField5(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Realname = _field + return nil +} + +func (p *AuthorDTO) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("AuthorDTO"); 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 *AuthorDTO) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.Id); 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 *AuthorDTO) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("createTime", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.CreateTime); 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 *AuthorDTO) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("updateTime", thrift.I64, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.UpdateTime); 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 *AuthorDTO) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("username", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Username); 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 *AuthorDTO) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("realname", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Realname); 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 *AuthorDTO) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuthorDTO(%+v)", *p) + +} + +func (p *AuthorDTO) DeepEqual(ano *AuthorDTO) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Id) { + return false + } + if !p.Field2DeepEqual(ano.CreateTime) { + return false + } + if !p.Field3DeepEqual(ano.UpdateTime) { + return false + } + if !p.Field4DeepEqual(ano.Username) { + return false + } + if !p.Field5DeepEqual(ano.Realname) { + return false + } + return true +} + +func (p *AuthorDTO) Field1DeepEqual(src int64) bool { + + if p.Id != src { + return false + } + return true +} +func (p *AuthorDTO) Field2DeepEqual(src int64) bool { + + if p.CreateTime != src { + return false + } + return true +} +func (p *AuthorDTO) Field3DeepEqual(src int64) bool { + + if p.UpdateTime != src { + return false + } + return true +} +func (p *AuthorDTO) Field4DeepEqual(src string) bool { + + if strings.Compare(p.Username, src) != 0 { + return false + } + return true +} +func (p *AuthorDTO) Field5DeepEqual(src string) bool { + + if strings.Compare(p.Realname, src) != 0 { + return false + } + return true +} diff --git a/kitex_gen/sc_bff_api/column_api.go b/kitex_gen/sc_bff_api/column_api.go new file mode 100644 index 0000000..945ac0c --- /dev/null +++ b/kitex_gen/sc_bff_api/column_api.go @@ -0,0 +1,1829 @@ +// Code generated by thriftgo (0.3.12). DO NOT EDIT. + +package sc_bff_api + +import ( + "fmt" + "github.com/apache/thrift/lib/go/thrift" + "github.com/eyebluecn/sc-misc-idl/kitex_gen/sc_misc_base" + "strings" +) + +type ColumnOmnibusRequest struct { + AuthorName string `thrift:"authorName,1" frugal:"1,default,string" json:"authorName"` + ColumnName string `thrift:"columnName,2" frugal:"2,default,string" json:"columnName"` + ColumnPrice int64 `thrift:"columnPrice,3" frugal:"3,default,i64" json:"columnPrice"` + Base *sc_misc_base.Base `thrift:"base,255,optional" frugal:"255,optional,sc_misc_base.Base" json:"base,omitempty"` +} + +func NewColumnOmnibusRequest() *ColumnOmnibusRequest { + return &ColumnOmnibusRequest{} +} + +func (p *ColumnOmnibusRequest) InitDefault() { + *p = ColumnOmnibusRequest{} +} + +func (p *ColumnOmnibusRequest) GetAuthorName() (v string) { + return p.AuthorName +} + +func (p *ColumnOmnibusRequest) GetColumnName() (v string) { + return p.ColumnName +} + +func (p *ColumnOmnibusRequest) GetColumnPrice() (v int64) { + return p.ColumnPrice +} + +var ColumnOmnibusRequest_Base_DEFAULT *sc_misc_base.Base + +func (p *ColumnOmnibusRequest) GetBase() (v *sc_misc_base.Base) { + if !p.IsSetBase() { + return ColumnOmnibusRequest_Base_DEFAULT + } + return p.Base +} +func (p *ColumnOmnibusRequest) SetAuthorName(val string) { + p.AuthorName = val +} +func (p *ColumnOmnibusRequest) SetColumnName(val string) { + p.ColumnName = val +} +func (p *ColumnOmnibusRequest) SetColumnPrice(val int64) { + p.ColumnPrice = val +} +func (p *ColumnOmnibusRequest) SetBase(val *sc_misc_base.Base) { + p.Base = val +} + +var fieldIDToName_ColumnOmnibusRequest = map[int16]string{ + 1: "authorName", + 2: "columnName", + 3: "columnPrice", + 255: "base", +} + +func (p *ColumnOmnibusRequest) IsSetBase() bool { + return p.Base != nil +} + +func (p *ColumnOmnibusRequest) 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.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + 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 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(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_ColumnOmnibusRequest[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 *ColumnOmnibusRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.AuthorName = _field + return nil +} +func (p *ColumnOmnibusRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.ColumnName = _field + return nil +} +func (p *ColumnOmnibusRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.ColumnPrice = _field + return nil +} +func (p *ColumnOmnibusRequest) ReadField255(iprot thrift.TProtocol) error { + _field := sc_misc_base.NewBase() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} + +func (p *ColumnOmnibusRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ColumnOmnibusRequest"); 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.writeField255(oprot); err != nil { + fieldId = 255 + 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 *ColumnOmnibusRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("authorName", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.AuthorName); 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 *ColumnOmnibusRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("columnName", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.ColumnName); 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 *ColumnOmnibusRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("columnPrice", thrift.I64, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.ColumnPrice); 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 *ColumnOmnibusRequest) writeField255(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.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 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *ColumnOmnibusRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ColumnOmnibusRequest(%+v)", *p) + +} + +func (p *ColumnOmnibusRequest) DeepEqual(ano *ColumnOmnibusRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.AuthorName) { + return false + } + if !p.Field2DeepEqual(ano.ColumnName) { + return false + } + if !p.Field3DeepEqual(ano.ColumnPrice) { + return false + } + if !p.Field255DeepEqual(ano.Base) { + return false + } + return true +} + +func (p *ColumnOmnibusRequest) Field1DeepEqual(src string) bool { + + if strings.Compare(p.AuthorName, src) != 0 { + return false + } + return true +} +func (p *ColumnOmnibusRequest) Field2DeepEqual(src string) bool { + + if strings.Compare(p.ColumnName, src) != 0 { + return false + } + return true +} +func (p *ColumnOmnibusRequest) Field3DeepEqual(src int64) bool { + + if p.ColumnPrice != src { + return false + } + return true +} +func (p *ColumnOmnibusRequest) Field255DeepEqual(src *sc_misc_base.Base) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} + +type ColumnOmnibusResponse struct { + BaseResp *sc_misc_base.BaseResp `thrift:"baseResp,255" frugal:"255,default,sc_misc_base.BaseResp" json:"baseResp"` +} + +func NewColumnOmnibusResponse() *ColumnOmnibusResponse { + return &ColumnOmnibusResponse{} +} + +func (p *ColumnOmnibusResponse) InitDefault() { + *p = ColumnOmnibusResponse{} +} + +var ColumnOmnibusResponse_BaseResp_DEFAULT *sc_misc_base.BaseResp + +func (p *ColumnOmnibusResponse) GetBaseResp() (v *sc_misc_base.BaseResp) { + if !p.IsSetBaseResp() { + return ColumnOmnibusResponse_BaseResp_DEFAULT + } + return p.BaseResp +} +func (p *ColumnOmnibusResponse) SetBaseResp(val *sc_misc_base.BaseResp) { + p.BaseResp = val +} + +var fieldIDToName_ColumnOmnibusResponse = map[int16]string{ + 255: "baseResp", +} + +func (p *ColumnOmnibusResponse) IsSetBaseResp() bool { + return p.BaseResp != nil +} + +func (p *ColumnOmnibusResponse) 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 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(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_ColumnOmnibusResponse[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 *ColumnOmnibusResponse) ReadField255(iprot thrift.TProtocol) error { + _field := sc_misc_base.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.BaseResp = _field + return nil +} + +func (p *ColumnOmnibusResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ColumnOmnibusResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + 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 *ColumnOmnibusResponse) writeField255(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("baseResp", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.BaseResp.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 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *ColumnOmnibusResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ColumnOmnibusResponse(%+v)", *p) + +} + +func (p *ColumnOmnibusResponse) DeepEqual(ano *ColumnOmnibusResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field255DeepEqual(ano.BaseResp) { + return false + } + return true +} + +func (p *ColumnOmnibusResponse) Field255DeepEqual(src *sc_misc_base.BaseResp) bool { + + if !p.BaseResp.DeepEqual(src) { + return false + } + return true +} + +type ColumnPageRequest struct { + PageNum int64 `thrift:"pageNum,1" frugal:"1,default,i64" json:"pageNum"` + PageSize int64 `thrift:"pageSize,2" frugal:"2,default,i64" json:"pageSize"` + Name *string `thrift:"name,4,optional" frugal:"4,optional,string" json:"name,omitempty"` + AuthorId *int64 `thrift:"authorId,5,optional" frugal:"5,optional,i64" json:"authorId,omitempty"` + Status *int32 `thrift:"status,6,optional" frugal:"6,optional,i32" json:"status,omitempty"` + Base *sc_misc_base.Base `thrift:"base,255,optional" frugal:"255,optional,sc_misc_base.Base" json:"base,omitempty"` +} + +func NewColumnPageRequest() *ColumnPageRequest { + return &ColumnPageRequest{} +} + +func (p *ColumnPageRequest) InitDefault() { + *p = ColumnPageRequest{} +} + +func (p *ColumnPageRequest) GetPageNum() (v int64) { + return p.PageNum +} + +func (p *ColumnPageRequest) GetPageSize() (v int64) { + return p.PageSize +} + +var ColumnPageRequest_Name_DEFAULT string + +func (p *ColumnPageRequest) GetName() (v string) { + if !p.IsSetName() { + return ColumnPageRequest_Name_DEFAULT + } + return *p.Name +} + +var ColumnPageRequest_AuthorId_DEFAULT int64 + +func (p *ColumnPageRequest) GetAuthorId() (v int64) { + if !p.IsSetAuthorId() { + return ColumnPageRequest_AuthorId_DEFAULT + } + return *p.AuthorId +} + +var ColumnPageRequest_Status_DEFAULT int32 + +func (p *ColumnPageRequest) GetStatus() (v int32) { + if !p.IsSetStatus() { + return ColumnPageRequest_Status_DEFAULT + } + return *p.Status +} + +var ColumnPageRequest_Base_DEFAULT *sc_misc_base.Base + +func (p *ColumnPageRequest) GetBase() (v *sc_misc_base.Base) { + if !p.IsSetBase() { + return ColumnPageRequest_Base_DEFAULT + } + return p.Base +} +func (p *ColumnPageRequest) SetPageNum(val int64) { + p.PageNum = val +} +func (p *ColumnPageRequest) SetPageSize(val int64) { + p.PageSize = val +} +func (p *ColumnPageRequest) SetName(val *string) { + p.Name = val +} +func (p *ColumnPageRequest) SetAuthorId(val *int64) { + p.AuthorId = val +} +func (p *ColumnPageRequest) SetStatus(val *int32) { + p.Status = val +} +func (p *ColumnPageRequest) SetBase(val *sc_misc_base.Base) { + p.Base = val +} + +var fieldIDToName_ColumnPageRequest = map[int16]string{ + 1: "pageNum", + 2: "pageSize", + 4: "name", + 5: "authorId", + 6: "status", + 255: "base", +} + +func (p *ColumnPageRequest) IsSetName() bool { + return p.Name != nil +} + +func (p *ColumnPageRequest) IsSetAuthorId() bool { + return p.AuthorId != nil +} + +func (p *ColumnPageRequest) IsSetStatus() bool { + return p.Status != nil +} + +func (p *ColumnPageRequest) IsSetBase() bool { + return p.Base != nil +} + +func (p *ColumnPageRequest) 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 4: + if fieldTypeId == thrift.STRING { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.I64 { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.I32 { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(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_ColumnPageRequest[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 *ColumnPageRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.PageNum = _field + return nil +} +func (p *ColumnPageRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.PageSize = _field + return nil +} +func (p *ColumnPageRequest) ReadField4(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Name = _field + return nil +} +func (p *ColumnPageRequest) ReadField5(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.AuthorId = _field + return nil +} +func (p *ColumnPageRequest) ReadField6(iprot thrift.TProtocol) error { + + var _field *int32 + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _field = &v + } + p.Status = _field + return nil +} +func (p *ColumnPageRequest) ReadField255(iprot thrift.TProtocol) error { + _field := sc_misc_base.NewBase() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} + +func (p *ColumnPageRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ColumnPageRequest"); 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.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + 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 *ColumnPageRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("pageNum", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.PageNum); 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 *ColumnPageRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("pageSize", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.PageSize); 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 *ColumnPageRequest) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetName() { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Name); 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 *ColumnPageRequest) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetAuthorId() { + if err = oprot.WriteFieldBegin("authorId", thrift.I64, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.AuthorId); 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 *ColumnPageRequest) writeField6(oprot thrift.TProtocol) (err error) { + if p.IsSetStatus() { + if err = oprot.WriteFieldBegin("status", thrift.I32, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(*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 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *ColumnPageRequest) writeField255(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.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 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *ColumnPageRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ColumnPageRequest(%+v)", *p) + +} + +func (p *ColumnPageRequest) DeepEqual(ano *ColumnPageRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.PageNum) { + return false + } + if !p.Field2DeepEqual(ano.PageSize) { + return false + } + if !p.Field4DeepEqual(ano.Name) { + return false + } + if !p.Field5DeepEqual(ano.AuthorId) { + return false + } + if !p.Field6DeepEqual(ano.Status) { + return false + } + if !p.Field255DeepEqual(ano.Base) { + return false + } + return true +} + +func (p *ColumnPageRequest) Field1DeepEqual(src int64) bool { + + if p.PageNum != src { + return false + } + return true +} +func (p *ColumnPageRequest) Field2DeepEqual(src int64) bool { + + if p.PageSize != src { + return false + } + return true +} +func (p *ColumnPageRequest) Field4DeepEqual(src *string) bool { + + if p.Name == src { + return true + } else if p.Name == nil || src == nil { + return false + } + if strings.Compare(*p.Name, *src) != 0 { + return false + } + return true +} +func (p *ColumnPageRequest) Field5DeepEqual(src *int64) bool { + + if p.AuthorId == src { + return true + } else if p.AuthorId == nil || src == nil { + return false + } + if *p.AuthorId != *src { + return false + } + return true +} +func (p *ColumnPageRequest) Field6DeepEqual(src *int32) bool { + + if p.Status == src { + return true + } else if p.Status == nil || src == nil { + return false + } + if *p.Status != *src { + return false + } + return true +} +func (p *ColumnPageRequest) Field255DeepEqual(src *sc_misc_base.Base) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} + +type ColumnPageResponse struct { + Data []*RickColumnDTO `thrift:"data,1" frugal:"1,default,list" json:"data"` + Pagination *sc_misc_base.Pagination `thrift:"pagination,2" frugal:"2,default,sc_misc_base.Pagination" json:"pagination"` + BaseResp *sc_misc_base.BaseResp `thrift:"baseResp,255" frugal:"255,default,sc_misc_base.BaseResp" json:"baseResp"` +} + +func NewColumnPageResponse() *ColumnPageResponse { + return &ColumnPageResponse{} +} + +func (p *ColumnPageResponse) InitDefault() { + *p = ColumnPageResponse{} +} + +func (p *ColumnPageResponse) GetData() (v []*RickColumnDTO) { + return p.Data +} + +var ColumnPageResponse_Pagination_DEFAULT *sc_misc_base.Pagination + +func (p *ColumnPageResponse) GetPagination() (v *sc_misc_base.Pagination) { + if !p.IsSetPagination() { + return ColumnPageResponse_Pagination_DEFAULT + } + return p.Pagination +} + +var ColumnPageResponse_BaseResp_DEFAULT *sc_misc_base.BaseResp + +func (p *ColumnPageResponse) GetBaseResp() (v *sc_misc_base.BaseResp) { + if !p.IsSetBaseResp() { + return ColumnPageResponse_BaseResp_DEFAULT + } + return p.BaseResp +} +func (p *ColumnPageResponse) SetData(val []*RickColumnDTO) { + p.Data = val +} +func (p *ColumnPageResponse) SetPagination(val *sc_misc_base.Pagination) { + p.Pagination = val +} +func (p *ColumnPageResponse) SetBaseResp(val *sc_misc_base.BaseResp) { + p.BaseResp = val +} + +var fieldIDToName_ColumnPageResponse = map[int16]string{ + 1: "data", + 2: "pagination", + 255: "baseResp", +} + +func (p *ColumnPageResponse) IsSetPagination() bool { + return p.Pagination != nil +} + +func (p *ColumnPageResponse) IsSetBaseResp() bool { + return p.BaseResp != nil +} + +func (p *ColumnPageResponse) 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.LIST { + 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 + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(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_ColumnPageResponse[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 *ColumnPageResponse) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*RickColumnDTO, 0, size) + values := make([]RickColumnDTO, size) + for i := 0; i < size; i++ { + _elem := &values[i] + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.Data = _field + return nil +} +func (p *ColumnPageResponse) ReadField2(iprot thrift.TProtocol) error { + _field := sc_misc_base.NewPagination() + if err := _field.Read(iprot); err != nil { + return err + } + p.Pagination = _field + return nil +} +func (p *ColumnPageResponse) ReadField255(iprot thrift.TProtocol) error { + _field := sc_misc_base.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.BaseResp = _field + return nil +} + +func (p *ColumnPageResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ColumnPageResponse"); 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.writeField255(oprot); err != nil { + fieldId = 255 + 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 *ColumnPageResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("data", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Data)); err != nil { + return err + } + for _, v := range p.Data { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); 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 *ColumnPageResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("pagination", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Pagination.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 *ColumnPageResponse) writeField255(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("baseResp", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.BaseResp.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 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *ColumnPageResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ColumnPageResponse(%+v)", *p) + +} + +func (p *ColumnPageResponse) DeepEqual(ano *ColumnPageResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Data) { + return false + } + if !p.Field2DeepEqual(ano.Pagination) { + return false + } + if !p.Field255DeepEqual(ano.BaseResp) { + return false + } + return true +} + +func (p *ColumnPageResponse) Field1DeepEqual(src []*RickColumnDTO) bool { + + if len(p.Data) != len(src) { + return false + } + for i, v := range p.Data { + _src := src[i] + if !v.DeepEqual(_src) { + return false + } + } + return true +} +func (p *ColumnPageResponse) Field2DeepEqual(src *sc_misc_base.Pagination) bool { + + if !p.Pagination.DeepEqual(src) { + return false + } + return true +} +func (p *ColumnPageResponse) Field255DeepEqual(src *sc_misc_base.BaseResp) bool { + + if !p.BaseResp.DeepEqual(src) { + return false + } + return true +} + +type ColumnDetailRequest struct { + Id int64 `thrift:"id,1" frugal:"1,default,i64" json:"id"` + Base *sc_misc_base.Base `thrift:"base,255,optional" frugal:"255,optional,sc_misc_base.Base" json:"base,omitempty"` +} + +func NewColumnDetailRequest() *ColumnDetailRequest { + return &ColumnDetailRequest{} +} + +func (p *ColumnDetailRequest) InitDefault() { + *p = ColumnDetailRequest{} +} + +func (p *ColumnDetailRequest) GetId() (v int64) { + return p.Id +} + +var ColumnDetailRequest_Base_DEFAULT *sc_misc_base.Base + +func (p *ColumnDetailRequest) GetBase() (v *sc_misc_base.Base) { + if !p.IsSetBase() { + return ColumnDetailRequest_Base_DEFAULT + } + return p.Base +} +func (p *ColumnDetailRequest) SetId(val int64) { + p.Id = val +} +func (p *ColumnDetailRequest) SetBase(val *sc_misc_base.Base) { + p.Base = val +} + +var fieldIDToName_ColumnDetailRequest = map[int16]string{ + 1: "id", + 255: "base", +} + +func (p *ColumnDetailRequest) IsSetBase() bool { + return p.Base != nil +} + +func (p *ColumnDetailRequest) 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 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(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_ColumnDetailRequest[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 *ColumnDetailRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Id = _field + return nil +} +func (p *ColumnDetailRequest) ReadField255(iprot thrift.TProtocol) error { + _field := sc_misc_base.NewBase() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} + +func (p *ColumnDetailRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ColumnDetailRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + 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 *ColumnDetailRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.Id); 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 *ColumnDetailRequest) writeField255(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.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 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *ColumnDetailRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ColumnDetailRequest(%+v)", *p) + +} + +func (p *ColumnDetailRequest) DeepEqual(ano *ColumnDetailRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Id) { + return false + } + if !p.Field255DeepEqual(ano.Base) { + return false + } + return true +} + +func (p *ColumnDetailRequest) Field1DeepEqual(src int64) bool { + + if p.Id != src { + return false + } + return true +} +func (p *ColumnDetailRequest) Field255DeepEqual(src *sc_misc_base.Base) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} + +type ColumnDetailResponse struct { + Data *ColumnDTO `thrift:"data,1" frugal:"1,default,ColumnDTO" json:"data"` + BaseResp *sc_misc_base.BaseResp `thrift:"baseResp,255" frugal:"255,default,sc_misc_base.BaseResp" json:"baseResp"` +} + +func NewColumnDetailResponse() *ColumnDetailResponse { + return &ColumnDetailResponse{} +} + +func (p *ColumnDetailResponse) InitDefault() { + *p = ColumnDetailResponse{} +} + +var ColumnDetailResponse_Data_DEFAULT *ColumnDTO + +func (p *ColumnDetailResponse) GetData() (v *ColumnDTO) { + if !p.IsSetData() { + return ColumnDetailResponse_Data_DEFAULT + } + return p.Data +} + +var ColumnDetailResponse_BaseResp_DEFAULT *sc_misc_base.BaseResp + +func (p *ColumnDetailResponse) GetBaseResp() (v *sc_misc_base.BaseResp) { + if !p.IsSetBaseResp() { + return ColumnDetailResponse_BaseResp_DEFAULT + } + return p.BaseResp +} +func (p *ColumnDetailResponse) SetData(val *ColumnDTO) { + p.Data = val +} +func (p *ColumnDetailResponse) SetBaseResp(val *sc_misc_base.BaseResp) { + p.BaseResp = val +} + +var fieldIDToName_ColumnDetailResponse = map[int16]string{ + 1: "data", + 255: "baseResp", +} + +func (p *ColumnDetailResponse) IsSetData() bool { + return p.Data != nil +} + +func (p *ColumnDetailResponse) IsSetBaseResp() bool { + return p.BaseResp != nil +} + +func (p *ColumnDetailResponse) 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 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(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_ColumnDetailResponse[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 *ColumnDetailResponse) ReadField1(iprot thrift.TProtocol) error { + _field := NewColumnDTO() + if err := _field.Read(iprot); err != nil { + return err + } + p.Data = _field + return nil +} +func (p *ColumnDetailResponse) ReadField255(iprot thrift.TProtocol) error { + _field := sc_misc_base.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.BaseResp = _field + return nil +} + +func (p *ColumnDetailResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ColumnDetailResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + 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 *ColumnDetailResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("data", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Data.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 *ColumnDetailResponse) writeField255(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("baseResp", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.BaseResp.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 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *ColumnDetailResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ColumnDetailResponse(%+v)", *p) + +} + +func (p *ColumnDetailResponse) DeepEqual(ano *ColumnDetailResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Data) { + return false + } + if !p.Field255DeepEqual(ano.BaseResp) { + return false + } + return true +} + +func (p *ColumnDetailResponse) Field1DeepEqual(src *ColumnDTO) bool { + + if !p.Data.DeepEqual(src) { + return false + } + return true +} +func (p *ColumnDetailResponse) Field255DeepEqual(src *sc_misc_base.BaseResp) bool { + + if !p.BaseResp.DeepEqual(src) { + return false + } + return true +} diff --git a/kitex_gen/sc_bff_api/column_model.go b/kitex_gen/sc_bff_api/column_model.go new file mode 100644 index 0000000..332c4f3 --- /dev/null +++ b/kitex_gen/sc_bff_api/column_model.go @@ -0,0 +1,833 @@ +// Code generated by thriftgo (0.3.12). DO NOT EDIT. + +package sc_bff_api + +import ( + "fmt" + "github.com/apache/thrift/lib/go/thrift" + "strings" +) + +type ColumnDTO struct { + Id int64 `thrift:"id,1" frugal:"1,default,i64" json:"id"` + CreateTime int64 `thrift:"createTime,2" frugal:"2,default,i64" json:"createTime"` + UpdateTime int64 `thrift:"updateTime,3" frugal:"3,default,i64" json:"updateTime"` + Name string `thrift:"name,4" frugal:"4,default,string" json:"name"` + AuthorId int64 `thrift:"authorId,5" frugal:"5,default,i64" json:"authorId"` + Status int32 `thrift:"status,6" frugal:"6,default,i32" json:"status"` +} + +func NewColumnDTO() *ColumnDTO { + return &ColumnDTO{} +} + +func (p *ColumnDTO) InitDefault() { + *p = ColumnDTO{} +} + +func (p *ColumnDTO) GetId() (v int64) { + return p.Id +} + +func (p *ColumnDTO) GetCreateTime() (v int64) { + return p.CreateTime +} + +func (p *ColumnDTO) GetUpdateTime() (v int64) { + return p.UpdateTime +} + +func (p *ColumnDTO) GetName() (v string) { + return p.Name +} + +func (p *ColumnDTO) GetAuthorId() (v int64) { + return p.AuthorId +} + +func (p *ColumnDTO) GetStatus() (v int32) { + return p.Status +} +func (p *ColumnDTO) SetId(val int64) { + p.Id = val +} +func (p *ColumnDTO) SetCreateTime(val int64) { + p.CreateTime = val +} +func (p *ColumnDTO) SetUpdateTime(val int64) { + p.UpdateTime = val +} +func (p *ColumnDTO) SetName(val string) { + p.Name = val +} +func (p *ColumnDTO) SetAuthorId(val int64) { + p.AuthorId = val +} +func (p *ColumnDTO) SetStatus(val int32) { + p.Status = val +} + +var fieldIDToName_ColumnDTO = map[int16]string{ + 1: "id", + 2: "createTime", + 3: "updateTime", + 4: "name", + 5: "authorId", + 6: "status", +} + +func (p *ColumnDTO) 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.STRING { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.I64 { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.I32 { + if err = p.ReadField6(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_ColumnDTO[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 *ColumnDTO) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Id = _field + return nil +} +func (p *ColumnDTO) ReadField2(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.CreateTime = _field + return nil +} +func (p *ColumnDTO) ReadField3(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.UpdateTime = _field + return nil +} +func (p *ColumnDTO) ReadField4(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *ColumnDTO) ReadField5(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.AuthorId = _field + return nil +} +func (p *ColumnDTO) ReadField6(iprot thrift.TProtocol) error { + + var _field int32 + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _field = v + } + p.Status = _field + return nil +} + +func (p *ColumnDTO) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ColumnDTO"); 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 = p.writeField6(oprot); err != nil { + fieldId = 6 + 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 *ColumnDTO) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.Id); 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 *ColumnDTO) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("createTime", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.CreateTime); 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 *ColumnDTO) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("updateTime", thrift.I64, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.UpdateTime); 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 *ColumnDTO) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Name); 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 *ColumnDTO) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("authorId", thrift.I64, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.AuthorId); 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 *ColumnDTO) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("status", thrift.I32, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(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 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *ColumnDTO) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ColumnDTO(%+v)", *p) + +} + +func (p *ColumnDTO) DeepEqual(ano *ColumnDTO) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Id) { + return false + } + if !p.Field2DeepEqual(ano.CreateTime) { + return false + } + if !p.Field3DeepEqual(ano.UpdateTime) { + return false + } + if !p.Field4DeepEqual(ano.Name) { + return false + } + if !p.Field5DeepEqual(ano.AuthorId) { + return false + } + if !p.Field6DeepEqual(ano.Status) { + return false + } + return true +} + +func (p *ColumnDTO) Field1DeepEqual(src int64) bool { + + if p.Id != src { + return false + } + return true +} +func (p *ColumnDTO) Field2DeepEqual(src int64) bool { + + if p.CreateTime != src { + return false + } + return true +} +func (p *ColumnDTO) Field3DeepEqual(src int64) bool { + + if p.UpdateTime != src { + return false + } + return true +} +func (p *ColumnDTO) Field4DeepEqual(src string) bool { + + if strings.Compare(p.Name, src) != 0 { + return false + } + return true +} +func (p *ColumnDTO) Field5DeepEqual(src int64) bool { + + if p.AuthorId != src { + return false + } + return true +} +func (p *ColumnDTO) Field6DeepEqual(src int32) bool { + + if p.Status != src { + return false + } + return true +} + +type RickColumnDTO struct { + Column *ColumnDTO `thrift:"column,1" frugal:"1,default,ColumnDTO" json:"column"` + Author *AuthorDTO `thrift:"author,2" frugal:"2,default,AuthorDTO" json:"author"` + ColumnQuote *ColumnQuoteDTO `thrift:"columnQuote,3" frugal:"3,default,ColumnQuoteDTO" json:"columnQuote"` + Subscription *SubscriptionDTO `thrift:"subscription,4" frugal:"4,default,SubscriptionDTO" json:"subscription"` +} + +func NewRickColumnDTO() *RickColumnDTO { + return &RickColumnDTO{} +} + +func (p *RickColumnDTO) InitDefault() { + *p = RickColumnDTO{} +} + +var RickColumnDTO_Column_DEFAULT *ColumnDTO + +func (p *RickColumnDTO) GetColumn() (v *ColumnDTO) { + if !p.IsSetColumn() { + return RickColumnDTO_Column_DEFAULT + } + return p.Column +} + +var RickColumnDTO_Author_DEFAULT *AuthorDTO + +func (p *RickColumnDTO) GetAuthor() (v *AuthorDTO) { + if !p.IsSetAuthor() { + return RickColumnDTO_Author_DEFAULT + } + return p.Author +} + +var RickColumnDTO_ColumnQuote_DEFAULT *ColumnQuoteDTO + +func (p *RickColumnDTO) GetColumnQuote() (v *ColumnQuoteDTO) { + if !p.IsSetColumnQuote() { + return RickColumnDTO_ColumnQuote_DEFAULT + } + return p.ColumnQuote +} + +var RickColumnDTO_Subscription_DEFAULT *SubscriptionDTO + +func (p *RickColumnDTO) GetSubscription() (v *SubscriptionDTO) { + if !p.IsSetSubscription() { + return RickColumnDTO_Subscription_DEFAULT + } + return p.Subscription +} +func (p *RickColumnDTO) SetColumn(val *ColumnDTO) { + p.Column = val +} +func (p *RickColumnDTO) SetAuthor(val *AuthorDTO) { + p.Author = val +} +func (p *RickColumnDTO) SetColumnQuote(val *ColumnQuoteDTO) { + p.ColumnQuote = val +} +func (p *RickColumnDTO) SetSubscription(val *SubscriptionDTO) { + p.Subscription = val +} + +var fieldIDToName_RickColumnDTO = map[int16]string{ + 1: "column", + 2: "author", + 3: "columnQuote", + 4: "subscription", +} + +func (p *RickColumnDTO) IsSetColumn() bool { + return p.Column != nil +} + +func (p *RickColumnDTO) IsSetAuthor() bool { + return p.Author != nil +} + +func (p *RickColumnDTO) IsSetColumnQuote() bool { + return p.ColumnQuote != nil +} + +func (p *RickColumnDTO) IsSetSubscription() bool { + return p.Subscription != nil +} + +func (p *RickColumnDTO) 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 + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField4(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_RickColumnDTO[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 *RickColumnDTO) ReadField1(iprot thrift.TProtocol) error { + _field := NewColumnDTO() + if err := _field.Read(iprot); err != nil { + return err + } + p.Column = _field + return nil +} +func (p *RickColumnDTO) ReadField2(iprot thrift.TProtocol) error { + _field := NewAuthorDTO() + if err := _field.Read(iprot); err != nil { + return err + } + p.Author = _field + return nil +} +func (p *RickColumnDTO) ReadField3(iprot thrift.TProtocol) error { + _field := NewColumnQuoteDTO() + if err := _field.Read(iprot); err != nil { + return err + } + p.ColumnQuote = _field + return nil +} +func (p *RickColumnDTO) ReadField4(iprot thrift.TProtocol) error { + _field := NewSubscriptionDTO() + if err := _field.Read(iprot); err != nil { + return err + } + p.Subscription = _field + return nil +} + +func (p *RickColumnDTO) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("RickColumnDTO"); 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 = 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 *RickColumnDTO) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("column", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Column.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 *RickColumnDTO) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("author", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Author.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 *RickColumnDTO) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("columnQuote", thrift.STRUCT, 3); err != nil { + goto WriteFieldBeginError + } + if err := p.ColumnQuote.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 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *RickColumnDTO) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("subscription", thrift.STRUCT, 4); err != nil { + goto WriteFieldBeginError + } + if err := p.Subscription.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 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *RickColumnDTO) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RickColumnDTO(%+v)", *p) + +} + +func (p *RickColumnDTO) DeepEqual(ano *RickColumnDTO) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Column) { + return false + } + if !p.Field2DeepEqual(ano.Author) { + return false + } + if !p.Field3DeepEqual(ano.ColumnQuote) { + return false + } + if !p.Field4DeepEqual(ano.Subscription) { + return false + } + return true +} + +func (p *RickColumnDTO) Field1DeepEqual(src *ColumnDTO) bool { + + if !p.Column.DeepEqual(src) { + return false + } + return true +} +func (p *RickColumnDTO) Field2DeepEqual(src *AuthorDTO) bool { + + if !p.Author.DeepEqual(src) { + return false + } + return true +} +func (p *RickColumnDTO) Field3DeepEqual(src *ColumnQuoteDTO) bool { + + if !p.ColumnQuote.DeepEqual(src) { + return false + } + return true +} +func (p *RickColumnDTO) Field4DeepEqual(src *SubscriptionDTO) bool { + + if !p.Subscription.DeepEqual(src) { + return false + } + return true +} diff --git a/kitex_gen/sc_bff_api/column_quote_model.go b/kitex_gen/sc_bff_api/column_quote_model.go new file mode 100644 index 0000000..74ac924 --- /dev/null +++ b/kitex_gen/sc_bff_api/column_quote_model.go @@ -0,0 +1,526 @@ +// Code generated by thriftgo (0.3.12). DO NOT EDIT. + +package sc_bff_api + +import ( + "fmt" + "github.com/apache/thrift/lib/go/thrift" +) + +type ColumnQuoteDTO struct { + Id int64 `thrift:"id,1" frugal:"1,default,i64" json:"id"` + CreateTime int64 `thrift:"createTime,2" frugal:"2,default,i64" json:"createTime"` + UpdateTime int64 `thrift:"updateTime,3" frugal:"3,default,i64" json:"updateTime"` + ColumnId int64 `thrift:"columnId,4" frugal:"4,default,i64" json:"columnId"` + Editor int64 `thrift:"editor,5" frugal:"5,default,i64" json:"editor"` + Price int64 `thrift:"price,6" frugal:"6,default,i64" json:"price"` + Status int32 `thrift:"status,7" frugal:"7,default,i32" json:"status"` +} + +func NewColumnQuoteDTO() *ColumnQuoteDTO { + return &ColumnQuoteDTO{} +} + +func (p *ColumnQuoteDTO) InitDefault() { + *p = ColumnQuoteDTO{} +} + +func (p *ColumnQuoteDTO) GetId() (v int64) { + return p.Id +} + +func (p *ColumnQuoteDTO) GetCreateTime() (v int64) { + return p.CreateTime +} + +func (p *ColumnQuoteDTO) GetUpdateTime() (v int64) { + return p.UpdateTime +} + +func (p *ColumnQuoteDTO) GetColumnId() (v int64) { + return p.ColumnId +} + +func (p *ColumnQuoteDTO) GetEditor() (v int64) { + return p.Editor +} + +func (p *ColumnQuoteDTO) GetPrice() (v int64) { + return p.Price +} + +func (p *ColumnQuoteDTO) GetStatus() (v int32) { + return p.Status +} +func (p *ColumnQuoteDTO) SetId(val int64) { + p.Id = val +} +func (p *ColumnQuoteDTO) SetCreateTime(val int64) { + p.CreateTime = val +} +func (p *ColumnQuoteDTO) SetUpdateTime(val int64) { + p.UpdateTime = val +} +func (p *ColumnQuoteDTO) SetColumnId(val int64) { + p.ColumnId = val +} +func (p *ColumnQuoteDTO) SetEditor(val int64) { + p.Editor = val +} +func (p *ColumnQuoteDTO) SetPrice(val int64) { + p.Price = val +} +func (p *ColumnQuoteDTO) SetStatus(val int32) { + p.Status = val +} + +var fieldIDToName_ColumnQuoteDTO = map[int16]string{ + 1: "id", + 2: "createTime", + 3: "updateTime", + 4: "columnId", + 5: "editor", + 6: "price", + 7: "status", +} + +func (p *ColumnQuoteDTO) 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.I64 { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.I64 { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.I32 { + if err = p.ReadField7(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_ColumnQuoteDTO[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 *ColumnQuoteDTO) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Id = _field + return nil +} +func (p *ColumnQuoteDTO) ReadField2(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.CreateTime = _field + return nil +} +func (p *ColumnQuoteDTO) ReadField3(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.UpdateTime = _field + return nil +} +func (p *ColumnQuoteDTO) ReadField4(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.ColumnId = _field + return nil +} +func (p *ColumnQuoteDTO) ReadField5(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Editor = _field + return nil +} +func (p *ColumnQuoteDTO) ReadField6(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Price = _field + return nil +} +func (p *ColumnQuoteDTO) ReadField7(iprot thrift.TProtocol) error { + + var _field int32 + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _field = v + } + p.Status = _field + return nil +} + +func (p *ColumnQuoteDTO) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ColumnQuoteDTO"); 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 = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + 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 *ColumnQuoteDTO) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.Id); 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 *ColumnQuoteDTO) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("createTime", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.CreateTime); 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 *ColumnQuoteDTO) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("updateTime", thrift.I64, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.UpdateTime); 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 *ColumnQuoteDTO) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("columnId", thrift.I64, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.ColumnId); 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 *ColumnQuoteDTO) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("editor", thrift.I64, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.Editor); 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 *ColumnQuoteDTO) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("price", thrift.I64, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.Price); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *ColumnQuoteDTO) writeField7(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("status", thrift.I32, 7); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(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 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} + +func (p *ColumnQuoteDTO) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ColumnQuoteDTO(%+v)", *p) + +} + +func (p *ColumnQuoteDTO) DeepEqual(ano *ColumnQuoteDTO) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Id) { + return false + } + if !p.Field2DeepEqual(ano.CreateTime) { + return false + } + if !p.Field3DeepEqual(ano.UpdateTime) { + return false + } + if !p.Field4DeepEqual(ano.ColumnId) { + return false + } + if !p.Field5DeepEqual(ano.Editor) { + return false + } + if !p.Field6DeepEqual(ano.Price) { + return false + } + if !p.Field7DeepEqual(ano.Status) { + return false + } + return true +} + +func (p *ColumnQuoteDTO) Field1DeepEqual(src int64) bool { + + if p.Id != src { + return false + } + return true +} +func (p *ColumnQuoteDTO) Field2DeepEqual(src int64) bool { + + if p.CreateTime != src { + return false + } + return true +} +func (p *ColumnQuoteDTO) Field3DeepEqual(src int64) bool { + + if p.UpdateTime != src { + return false + } + return true +} +func (p *ColumnQuoteDTO) Field4DeepEqual(src int64) bool { + + if p.ColumnId != src { + return false + } + return true +} +func (p *ColumnQuoteDTO) Field5DeepEqual(src int64) bool { + + if p.Editor != src { + return false + } + return true +} +func (p *ColumnQuoteDTO) Field6DeepEqual(src int64) bool { + + if p.Price != src { + return false + } + return true +} +func (p *ColumnQuoteDTO) Field7DeepEqual(src int32) bool { + + if p.Status != src { + return false + } + return true +} diff --git a/kitex_gen/sc_bff_api/k-author_model.go b/kitex_gen/sc_bff_api/k-author_model.go new file mode 100644 index 0000000..0ebe7d4 --- /dev/null +++ b/kitex_gen/sc_bff_api/k-author_model.go @@ -0,0 +1,346 @@ +// Code generated by Kitex v0.9.1. DO NOT EDIT. + +package sc_bff_api + +import ( + "bytes" + "fmt" + "reflect" + "strings" + + "github.com/apache/thrift/lib/go/thrift" + + "github.com/cloudwego/kitex/pkg/protocol/bthrift" +) + +// unused protection +var ( + _ = fmt.Formatter(nil) + _ = (*bytes.Buffer)(nil) + _ = (*strings.Builder)(nil) + _ = reflect.Type(nil) + _ = thrift.TProtocol(nil) + _ = bthrift.BinaryWriter(nil) +) + +func (p *AuthorDTO) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AuthorDTO[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *AuthorDTO) FastReadField1(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Id = v + + } + return offset, nil +} + +func (p *AuthorDTO) FastReadField2(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.CreateTime = v + + } + return offset, nil +} + +func (p *AuthorDTO) FastReadField3(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.UpdateTime = v + + } + return offset, nil +} + +func (p *AuthorDTO) FastReadField4(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Username = v + + } + return offset, nil +} + +func (p *AuthorDTO) FastReadField5(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Realname = v + + } + return offset, nil +} + +// for compatibility +func (p *AuthorDTO) FastWrite(buf []byte) int { + return 0 +} + +func (p *AuthorDTO) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "AuthorDTO") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField3(buf[offset:], binaryWriter) + offset += p.fastWriteField4(buf[offset:], binaryWriter) + offset += p.fastWriteField5(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *AuthorDTO) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("AuthorDTO") + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field4Length() + l += p.field5Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *AuthorDTO) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "id", thrift.I64, 1) + offset += bthrift.Binary.WriteI64(buf[offset:], p.Id) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *AuthorDTO) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "createTime", thrift.I64, 2) + offset += bthrift.Binary.WriteI64(buf[offset:], p.CreateTime) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *AuthorDTO) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "updateTime", thrift.I64, 3) + offset += bthrift.Binary.WriteI64(buf[offset:], p.UpdateTime) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *AuthorDTO) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "username", thrift.STRING, 4) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Username) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *AuthorDTO) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "realname", thrift.STRING, 5) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Realname) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *AuthorDTO) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("id", thrift.I64, 1) + l += bthrift.Binary.I64Length(p.Id) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *AuthorDTO) field2Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("createTime", thrift.I64, 2) + l += bthrift.Binary.I64Length(p.CreateTime) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *AuthorDTO) field3Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("updateTime", thrift.I64, 3) + l += bthrift.Binary.I64Length(p.UpdateTime) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *AuthorDTO) field4Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("username", thrift.STRING, 4) + l += bthrift.Binary.StringLengthNocopy(p.Username) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *AuthorDTO) field5Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("realname", thrift.STRING, 5) + l += bthrift.Binary.StringLengthNocopy(p.Realname) + + l += bthrift.Binary.FieldEndLength() + return l +} diff --git a/kitex_gen/sc_bff_api/k-column_api.go b/kitex_gen/sc_bff_api/k-column_api.go new file mode 100644 index 0000000..fea3448 --- /dev/null +++ b/kitex_gen/sc_bff_api/k-column_api.go @@ -0,0 +1,1403 @@ +// Code generated by Kitex v0.9.1. DO NOT EDIT. + +package sc_bff_api + +import ( + "bytes" + "fmt" + "reflect" + "strings" + + "github.com/apache/thrift/lib/go/thrift" + + "github.com/cloudwego/kitex/pkg/protocol/bthrift" + + "github.com/eyebluecn/sc-misc-idl/kitex_gen/sc_misc_base" +) + +// unused protection +var ( + _ = fmt.Formatter(nil) + _ = (*bytes.Buffer)(nil) + _ = (*strings.Builder)(nil) + _ = reflect.Type(nil) + _ = thrift.TProtocol(nil) + _ = bthrift.BinaryWriter(nil) + _ = sc_misc_base.KitexUnusedProtection +) + +func (p *ColumnOmnibusRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ColumnOmnibusRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *ColumnOmnibusRequest) FastReadField1(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.AuthorName = v + + } + return offset, nil +} + +func (p *ColumnOmnibusRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.ColumnName = v + + } + return offset, nil +} + +func (p *ColumnOmnibusRequest) FastReadField3(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.ColumnPrice = v + + } + return offset, nil +} + +func (p *ColumnOmnibusRequest) FastReadField255(buf []byte) (int, error) { + offset := 0 + + tmp := sc_misc_base.NewBase() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = tmp + return offset, nil +} + +// for compatibility +func (p *ColumnOmnibusRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *ColumnOmnibusRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "ColumnOmnibusRequest") + if p != nil { + offset += p.fastWriteField3(buf[offset:], binaryWriter) + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField255(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *ColumnOmnibusRequest) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("ColumnOmnibusRequest") + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field255Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *ColumnOmnibusRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "authorName", thrift.STRING, 1) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.AuthorName) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ColumnOmnibusRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "columnName", thrift.STRING, 2) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.ColumnName) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ColumnOmnibusRequest) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "columnPrice", thrift.I64, 3) + offset += bthrift.Binary.WriteI64(buf[offset:], p.ColumnPrice) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ColumnOmnibusRequest) fastWriteField255(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetBase() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "base", thrift.STRUCT, 255) + offset += p.Base.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *ColumnOmnibusRequest) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("authorName", thrift.STRING, 1) + l += bthrift.Binary.StringLengthNocopy(p.AuthorName) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ColumnOmnibusRequest) field2Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("columnName", thrift.STRING, 2) + l += bthrift.Binary.StringLengthNocopy(p.ColumnName) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ColumnOmnibusRequest) field3Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("columnPrice", thrift.I64, 3) + l += bthrift.Binary.I64Length(p.ColumnPrice) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ColumnOmnibusRequest) field255Length() int { + l := 0 + if p.IsSetBase() { + l += bthrift.Binary.FieldBeginLength("base", thrift.STRUCT, 255) + l += p.Base.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *ColumnOmnibusResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ColumnOmnibusResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *ColumnOmnibusResponse) FastReadField255(buf []byte) (int, error) { + offset := 0 + + tmp := sc_misc_base.NewBaseResp() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.BaseResp = tmp + return offset, nil +} + +// for compatibility +func (p *ColumnOmnibusResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *ColumnOmnibusResponse) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "ColumnOmnibusResponse") + if p != nil { + offset += p.fastWriteField255(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *ColumnOmnibusResponse) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("ColumnOmnibusResponse") + if p != nil { + l += p.field255Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *ColumnOmnibusResponse) fastWriteField255(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "baseResp", thrift.STRUCT, 255) + offset += p.BaseResp.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ColumnOmnibusResponse) field255Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("baseResp", thrift.STRUCT, 255) + l += p.BaseResp.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ColumnPageRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 6: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField6(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ColumnPageRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *ColumnPageRequest) FastReadField1(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.PageNum = v + + } + return offset, nil +} + +func (p *ColumnPageRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.PageSize = v + + } + return offset, nil +} + +func (p *ColumnPageRequest) FastReadField4(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Name = &v + + } + return offset, nil +} + +func (p *ColumnPageRequest) FastReadField5(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.AuthorId = &v + + } + return offset, nil +} + +func (p *ColumnPageRequest) FastReadField6(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Status = &v + + } + return offset, nil +} + +func (p *ColumnPageRequest) FastReadField255(buf []byte) (int, error) { + offset := 0 + + tmp := sc_misc_base.NewBase() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = tmp + return offset, nil +} + +// for compatibility +func (p *ColumnPageRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *ColumnPageRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "ColumnPageRequest") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField5(buf[offset:], binaryWriter) + offset += p.fastWriteField6(buf[offset:], binaryWriter) + offset += p.fastWriteField4(buf[offset:], binaryWriter) + offset += p.fastWriteField255(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *ColumnPageRequest) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("ColumnPageRequest") + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field4Length() + l += p.field5Length() + l += p.field6Length() + l += p.field255Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *ColumnPageRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "pageNum", thrift.I64, 1) + offset += bthrift.Binary.WriteI64(buf[offset:], p.PageNum) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ColumnPageRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "pageSize", thrift.I64, 2) + offset += bthrift.Binary.WriteI64(buf[offset:], p.PageSize) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ColumnPageRequest) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetName() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "name", thrift.STRING, 4) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Name) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *ColumnPageRequest) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetAuthorId() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "authorId", thrift.I64, 5) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.AuthorId) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *ColumnPageRequest) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetStatus() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "status", thrift.I32, 6) + offset += bthrift.Binary.WriteI32(buf[offset:], *p.Status) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *ColumnPageRequest) fastWriteField255(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetBase() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "base", thrift.STRUCT, 255) + offset += p.Base.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *ColumnPageRequest) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("pageNum", thrift.I64, 1) + l += bthrift.Binary.I64Length(p.PageNum) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ColumnPageRequest) field2Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("pageSize", thrift.I64, 2) + l += bthrift.Binary.I64Length(p.PageSize) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ColumnPageRequest) field4Length() int { + l := 0 + if p.IsSetName() { + l += bthrift.Binary.FieldBeginLength("name", thrift.STRING, 4) + l += bthrift.Binary.StringLengthNocopy(*p.Name) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *ColumnPageRequest) field5Length() int { + l := 0 + if p.IsSetAuthorId() { + l += bthrift.Binary.FieldBeginLength("authorId", thrift.I64, 5) + l += bthrift.Binary.I64Length(*p.AuthorId) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *ColumnPageRequest) field6Length() int { + l := 0 + if p.IsSetStatus() { + l += bthrift.Binary.FieldBeginLength("status", thrift.I32, 6) + l += bthrift.Binary.I32Length(*p.Status) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *ColumnPageRequest) field255Length() int { + l := 0 + if p.IsSetBase() { + l += bthrift.Binary.FieldBeginLength("base", thrift.STRUCT, 255) + l += p.Base.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *ColumnPageResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ColumnPageResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *ColumnPageResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + p.Data = make([]*RickColumnDTO, 0, size) + for i := 0; i < size; i++ { + _elem := NewRickColumnDTO() + if l, err := _elem.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + + p.Data = append(p.Data, _elem) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + return offset, nil +} + +func (p *ColumnPageResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 + + tmp := sc_misc_base.NewPagination() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Pagination = tmp + return offset, nil +} + +func (p *ColumnPageResponse) FastReadField255(buf []byte) (int, error) { + offset := 0 + + tmp := sc_misc_base.NewBaseResp() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.BaseResp = tmp + return offset, nil +} + +// for compatibility +func (p *ColumnPageResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *ColumnPageResponse) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "ColumnPageResponse") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField255(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *ColumnPageResponse) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("ColumnPageResponse") + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field255Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *ColumnPageResponse) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "data", thrift.LIST, 1) + listBeginOffset := offset + offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) + var length int + for _, v := range p.Data { + length++ + offset += v.FastWriteNocopy(buf[offset:], binaryWriter) + } + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) + offset += bthrift.Binary.WriteListEnd(buf[offset:]) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ColumnPageResponse) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "pagination", thrift.STRUCT, 2) + offset += p.Pagination.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ColumnPageResponse) fastWriteField255(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "baseResp", thrift.STRUCT, 255) + offset += p.BaseResp.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ColumnPageResponse) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("data", thrift.LIST, 1) + l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.Data)) + for _, v := range p.Data { + l += v.BLength() + } + l += bthrift.Binary.ListEndLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ColumnPageResponse) field2Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("pagination", thrift.STRUCT, 2) + l += p.Pagination.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ColumnPageResponse) field255Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("baseResp", thrift.STRUCT, 255) + l += p.BaseResp.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ColumnDetailRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ColumnDetailRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *ColumnDetailRequest) FastReadField1(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Id = v + + } + return offset, nil +} + +func (p *ColumnDetailRequest) FastReadField255(buf []byte) (int, error) { + offset := 0 + + tmp := sc_misc_base.NewBase() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = tmp + return offset, nil +} + +// for compatibility +func (p *ColumnDetailRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *ColumnDetailRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "ColumnDetailRequest") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField255(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *ColumnDetailRequest) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("ColumnDetailRequest") + if p != nil { + l += p.field1Length() + l += p.field255Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *ColumnDetailRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "id", thrift.I64, 1) + offset += bthrift.Binary.WriteI64(buf[offset:], p.Id) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ColumnDetailRequest) fastWriteField255(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetBase() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "base", thrift.STRUCT, 255) + offset += p.Base.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *ColumnDetailRequest) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("id", thrift.I64, 1) + l += bthrift.Binary.I64Length(p.Id) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ColumnDetailRequest) field255Length() int { + l := 0 + if p.IsSetBase() { + l += bthrift.Binary.FieldBeginLength("base", thrift.STRUCT, 255) + l += p.Base.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *ColumnDetailResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ColumnDetailResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *ColumnDetailResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := NewColumnDTO() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Data = tmp + return offset, nil +} + +func (p *ColumnDetailResponse) FastReadField255(buf []byte) (int, error) { + offset := 0 + + tmp := sc_misc_base.NewBaseResp() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.BaseResp = tmp + return offset, nil +} + +// for compatibility +func (p *ColumnDetailResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *ColumnDetailResponse) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "ColumnDetailResponse") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField255(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *ColumnDetailResponse) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("ColumnDetailResponse") + if p != nil { + l += p.field1Length() + l += p.field255Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *ColumnDetailResponse) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "data", thrift.STRUCT, 1) + offset += p.Data.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ColumnDetailResponse) fastWriteField255(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "baseResp", thrift.STRUCT, 255) + offset += p.BaseResp.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ColumnDetailResponse) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("data", thrift.STRUCT, 1) + l += p.Data.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ColumnDetailResponse) field255Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("baseResp", thrift.STRUCT, 255) + l += p.BaseResp.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} diff --git a/kitex_gen/sc_bff_api/k-column_model.go b/kitex_gen/sc_bff_api/k-column_model.go new file mode 100644 index 0000000..eabd5ba --- /dev/null +++ b/kitex_gen/sc_bff_api/k-column_model.go @@ -0,0 +1,656 @@ +// Code generated by Kitex v0.9.1. DO NOT EDIT. + +package sc_bff_api + +import ( + "bytes" + "fmt" + "reflect" + "strings" + + "github.com/apache/thrift/lib/go/thrift" + + "github.com/cloudwego/kitex/pkg/protocol/bthrift" +) + +// unused protection +var ( + _ = fmt.Formatter(nil) + _ = (*bytes.Buffer)(nil) + _ = (*strings.Builder)(nil) + _ = reflect.Type(nil) + _ = thrift.TProtocol(nil) + _ = bthrift.BinaryWriter(nil) +) + +func (p *ColumnDTO) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 6: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField6(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ColumnDTO[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *ColumnDTO) FastReadField1(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Id = v + + } + return offset, nil +} + +func (p *ColumnDTO) FastReadField2(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.CreateTime = v + + } + return offset, nil +} + +func (p *ColumnDTO) FastReadField3(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.UpdateTime = v + + } + return offset, nil +} + +func (p *ColumnDTO) FastReadField4(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Name = v + + } + return offset, nil +} + +func (p *ColumnDTO) FastReadField5(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.AuthorId = v + + } + return offset, nil +} + +func (p *ColumnDTO) FastReadField6(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Status = v + + } + return offset, nil +} + +// for compatibility +func (p *ColumnDTO) FastWrite(buf []byte) int { + return 0 +} + +func (p *ColumnDTO) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "ColumnDTO") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField3(buf[offset:], binaryWriter) + offset += p.fastWriteField5(buf[offset:], binaryWriter) + offset += p.fastWriteField6(buf[offset:], binaryWriter) + offset += p.fastWriteField4(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *ColumnDTO) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("ColumnDTO") + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field4Length() + l += p.field5Length() + l += p.field6Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *ColumnDTO) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "id", thrift.I64, 1) + offset += bthrift.Binary.WriteI64(buf[offset:], p.Id) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ColumnDTO) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "createTime", thrift.I64, 2) + offset += bthrift.Binary.WriteI64(buf[offset:], p.CreateTime) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ColumnDTO) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "updateTime", thrift.I64, 3) + offset += bthrift.Binary.WriteI64(buf[offset:], p.UpdateTime) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ColumnDTO) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "name", thrift.STRING, 4) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Name) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ColumnDTO) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "authorId", thrift.I64, 5) + offset += bthrift.Binary.WriteI64(buf[offset:], p.AuthorId) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ColumnDTO) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "status", thrift.I32, 6) + offset += bthrift.Binary.WriteI32(buf[offset:], p.Status) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ColumnDTO) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("id", thrift.I64, 1) + l += bthrift.Binary.I64Length(p.Id) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ColumnDTO) field2Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("createTime", thrift.I64, 2) + l += bthrift.Binary.I64Length(p.CreateTime) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ColumnDTO) field3Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("updateTime", thrift.I64, 3) + l += bthrift.Binary.I64Length(p.UpdateTime) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ColumnDTO) field4Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("name", thrift.STRING, 4) + l += bthrift.Binary.StringLengthNocopy(p.Name) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ColumnDTO) field5Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("authorId", thrift.I64, 5) + l += bthrift.Binary.I64Length(p.AuthorId) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ColumnDTO) field6Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("status", thrift.I32, 6) + l += bthrift.Binary.I32Length(p.Status) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *RickColumnDTO) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_RickColumnDTO[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *RickColumnDTO) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := NewColumnDTO() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Column = tmp + return offset, nil +} + +func (p *RickColumnDTO) FastReadField2(buf []byte) (int, error) { + offset := 0 + + tmp := NewAuthorDTO() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Author = tmp + return offset, nil +} + +func (p *RickColumnDTO) FastReadField3(buf []byte) (int, error) { + offset := 0 + + tmp := NewColumnQuoteDTO() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.ColumnQuote = tmp + return offset, nil +} + +func (p *RickColumnDTO) FastReadField4(buf []byte) (int, error) { + offset := 0 + + tmp := NewSubscriptionDTO() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Subscription = tmp + return offset, nil +} + +// for compatibility +func (p *RickColumnDTO) FastWrite(buf []byte) int { + return 0 +} + +func (p *RickColumnDTO) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "RickColumnDTO") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField3(buf[offset:], binaryWriter) + offset += p.fastWriteField4(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *RickColumnDTO) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("RickColumnDTO") + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field4Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *RickColumnDTO) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "column", thrift.STRUCT, 1) + offset += p.Column.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *RickColumnDTO) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "author", thrift.STRUCT, 2) + offset += p.Author.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *RickColumnDTO) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "columnQuote", thrift.STRUCT, 3) + offset += p.ColumnQuote.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *RickColumnDTO) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "subscription", thrift.STRUCT, 4) + offset += p.Subscription.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *RickColumnDTO) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("column", thrift.STRUCT, 1) + l += p.Column.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *RickColumnDTO) field2Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("author", thrift.STRUCT, 2) + l += p.Author.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *RickColumnDTO) field3Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("columnQuote", thrift.STRUCT, 3) + l += p.ColumnQuote.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *RickColumnDTO) field4Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("subscription", thrift.STRUCT, 4) + l += p.Subscription.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} diff --git a/kitex_gen/sc_bff_api/k-column_quote_model.go b/kitex_gen/sc_bff_api/k-column_quote_model.go new file mode 100644 index 0000000..8a32913 --- /dev/null +++ b/kitex_gen/sc_bff_api/k-column_quote_model.go @@ -0,0 +1,442 @@ +// Code generated by Kitex v0.9.1. DO NOT EDIT. + +package sc_bff_api + +import ( + "bytes" + "fmt" + "reflect" + "strings" + + "github.com/apache/thrift/lib/go/thrift" + + "github.com/cloudwego/kitex/pkg/protocol/bthrift" +) + +// unused protection +var ( + _ = fmt.Formatter(nil) + _ = (*bytes.Buffer)(nil) + _ = (*strings.Builder)(nil) + _ = reflect.Type(nil) + _ = thrift.TProtocol(nil) + _ = bthrift.BinaryWriter(nil) +) + +func (p *ColumnQuoteDTO) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 6: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField6(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 7: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField7(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ColumnQuoteDTO[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *ColumnQuoteDTO) FastReadField1(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Id = v + + } + return offset, nil +} + +func (p *ColumnQuoteDTO) FastReadField2(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.CreateTime = v + + } + return offset, nil +} + +func (p *ColumnQuoteDTO) FastReadField3(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.UpdateTime = v + + } + return offset, nil +} + +func (p *ColumnQuoteDTO) FastReadField4(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.ColumnId = v + + } + return offset, nil +} + +func (p *ColumnQuoteDTO) FastReadField5(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Editor = v + + } + return offset, nil +} + +func (p *ColumnQuoteDTO) FastReadField6(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Price = v + + } + return offset, nil +} + +func (p *ColumnQuoteDTO) FastReadField7(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Status = v + + } + return offset, nil +} + +// for compatibility +func (p *ColumnQuoteDTO) FastWrite(buf []byte) int { + return 0 +} + +func (p *ColumnQuoteDTO) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "ColumnQuoteDTO") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField3(buf[offset:], binaryWriter) + offset += p.fastWriteField4(buf[offset:], binaryWriter) + offset += p.fastWriteField5(buf[offset:], binaryWriter) + offset += p.fastWriteField6(buf[offset:], binaryWriter) + offset += p.fastWriteField7(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *ColumnQuoteDTO) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("ColumnQuoteDTO") + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field4Length() + l += p.field5Length() + l += p.field6Length() + l += p.field7Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *ColumnQuoteDTO) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "id", thrift.I64, 1) + offset += bthrift.Binary.WriteI64(buf[offset:], p.Id) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ColumnQuoteDTO) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "createTime", thrift.I64, 2) + offset += bthrift.Binary.WriteI64(buf[offset:], p.CreateTime) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ColumnQuoteDTO) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "updateTime", thrift.I64, 3) + offset += bthrift.Binary.WriteI64(buf[offset:], p.UpdateTime) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ColumnQuoteDTO) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "columnId", thrift.I64, 4) + offset += bthrift.Binary.WriteI64(buf[offset:], p.ColumnId) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ColumnQuoteDTO) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "editor", thrift.I64, 5) + offset += bthrift.Binary.WriteI64(buf[offset:], p.Editor) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ColumnQuoteDTO) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "price", thrift.I64, 6) + offset += bthrift.Binary.WriteI64(buf[offset:], p.Price) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ColumnQuoteDTO) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "status", thrift.I32, 7) + offset += bthrift.Binary.WriteI32(buf[offset:], p.Status) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ColumnQuoteDTO) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("id", thrift.I64, 1) + l += bthrift.Binary.I64Length(p.Id) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ColumnQuoteDTO) field2Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("createTime", thrift.I64, 2) + l += bthrift.Binary.I64Length(p.CreateTime) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ColumnQuoteDTO) field3Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("updateTime", thrift.I64, 3) + l += bthrift.Binary.I64Length(p.UpdateTime) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ColumnQuoteDTO) field4Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("columnId", thrift.I64, 4) + l += bthrift.Binary.I64Length(p.ColumnId) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ColumnQuoteDTO) field5Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("editor", thrift.I64, 5) + l += bthrift.Binary.I64Length(p.Editor) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ColumnQuoteDTO) field6Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("price", thrift.I64, 6) + l += bthrift.Binary.I64Length(p.Price) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ColumnQuoteDTO) field7Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("status", thrift.I32, 7) + l += bthrift.Binary.I32Length(p.Status) + + l += bthrift.Binary.FieldEndLength() + return l +} diff --git a/kitex_gen/sc_bff_api/k-consts.go b/kitex_gen/sc_bff_api/k-consts.go new file mode 100644 index 0000000..efe20f5 --- /dev/null +++ b/kitex_gen/sc_bff_api/k-consts.go @@ -0,0 +1,4 @@ +package sc_bff_api + +// KitexUnusedProtection is used to prevent 'imported and not used' error. +var KitexUnusedProtection = struct{}{} diff --git a/kitex_gen/sc_bff_api/k-payment_api.go b/kitex_gen/sc_bff_api/k-payment_api.go new file mode 100644 index 0000000..6d80cdb --- /dev/null +++ b/kitex_gen/sc_bff_api/k-payment_api.go @@ -0,0 +1,378 @@ +// Code generated by Kitex v0.9.1. DO NOT EDIT. + +package sc_bff_api + +import ( + "bytes" + "fmt" + "reflect" + "strings" + + "github.com/apache/thrift/lib/go/thrift" + + "github.com/cloudwego/kitex/pkg/protocol/bthrift" + + "github.com/eyebluecn/sc-misc-idl/kitex_gen/sc_misc_base" +) + +// unused protection +var ( + _ = fmt.Formatter(nil) + _ = (*bytes.Buffer)(nil) + _ = (*strings.Builder)(nil) + _ = reflect.Type(nil) + _ = thrift.TProtocol(nil) + _ = bthrift.BinaryWriter(nil) + _ = sc_misc_base.KitexUnusedProtection +) + +func (p *PaymentPaidCallbackRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaymentPaidCallbackRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *PaymentPaidCallbackRequest) FastReadField1(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.OrderNo = v + + } + return offset, nil +} + +func (p *PaymentPaidCallbackRequest) FastReadField255(buf []byte) (int, error) { + offset := 0 + + tmp := sc_misc_base.NewBase() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = tmp + return offset, nil +} + +// for compatibility +func (p *PaymentPaidCallbackRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *PaymentPaidCallbackRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "PaymentPaidCallbackRequest") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField255(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *PaymentPaidCallbackRequest) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("PaymentPaidCallbackRequest") + if p != nil { + l += p.field1Length() + l += p.field255Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *PaymentPaidCallbackRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "orderNo", thrift.STRING, 1) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.OrderNo) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *PaymentPaidCallbackRequest) fastWriteField255(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetBase() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "base", thrift.STRUCT, 255) + offset += p.Base.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *PaymentPaidCallbackRequest) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("orderNo", thrift.STRING, 1) + l += bthrift.Binary.StringLengthNocopy(p.OrderNo) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *PaymentPaidCallbackRequest) field255Length() int { + l := 0 + if p.IsSetBase() { + l += bthrift.Binary.FieldBeginLength("base", thrift.STRUCT, 255) + l += p.Base.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *PaymentPaidCallbackResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 255: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField255(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaymentPaidCallbackResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *PaymentPaidCallbackResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := NewPaymentDTO() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Payment = tmp + return offset, nil +} + +func (p *PaymentPaidCallbackResponse) FastReadField255(buf []byte) (int, error) { + offset := 0 + + tmp := sc_misc_base.NewBaseResp() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.BaseResp = tmp + return offset, nil +} + +// for compatibility +func (p *PaymentPaidCallbackResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *PaymentPaidCallbackResponse) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "PaymentPaidCallbackResponse") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField255(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *PaymentPaidCallbackResponse) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("PaymentPaidCallbackResponse") + if p != nil { + l += p.field1Length() + l += p.field255Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *PaymentPaidCallbackResponse) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "payment", thrift.STRUCT, 1) + offset += p.Payment.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *PaymentPaidCallbackResponse) fastWriteField255(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "baseResp", thrift.STRUCT, 255) + offset += p.BaseResp.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *PaymentPaidCallbackResponse) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("payment", thrift.STRUCT, 1) + l += p.Payment.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *PaymentPaidCallbackResponse) field255Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("baseResp", thrift.STRUCT, 255) + l += p.BaseResp.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} diff --git a/kitex_gen/sc_bff_api/k-payment_model.go b/kitex_gen/sc_bff_api/k-payment_model.go new file mode 100644 index 0000000..ef6d05b --- /dev/null +++ b/kitex_gen/sc_bff_api/k-payment_model.go @@ -0,0 +1,490 @@ +// Code generated by Kitex v0.9.1. DO NOT EDIT. + +package sc_bff_api + +import ( + "bytes" + "fmt" + "reflect" + "strings" + + "github.com/apache/thrift/lib/go/thrift" + + "github.com/cloudwego/kitex/pkg/protocol/bthrift" +) + +// unused protection +var ( + _ = fmt.Formatter(nil) + _ = (*bytes.Buffer)(nil) + _ = (*strings.Builder)(nil) + _ = reflect.Type(nil) + _ = thrift.TProtocol(nil) + _ = bthrift.BinaryWriter(nil) +) + +func (p *PaymentDTO) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 6: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField6(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 7: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField7(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 8: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField8(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaymentDTO[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *PaymentDTO) FastReadField1(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Id = v + + } + return offset, nil +} + +func (p *PaymentDTO) FastReadField2(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.CreateTime = v + + } + return offset, nil +} + +func (p *PaymentDTO) FastReadField3(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.UpdateTime = v + + } + return offset, nil +} + +func (p *PaymentDTO) FastReadField4(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.OrderNo = v + + } + return offset, nil +} + +func (p *PaymentDTO) FastReadField5(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Method = v + + } + return offset, nil +} + +func (p *PaymentDTO) FastReadField6(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.ThirdTransactionNo = v + + } + return offset, nil +} + +func (p *PaymentDTO) FastReadField7(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Amount = v + + } + return offset, nil +} + +func (p *PaymentDTO) FastReadField8(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Status = v + + } + return offset, nil +} + +// for compatibility +func (p *PaymentDTO) FastWrite(buf []byte) int { + return 0 +} + +func (p *PaymentDTO) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "PaymentDTO") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField3(buf[offset:], binaryWriter) + offset += p.fastWriteField7(buf[offset:], binaryWriter) + offset += p.fastWriteField8(buf[offset:], binaryWriter) + offset += p.fastWriteField4(buf[offset:], binaryWriter) + offset += p.fastWriteField5(buf[offset:], binaryWriter) + offset += p.fastWriteField6(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *PaymentDTO) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("PaymentDTO") + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field4Length() + l += p.field5Length() + l += p.field6Length() + l += p.field7Length() + l += p.field8Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *PaymentDTO) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "id", thrift.I64, 1) + offset += bthrift.Binary.WriteI64(buf[offset:], p.Id) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *PaymentDTO) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "createTime", thrift.I64, 2) + offset += bthrift.Binary.WriteI64(buf[offset:], p.CreateTime) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *PaymentDTO) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "updateTime", thrift.I64, 3) + offset += bthrift.Binary.WriteI64(buf[offset:], p.UpdateTime) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *PaymentDTO) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "orderNo", thrift.STRING, 4) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.OrderNo) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *PaymentDTO) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "method", thrift.STRING, 5) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Method) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *PaymentDTO) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "thirdTransactionNo", thrift.STRING, 6) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.ThirdTransactionNo) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *PaymentDTO) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "amount", thrift.I64, 7) + offset += bthrift.Binary.WriteI64(buf[offset:], p.Amount) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *PaymentDTO) fastWriteField8(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "status", thrift.I32, 8) + offset += bthrift.Binary.WriteI32(buf[offset:], p.Status) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *PaymentDTO) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("id", thrift.I64, 1) + l += bthrift.Binary.I64Length(p.Id) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *PaymentDTO) field2Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("createTime", thrift.I64, 2) + l += bthrift.Binary.I64Length(p.CreateTime) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *PaymentDTO) field3Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("updateTime", thrift.I64, 3) + l += bthrift.Binary.I64Length(p.UpdateTime) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *PaymentDTO) field4Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("orderNo", thrift.STRING, 4) + l += bthrift.Binary.StringLengthNocopy(p.OrderNo) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *PaymentDTO) field5Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("method", thrift.STRING, 5) + l += bthrift.Binary.StringLengthNocopy(p.Method) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *PaymentDTO) field6Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("thirdTransactionNo", thrift.STRING, 6) + l += bthrift.Binary.StringLengthNocopy(p.ThirdTransactionNo) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *PaymentDTO) field7Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("amount", thrift.I64, 7) + l += bthrift.Binary.I64Length(p.Amount) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *PaymentDTO) field8Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("status", thrift.I32, 8) + l += bthrift.Binary.I32Length(p.Status) + + l += bthrift.Binary.FieldEndLength() + return l +} diff --git a/kitex_gen/sc_misc_api/k-model_1.go b/kitex_gen/sc_bff_api/k-reader_model.go similarity index 85% rename from kitex_gen/sc_misc_api/k-model_1.go rename to kitex_gen/sc_bff_api/k-reader_model.go index cfc3e10..7e69622 100644 --- a/kitex_gen/sc_misc_api/k-model_1.go +++ b/kitex_gen/sc_bff_api/k-reader_model.go @@ -1,6 +1,6 @@ // Code generated by Kitex v0.9.1. DO NOT EDIT. -package sc_misc_api +package sc_bff_api import ( "bytes" @@ -23,7 +23,7 @@ var ( _ = bthrift.BinaryWriter(nil) ) -func (p *EditorDTO) FastRead(buf []byte) (int, error) { +func (p *ReaderDTO) FastRead(buf []byte) (int, error) { var err error var offset int var l int @@ -127,7 +127,7 @@ ReadStructBeginError: ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EditorDTO[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ReaderDTO[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: @@ -136,7 +136,7 @@ ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EditorDTO) FastReadField1(buf []byte) (int, error) { +func (p *ReaderDTO) FastReadField1(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { @@ -150,7 +150,7 @@ func (p *EditorDTO) FastReadField1(buf []byte) (int, error) { return offset, nil } -func (p *EditorDTO) FastReadField2(buf []byte) (int, error) { +func (p *ReaderDTO) FastReadField2(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { @@ -164,7 +164,7 @@ func (p *EditorDTO) FastReadField2(buf []byte) (int, error) { return offset, nil } -func (p *EditorDTO) FastReadField3(buf []byte) (int, error) { +func (p *ReaderDTO) FastReadField3(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { @@ -178,7 +178,7 @@ func (p *EditorDTO) FastReadField3(buf []byte) (int, error) { return offset, nil } -func (p *EditorDTO) FastReadField4(buf []byte) (int, error) { +func (p *ReaderDTO) FastReadField4(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { @@ -193,13 +193,13 @@ func (p *EditorDTO) FastReadField4(buf []byte) (int, error) { } // for compatibility -func (p *EditorDTO) FastWrite(buf []byte) int { +func (p *ReaderDTO) FastWrite(buf []byte) int { return 0 } -func (p *EditorDTO) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *ReaderDTO) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "EditorDTO") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "ReaderDTO") if p != nil { offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) @@ -211,9 +211,9 @@ func (p *EditorDTO) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWrite return offset } -func (p *EditorDTO) BLength() int { +func (p *ReaderDTO) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("EditorDTO") + l += bthrift.Binary.StructBeginLength("ReaderDTO") if p != nil { l += p.field1Length() l += p.field2Length() @@ -225,7 +225,7 @@ func (p *EditorDTO) BLength() int { return l } -func (p *EditorDTO) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *ReaderDTO) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "id", thrift.I64, 1) offset += bthrift.Binary.WriteI64(buf[offset:], p.Id) @@ -234,7 +234,7 @@ func (p *EditorDTO) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWrite return offset } -func (p *EditorDTO) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *ReaderDTO) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "createTime", thrift.I64, 2) offset += bthrift.Binary.WriteI64(buf[offset:], p.CreateTime) @@ -243,7 +243,7 @@ func (p *EditorDTO) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWrite return offset } -func (p *EditorDTO) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *ReaderDTO) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "updateTime", thrift.I64, 3) offset += bthrift.Binary.WriteI64(buf[offset:], p.UpdateTime) @@ -252,7 +252,7 @@ func (p *EditorDTO) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWrite return offset } -func (p *EditorDTO) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *ReaderDTO) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "username", thrift.STRING, 4) offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Username) @@ -261,7 +261,7 @@ func (p *EditorDTO) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWrite return offset } -func (p *EditorDTO) field1Length() int { +func (p *ReaderDTO) field1Length() int { l := 0 l += bthrift.Binary.FieldBeginLength("id", thrift.I64, 1) l += bthrift.Binary.I64Length(p.Id) @@ -270,7 +270,7 @@ func (p *EditorDTO) field1Length() int { return l } -func (p *EditorDTO) field2Length() int { +func (p *ReaderDTO) field2Length() int { l := 0 l += bthrift.Binary.FieldBeginLength("createTime", thrift.I64, 2) l += bthrift.Binary.I64Length(p.CreateTime) @@ -279,7 +279,7 @@ func (p *EditorDTO) field2Length() int { return l } -func (p *EditorDTO) field3Length() int { +func (p *ReaderDTO) field3Length() int { l := 0 l += bthrift.Binary.FieldBeginLength("updateTime", thrift.I64, 3) l += bthrift.Binary.I64Length(p.UpdateTime) @@ -288,7 +288,7 @@ func (p *EditorDTO) field3Length() int { return l } -func (p *EditorDTO) field4Length() int { +func (p *ReaderDTO) field4Length() int { l := 0 l += bthrift.Binary.FieldBeginLength("username", thrift.STRING, 4) l += bthrift.Binary.StringLengthNocopy(p.Username) diff --git a/kitex_gen/sc_bff_api/k-subscription_enums.go b/kitex_gen/sc_bff_api/k-subscription_enums.go new file mode 100644 index 0000000..3d0a53a --- /dev/null +++ b/kitex_gen/sc_bff_api/k-subscription_enums.go @@ -0,0 +1,24 @@ +// Code generated by Kitex v0.9.1. DO NOT EDIT. + +package sc_bff_api + +import ( + "bytes" + "fmt" + "reflect" + "strings" + + "github.com/apache/thrift/lib/go/thrift" + + "github.com/cloudwego/kitex/pkg/protocol/bthrift" +) + +// unused protection +var ( + _ = fmt.Formatter(nil) + _ = (*bytes.Buffer)(nil) + _ = (*strings.Builder)(nil) + _ = reflect.Type(nil) + _ = thrift.TProtocol(nil) + _ = bthrift.BinaryWriter(nil) +) diff --git a/kitex_gen/sc_bff_api/k-subscription_model.go b/kitex_gen/sc_bff_api/k-subscription_model.go new file mode 100644 index 0000000..b1819f7 --- /dev/null +++ b/kitex_gen/sc_bff_api/k-subscription_model.go @@ -0,0 +1,442 @@ +// Code generated by Kitex v0.9.1. DO NOT EDIT. + +package sc_bff_api + +import ( + "bytes" + "fmt" + "reflect" + "strings" + + "github.com/apache/thrift/lib/go/thrift" + + "github.com/cloudwego/kitex/pkg/protocol/bthrift" +) + +// unused protection +var ( + _ = fmt.Formatter(nil) + _ = (*bytes.Buffer)(nil) + _ = (*strings.Builder)(nil) + _ = reflect.Type(nil) + _ = thrift.TProtocol(nil) + _ = bthrift.BinaryWriter(nil) +) + +func (p *SubscriptionDTO) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 6: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField6(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 7: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField7(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SubscriptionDTO[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *SubscriptionDTO) FastReadField1(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Id = v + + } + return offset, nil +} + +func (p *SubscriptionDTO) FastReadField2(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.CreateTime = v + + } + return offset, nil +} + +func (p *SubscriptionDTO) FastReadField3(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.UpdateTime = v + + } + return offset, nil +} + +func (p *SubscriptionDTO) FastReadField4(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.ReaderId = v + + } + return offset, nil +} + +func (p *SubscriptionDTO) FastReadField5(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.ColumnId = v + + } + return offset, nil +} + +func (p *SubscriptionDTO) FastReadField6(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.OrderId = v + + } + return offset, nil +} + +func (p *SubscriptionDTO) FastReadField7(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Status = SubscriptionStatus(v) + + } + return offset, nil +} + +// for compatibility +func (p *SubscriptionDTO) FastWrite(buf []byte) int { + return 0 +} + +func (p *SubscriptionDTO) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "SubscriptionDTO") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField3(buf[offset:], binaryWriter) + offset += p.fastWriteField4(buf[offset:], binaryWriter) + offset += p.fastWriteField5(buf[offset:], binaryWriter) + offset += p.fastWriteField6(buf[offset:], binaryWriter) + offset += p.fastWriteField7(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *SubscriptionDTO) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("SubscriptionDTO") + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field4Length() + l += p.field5Length() + l += p.field6Length() + l += p.field7Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *SubscriptionDTO) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "id", thrift.I64, 1) + offset += bthrift.Binary.WriteI64(buf[offset:], p.Id) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *SubscriptionDTO) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "createTime", thrift.I64, 2) + offset += bthrift.Binary.WriteI64(buf[offset:], p.CreateTime) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *SubscriptionDTO) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "updateTime", thrift.I64, 3) + offset += bthrift.Binary.WriteI64(buf[offset:], p.UpdateTime) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *SubscriptionDTO) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "readerId", thrift.I64, 4) + offset += bthrift.Binary.WriteI64(buf[offset:], p.ReaderId) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *SubscriptionDTO) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "columnId", thrift.I64, 5) + offset += bthrift.Binary.WriteI64(buf[offset:], p.ColumnId) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *SubscriptionDTO) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "orderId", thrift.I64, 6) + offset += bthrift.Binary.WriteI64(buf[offset:], p.OrderId) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *SubscriptionDTO) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "status", thrift.I32, 7) + offset += bthrift.Binary.WriteI32(buf[offset:], int32(p.Status)) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *SubscriptionDTO) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("id", thrift.I64, 1) + l += bthrift.Binary.I64Length(p.Id) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *SubscriptionDTO) field2Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("createTime", thrift.I64, 2) + l += bthrift.Binary.I64Length(p.CreateTime) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *SubscriptionDTO) field3Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("updateTime", thrift.I64, 3) + l += bthrift.Binary.I64Length(p.UpdateTime) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *SubscriptionDTO) field4Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("readerId", thrift.I64, 4) + l += bthrift.Binary.I64Length(p.ReaderId) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *SubscriptionDTO) field5Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("columnId", thrift.I64, 5) + l += bthrift.Binary.I64Length(p.ColumnId) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *SubscriptionDTO) field6Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("orderId", thrift.I64, 6) + l += bthrift.Binary.I64Length(p.OrderId) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *SubscriptionDTO) field7Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("status", thrift.I32, 7) + l += bthrift.Binary.I32Length(int32(p.Status)) + + l += bthrift.Binary.FieldEndLength() + return l +} diff --git a/kitex_gen/sc_bff_api/payment_api.go b/kitex_gen/sc_bff_api/payment_api.go new file mode 100644 index 0000000..2c9d407 --- /dev/null +++ b/kitex_gen/sc_bff_api/payment_api.go @@ -0,0 +1,476 @@ +// Code generated by thriftgo (0.3.12). DO NOT EDIT. + +package sc_bff_api + +import ( + "fmt" + "github.com/apache/thrift/lib/go/thrift" + "github.com/eyebluecn/sc-misc-idl/kitex_gen/sc_misc_base" + "strings" +) + +type PaymentPaidCallbackRequest struct { + OrderNo string `thrift:"orderNo,1" frugal:"1,default,string" json:"orderNo"` + Base *sc_misc_base.Base `thrift:"base,255,optional" frugal:"255,optional,sc_misc_base.Base" json:"base,omitempty"` +} + +func NewPaymentPaidCallbackRequest() *PaymentPaidCallbackRequest { + return &PaymentPaidCallbackRequest{} +} + +func (p *PaymentPaidCallbackRequest) InitDefault() { + *p = PaymentPaidCallbackRequest{} +} + +func (p *PaymentPaidCallbackRequest) GetOrderNo() (v string) { + return p.OrderNo +} + +var PaymentPaidCallbackRequest_Base_DEFAULT *sc_misc_base.Base + +func (p *PaymentPaidCallbackRequest) GetBase() (v *sc_misc_base.Base) { + if !p.IsSetBase() { + return PaymentPaidCallbackRequest_Base_DEFAULT + } + return p.Base +} +func (p *PaymentPaidCallbackRequest) SetOrderNo(val string) { + p.OrderNo = val +} +func (p *PaymentPaidCallbackRequest) SetBase(val *sc_misc_base.Base) { + p.Base = val +} + +var fieldIDToName_PaymentPaidCallbackRequest = map[int16]string{ + 1: "orderNo", + 255: "base", +} + +func (p *PaymentPaidCallbackRequest) IsSetBase() bool { + return p.Base != nil +} + +func (p *PaymentPaidCallbackRequest) 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.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(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_PaymentPaidCallbackRequest[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 *PaymentPaidCallbackRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.OrderNo = _field + return nil +} +func (p *PaymentPaidCallbackRequest) ReadField255(iprot thrift.TProtocol) error { + _field := sc_misc_base.NewBase() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} + +func (p *PaymentPaidCallbackRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("PaymentPaidCallbackRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + 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 *PaymentPaidCallbackRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("orderNo", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.OrderNo); 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 *PaymentPaidCallbackRequest) writeField255(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.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 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *PaymentPaidCallbackRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PaymentPaidCallbackRequest(%+v)", *p) + +} + +func (p *PaymentPaidCallbackRequest) DeepEqual(ano *PaymentPaidCallbackRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.OrderNo) { + return false + } + if !p.Field255DeepEqual(ano.Base) { + return false + } + return true +} + +func (p *PaymentPaidCallbackRequest) Field1DeepEqual(src string) bool { + + if strings.Compare(p.OrderNo, src) != 0 { + return false + } + return true +} +func (p *PaymentPaidCallbackRequest) Field255DeepEqual(src *sc_misc_base.Base) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} + +type PaymentPaidCallbackResponse struct { + Payment *PaymentDTO `thrift:"payment,1" frugal:"1,default,PaymentDTO" json:"payment"` + BaseResp *sc_misc_base.BaseResp `thrift:"baseResp,255" frugal:"255,default,sc_misc_base.BaseResp" json:"baseResp"` +} + +func NewPaymentPaidCallbackResponse() *PaymentPaidCallbackResponse { + return &PaymentPaidCallbackResponse{} +} + +func (p *PaymentPaidCallbackResponse) InitDefault() { + *p = PaymentPaidCallbackResponse{} +} + +var PaymentPaidCallbackResponse_Payment_DEFAULT *PaymentDTO + +func (p *PaymentPaidCallbackResponse) GetPayment() (v *PaymentDTO) { + if !p.IsSetPayment() { + return PaymentPaidCallbackResponse_Payment_DEFAULT + } + return p.Payment +} + +var PaymentPaidCallbackResponse_BaseResp_DEFAULT *sc_misc_base.BaseResp + +func (p *PaymentPaidCallbackResponse) GetBaseResp() (v *sc_misc_base.BaseResp) { + if !p.IsSetBaseResp() { + return PaymentPaidCallbackResponse_BaseResp_DEFAULT + } + return p.BaseResp +} +func (p *PaymentPaidCallbackResponse) SetPayment(val *PaymentDTO) { + p.Payment = val +} +func (p *PaymentPaidCallbackResponse) SetBaseResp(val *sc_misc_base.BaseResp) { + p.BaseResp = val +} + +var fieldIDToName_PaymentPaidCallbackResponse = map[int16]string{ + 1: "payment", + 255: "baseResp", +} + +func (p *PaymentPaidCallbackResponse) IsSetPayment() bool { + return p.Payment != nil +} + +func (p *PaymentPaidCallbackResponse) IsSetBaseResp() bool { + return p.BaseResp != nil +} + +func (p *PaymentPaidCallbackResponse) 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 255: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField255(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_PaymentPaidCallbackResponse[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 *PaymentPaidCallbackResponse) ReadField1(iprot thrift.TProtocol) error { + _field := NewPaymentDTO() + if err := _field.Read(iprot); err != nil { + return err + } + p.Payment = _field + return nil +} +func (p *PaymentPaidCallbackResponse) ReadField255(iprot thrift.TProtocol) error { + _field := sc_misc_base.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.BaseResp = _field + return nil +} + +func (p *PaymentPaidCallbackResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("PaymentPaidCallbackResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField255(oprot); err != nil { + fieldId = 255 + 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 *PaymentPaidCallbackResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("payment", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Payment.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 *PaymentPaidCallbackResponse) writeField255(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("baseResp", thrift.STRUCT, 255); err != nil { + goto WriteFieldBeginError + } + if err := p.BaseResp.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 255 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 255 end error: ", p), err) +} + +func (p *PaymentPaidCallbackResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PaymentPaidCallbackResponse(%+v)", *p) + +} + +func (p *PaymentPaidCallbackResponse) DeepEqual(ano *PaymentPaidCallbackResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Payment) { + return false + } + if !p.Field255DeepEqual(ano.BaseResp) { + return false + } + return true +} + +func (p *PaymentPaidCallbackResponse) Field1DeepEqual(src *PaymentDTO) bool { + + if !p.Payment.DeepEqual(src) { + return false + } + return true +} +func (p *PaymentPaidCallbackResponse) Field255DeepEqual(src *sc_misc_base.BaseResp) bool { + + if !p.BaseResp.DeepEqual(src) { + return false + } + return true +} diff --git a/kitex_gen/sc_bff_api/payment_model.go b/kitex_gen/sc_bff_api/payment_model.go new file mode 100644 index 0000000..d45e0e0 --- /dev/null +++ b/kitex_gen/sc_bff_api/payment_model.go @@ -0,0 +1,586 @@ +// Code generated by thriftgo (0.3.12). DO NOT EDIT. + +package sc_bff_api + +import ( + "fmt" + "github.com/apache/thrift/lib/go/thrift" + "strings" +) + +type PaymentDTO struct { + Id int64 `thrift:"id,1" frugal:"1,default,i64" json:"id"` + CreateTime int64 `thrift:"createTime,2" frugal:"2,default,i64" json:"createTime"` + UpdateTime int64 `thrift:"updateTime,3" frugal:"3,default,i64" json:"updateTime"` + OrderNo string `thrift:"orderNo,4" frugal:"4,default,string" json:"orderNo"` + Method string `thrift:"method,5" frugal:"5,default,string" json:"method"` + ThirdTransactionNo string `thrift:"thirdTransactionNo,6" frugal:"6,default,string" json:"thirdTransactionNo"` + Amount int64 `thrift:"amount,7" frugal:"7,default,i64" json:"amount"` + Status int32 `thrift:"status,8" frugal:"8,default,i32" json:"status"` +} + +func NewPaymentDTO() *PaymentDTO { + return &PaymentDTO{} +} + +func (p *PaymentDTO) InitDefault() { + *p = PaymentDTO{} +} + +func (p *PaymentDTO) GetId() (v int64) { + return p.Id +} + +func (p *PaymentDTO) GetCreateTime() (v int64) { + return p.CreateTime +} + +func (p *PaymentDTO) GetUpdateTime() (v int64) { + return p.UpdateTime +} + +func (p *PaymentDTO) GetOrderNo() (v string) { + return p.OrderNo +} + +func (p *PaymentDTO) GetMethod() (v string) { + return p.Method +} + +func (p *PaymentDTO) GetThirdTransactionNo() (v string) { + return p.ThirdTransactionNo +} + +func (p *PaymentDTO) GetAmount() (v int64) { + return p.Amount +} + +func (p *PaymentDTO) GetStatus() (v int32) { + return p.Status +} +func (p *PaymentDTO) SetId(val int64) { + p.Id = val +} +func (p *PaymentDTO) SetCreateTime(val int64) { + p.CreateTime = val +} +func (p *PaymentDTO) SetUpdateTime(val int64) { + p.UpdateTime = val +} +func (p *PaymentDTO) SetOrderNo(val string) { + p.OrderNo = val +} +func (p *PaymentDTO) SetMethod(val string) { + p.Method = val +} +func (p *PaymentDTO) SetThirdTransactionNo(val string) { + p.ThirdTransactionNo = val +} +func (p *PaymentDTO) SetAmount(val int64) { + p.Amount = val +} +func (p *PaymentDTO) SetStatus(val int32) { + p.Status = val +} + +var fieldIDToName_PaymentDTO = map[int16]string{ + 1: "id", + 2: "createTime", + 3: "updateTime", + 4: "orderNo", + 5: "method", + 6: "thirdTransactionNo", + 7: "amount", + 8: "status", +} + +func (p *PaymentDTO) 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.STRING { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.STRING { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.STRING { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.I64 { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 8: + if fieldTypeId == thrift.I32 { + if err = p.ReadField8(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_PaymentDTO[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 *PaymentDTO) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Id = _field + return nil +} +func (p *PaymentDTO) ReadField2(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.CreateTime = _field + return nil +} +func (p *PaymentDTO) ReadField3(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.UpdateTime = _field + return nil +} +func (p *PaymentDTO) ReadField4(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.OrderNo = _field + return nil +} +func (p *PaymentDTO) ReadField5(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Method = _field + return nil +} +func (p *PaymentDTO) ReadField6(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.ThirdTransactionNo = _field + return nil +} +func (p *PaymentDTO) ReadField7(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Amount = _field + return nil +} +func (p *PaymentDTO) ReadField8(iprot thrift.TProtocol) error { + + var _field int32 + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _field = v + } + p.Status = _field + return nil +} + +func (p *PaymentDTO) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("PaymentDTO"); 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 = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + goto WriteFieldError + } + if err = p.writeField8(oprot); err != nil { + fieldId = 8 + 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 *PaymentDTO) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.Id); 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 *PaymentDTO) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("createTime", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.CreateTime); 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 *PaymentDTO) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("updateTime", thrift.I64, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.UpdateTime); 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 *PaymentDTO) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("orderNo", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.OrderNo); 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 *PaymentDTO) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("method", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Method); 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 *PaymentDTO) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("thirdTransactionNo", thrift.STRING, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.ThirdTransactionNo); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *PaymentDTO) writeField7(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("amount", thrift.I64, 7); 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 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} + +func (p *PaymentDTO) writeField8(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("status", thrift.I32, 8); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(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 8 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) +} + +func (p *PaymentDTO) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PaymentDTO(%+v)", *p) + +} + +func (p *PaymentDTO) DeepEqual(ano *PaymentDTO) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Id) { + return false + } + if !p.Field2DeepEqual(ano.CreateTime) { + return false + } + if !p.Field3DeepEqual(ano.UpdateTime) { + return false + } + if !p.Field4DeepEqual(ano.OrderNo) { + return false + } + if !p.Field5DeepEqual(ano.Method) { + return false + } + if !p.Field6DeepEqual(ano.ThirdTransactionNo) { + return false + } + if !p.Field7DeepEqual(ano.Amount) { + return false + } + if !p.Field8DeepEqual(ano.Status) { + return false + } + return true +} + +func (p *PaymentDTO) Field1DeepEqual(src int64) bool { + + if p.Id != src { + return false + } + return true +} +func (p *PaymentDTO) Field2DeepEqual(src int64) bool { + + if p.CreateTime != src { + return false + } + return true +} +func (p *PaymentDTO) Field3DeepEqual(src int64) bool { + + if p.UpdateTime != src { + return false + } + return true +} +func (p *PaymentDTO) Field4DeepEqual(src string) bool { + + if strings.Compare(p.OrderNo, src) != 0 { + return false + } + return true +} +func (p *PaymentDTO) Field5DeepEqual(src string) bool { + + if strings.Compare(p.Method, src) != 0 { + return false + } + return true +} +func (p *PaymentDTO) Field6DeepEqual(src string) bool { + + if strings.Compare(p.ThirdTransactionNo, src) != 0 { + return false + } + return true +} +func (p *PaymentDTO) Field7DeepEqual(src int64) bool { + + if p.Amount != src { + return false + } + return true +} +func (p *PaymentDTO) Field8DeepEqual(src int32) bool { + + if p.Status != src { + return false + } + return true +} diff --git a/kitex_gen/sc_misc_api/model_1.go b/kitex_gen/sc_bff_api/reader_model.go similarity index 80% rename from kitex_gen/sc_misc_api/model_1.go rename to kitex_gen/sc_bff_api/reader_model.go index dc54ea4..04d5679 100644 --- a/kitex_gen/sc_misc_api/model_1.go +++ b/kitex_gen/sc_bff_api/reader_model.go @@ -1,6 +1,6 @@ // Code generated by thriftgo (0.3.12). DO NOT EDIT. -package sc_misc_api +package sc_bff_api import ( "fmt" @@ -8,57 +8,57 @@ import ( "strings" ) -type EditorDTO struct { +type ReaderDTO struct { Id int64 `thrift:"id,1" frugal:"1,default,i64" json:"id"` CreateTime int64 `thrift:"createTime,2" frugal:"2,default,i64" json:"createTime"` UpdateTime int64 `thrift:"updateTime,3" frugal:"3,default,i64" json:"updateTime"` Username string `thrift:"username,4" frugal:"4,default,string" json:"username"` } -func NewEditorDTO() *EditorDTO { - return &EditorDTO{} +func NewReaderDTO() *ReaderDTO { + return &ReaderDTO{} } -func (p *EditorDTO) InitDefault() { - *p = EditorDTO{} +func (p *ReaderDTO) InitDefault() { + *p = ReaderDTO{} } -func (p *EditorDTO) GetId() (v int64) { +func (p *ReaderDTO) GetId() (v int64) { return p.Id } -func (p *EditorDTO) GetCreateTime() (v int64) { +func (p *ReaderDTO) GetCreateTime() (v int64) { return p.CreateTime } -func (p *EditorDTO) GetUpdateTime() (v int64) { +func (p *ReaderDTO) GetUpdateTime() (v int64) { return p.UpdateTime } -func (p *EditorDTO) GetUsername() (v string) { +func (p *ReaderDTO) GetUsername() (v string) { return p.Username } -func (p *EditorDTO) SetId(val int64) { +func (p *ReaderDTO) SetId(val int64) { p.Id = val } -func (p *EditorDTO) SetCreateTime(val int64) { +func (p *ReaderDTO) SetCreateTime(val int64) { p.CreateTime = val } -func (p *EditorDTO) SetUpdateTime(val int64) { +func (p *ReaderDTO) SetUpdateTime(val int64) { p.UpdateTime = val } -func (p *EditorDTO) SetUsername(val string) { +func (p *ReaderDTO) SetUsername(val string) { p.Username = val } -var fieldIDToName_EditorDTO = map[int16]string{ +var fieldIDToName_ReaderDTO = map[int16]string{ 1: "id", 2: "createTime", 3: "updateTime", 4: "username", } -func (p *EditorDTO) Read(iprot thrift.TProtocol) (err error) { +func (p *ReaderDTO) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -128,7 +128,7 @@ ReadStructBeginError: 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_EditorDTO[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ReaderDTO[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -138,7 +138,7 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *EditorDTO) ReadField1(iprot thrift.TProtocol) error { +func (p *ReaderDTO) ReadField1(iprot thrift.TProtocol) error { var _field int64 if v, err := iprot.ReadI64(); err != nil { @@ -149,7 +149,7 @@ func (p *EditorDTO) ReadField1(iprot thrift.TProtocol) error { p.Id = _field return nil } -func (p *EditorDTO) ReadField2(iprot thrift.TProtocol) error { +func (p *ReaderDTO) ReadField2(iprot thrift.TProtocol) error { var _field int64 if v, err := iprot.ReadI64(); err != nil { @@ -160,7 +160,7 @@ func (p *EditorDTO) ReadField2(iprot thrift.TProtocol) error { p.CreateTime = _field return nil } -func (p *EditorDTO) ReadField3(iprot thrift.TProtocol) error { +func (p *ReaderDTO) ReadField3(iprot thrift.TProtocol) error { var _field int64 if v, err := iprot.ReadI64(); err != nil { @@ -171,7 +171,7 @@ func (p *EditorDTO) ReadField3(iprot thrift.TProtocol) error { p.UpdateTime = _field return nil } -func (p *EditorDTO) ReadField4(iprot thrift.TProtocol) error { +func (p *ReaderDTO) ReadField4(iprot thrift.TProtocol) error { var _field string if v, err := iprot.ReadString(); err != nil { @@ -183,9 +183,9 @@ func (p *EditorDTO) ReadField4(iprot thrift.TProtocol) error { return nil } -func (p *EditorDTO) Write(oprot thrift.TProtocol) (err error) { +func (p *ReaderDTO) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("EditorDTO"); err != nil { + if err = oprot.WriteStructBegin("ReaderDTO"); err != nil { goto WriteStructBeginError } if p != nil { @@ -223,7 +223,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *EditorDTO) writeField1(oprot thrift.TProtocol) (err error) { +func (p *ReaderDTO) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("id", thrift.I64, 1); err != nil { goto WriteFieldBeginError } @@ -240,7 +240,7 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *EditorDTO) writeField2(oprot thrift.TProtocol) (err error) { +func (p *ReaderDTO) writeField2(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("createTime", thrift.I64, 2); err != nil { goto WriteFieldBeginError } @@ -257,7 +257,7 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *EditorDTO) writeField3(oprot thrift.TProtocol) (err error) { +func (p *ReaderDTO) writeField3(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("updateTime", thrift.I64, 3); err != nil { goto WriteFieldBeginError } @@ -274,7 +274,7 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) } -func (p *EditorDTO) writeField4(oprot thrift.TProtocol) (err error) { +func (p *ReaderDTO) writeField4(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("username", thrift.STRING, 4); err != nil { goto WriteFieldBeginError } @@ -291,15 +291,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) } -func (p *EditorDTO) String() string { +func (p *ReaderDTO) String() string { if p == nil { return "" } - return fmt.Sprintf("EditorDTO(%+v)", *p) + return fmt.Sprintf("ReaderDTO(%+v)", *p) } -func (p *EditorDTO) DeepEqual(ano *EditorDTO) bool { +func (p *ReaderDTO) DeepEqual(ano *ReaderDTO) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -320,28 +320,28 @@ func (p *EditorDTO) DeepEqual(ano *EditorDTO) bool { return true } -func (p *EditorDTO) Field1DeepEqual(src int64) bool { +func (p *ReaderDTO) Field1DeepEqual(src int64) bool { if p.Id != src { return false } return true } -func (p *EditorDTO) Field2DeepEqual(src int64) bool { +func (p *ReaderDTO) Field2DeepEqual(src int64) bool { if p.CreateTime != src { return false } return true } -func (p *EditorDTO) Field3DeepEqual(src int64) bool { +func (p *ReaderDTO) Field3DeepEqual(src int64) bool { if p.UpdateTime != src { return false } return true } -func (p *EditorDTO) Field4DeepEqual(src string) bool { +func (p *ReaderDTO) Field4DeepEqual(src string) bool { if strings.Compare(p.Username, src) != 0 { return false diff --git a/kitex_gen/sc_bff_api/subscription_enums.go b/kitex_gen/sc_bff_api/subscription_enums.go new file mode 100644 index 0000000..926ff32 --- /dev/null +++ b/kitex_gen/sc_bff_api/subscription_enums.go @@ -0,0 +1,56 @@ +// Code generated by thriftgo (0.3.12). DO NOT EDIT. + +package sc_bff_api + +import ( + "database/sql" + "database/sql/driver" + "fmt" +) + +type SubscriptionStatus int64 + +const ( + SubscriptionStatus_CREATED SubscriptionStatus = 0 + SubscriptionStatus_OK SubscriptionStatus = 1 + SubscriptionStatus_DISABLED SubscriptionStatus = 2 +) + +func (p SubscriptionStatus) String() string { + switch p { + case SubscriptionStatus_CREATED: + return "CREATED" + case SubscriptionStatus_OK: + return "OK" + case SubscriptionStatus_DISABLED: + return "DISABLED" + } + return "" +} + +func SubscriptionStatusFromString(s string) (SubscriptionStatus, error) { + switch s { + case "CREATED": + return SubscriptionStatus_CREATED, nil + case "OK": + return SubscriptionStatus_OK, nil + case "DISABLED": + return SubscriptionStatus_DISABLED, nil + } + return SubscriptionStatus(0), fmt.Errorf("not a valid SubscriptionStatus string") +} + +func SubscriptionStatusPtr(v SubscriptionStatus) *SubscriptionStatus { return &v } +func (p *SubscriptionStatus) Scan(value interface{}) (err error) { + var result sql.NullInt64 + err = result.Scan(value) + *p = SubscriptionStatus(result.Int64) + return +} + +func (p *SubscriptionStatus) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} diff --git a/kitex_gen/sc_bff_api/subscription_model.go b/kitex_gen/sc_bff_api/subscription_model.go new file mode 100644 index 0000000..1ca5fe8 --- /dev/null +++ b/kitex_gen/sc_bff_api/subscription_model.go @@ -0,0 +1,526 @@ +// Code generated by thriftgo (0.3.12). DO NOT EDIT. + +package sc_bff_api + +import ( + "fmt" + "github.com/apache/thrift/lib/go/thrift" +) + +type SubscriptionDTO struct { + Id int64 `thrift:"id,1" frugal:"1,default,i64" json:"id"` + CreateTime int64 `thrift:"createTime,2" frugal:"2,default,i64" json:"createTime"` + UpdateTime int64 `thrift:"updateTime,3" frugal:"3,default,i64" json:"updateTime"` + ReaderId int64 `thrift:"readerId,4" frugal:"4,default,i64" json:"readerId"` + ColumnId int64 `thrift:"columnId,5" frugal:"5,default,i64" json:"columnId"` + OrderId int64 `thrift:"orderId,6" frugal:"6,default,i64" json:"orderId"` + Status SubscriptionStatus `thrift:"status,7" frugal:"7,default,SubscriptionStatus" json:"status"` +} + +func NewSubscriptionDTO() *SubscriptionDTO { + return &SubscriptionDTO{} +} + +func (p *SubscriptionDTO) InitDefault() { + *p = SubscriptionDTO{} +} + +func (p *SubscriptionDTO) GetId() (v int64) { + return p.Id +} + +func (p *SubscriptionDTO) GetCreateTime() (v int64) { + return p.CreateTime +} + +func (p *SubscriptionDTO) GetUpdateTime() (v int64) { + return p.UpdateTime +} + +func (p *SubscriptionDTO) GetReaderId() (v int64) { + return p.ReaderId +} + +func (p *SubscriptionDTO) GetColumnId() (v int64) { + return p.ColumnId +} + +func (p *SubscriptionDTO) GetOrderId() (v int64) { + return p.OrderId +} + +func (p *SubscriptionDTO) GetStatus() (v SubscriptionStatus) { + return p.Status +} +func (p *SubscriptionDTO) SetId(val int64) { + p.Id = val +} +func (p *SubscriptionDTO) SetCreateTime(val int64) { + p.CreateTime = val +} +func (p *SubscriptionDTO) SetUpdateTime(val int64) { + p.UpdateTime = val +} +func (p *SubscriptionDTO) SetReaderId(val int64) { + p.ReaderId = val +} +func (p *SubscriptionDTO) SetColumnId(val int64) { + p.ColumnId = val +} +func (p *SubscriptionDTO) SetOrderId(val int64) { + p.OrderId = val +} +func (p *SubscriptionDTO) SetStatus(val SubscriptionStatus) { + p.Status = val +} + +var fieldIDToName_SubscriptionDTO = map[int16]string{ + 1: "id", + 2: "createTime", + 3: "updateTime", + 4: "readerId", + 5: "columnId", + 6: "orderId", + 7: "status", +} + +func (p *SubscriptionDTO) 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.I64 { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.I64 { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.I32 { + if err = p.ReadField7(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_SubscriptionDTO[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 *SubscriptionDTO) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Id = _field + return nil +} +func (p *SubscriptionDTO) ReadField2(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.CreateTime = _field + return nil +} +func (p *SubscriptionDTO) ReadField3(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.UpdateTime = _field + return nil +} +func (p *SubscriptionDTO) ReadField4(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.ReaderId = _field + return nil +} +func (p *SubscriptionDTO) ReadField5(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.ColumnId = _field + return nil +} +func (p *SubscriptionDTO) ReadField6(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.OrderId = _field + return nil +} +func (p *SubscriptionDTO) ReadField7(iprot thrift.TProtocol) error { + + var _field SubscriptionStatus + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _field = SubscriptionStatus(v) + } + p.Status = _field + return nil +} + +func (p *SubscriptionDTO) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("SubscriptionDTO"); 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 = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + 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 *SubscriptionDTO) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.Id); 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 *SubscriptionDTO) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("createTime", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.CreateTime); 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 *SubscriptionDTO) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("updateTime", thrift.I64, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.UpdateTime); 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 *SubscriptionDTO) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("readerId", thrift.I64, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.ReaderId); 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 *SubscriptionDTO) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("columnId", thrift.I64, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.ColumnId); 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 *SubscriptionDTO) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("orderId", thrift.I64, 6); 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 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *SubscriptionDTO) writeField7(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("status", thrift.I32, 7); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(int32(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 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} + +func (p *SubscriptionDTO) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SubscriptionDTO(%+v)", *p) + +} + +func (p *SubscriptionDTO) DeepEqual(ano *SubscriptionDTO) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Id) { + return false + } + if !p.Field2DeepEqual(ano.CreateTime) { + return false + } + if !p.Field3DeepEqual(ano.UpdateTime) { + return false + } + if !p.Field4DeepEqual(ano.ReaderId) { + return false + } + if !p.Field5DeepEqual(ano.ColumnId) { + return false + } + if !p.Field6DeepEqual(ano.OrderId) { + return false + } + if !p.Field7DeepEqual(ano.Status) { + return false + } + return true +} + +func (p *SubscriptionDTO) Field1DeepEqual(src int64) bool { + + if p.Id != src { + return false + } + return true +} +func (p *SubscriptionDTO) Field2DeepEqual(src int64) bool { + + if p.CreateTime != src { + return false + } + return true +} +func (p *SubscriptionDTO) Field3DeepEqual(src int64) bool { + + if p.UpdateTime != src { + return false + } + return true +} +func (p *SubscriptionDTO) Field4DeepEqual(src int64) bool { + + if p.ReaderId != src { + return false + } + return true +} +func (p *SubscriptionDTO) Field5DeepEqual(src int64) bool { + + if p.ColumnId != src { + return false + } + return true +} +func (p *SubscriptionDTO) Field6DeepEqual(src int64) bool { + + if p.OrderId != src { + return false + } + return true +} +func (p *SubscriptionDTO) Field7DeepEqual(src SubscriptionStatus) bool { + + if p.Status != src { + return false + } + return true +} diff --git a/kitex_gen/sc_misc_api/k-model.go b/kitex_gen/sc_misc_api/k-model.go index 6a75640..cfc3e10 100644 --- a/kitex_gen/sc_misc_api/k-model.go +++ b/kitex_gen/sc_misc_api/k-model.go @@ -23,7 +23,7 @@ var ( _ = bthrift.BinaryWriter(nil) ) -func (p *ReaderDTO) FastRead(buf []byte) (int, error) { +func (p *EditorDTO) FastRead(buf []byte) (int, error) { var err error var offset int var l int @@ -127,7 +127,7 @@ ReadStructBeginError: ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ReaderDTO[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EditorDTO[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: @@ -136,7 +136,7 @@ ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *ReaderDTO) FastReadField1(buf []byte) (int, error) { +func (p *EditorDTO) FastReadField1(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { @@ -150,7 +150,7 @@ func (p *ReaderDTO) FastReadField1(buf []byte) (int, error) { return offset, nil } -func (p *ReaderDTO) FastReadField2(buf []byte) (int, error) { +func (p *EditorDTO) FastReadField2(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { @@ -164,7 +164,7 @@ func (p *ReaderDTO) FastReadField2(buf []byte) (int, error) { return offset, nil } -func (p *ReaderDTO) FastReadField3(buf []byte) (int, error) { +func (p *EditorDTO) FastReadField3(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { @@ -178,7 +178,7 @@ func (p *ReaderDTO) FastReadField3(buf []byte) (int, error) { return offset, nil } -func (p *ReaderDTO) FastReadField4(buf []byte) (int, error) { +func (p *EditorDTO) FastReadField4(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { @@ -193,13 +193,13 @@ func (p *ReaderDTO) FastReadField4(buf []byte) (int, error) { } // for compatibility -func (p *ReaderDTO) FastWrite(buf []byte) int { +func (p *EditorDTO) FastWrite(buf []byte) int { return 0 } -func (p *ReaderDTO) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *EditorDTO) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "ReaderDTO") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "EditorDTO") if p != nil { offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) @@ -211,9 +211,9 @@ func (p *ReaderDTO) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWrite return offset } -func (p *ReaderDTO) BLength() int { +func (p *EditorDTO) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("ReaderDTO") + l += bthrift.Binary.StructBeginLength("EditorDTO") if p != nil { l += p.field1Length() l += p.field2Length() @@ -225,7 +225,7 @@ func (p *ReaderDTO) BLength() int { return l } -func (p *ReaderDTO) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *EditorDTO) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "id", thrift.I64, 1) offset += bthrift.Binary.WriteI64(buf[offset:], p.Id) @@ -234,7 +234,7 @@ func (p *ReaderDTO) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWrite return offset } -func (p *ReaderDTO) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *EditorDTO) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "createTime", thrift.I64, 2) offset += bthrift.Binary.WriteI64(buf[offset:], p.CreateTime) @@ -243,7 +243,7 @@ func (p *ReaderDTO) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWrite return offset } -func (p *ReaderDTO) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *EditorDTO) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "updateTime", thrift.I64, 3) offset += bthrift.Binary.WriteI64(buf[offset:], p.UpdateTime) @@ -252,7 +252,7 @@ func (p *ReaderDTO) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWrite return offset } -func (p *ReaderDTO) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *EditorDTO) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "username", thrift.STRING, 4) offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Username) @@ -261,7 +261,7 @@ func (p *ReaderDTO) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWrite return offset } -func (p *ReaderDTO) field1Length() int { +func (p *EditorDTO) field1Length() int { l := 0 l += bthrift.Binary.FieldBeginLength("id", thrift.I64, 1) l += bthrift.Binary.I64Length(p.Id) @@ -270,7 +270,7 @@ func (p *ReaderDTO) field1Length() int { return l } -func (p *ReaderDTO) field2Length() int { +func (p *EditorDTO) field2Length() int { l := 0 l += bthrift.Binary.FieldBeginLength("createTime", thrift.I64, 2) l += bthrift.Binary.I64Length(p.CreateTime) @@ -279,7 +279,7 @@ func (p *ReaderDTO) field2Length() int { return l } -func (p *ReaderDTO) field3Length() int { +func (p *EditorDTO) field3Length() int { l := 0 l += bthrift.Binary.FieldBeginLength("updateTime", thrift.I64, 3) l += bthrift.Binary.I64Length(p.UpdateTime) @@ -288,7 +288,7 @@ func (p *ReaderDTO) field3Length() int { return l } -func (p *ReaderDTO) field4Length() int { +func (p *EditorDTO) field4Length() int { l := 0 l += bthrift.Binary.FieldBeginLength("username", thrift.STRING, 4) l += bthrift.Binary.StringLengthNocopy(p.Username) diff --git a/kitex_gen/sc_misc_api/k-reader_api.go b/kitex_gen/sc_misc_api/k-reader_api.go index 88ad30c..a2037c6 100644 --- a/kitex_gen/sc_misc_api/k-reader_api.go +++ b/kitex_gen/sc_misc_api/k-reader_api.go @@ -12,6 +12,7 @@ import ( "github.com/cloudwego/kitex/pkg/protocol/bthrift" + "github.com/eyebluecn/sc-misc-idl/kitex_gen/sc_bff_api" "github.com/eyebluecn/sc-misc-idl/kitex_gen/sc_misc_base" ) @@ -23,6 +24,7 @@ var ( _ = reflect.Type(nil) _ = thrift.TProtocol(nil) _ = bthrift.BinaryWriter(nil) + _ = sc_bff_api.KitexUnusedProtection _ = sc_misc_base.KitexUnusedProtection ) @@ -341,7 +343,7 @@ ReadStructEndError: func (p *ReaderLoginResponse) FastReadField1(buf []byte) (int, error) { offset := 0 - tmp := NewReaderDTO() + tmp := sc_bff_api.NewReaderDTO() if l, err := tmp.FastRead(buf[offset:]); err != nil { return offset, err } else { diff --git a/kitex_gen/sc_misc_api/k-smart_classroom_misc.go b/kitex_gen/sc_misc_api/k-smart_classroom_misc.go index 6ab9823..42cdf16 100644 --- a/kitex_gen/sc_misc_api/k-smart_classroom_misc.go +++ b/kitex_gen/sc_misc_api/k-smart_classroom_misc.go @@ -11,17 +11,1052 @@ import ( "github.com/apache/thrift/lib/go/thrift" "github.com/cloudwego/kitex/pkg/protocol/bthrift" + + "github.com/eyebluecn/sc-misc-idl/kitex_gen/sc_bff_api" +) + +// unused protection +var ( + _ = fmt.Formatter(nil) + _ = (*bytes.Buffer)(nil) + _ = (*strings.Builder)(nil) + _ = reflect.Type(nil) + _ = thrift.TProtocol(nil) + _ = bthrift.BinaryWriter(nil) + _ = sc_bff_api.KitexUnusedProtection ) -// unused protection -var ( - _ = fmt.Formatter(nil) - _ = (*bytes.Buffer)(nil) - _ = (*strings.Builder)(nil) - _ = reflect.Type(nil) - _ = thrift.TProtocol(nil) - _ = bthrift.BinaryWriter(nil) -) +func (p *MiscServiceColumnOmnibusArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MiscServiceColumnOmnibusArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *MiscServiceColumnOmnibusArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := sc_bff_api.NewColumnOmnibusRequest() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Request = tmp + return offset, nil +} + +// for compatibility +func (p *MiscServiceColumnOmnibusArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *MiscServiceColumnOmnibusArgs) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "ColumnOmnibus_args") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *MiscServiceColumnOmnibusArgs) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("ColumnOmnibus_args") + if p != nil { + l += p.field1Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *MiscServiceColumnOmnibusArgs) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "request", thrift.STRUCT, 1) + offset += p.Request.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *MiscServiceColumnOmnibusArgs) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("request", thrift.STRUCT, 1) + l += p.Request.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *MiscServiceColumnOmnibusResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MiscServiceColumnOmnibusResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *MiscServiceColumnOmnibusResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + + tmp := sc_bff_api.NewColumnOmnibusResponse() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = tmp + return offset, nil +} + +// for compatibility +func (p *MiscServiceColumnOmnibusResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *MiscServiceColumnOmnibusResult) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "ColumnOmnibus_result") + if p != nil { + offset += p.fastWriteField0(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *MiscServiceColumnOmnibusResult) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("ColumnOmnibus_result") + if p != nil { + l += p.field0Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *MiscServiceColumnOmnibusResult) fastWriteField0(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "success", thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *MiscServiceColumnOmnibusResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += bthrift.Binary.FieldBeginLength("success", thrift.STRUCT, 0) + l += p.Success.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *MiscServiceColumnPageArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MiscServiceColumnPageArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *MiscServiceColumnPageArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := sc_bff_api.NewColumnPageRequest() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Request = tmp + return offset, nil +} + +// for compatibility +func (p *MiscServiceColumnPageArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *MiscServiceColumnPageArgs) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "ColumnPage_args") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *MiscServiceColumnPageArgs) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("ColumnPage_args") + if p != nil { + l += p.field1Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *MiscServiceColumnPageArgs) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "request", thrift.STRUCT, 1) + offset += p.Request.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *MiscServiceColumnPageArgs) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("request", thrift.STRUCT, 1) + l += p.Request.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *MiscServiceColumnPageResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MiscServiceColumnPageResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *MiscServiceColumnPageResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + + tmp := sc_bff_api.NewColumnPageResponse() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = tmp + return offset, nil +} + +// for compatibility +func (p *MiscServiceColumnPageResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *MiscServiceColumnPageResult) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "ColumnPage_result") + if p != nil { + offset += p.fastWriteField0(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *MiscServiceColumnPageResult) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("ColumnPage_result") + if p != nil { + l += p.field0Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *MiscServiceColumnPageResult) fastWriteField0(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "success", thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *MiscServiceColumnPageResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += bthrift.Binary.FieldBeginLength("success", thrift.STRUCT, 0) + l += p.Success.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *MiscServiceColumnDetailArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MiscServiceColumnDetailArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *MiscServiceColumnDetailArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := sc_bff_api.NewColumnDetailRequest() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Request = tmp + return offset, nil +} + +// for compatibility +func (p *MiscServiceColumnDetailArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *MiscServiceColumnDetailArgs) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "ColumnDetail_args") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *MiscServiceColumnDetailArgs) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("ColumnDetail_args") + if p != nil { + l += p.field1Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *MiscServiceColumnDetailArgs) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "request", thrift.STRUCT, 1) + offset += p.Request.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *MiscServiceColumnDetailArgs) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("request", thrift.STRUCT, 1) + l += p.Request.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *MiscServiceColumnDetailResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MiscServiceColumnDetailResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *MiscServiceColumnDetailResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + + tmp := sc_bff_api.NewColumnDetailResponse() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = tmp + return offset, nil +} + +// for compatibility +func (p *MiscServiceColumnDetailResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *MiscServiceColumnDetailResult) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "ColumnDetail_result") + if p != nil { + offset += p.fastWriteField0(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *MiscServiceColumnDetailResult) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("ColumnDetail_result") + if p != nil { + l += p.field0Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *MiscServiceColumnDetailResult) fastWriteField0(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "success", thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *MiscServiceColumnDetailResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += bthrift.Binary.FieldBeginLength("success", thrift.STRUCT, 0) + l += p.Success.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *MiscServiceEditorLoginArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MiscServiceEditorLoginArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *MiscServiceEditorLoginArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := NewEditorLoginRequest() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Request = tmp + return offset, nil +} + +// for compatibility +func (p *MiscServiceEditorLoginArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *MiscServiceEditorLoginArgs) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "EditorLogin_args") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *MiscServiceEditorLoginArgs) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("EditorLogin_args") + if p != nil { + l += p.field1Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *MiscServiceEditorLoginArgs) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "request", thrift.STRUCT, 1) + offset += p.Request.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *MiscServiceEditorLoginArgs) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("request", thrift.STRUCT, 1) + l += p.Request.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *MiscServiceEditorLoginResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MiscServiceEditorLoginResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *MiscServiceEditorLoginResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + + tmp := NewEditorLoginResponse() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = tmp + return offset, nil +} + +// for compatibility +func (p *MiscServiceEditorLoginResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *MiscServiceEditorLoginResult) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "EditorLogin_result") + if p != nil { + offset += p.fastWriteField0(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *MiscServiceEditorLoginResult) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("EditorLogin_result") + if p != nil { + l += p.field0Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *MiscServiceEditorLoginResult) fastWriteField0(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "success", thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *MiscServiceEditorLoginResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += bthrift.Binary.FieldBeginLength("success", thrift.STRUCT, 0) + l += p.Success.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} func (p *MiscServiceReaderLoginArgs) FastRead(buf []byte) (int, error) { var err error @@ -281,7 +1316,7 @@ func (p *MiscServiceReaderLoginResult) field0Length() int { return l } -func (p *MiscServiceEditorLoginArgs) FastRead(buf []byte) (int, error) { +func (p *MiscServicePaymentPaidCallbackArgs) FastRead(buf []byte) (int, error) { var err error var offset int var l int @@ -343,7 +1378,7 @@ ReadStructBeginError: ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MiscServiceEditorLoginArgs[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MiscServicePaymentPaidCallbackArgs[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: @@ -352,10 +1387,10 @@ ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *MiscServiceEditorLoginArgs) FastReadField1(buf []byte) (int, error) { +func (p *MiscServicePaymentPaidCallbackArgs) FastReadField1(buf []byte) (int, error) { offset := 0 - tmp := NewEditorLoginRequest() + tmp := sc_bff_api.NewPaymentPaidCallbackRequest() if l, err := tmp.FastRead(buf[offset:]); err != nil { return offset, err } else { @@ -366,13 +1401,13 @@ func (p *MiscServiceEditorLoginArgs) FastReadField1(buf []byte) (int, error) { } // for compatibility -func (p *MiscServiceEditorLoginArgs) FastWrite(buf []byte) int { +func (p *MiscServicePaymentPaidCallbackArgs) FastWrite(buf []byte) int { return 0 } -func (p *MiscServiceEditorLoginArgs) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *MiscServicePaymentPaidCallbackArgs) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "EditorLogin_args") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "PaymentPaidCallback_args") if p != nil { offset += p.fastWriteField1(buf[offset:], binaryWriter) } @@ -381,9 +1416,9 @@ func (p *MiscServiceEditorLoginArgs) FastWriteNocopy(buf []byte, binaryWriter bt return offset } -func (p *MiscServiceEditorLoginArgs) BLength() int { +func (p *MiscServicePaymentPaidCallbackArgs) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("EditorLogin_args") + l += bthrift.Binary.StructBeginLength("PaymentPaidCallback_args") if p != nil { l += p.field1Length() } @@ -392,7 +1427,7 @@ func (p *MiscServiceEditorLoginArgs) BLength() int { return l } -func (p *MiscServiceEditorLoginArgs) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *MiscServicePaymentPaidCallbackArgs) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "request", thrift.STRUCT, 1) offset += p.Request.FastWriteNocopy(buf[offset:], binaryWriter) @@ -400,7 +1435,7 @@ func (p *MiscServiceEditorLoginArgs) fastWriteField1(buf []byte, binaryWriter bt return offset } -func (p *MiscServiceEditorLoginArgs) field1Length() int { +func (p *MiscServicePaymentPaidCallbackArgs) field1Length() int { l := 0 l += bthrift.Binary.FieldBeginLength("request", thrift.STRUCT, 1) l += p.Request.BLength() @@ -408,7 +1443,7 @@ func (p *MiscServiceEditorLoginArgs) field1Length() int { return l } -func (p *MiscServiceEditorLoginResult) FastRead(buf []byte) (int, error) { +func (p *MiscServicePaymentPaidCallbackResult) FastRead(buf []byte) (int, error) { var err error var offset int var l int @@ -470,7 +1505,7 @@ ReadStructBeginError: ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MiscServiceEditorLoginResult[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MiscServicePaymentPaidCallbackResult[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: @@ -479,10 +1514,10 @@ ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *MiscServiceEditorLoginResult) FastReadField0(buf []byte) (int, error) { +func (p *MiscServicePaymentPaidCallbackResult) FastReadField0(buf []byte) (int, error) { offset := 0 - tmp := NewEditorLoginResponse() + tmp := sc_bff_api.NewPaymentPaidCallbackResponse() if l, err := tmp.FastRead(buf[offset:]); err != nil { return offset, err } else { @@ -493,13 +1528,13 @@ func (p *MiscServiceEditorLoginResult) FastReadField0(buf []byte) (int, error) { } // for compatibility -func (p *MiscServiceEditorLoginResult) FastWrite(buf []byte) int { +func (p *MiscServicePaymentPaidCallbackResult) FastWrite(buf []byte) int { return 0 } -func (p *MiscServiceEditorLoginResult) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *MiscServicePaymentPaidCallbackResult) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "EditorLogin_result") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "PaymentPaidCallback_result") if p != nil { offset += p.fastWriteField0(buf[offset:], binaryWriter) } @@ -508,9 +1543,9 @@ func (p *MiscServiceEditorLoginResult) FastWriteNocopy(buf []byte, binaryWriter return offset } -func (p *MiscServiceEditorLoginResult) BLength() int { +func (p *MiscServicePaymentPaidCallbackResult) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("EditorLogin_result") + l += bthrift.Binary.StructBeginLength("PaymentPaidCallback_result") if p != nil { l += p.field0Length() } @@ -519,7 +1554,7 @@ func (p *MiscServiceEditorLoginResult) BLength() int { return l } -func (p *MiscServiceEditorLoginResult) fastWriteField0(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *MiscServicePaymentPaidCallbackResult) fastWriteField0(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 if p.IsSetSuccess() { offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "success", thrift.STRUCT, 0) @@ -529,7 +1564,7 @@ func (p *MiscServiceEditorLoginResult) fastWriteField0(buf []byte, binaryWriter return offset } -func (p *MiscServiceEditorLoginResult) field0Length() int { +func (p *MiscServicePaymentPaidCallbackResult) field0Length() int { l := 0 if p.IsSetSuccess() { l += bthrift.Binary.FieldBeginLength("success", thrift.STRUCT, 0) @@ -539,11 +1574,27 @@ func (p *MiscServiceEditorLoginResult) field0Length() int { return l } -func (p *MiscServiceReaderLoginArgs) GetFirstArgument() interface{} { +func (p *MiscServiceColumnOmnibusArgs) GetFirstArgument() interface{} { return p.Request } -func (p *MiscServiceReaderLoginResult) GetResult() interface{} { +func (p *MiscServiceColumnOmnibusResult) GetResult() interface{} { + return p.Success +} + +func (p *MiscServiceColumnPageArgs) GetFirstArgument() interface{} { + return p.Request +} + +func (p *MiscServiceColumnPageResult) GetResult() interface{} { + return p.Success +} + +func (p *MiscServiceColumnDetailArgs) GetFirstArgument() interface{} { + return p.Request +} + +func (p *MiscServiceColumnDetailResult) GetResult() interface{} { return p.Success } @@ -554,3 +1605,19 @@ func (p *MiscServiceEditorLoginArgs) GetFirstArgument() interface{} { func (p *MiscServiceEditorLoginResult) GetResult() interface{} { return p.Success } + +func (p *MiscServiceReaderLoginArgs) GetFirstArgument() interface{} { + return p.Request +} + +func (p *MiscServiceReaderLoginResult) GetResult() interface{} { + return p.Success +} + +func (p *MiscServicePaymentPaidCallbackArgs) GetFirstArgument() interface{} { + return p.Request +} + +func (p *MiscServicePaymentPaidCallbackResult) GetResult() interface{} { + return p.Success +} diff --git a/kitex_gen/sc_misc_api/miscservice/client.go b/kitex_gen/sc_misc_api/miscservice/client.go index 0d02b63..3ca24aa 100644 --- a/kitex_gen/sc_misc_api/miscservice/client.go +++ b/kitex_gen/sc_misc_api/miscservice/client.go @@ -6,13 +6,18 @@ import ( "context" client "github.com/cloudwego/kitex/client" callopt "github.com/cloudwego/kitex/client/callopt" + sc_bff_api "github.com/eyebluecn/sc-misc-idl/kitex_gen/sc_bff_api" sc_misc_api "github.com/eyebluecn/sc-misc-idl/kitex_gen/sc_misc_api" ) // Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework. type Client interface { - ReaderLogin(ctx context.Context, request *sc_misc_api.ReaderLoginRequest, callOptions ...callopt.Option) (r *sc_misc_api.ReaderLoginResponse, err error) + ColumnOmnibus(ctx context.Context, request *sc_bff_api.ColumnOmnibusRequest, callOptions ...callopt.Option) (r *sc_bff_api.ColumnOmnibusResponse, err error) + ColumnPage(ctx context.Context, request *sc_bff_api.ColumnPageRequest, callOptions ...callopt.Option) (r *sc_bff_api.ColumnPageResponse, err error) + ColumnDetail(ctx context.Context, request *sc_bff_api.ColumnDetailRequest, callOptions ...callopt.Option) (r *sc_bff_api.ColumnDetailResponse, err error) EditorLogin(ctx context.Context, request *sc_misc_api.EditorLoginRequest, callOptions ...callopt.Option) (r *sc_misc_api.EditorLoginResponse, err error) + ReaderLogin(ctx context.Context, request *sc_misc_api.ReaderLoginRequest, callOptions ...callopt.Option) (r *sc_misc_api.ReaderLoginResponse, err error) + PaymentPaidCallback(ctx context.Context, request *sc_bff_api.PaymentPaidCallbackRequest, callOptions ...callopt.Option) (r *sc_bff_api.PaymentPaidCallbackResponse, err error) } // NewClient creates a client for the service defined in IDL. @@ -44,12 +49,32 @@ type kMiscServiceClient struct { *kClient } -func (p *kMiscServiceClient) ReaderLogin(ctx context.Context, request *sc_misc_api.ReaderLoginRequest, callOptions ...callopt.Option) (r *sc_misc_api.ReaderLoginResponse, err error) { +func (p *kMiscServiceClient) ColumnOmnibus(ctx context.Context, request *sc_bff_api.ColumnOmnibusRequest, callOptions ...callopt.Option) (r *sc_bff_api.ColumnOmnibusResponse, err error) { ctx = client.NewCtxWithCallOptions(ctx, callOptions) - return p.kClient.ReaderLogin(ctx, request) + return p.kClient.ColumnOmnibus(ctx, request) +} + +func (p *kMiscServiceClient) ColumnPage(ctx context.Context, request *sc_bff_api.ColumnPageRequest, callOptions ...callopt.Option) (r *sc_bff_api.ColumnPageResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.ColumnPage(ctx, request) +} + +func (p *kMiscServiceClient) ColumnDetail(ctx context.Context, request *sc_bff_api.ColumnDetailRequest, callOptions ...callopt.Option) (r *sc_bff_api.ColumnDetailResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.ColumnDetail(ctx, request) } func (p *kMiscServiceClient) EditorLogin(ctx context.Context, request *sc_misc_api.EditorLoginRequest, callOptions ...callopt.Option) (r *sc_misc_api.EditorLoginResponse, err error) { ctx = client.NewCtxWithCallOptions(ctx, callOptions) return p.kClient.EditorLogin(ctx, request) } + +func (p *kMiscServiceClient) ReaderLogin(ctx context.Context, request *sc_misc_api.ReaderLoginRequest, callOptions ...callopt.Option) (r *sc_misc_api.ReaderLoginResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.ReaderLogin(ctx, request) +} + +func (p *kMiscServiceClient) PaymentPaidCallback(ctx context.Context, request *sc_bff_api.PaymentPaidCallbackRequest, callOptions ...callopt.Option) (r *sc_bff_api.PaymentPaidCallbackResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.PaymentPaidCallback(ctx, request) +} diff --git a/kitex_gen/sc_misc_api/miscservice/miscservice.go b/kitex_gen/sc_misc_api/miscservice/miscservice.go index 4600165..3fbff19 100644 --- a/kitex_gen/sc_misc_api/miscservice/miscservice.go +++ b/kitex_gen/sc_misc_api/miscservice/miscservice.go @@ -7,16 +7,31 @@ import ( "errors" client "github.com/cloudwego/kitex/client" kitex "github.com/cloudwego/kitex/pkg/serviceinfo" + sc_bff_api "github.com/eyebluecn/sc-misc-idl/kitex_gen/sc_bff_api" sc_misc_api "github.com/eyebluecn/sc-misc-idl/kitex_gen/sc_misc_api" ) var errInvalidMessageType = errors.New("invalid message type for service method handler") var serviceMethods = map[string]kitex.MethodInfo{ - "ReaderLogin": kitex.NewMethodInfo( - readerLoginHandler, - newMiscServiceReaderLoginArgs, - newMiscServiceReaderLoginResult, + "ColumnOmnibus": kitex.NewMethodInfo( + columnOmnibusHandler, + newMiscServiceColumnOmnibusArgs, + newMiscServiceColumnOmnibusResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "ColumnPage": kitex.NewMethodInfo( + columnPageHandler, + newMiscServiceColumnPageArgs, + newMiscServiceColumnPageResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "ColumnDetail": kitex.NewMethodInfo( + columnDetailHandler, + newMiscServiceColumnDetailArgs, + newMiscServiceColumnDetailResult, false, kitex.WithStreamingMode(kitex.StreamingNone), ), @@ -27,6 +42,20 @@ var serviceMethods = map[string]kitex.MethodInfo{ false, kitex.WithStreamingMode(kitex.StreamingNone), ), + "ReaderLogin": kitex.NewMethodInfo( + readerLoginHandler, + newMiscServiceReaderLoginArgs, + newMiscServiceReaderLoginResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "PaymentPaidCallback": kitex.NewMethodInfo( + paymentPaidCallbackHandler, + newMiscServicePaymentPaidCallbackArgs, + newMiscServicePaymentPaidCallbackResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), } var ( @@ -93,22 +122,58 @@ func newServiceInfo(hasStreaming bool, keepStreamingMethods bool, keepNonStreami return svcInfo } -func readerLoginHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { - realArg := arg.(*sc_misc_api.MiscServiceReaderLoginArgs) - realResult := result.(*sc_misc_api.MiscServiceReaderLoginResult) - success, err := handler.(sc_misc_api.MiscService).ReaderLogin(ctx, realArg.Request) +func columnOmnibusHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*sc_misc_api.MiscServiceColumnOmnibusArgs) + realResult := result.(*sc_misc_api.MiscServiceColumnOmnibusResult) + success, err := handler.(sc_misc_api.MiscService).ColumnOmnibus(ctx, realArg.Request) if err != nil { return err } realResult.Success = success return nil } -func newMiscServiceReaderLoginArgs() interface{} { - return sc_misc_api.NewMiscServiceReaderLoginArgs() +func newMiscServiceColumnOmnibusArgs() interface{} { + return sc_misc_api.NewMiscServiceColumnOmnibusArgs() } -func newMiscServiceReaderLoginResult() interface{} { - return sc_misc_api.NewMiscServiceReaderLoginResult() +func newMiscServiceColumnOmnibusResult() interface{} { + return sc_misc_api.NewMiscServiceColumnOmnibusResult() +} + +func columnPageHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*sc_misc_api.MiscServiceColumnPageArgs) + realResult := result.(*sc_misc_api.MiscServiceColumnPageResult) + success, err := handler.(sc_misc_api.MiscService).ColumnPage(ctx, realArg.Request) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newMiscServiceColumnPageArgs() interface{} { + return sc_misc_api.NewMiscServiceColumnPageArgs() +} + +func newMiscServiceColumnPageResult() interface{} { + return sc_misc_api.NewMiscServiceColumnPageResult() +} + +func columnDetailHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*sc_misc_api.MiscServiceColumnDetailArgs) + realResult := result.(*sc_misc_api.MiscServiceColumnDetailResult) + success, err := handler.(sc_misc_api.MiscService).ColumnDetail(ctx, realArg.Request) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newMiscServiceColumnDetailArgs() interface{} { + return sc_misc_api.NewMiscServiceColumnDetailArgs() +} + +func newMiscServiceColumnDetailResult() interface{} { + return sc_misc_api.NewMiscServiceColumnDetailResult() } func editorLoginHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { @@ -129,6 +194,42 @@ func newMiscServiceEditorLoginResult() interface{} { return sc_misc_api.NewMiscServiceEditorLoginResult() } +func readerLoginHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*sc_misc_api.MiscServiceReaderLoginArgs) + realResult := result.(*sc_misc_api.MiscServiceReaderLoginResult) + success, err := handler.(sc_misc_api.MiscService).ReaderLogin(ctx, realArg.Request) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newMiscServiceReaderLoginArgs() interface{} { + return sc_misc_api.NewMiscServiceReaderLoginArgs() +} + +func newMiscServiceReaderLoginResult() interface{} { + return sc_misc_api.NewMiscServiceReaderLoginResult() +} + +func paymentPaidCallbackHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*sc_misc_api.MiscServicePaymentPaidCallbackArgs) + realResult := result.(*sc_misc_api.MiscServicePaymentPaidCallbackResult) + success, err := handler.(sc_misc_api.MiscService).PaymentPaidCallback(ctx, realArg.Request) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newMiscServicePaymentPaidCallbackArgs() interface{} { + return sc_misc_api.NewMiscServicePaymentPaidCallbackArgs() +} + +func newMiscServicePaymentPaidCallbackResult() interface{} { + return sc_misc_api.NewMiscServicePaymentPaidCallbackResult() +} + type kClient struct { c client.Client } @@ -139,11 +240,31 @@ func newServiceClient(c client.Client) *kClient { } } -func (p *kClient) ReaderLogin(ctx context.Context, request *sc_misc_api.ReaderLoginRequest) (r *sc_misc_api.ReaderLoginResponse, err error) { - var _args sc_misc_api.MiscServiceReaderLoginArgs +func (p *kClient) ColumnOmnibus(ctx context.Context, request *sc_bff_api.ColumnOmnibusRequest) (r *sc_bff_api.ColumnOmnibusResponse, err error) { + var _args sc_misc_api.MiscServiceColumnOmnibusArgs _args.Request = request - var _result sc_misc_api.MiscServiceReaderLoginResult - if err = p.c.Call(ctx, "ReaderLogin", &_args, &_result); err != nil { + var _result sc_misc_api.MiscServiceColumnOmnibusResult + if err = p.c.Call(ctx, "ColumnOmnibus", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) ColumnPage(ctx context.Context, request *sc_bff_api.ColumnPageRequest) (r *sc_bff_api.ColumnPageResponse, err error) { + var _args sc_misc_api.MiscServiceColumnPageArgs + _args.Request = request + var _result sc_misc_api.MiscServiceColumnPageResult + if err = p.c.Call(ctx, "ColumnPage", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) ColumnDetail(ctx context.Context, request *sc_bff_api.ColumnDetailRequest) (r *sc_bff_api.ColumnDetailResponse, err error) { + var _args sc_misc_api.MiscServiceColumnDetailArgs + _args.Request = request + var _result sc_misc_api.MiscServiceColumnDetailResult + if err = p.c.Call(ctx, "ColumnDetail", &_args, &_result); err != nil { return } return _result.GetSuccess(), nil @@ -158,3 +279,23 @@ func (p *kClient) EditorLogin(ctx context.Context, request *sc_misc_api.EditorLo } return _result.GetSuccess(), nil } + +func (p *kClient) ReaderLogin(ctx context.Context, request *sc_misc_api.ReaderLoginRequest) (r *sc_misc_api.ReaderLoginResponse, err error) { + var _args sc_misc_api.MiscServiceReaderLoginArgs + _args.Request = request + var _result sc_misc_api.MiscServiceReaderLoginResult + if err = p.c.Call(ctx, "ReaderLogin", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) PaymentPaidCallback(ctx context.Context, request *sc_bff_api.PaymentPaidCallbackRequest) (r *sc_bff_api.PaymentPaidCallbackResponse, err error) { + var _args sc_misc_api.MiscServicePaymentPaidCallbackArgs + _args.Request = request + var _result sc_misc_api.MiscServicePaymentPaidCallbackResult + if err = p.c.Call(ctx, "PaymentPaidCallback", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} diff --git a/kitex_gen/sc_misc_api/model.go b/kitex_gen/sc_misc_api/model.go index 1364451..dc54ea4 100644 --- a/kitex_gen/sc_misc_api/model.go +++ b/kitex_gen/sc_misc_api/model.go @@ -8,57 +8,57 @@ import ( "strings" ) -type ReaderDTO struct { +type EditorDTO struct { Id int64 `thrift:"id,1" frugal:"1,default,i64" json:"id"` CreateTime int64 `thrift:"createTime,2" frugal:"2,default,i64" json:"createTime"` UpdateTime int64 `thrift:"updateTime,3" frugal:"3,default,i64" json:"updateTime"` Username string `thrift:"username,4" frugal:"4,default,string" json:"username"` } -func NewReaderDTO() *ReaderDTO { - return &ReaderDTO{} +func NewEditorDTO() *EditorDTO { + return &EditorDTO{} } -func (p *ReaderDTO) InitDefault() { - *p = ReaderDTO{} +func (p *EditorDTO) InitDefault() { + *p = EditorDTO{} } -func (p *ReaderDTO) GetId() (v int64) { +func (p *EditorDTO) GetId() (v int64) { return p.Id } -func (p *ReaderDTO) GetCreateTime() (v int64) { +func (p *EditorDTO) GetCreateTime() (v int64) { return p.CreateTime } -func (p *ReaderDTO) GetUpdateTime() (v int64) { +func (p *EditorDTO) GetUpdateTime() (v int64) { return p.UpdateTime } -func (p *ReaderDTO) GetUsername() (v string) { +func (p *EditorDTO) GetUsername() (v string) { return p.Username } -func (p *ReaderDTO) SetId(val int64) { +func (p *EditorDTO) SetId(val int64) { p.Id = val } -func (p *ReaderDTO) SetCreateTime(val int64) { +func (p *EditorDTO) SetCreateTime(val int64) { p.CreateTime = val } -func (p *ReaderDTO) SetUpdateTime(val int64) { +func (p *EditorDTO) SetUpdateTime(val int64) { p.UpdateTime = val } -func (p *ReaderDTO) SetUsername(val string) { +func (p *EditorDTO) SetUsername(val string) { p.Username = val } -var fieldIDToName_ReaderDTO = map[int16]string{ +var fieldIDToName_EditorDTO = map[int16]string{ 1: "id", 2: "createTime", 3: "updateTime", 4: "username", } -func (p *ReaderDTO) Read(iprot thrift.TProtocol) (err error) { +func (p *EditorDTO) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -128,7 +128,7 @@ ReadStructBeginError: 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_ReaderDTO[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_EditorDTO[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -138,7 +138,7 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *ReaderDTO) ReadField1(iprot thrift.TProtocol) error { +func (p *EditorDTO) ReadField1(iprot thrift.TProtocol) error { var _field int64 if v, err := iprot.ReadI64(); err != nil { @@ -149,7 +149,7 @@ func (p *ReaderDTO) ReadField1(iprot thrift.TProtocol) error { p.Id = _field return nil } -func (p *ReaderDTO) ReadField2(iprot thrift.TProtocol) error { +func (p *EditorDTO) ReadField2(iprot thrift.TProtocol) error { var _field int64 if v, err := iprot.ReadI64(); err != nil { @@ -160,7 +160,7 @@ func (p *ReaderDTO) ReadField2(iprot thrift.TProtocol) error { p.CreateTime = _field return nil } -func (p *ReaderDTO) ReadField3(iprot thrift.TProtocol) error { +func (p *EditorDTO) ReadField3(iprot thrift.TProtocol) error { var _field int64 if v, err := iprot.ReadI64(); err != nil { @@ -171,7 +171,7 @@ func (p *ReaderDTO) ReadField3(iprot thrift.TProtocol) error { p.UpdateTime = _field return nil } -func (p *ReaderDTO) ReadField4(iprot thrift.TProtocol) error { +func (p *EditorDTO) ReadField4(iprot thrift.TProtocol) error { var _field string if v, err := iprot.ReadString(); err != nil { @@ -183,9 +183,9 @@ func (p *ReaderDTO) ReadField4(iprot thrift.TProtocol) error { return nil } -func (p *ReaderDTO) Write(oprot thrift.TProtocol) (err error) { +func (p *EditorDTO) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ReaderDTO"); err != nil { + if err = oprot.WriteStructBegin("EditorDTO"); err != nil { goto WriteStructBeginError } if p != nil { @@ -223,7 +223,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *ReaderDTO) writeField1(oprot thrift.TProtocol) (err error) { +func (p *EditorDTO) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("id", thrift.I64, 1); err != nil { goto WriteFieldBeginError } @@ -240,7 +240,7 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *ReaderDTO) writeField2(oprot thrift.TProtocol) (err error) { +func (p *EditorDTO) writeField2(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("createTime", thrift.I64, 2); err != nil { goto WriteFieldBeginError } @@ -257,7 +257,7 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *ReaderDTO) writeField3(oprot thrift.TProtocol) (err error) { +func (p *EditorDTO) writeField3(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("updateTime", thrift.I64, 3); err != nil { goto WriteFieldBeginError } @@ -274,7 +274,7 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) } -func (p *ReaderDTO) writeField4(oprot thrift.TProtocol) (err error) { +func (p *EditorDTO) writeField4(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("username", thrift.STRING, 4); err != nil { goto WriteFieldBeginError } @@ -291,15 +291,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) } -func (p *ReaderDTO) String() string { +func (p *EditorDTO) String() string { if p == nil { return "" } - return fmt.Sprintf("ReaderDTO(%+v)", *p) + return fmt.Sprintf("EditorDTO(%+v)", *p) } -func (p *ReaderDTO) DeepEqual(ano *ReaderDTO) bool { +func (p *EditorDTO) DeepEqual(ano *EditorDTO) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -320,28 +320,28 @@ func (p *ReaderDTO) DeepEqual(ano *ReaderDTO) bool { return true } -func (p *ReaderDTO) Field1DeepEqual(src int64) bool { +func (p *EditorDTO) Field1DeepEqual(src int64) bool { if p.Id != src { return false } return true } -func (p *ReaderDTO) Field2DeepEqual(src int64) bool { +func (p *EditorDTO) Field2DeepEqual(src int64) bool { if p.CreateTime != src { return false } return true } -func (p *ReaderDTO) Field3DeepEqual(src int64) bool { +func (p *EditorDTO) Field3DeepEqual(src int64) bool { if p.UpdateTime != src { return false } return true } -func (p *ReaderDTO) Field4DeepEqual(src string) bool { +func (p *EditorDTO) Field4DeepEqual(src string) bool { if strings.Compare(p.Username, src) != 0 { return false diff --git a/kitex_gen/sc_misc_api/reader_api.go b/kitex_gen/sc_misc_api/reader_api.go index 34fb7f0..15b4aa1 100644 --- a/kitex_gen/sc_misc_api/reader_api.go +++ b/kitex_gen/sc_misc_api/reader_api.go @@ -5,13 +5,14 @@ package sc_misc_api import ( "fmt" "github.com/apache/thrift/lib/go/thrift" + "github.com/eyebluecn/sc-misc-idl/kitex_gen/sc_bff_api" "github.com/eyebluecn/sc-misc-idl/kitex_gen/sc_misc_base" "strings" ) type ReaderLoginRequest struct { - Username string `thrift:"username,1" frugal:"1,default,string" json:"username" query:"username"` - Password string `thrift:"password,2" frugal:"2,default,string" json:"password" query:"password"` + Username string `thrift:"username,1" frugal:"1,default,string" json:"username"` + Password string `thrift:"password,2" frugal:"2,default,string" json:"password"` Base *sc_misc_base.Base `thrift:"base,255,optional" frugal:"255,optional,sc_misc_base.Base" json:"base,omitempty"` } @@ -300,7 +301,7 @@ func (p *ReaderLoginRequest) Field255DeepEqual(src *sc_misc_base.Base) bool { } type ReaderLoginResponse struct { - Data *ReaderDTO `thrift:"data,1" frugal:"1,default,ReaderDTO" json:"data"` + Data *sc_bff_api.ReaderDTO `thrift:"data,1" frugal:"1,default,sc_bff_api.ReaderDTO" json:"data"` BaseResp *sc_misc_base.BaseResp `thrift:"baseResp,255" frugal:"255,default,sc_misc_base.BaseResp" json:"baseResp"` } @@ -312,9 +313,9 @@ func (p *ReaderLoginResponse) InitDefault() { *p = ReaderLoginResponse{} } -var ReaderLoginResponse_Data_DEFAULT *ReaderDTO +var ReaderLoginResponse_Data_DEFAULT *sc_bff_api.ReaderDTO -func (p *ReaderLoginResponse) GetData() (v *ReaderDTO) { +func (p *ReaderLoginResponse) GetData() (v *sc_bff_api.ReaderDTO) { if !p.IsSetData() { return ReaderLoginResponse_Data_DEFAULT } @@ -329,7 +330,7 @@ func (p *ReaderLoginResponse) GetBaseResp() (v *sc_misc_base.BaseResp) { } return p.BaseResp } -func (p *ReaderLoginResponse) SetData(val *ReaderDTO) { +func (p *ReaderLoginResponse) SetData(val *sc_bff_api.ReaderDTO) { p.Data = val } func (p *ReaderLoginResponse) SetBaseResp(val *sc_misc_base.BaseResp) { @@ -414,7 +415,7 @@ ReadStructEndError: } func (p *ReaderLoginResponse) ReadField1(iprot thrift.TProtocol) error { - _field := NewReaderDTO() + _field := sc_bff_api.NewReaderDTO() if err := _field.Read(iprot); err != nil { return err } @@ -519,7 +520,7 @@ func (p *ReaderLoginResponse) DeepEqual(ano *ReaderLoginResponse) bool { return true } -func (p *ReaderLoginResponse) Field1DeepEqual(src *ReaderDTO) bool { +func (p *ReaderLoginResponse) Field1DeepEqual(src *sc_bff_api.ReaderDTO) bool { if !p.Data.DeepEqual(src) { return false diff --git a/kitex_gen/sc_misc_api/smart_classroom_misc.go b/kitex_gen/sc_misc_api/smart_classroom_misc.go index 1b404ca..1b4aca5 100644 --- a/kitex_gen/sc_misc_api/smart_classroom_misc.go +++ b/kitex_gen/sc_misc_api/smart_classroom_misc.go @@ -6,12 +6,21 @@ import ( "context" "fmt" "github.com/apache/thrift/lib/go/thrift" + "github.com/eyebluecn/sc-misc-idl/kitex_gen/sc_bff_api" ) type MiscService interface { - ReaderLogin(ctx context.Context, request *ReaderLoginRequest) (r *ReaderLoginResponse, err error) + ColumnOmnibus(ctx context.Context, request *sc_bff_api.ColumnOmnibusRequest) (r *sc_bff_api.ColumnOmnibusResponse, err error) + + ColumnPage(ctx context.Context, request *sc_bff_api.ColumnPageRequest) (r *sc_bff_api.ColumnPageResponse, err error) + + ColumnDetail(ctx context.Context, request *sc_bff_api.ColumnDetailRequest) (r *sc_bff_api.ColumnDetailResponse, err error) EditorLogin(ctx context.Context, request *EditorLoginRequest) (r *EditorLoginResponse, err error) + + ReaderLogin(ctx context.Context, request *ReaderLoginRequest) (r *ReaderLoginResponse, err error) + + PaymentPaidCallback(ctx context.Context, request *sc_bff_api.PaymentPaidCallbackRequest) (r *sc_bff_api.PaymentPaidCallbackResponse, err error) } type MiscServiceClient struct { @@ -40,11 +49,29 @@ func (p *MiscServiceClient) Client_() thrift.TClient { return p.c } -func (p *MiscServiceClient) ReaderLogin(ctx context.Context, request *ReaderLoginRequest) (r *ReaderLoginResponse, err error) { - var _args MiscServiceReaderLoginArgs +func (p *MiscServiceClient) ColumnOmnibus(ctx context.Context, request *sc_bff_api.ColumnOmnibusRequest) (r *sc_bff_api.ColumnOmnibusResponse, err error) { + var _args MiscServiceColumnOmnibusArgs _args.Request = request - var _result MiscServiceReaderLoginResult - if err = p.Client_().Call(ctx, "ReaderLogin", &_args, &_result); err != nil { + var _result MiscServiceColumnOmnibusResult + if err = p.Client_().Call(ctx, "ColumnOmnibus", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *MiscServiceClient) ColumnPage(ctx context.Context, request *sc_bff_api.ColumnPageRequest) (r *sc_bff_api.ColumnPageResponse, err error) { + var _args MiscServiceColumnPageArgs + _args.Request = request + var _result MiscServiceColumnPageResult + if err = p.Client_().Call(ctx, "ColumnPage", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *MiscServiceClient) ColumnDetail(ctx context.Context, request *sc_bff_api.ColumnDetailRequest) (r *sc_bff_api.ColumnDetailResponse, err error) { + var _args MiscServiceColumnDetailArgs + _args.Request = request + var _result MiscServiceColumnDetailResult + if err = p.Client_().Call(ctx, "ColumnDetail", &_args, &_result); err != nil { return } return _result.GetSuccess(), nil @@ -58,6 +85,24 @@ func (p *MiscServiceClient) EditorLogin(ctx context.Context, request *EditorLogi } return _result.GetSuccess(), nil } +func (p *MiscServiceClient) ReaderLogin(ctx context.Context, request *ReaderLoginRequest) (r *ReaderLoginResponse, err error) { + var _args MiscServiceReaderLoginArgs + _args.Request = request + var _result MiscServiceReaderLoginResult + if err = p.Client_().Call(ctx, "ReaderLogin", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *MiscServiceClient) PaymentPaidCallback(ctx context.Context, request *sc_bff_api.PaymentPaidCallbackRequest) (r *sc_bff_api.PaymentPaidCallbackResponse, err error) { + var _args MiscServicePaymentPaidCallbackArgs + _args.Request = request + var _result MiscServicePaymentPaidCallbackResult + if err = p.Client_().Call(ctx, "PaymentPaidCallback", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} type MiscServiceProcessor struct { processorMap map[string]thrift.TProcessorFunction @@ -73,128 +118,1692 @@ func (p *MiscServiceProcessor) GetProcessorFunction(key string) (processor thrif return processor, ok } -func (p *MiscServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap -} +func (p *MiscServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewMiscServiceProcessor(handler MiscService) *MiscServiceProcessor { + self := &MiscServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self.AddToProcessorMap("ColumnOmnibus", &miscServiceProcessorColumnOmnibus{handler: handler}) + self.AddToProcessorMap("ColumnPage", &miscServiceProcessorColumnPage{handler: handler}) + self.AddToProcessorMap("ColumnDetail", &miscServiceProcessorColumnDetail{handler: handler}) + self.AddToProcessorMap("EditorLogin", &miscServiceProcessorEditorLogin{handler: handler}) + self.AddToProcessorMap("ReaderLogin", &miscServiceProcessorReaderLogin{handler: handler}) + self.AddToProcessorMap("PaymentPaidCallback", &miscServiceProcessorPaymentPaidCallback{handler: handler}) + return self +} +func (p *MiscServiceProcessor) 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 miscServiceProcessorColumnOmnibus struct { + handler MiscService +} + +func (p *miscServiceProcessorColumnOmnibus) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := MiscServiceColumnOmnibusArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("ColumnOmnibus", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := MiscServiceColumnOmnibusResult{} + var retval *sc_bff_api.ColumnOmnibusResponse + if retval, err2 = p.handler.ColumnOmnibus(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ColumnOmnibus: "+err2.Error()) + oprot.WriteMessageBegin("ColumnOmnibus", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("ColumnOmnibus", 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 miscServiceProcessorColumnPage struct { + handler MiscService +} + +func (p *miscServiceProcessorColumnPage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := MiscServiceColumnPageArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("ColumnPage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := MiscServiceColumnPageResult{} + var retval *sc_bff_api.ColumnPageResponse + if retval, err2 = p.handler.ColumnPage(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ColumnPage: "+err2.Error()) + oprot.WriteMessageBegin("ColumnPage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("ColumnPage", 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 miscServiceProcessorColumnDetail struct { + handler MiscService +} + +func (p *miscServiceProcessorColumnDetail) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := MiscServiceColumnDetailArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("ColumnDetail", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := MiscServiceColumnDetailResult{} + var retval *sc_bff_api.ColumnDetailResponse + if retval, err2 = p.handler.ColumnDetail(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ColumnDetail: "+err2.Error()) + oprot.WriteMessageBegin("ColumnDetail", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("ColumnDetail", 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 miscServiceProcessorEditorLogin struct { + handler MiscService +} + +func (p *miscServiceProcessorEditorLogin) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := MiscServiceEditorLoginArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("EditorLogin", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := MiscServiceEditorLoginResult{} + var retval *EditorLoginResponse + if retval, err2 = p.handler.EditorLogin(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing EditorLogin: "+err2.Error()) + oprot.WriteMessageBegin("EditorLogin", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("EditorLogin", 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 miscServiceProcessorReaderLogin struct { + handler MiscService +} + +func (p *miscServiceProcessorReaderLogin) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := MiscServiceReaderLoginArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("ReaderLogin", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := MiscServiceReaderLoginResult{} + var retval *ReaderLoginResponse + if retval, err2 = p.handler.ReaderLogin(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ReaderLogin: "+err2.Error()) + oprot.WriteMessageBegin("ReaderLogin", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("ReaderLogin", 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 miscServiceProcessorPaymentPaidCallback struct { + handler MiscService +} + +func (p *miscServiceProcessorPaymentPaidCallback) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := MiscServicePaymentPaidCallbackArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("PaymentPaidCallback", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := MiscServicePaymentPaidCallbackResult{} + var retval *sc_bff_api.PaymentPaidCallbackResponse + if retval, err2 = p.handler.PaymentPaidCallback(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing PaymentPaidCallback: "+err2.Error()) + oprot.WriteMessageBegin("PaymentPaidCallback", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("PaymentPaidCallback", 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 MiscServiceColumnOmnibusArgs struct { + Request *sc_bff_api.ColumnOmnibusRequest `thrift:"request,1" frugal:"1,default,sc_bff_api.ColumnOmnibusRequest" json:"request"` +} + +func NewMiscServiceColumnOmnibusArgs() *MiscServiceColumnOmnibusArgs { + return &MiscServiceColumnOmnibusArgs{} +} + +func (p *MiscServiceColumnOmnibusArgs) InitDefault() { + *p = MiscServiceColumnOmnibusArgs{} +} + +var MiscServiceColumnOmnibusArgs_Request_DEFAULT *sc_bff_api.ColumnOmnibusRequest + +func (p *MiscServiceColumnOmnibusArgs) GetRequest() (v *sc_bff_api.ColumnOmnibusRequest) { + if !p.IsSetRequest() { + return MiscServiceColumnOmnibusArgs_Request_DEFAULT + } + return p.Request +} +func (p *MiscServiceColumnOmnibusArgs) SetRequest(val *sc_bff_api.ColumnOmnibusRequest) { + p.Request = val +} + +var fieldIDToName_MiscServiceColumnOmnibusArgs = map[int16]string{ + 1: "request", +} + +func (p *MiscServiceColumnOmnibusArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *MiscServiceColumnOmnibusArgs) 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_MiscServiceColumnOmnibusArgs[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 *MiscServiceColumnOmnibusArgs) ReadField1(iprot thrift.TProtocol) error { + _field := sc_bff_api.NewColumnOmnibusRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Request = _field + return nil +} + +func (p *MiscServiceColumnOmnibusArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ColumnOmnibus_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 *MiscServiceColumnOmnibusArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Request.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 *MiscServiceColumnOmnibusArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MiscServiceColumnOmnibusArgs(%+v)", *p) + +} + +func (p *MiscServiceColumnOmnibusArgs) DeepEqual(ano *MiscServiceColumnOmnibusArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Request) { + return false + } + return true +} + +func (p *MiscServiceColumnOmnibusArgs) Field1DeepEqual(src *sc_bff_api.ColumnOmnibusRequest) bool { + + if !p.Request.DeepEqual(src) { + return false + } + return true +} + +type MiscServiceColumnOmnibusResult struct { + Success *sc_bff_api.ColumnOmnibusResponse `thrift:"success,0,optional" frugal:"0,optional,sc_bff_api.ColumnOmnibusResponse" json:"success,omitempty"` +} + +func NewMiscServiceColumnOmnibusResult() *MiscServiceColumnOmnibusResult { + return &MiscServiceColumnOmnibusResult{} +} + +func (p *MiscServiceColumnOmnibusResult) InitDefault() { + *p = MiscServiceColumnOmnibusResult{} +} + +var MiscServiceColumnOmnibusResult_Success_DEFAULT *sc_bff_api.ColumnOmnibusResponse + +func (p *MiscServiceColumnOmnibusResult) GetSuccess() (v *sc_bff_api.ColumnOmnibusResponse) { + if !p.IsSetSuccess() { + return MiscServiceColumnOmnibusResult_Success_DEFAULT + } + return p.Success +} +func (p *MiscServiceColumnOmnibusResult) SetSuccess(x interface{}) { + p.Success = x.(*sc_bff_api.ColumnOmnibusResponse) +} + +var fieldIDToName_MiscServiceColumnOmnibusResult = map[int16]string{ + 0: "success", +} + +func (p *MiscServiceColumnOmnibusResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MiscServiceColumnOmnibusResult) 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_MiscServiceColumnOmnibusResult[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 *MiscServiceColumnOmnibusResult) ReadField0(iprot thrift.TProtocol) error { + _field := sc_bff_api.NewColumnOmnibusResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *MiscServiceColumnOmnibusResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ColumnOmnibus_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 *MiscServiceColumnOmnibusResult) 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 *MiscServiceColumnOmnibusResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MiscServiceColumnOmnibusResult(%+v)", *p) + +} + +func (p *MiscServiceColumnOmnibusResult) DeepEqual(ano *MiscServiceColumnOmnibusResult) 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 *MiscServiceColumnOmnibusResult) Field0DeepEqual(src *sc_bff_api.ColumnOmnibusResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type MiscServiceColumnPageArgs struct { + Request *sc_bff_api.ColumnPageRequest `thrift:"request,1" frugal:"1,default,sc_bff_api.ColumnPageRequest" json:"request"` +} + +func NewMiscServiceColumnPageArgs() *MiscServiceColumnPageArgs { + return &MiscServiceColumnPageArgs{} +} + +func (p *MiscServiceColumnPageArgs) InitDefault() { + *p = MiscServiceColumnPageArgs{} +} + +var MiscServiceColumnPageArgs_Request_DEFAULT *sc_bff_api.ColumnPageRequest + +func (p *MiscServiceColumnPageArgs) GetRequest() (v *sc_bff_api.ColumnPageRequest) { + if !p.IsSetRequest() { + return MiscServiceColumnPageArgs_Request_DEFAULT + } + return p.Request +} +func (p *MiscServiceColumnPageArgs) SetRequest(val *sc_bff_api.ColumnPageRequest) { + p.Request = val +} + +var fieldIDToName_MiscServiceColumnPageArgs = map[int16]string{ + 1: "request", +} + +func (p *MiscServiceColumnPageArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *MiscServiceColumnPageArgs) 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_MiscServiceColumnPageArgs[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 *MiscServiceColumnPageArgs) ReadField1(iprot thrift.TProtocol) error { + _field := sc_bff_api.NewColumnPageRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Request = _field + return nil +} + +func (p *MiscServiceColumnPageArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ColumnPage_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 *MiscServiceColumnPageArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Request.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 *MiscServiceColumnPageArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MiscServiceColumnPageArgs(%+v)", *p) + +} + +func (p *MiscServiceColumnPageArgs) DeepEqual(ano *MiscServiceColumnPageArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Request) { + return false + } + return true +} + +func (p *MiscServiceColumnPageArgs) Field1DeepEqual(src *sc_bff_api.ColumnPageRequest) bool { + + if !p.Request.DeepEqual(src) { + return false + } + return true +} + +type MiscServiceColumnPageResult struct { + Success *sc_bff_api.ColumnPageResponse `thrift:"success,0,optional" frugal:"0,optional,sc_bff_api.ColumnPageResponse" json:"success,omitempty"` +} + +func NewMiscServiceColumnPageResult() *MiscServiceColumnPageResult { + return &MiscServiceColumnPageResult{} +} + +func (p *MiscServiceColumnPageResult) InitDefault() { + *p = MiscServiceColumnPageResult{} +} + +var MiscServiceColumnPageResult_Success_DEFAULT *sc_bff_api.ColumnPageResponse + +func (p *MiscServiceColumnPageResult) GetSuccess() (v *sc_bff_api.ColumnPageResponse) { + if !p.IsSetSuccess() { + return MiscServiceColumnPageResult_Success_DEFAULT + } + return p.Success +} +func (p *MiscServiceColumnPageResult) SetSuccess(x interface{}) { + p.Success = x.(*sc_bff_api.ColumnPageResponse) +} + +var fieldIDToName_MiscServiceColumnPageResult = map[int16]string{ + 0: "success", +} + +func (p *MiscServiceColumnPageResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MiscServiceColumnPageResult) 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_MiscServiceColumnPageResult[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 *MiscServiceColumnPageResult) ReadField0(iprot thrift.TProtocol) error { + _field := sc_bff_api.NewColumnPageResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *MiscServiceColumnPageResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ColumnPage_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 *MiscServiceColumnPageResult) 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 *MiscServiceColumnPageResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MiscServiceColumnPageResult(%+v)", *p) + +} + +func (p *MiscServiceColumnPageResult) DeepEqual(ano *MiscServiceColumnPageResult) 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 *MiscServiceColumnPageResult) Field0DeepEqual(src *sc_bff_api.ColumnPageResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type MiscServiceColumnDetailArgs struct { + Request *sc_bff_api.ColumnDetailRequest `thrift:"request,1" frugal:"1,default,sc_bff_api.ColumnDetailRequest" json:"request"` +} + +func NewMiscServiceColumnDetailArgs() *MiscServiceColumnDetailArgs { + return &MiscServiceColumnDetailArgs{} +} + +func (p *MiscServiceColumnDetailArgs) InitDefault() { + *p = MiscServiceColumnDetailArgs{} +} + +var MiscServiceColumnDetailArgs_Request_DEFAULT *sc_bff_api.ColumnDetailRequest + +func (p *MiscServiceColumnDetailArgs) GetRequest() (v *sc_bff_api.ColumnDetailRequest) { + if !p.IsSetRequest() { + return MiscServiceColumnDetailArgs_Request_DEFAULT + } + return p.Request +} +func (p *MiscServiceColumnDetailArgs) SetRequest(val *sc_bff_api.ColumnDetailRequest) { + p.Request = val +} + +var fieldIDToName_MiscServiceColumnDetailArgs = map[int16]string{ + 1: "request", +} + +func (p *MiscServiceColumnDetailArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *MiscServiceColumnDetailArgs) 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_MiscServiceColumnDetailArgs[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 *MiscServiceColumnDetailArgs) ReadField1(iprot thrift.TProtocol) error { + _field := sc_bff_api.NewColumnDetailRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Request = _field + return nil +} + +func (p *MiscServiceColumnDetailArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ColumnDetail_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 *MiscServiceColumnDetailArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Request.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 *MiscServiceColumnDetailArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MiscServiceColumnDetailArgs(%+v)", *p) + +} + +func (p *MiscServiceColumnDetailArgs) DeepEqual(ano *MiscServiceColumnDetailArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Request) { + return false + } + return true +} + +func (p *MiscServiceColumnDetailArgs) Field1DeepEqual(src *sc_bff_api.ColumnDetailRequest) bool { + + if !p.Request.DeepEqual(src) { + return false + } + return true +} + +type MiscServiceColumnDetailResult struct { + Success *sc_bff_api.ColumnDetailResponse `thrift:"success,0,optional" frugal:"0,optional,sc_bff_api.ColumnDetailResponse" json:"success,omitempty"` +} + +func NewMiscServiceColumnDetailResult() *MiscServiceColumnDetailResult { + return &MiscServiceColumnDetailResult{} +} + +func (p *MiscServiceColumnDetailResult) InitDefault() { + *p = MiscServiceColumnDetailResult{} +} + +var MiscServiceColumnDetailResult_Success_DEFAULT *sc_bff_api.ColumnDetailResponse + +func (p *MiscServiceColumnDetailResult) GetSuccess() (v *sc_bff_api.ColumnDetailResponse) { + if !p.IsSetSuccess() { + return MiscServiceColumnDetailResult_Success_DEFAULT + } + return p.Success +} +func (p *MiscServiceColumnDetailResult) SetSuccess(x interface{}) { + p.Success = x.(*sc_bff_api.ColumnDetailResponse) +} + +var fieldIDToName_MiscServiceColumnDetailResult = map[int16]string{ + 0: "success", +} + +func (p *MiscServiceColumnDetailResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MiscServiceColumnDetailResult) 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_MiscServiceColumnDetailResult[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 *MiscServiceColumnDetailResult) ReadField0(iprot thrift.TProtocol) error { + _field := sc_bff_api.NewColumnDetailResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *MiscServiceColumnDetailResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ColumnDetail_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 *MiscServiceColumnDetailResult) 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 *MiscServiceColumnDetailResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MiscServiceColumnDetailResult(%+v)", *p) + +} + +func (p *MiscServiceColumnDetailResult) DeepEqual(ano *MiscServiceColumnDetailResult) 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 *MiscServiceColumnDetailResult) Field0DeepEqual(src *sc_bff_api.ColumnDetailResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type MiscServiceEditorLoginArgs struct { + Request *EditorLoginRequest `thrift:"request,1" frugal:"1,default,EditorLoginRequest" json:"request"` +} + +func NewMiscServiceEditorLoginArgs() *MiscServiceEditorLoginArgs { + return &MiscServiceEditorLoginArgs{} +} + +func (p *MiscServiceEditorLoginArgs) InitDefault() { + *p = MiscServiceEditorLoginArgs{} +} + +var MiscServiceEditorLoginArgs_Request_DEFAULT *EditorLoginRequest + +func (p *MiscServiceEditorLoginArgs) GetRequest() (v *EditorLoginRequest) { + if !p.IsSetRequest() { + return MiscServiceEditorLoginArgs_Request_DEFAULT + } + return p.Request +} +func (p *MiscServiceEditorLoginArgs) SetRequest(val *EditorLoginRequest) { + p.Request = val +} + +var fieldIDToName_MiscServiceEditorLoginArgs = map[int16]string{ + 1: "request", +} + +func (p *MiscServiceEditorLoginArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *MiscServiceEditorLoginArgs) 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_MiscServiceEditorLoginArgs[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 *MiscServiceEditorLoginArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewEditorLoginRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Request = _field + return nil +} + +func (p *MiscServiceEditorLoginArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("EditorLogin_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 *MiscServiceEditorLoginArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Request.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 *MiscServiceEditorLoginArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MiscServiceEditorLoginArgs(%+v)", *p) + +} + +func (p *MiscServiceEditorLoginArgs) DeepEqual(ano *MiscServiceEditorLoginArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Request) { + return false + } + return true +} + +func (p *MiscServiceEditorLoginArgs) Field1DeepEqual(src *EditorLoginRequest) bool { + + if !p.Request.DeepEqual(src) { + return false + } + return true +} + +type MiscServiceEditorLoginResult struct { + Success *EditorLoginResponse `thrift:"success,0,optional" frugal:"0,optional,EditorLoginResponse" json:"success,omitempty"` +} + +func NewMiscServiceEditorLoginResult() *MiscServiceEditorLoginResult { + return &MiscServiceEditorLoginResult{} +} + +func (p *MiscServiceEditorLoginResult) InitDefault() { + *p = MiscServiceEditorLoginResult{} +} + +var MiscServiceEditorLoginResult_Success_DEFAULT *EditorLoginResponse + +func (p *MiscServiceEditorLoginResult) GetSuccess() (v *EditorLoginResponse) { + if !p.IsSetSuccess() { + return MiscServiceEditorLoginResult_Success_DEFAULT + } + return p.Success +} +func (p *MiscServiceEditorLoginResult) SetSuccess(x interface{}) { + p.Success = x.(*EditorLoginResponse) +} + +var fieldIDToName_MiscServiceEditorLoginResult = map[int16]string{ + 0: "success", +} + +func (p *MiscServiceEditorLoginResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MiscServiceEditorLoginResult) 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 + } -func NewMiscServiceProcessor(handler MiscService) *MiscServiceProcessor { - self := &MiscServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} - self.AddToProcessorMap("ReaderLogin", &miscServiceProcessorReaderLogin{handler: handler}) - self.AddToProcessorMap("EditorLogin", &miscServiceProcessorEditorLogin{handler: handler}) - return self -} -func (p *MiscServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - name, _, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return false, err + 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 processor, ok := p.GetProcessorFunction(name); ok { - return processor.Process(ctx, seqId, iprot, oprot) + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError } - 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 miscServiceProcessorReaderLogin struct { - handler MiscService + 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_MiscServiceEditorLoginResult[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 *miscServiceProcessorReaderLogin) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := MiscServiceReaderLoginArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("ReaderLogin", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *MiscServiceEditorLoginResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewEditorLoginResponse() + if err := _field.Read(iprot); err != nil { + return err } + p.Success = _field + return nil +} - iprot.ReadMessageEnd() - var err2 error - result := MiscServiceReaderLoginResult{} - var retval *ReaderLoginResponse - if retval, err2 = p.handler.ReaderLogin(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ReaderLogin: "+err2.Error()) - oprot.WriteMessageBegin("ReaderLogin", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("ReaderLogin", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 +func (p *MiscServiceEditorLoginResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("EditorLogin_result"); err != nil { + goto WriteStructBeginError } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError } - if err != nil { - return + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError } - return true, err + 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) } -type miscServiceProcessorEditorLogin struct { - handler MiscService +func (p *MiscServiceEditorLoginResult) 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 *miscServiceProcessorEditorLogin) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := MiscServiceEditorLoginArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("EditorLogin", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *MiscServiceEditorLoginResult) String() string { + if p == nil { + return "" } + return fmt.Sprintf("MiscServiceEditorLoginResult(%+v)", *p) - iprot.ReadMessageEnd() - var err2 error - result := MiscServiceEditorLoginResult{} - var retval *EditorLoginResponse - if retval, err2 = p.handler.EditorLogin(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing EditorLogin: "+err2.Error()) - oprot.WriteMessageBegin("EditorLogin", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("EditorLogin", 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 +} + +func (p *MiscServiceEditorLoginResult) DeepEqual(ano *MiscServiceEditorLoginResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + if !p.Field0DeepEqual(ano.Success) { + return false } - if err != nil { - return + return true +} + +func (p *MiscServiceEditorLoginResult) Field0DeepEqual(src *EditorLoginResponse) bool { + + if !p.Success.DeepEqual(src) { + return false } - return true, err + return true } type MiscServiceReaderLoginArgs struct { @@ -539,39 +2148,39 @@ func (p *MiscServiceReaderLoginResult) Field0DeepEqual(src *ReaderLoginResponse) return true } -type MiscServiceEditorLoginArgs struct { - Request *EditorLoginRequest `thrift:"request,1" frugal:"1,default,EditorLoginRequest" json:"request"` +type MiscServicePaymentPaidCallbackArgs struct { + Request *sc_bff_api.PaymentPaidCallbackRequest `thrift:"request,1" frugal:"1,default,sc_bff_api.PaymentPaidCallbackRequest" json:"request"` } -func NewMiscServiceEditorLoginArgs() *MiscServiceEditorLoginArgs { - return &MiscServiceEditorLoginArgs{} +func NewMiscServicePaymentPaidCallbackArgs() *MiscServicePaymentPaidCallbackArgs { + return &MiscServicePaymentPaidCallbackArgs{} } -func (p *MiscServiceEditorLoginArgs) InitDefault() { - *p = MiscServiceEditorLoginArgs{} +func (p *MiscServicePaymentPaidCallbackArgs) InitDefault() { + *p = MiscServicePaymentPaidCallbackArgs{} } -var MiscServiceEditorLoginArgs_Request_DEFAULT *EditorLoginRequest +var MiscServicePaymentPaidCallbackArgs_Request_DEFAULT *sc_bff_api.PaymentPaidCallbackRequest -func (p *MiscServiceEditorLoginArgs) GetRequest() (v *EditorLoginRequest) { +func (p *MiscServicePaymentPaidCallbackArgs) GetRequest() (v *sc_bff_api.PaymentPaidCallbackRequest) { if !p.IsSetRequest() { - return MiscServiceEditorLoginArgs_Request_DEFAULT + return MiscServicePaymentPaidCallbackArgs_Request_DEFAULT } return p.Request } -func (p *MiscServiceEditorLoginArgs) SetRequest(val *EditorLoginRequest) { +func (p *MiscServicePaymentPaidCallbackArgs) SetRequest(val *sc_bff_api.PaymentPaidCallbackRequest) { p.Request = val } -var fieldIDToName_MiscServiceEditorLoginArgs = map[int16]string{ +var fieldIDToName_MiscServicePaymentPaidCallbackArgs = map[int16]string{ 1: "request", } -func (p *MiscServiceEditorLoginArgs) IsSetRequest() bool { +func (p *MiscServicePaymentPaidCallbackArgs) IsSetRequest() bool { return p.Request != nil } -func (p *MiscServiceEditorLoginArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *MiscServicePaymentPaidCallbackArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -617,7 +2226,7 @@ ReadStructBeginError: 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_MiscServiceEditorLoginArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MiscServicePaymentPaidCallbackArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -627,8 +2236,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *MiscServiceEditorLoginArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewEditorLoginRequest() +func (p *MiscServicePaymentPaidCallbackArgs) ReadField1(iprot thrift.TProtocol) error { + _field := sc_bff_api.NewPaymentPaidCallbackRequest() if err := _field.Read(iprot); err != nil { return err } @@ -636,9 +2245,9 @@ func (p *MiscServiceEditorLoginArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *MiscServiceEditorLoginArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *MiscServicePaymentPaidCallbackArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("EditorLogin_args"); err != nil { + if err = oprot.WriteStructBegin("PaymentPaidCallback_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -664,7 +2273,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *MiscServiceEditorLoginArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *MiscServicePaymentPaidCallbackArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -681,15 +2290,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *MiscServiceEditorLoginArgs) String() string { +func (p *MiscServicePaymentPaidCallbackArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("MiscServiceEditorLoginArgs(%+v)", *p) + return fmt.Sprintf("MiscServicePaymentPaidCallbackArgs(%+v)", *p) } -func (p *MiscServiceEditorLoginArgs) DeepEqual(ano *MiscServiceEditorLoginArgs) bool { +func (p *MiscServicePaymentPaidCallbackArgs) DeepEqual(ano *MiscServicePaymentPaidCallbackArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -701,7 +2310,7 @@ func (p *MiscServiceEditorLoginArgs) DeepEqual(ano *MiscServiceEditorLoginArgs) return true } -func (p *MiscServiceEditorLoginArgs) Field1DeepEqual(src *EditorLoginRequest) bool { +func (p *MiscServicePaymentPaidCallbackArgs) Field1DeepEqual(src *sc_bff_api.PaymentPaidCallbackRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -709,39 +2318,39 @@ func (p *MiscServiceEditorLoginArgs) Field1DeepEqual(src *EditorLoginRequest) bo return true } -type MiscServiceEditorLoginResult struct { - Success *EditorLoginResponse `thrift:"success,0,optional" frugal:"0,optional,EditorLoginResponse" json:"success,omitempty"` +type MiscServicePaymentPaidCallbackResult struct { + Success *sc_bff_api.PaymentPaidCallbackResponse `thrift:"success,0,optional" frugal:"0,optional,sc_bff_api.PaymentPaidCallbackResponse" json:"success,omitempty"` } -func NewMiscServiceEditorLoginResult() *MiscServiceEditorLoginResult { - return &MiscServiceEditorLoginResult{} +func NewMiscServicePaymentPaidCallbackResult() *MiscServicePaymentPaidCallbackResult { + return &MiscServicePaymentPaidCallbackResult{} } -func (p *MiscServiceEditorLoginResult) InitDefault() { - *p = MiscServiceEditorLoginResult{} +func (p *MiscServicePaymentPaidCallbackResult) InitDefault() { + *p = MiscServicePaymentPaidCallbackResult{} } -var MiscServiceEditorLoginResult_Success_DEFAULT *EditorLoginResponse +var MiscServicePaymentPaidCallbackResult_Success_DEFAULT *sc_bff_api.PaymentPaidCallbackResponse -func (p *MiscServiceEditorLoginResult) GetSuccess() (v *EditorLoginResponse) { +func (p *MiscServicePaymentPaidCallbackResult) GetSuccess() (v *sc_bff_api.PaymentPaidCallbackResponse) { if !p.IsSetSuccess() { - return MiscServiceEditorLoginResult_Success_DEFAULT + return MiscServicePaymentPaidCallbackResult_Success_DEFAULT } return p.Success } -func (p *MiscServiceEditorLoginResult) SetSuccess(x interface{}) { - p.Success = x.(*EditorLoginResponse) +func (p *MiscServicePaymentPaidCallbackResult) SetSuccess(x interface{}) { + p.Success = x.(*sc_bff_api.PaymentPaidCallbackResponse) } -var fieldIDToName_MiscServiceEditorLoginResult = map[int16]string{ +var fieldIDToName_MiscServicePaymentPaidCallbackResult = map[int16]string{ 0: "success", } -func (p *MiscServiceEditorLoginResult) IsSetSuccess() bool { +func (p *MiscServicePaymentPaidCallbackResult) IsSetSuccess() bool { return p.Success != nil } -func (p *MiscServiceEditorLoginResult) Read(iprot thrift.TProtocol) (err error) { +func (p *MiscServicePaymentPaidCallbackResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -787,7 +2396,7 @@ ReadStructBeginError: 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_MiscServiceEditorLoginResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MiscServicePaymentPaidCallbackResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -797,8 +2406,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *MiscServiceEditorLoginResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewEditorLoginResponse() +func (p *MiscServicePaymentPaidCallbackResult) ReadField0(iprot thrift.TProtocol) error { + _field := sc_bff_api.NewPaymentPaidCallbackResponse() if err := _field.Read(iprot); err != nil { return err } @@ -806,9 +2415,9 @@ func (p *MiscServiceEditorLoginResult) ReadField0(iprot thrift.TProtocol) error return nil } -func (p *MiscServiceEditorLoginResult) Write(oprot thrift.TProtocol) (err error) { +func (p *MiscServicePaymentPaidCallbackResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("EditorLogin_result"); err != nil { + if err = oprot.WriteStructBegin("PaymentPaidCallback_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -834,7 +2443,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *MiscServiceEditorLoginResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *MiscServicePaymentPaidCallbackResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -853,15 +2462,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *MiscServiceEditorLoginResult) String() string { +func (p *MiscServicePaymentPaidCallbackResult) String() string { if p == nil { return "" } - return fmt.Sprintf("MiscServiceEditorLoginResult(%+v)", *p) + return fmt.Sprintf("MiscServicePaymentPaidCallbackResult(%+v)", *p) } -func (p *MiscServiceEditorLoginResult) DeepEqual(ano *MiscServiceEditorLoginResult) bool { +func (p *MiscServicePaymentPaidCallbackResult) DeepEqual(ano *MiscServicePaymentPaidCallbackResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -873,7 +2482,7 @@ func (p *MiscServiceEditorLoginResult) DeepEqual(ano *MiscServiceEditorLoginResu return true } -func (p *MiscServiceEditorLoginResult) Field0DeepEqual(src *EditorLoginResponse) bool { +func (p *MiscServicePaymentPaidCallbackResult) Field0DeepEqual(src *sc_bff_api.PaymentPaidCallbackResponse) bool { if !p.Success.DeepEqual(src) { return false