diff --git a/api/handler/api/common_service.go b/api/handler/api/common_service.go index 8c3082bb..636b423f 100644 --- a/api/handler/api/common_service.go +++ b/api/handler/api/common_service.go @@ -21,6 +21,8 @@ package api import ( "context" + "github.com/west2-online/fzuhelper-server/kitex_gen/model" + "github.com/cloudwego/hertz/pkg/app" "github.com/cloudwego/hertz/pkg/protocol/consts" @@ -87,3 +89,44 @@ func GetUserAgreement(ctx context.Context, c *app.RequestContext) { } c.Data(consts.StatusOK, "text/html", *userAgreement) } + +// GetTermsList . +// @router /api/v1/terms/list [GET] +func GetTermsList(ctx context.Context, c *app.RequestContext) { + req := new(common.TermListRequest) + res, err := rpc.GetTermsListRPC(ctx, req) + if err != nil { + pack.RespError(c, err) + return + } + + resp := new(api.TermListResponse) + resp.TermLists = pack.BuildTermList(res) + + pack.RespData(c, resp.TermLists) +} + +// GetTerm . +// @router /api/v1/terms/info [GET] +func GetTerm(ctx context.Context, c *app.RequestContext) { + var err error + var req api.TermRequest + err = c.BindAndValidate(&req) + if err != nil { + pack.RespError(c, errno.ParamError.WithError(err)) + return + } + res := new(model.TermInfo) + res, err = rpc.GetTermRPC(ctx, &common.TermRequest{ + Term: req.Term, + }) + if err != nil { + pack.RespError(c, err) + return + } + + resp := new(api.TermResponse) + resp.TermInfo = pack.BuildTermInfo(res) + + pack.RespData(c, resp.TermInfo) +} diff --git a/api/handler/api/common_service_test.go b/api/handler/api/common_service_test.go new file mode 100644 index 00000000..18abd027 --- /dev/null +++ b/api/handler/api/common_service_test.go @@ -0,0 +1,210 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package api + +import ( + "context" + "errors" + "testing" + + "github.com/bytedance/mockey" + "github.com/bytedance/sonic" + "github.com/cloudwego/hertz/pkg/common/config" + "github.com/cloudwego/hertz/pkg/common/ut" + "github.com/cloudwego/hertz/pkg/protocol/consts" + "github.com/cloudwego/hertz/pkg/route" + "github.com/stretchr/testify/assert" + + "github.com/west2-online/fzuhelper-server/api/rpc" + "github.com/west2-online/fzuhelper-server/kitex_gen/common" + "github.com/west2-online/fzuhelper-server/kitex_gen/model" +) + +func TestGetTerm(t *testing.T) { + f := func(str string) *string { + return &str + } + + type TestCase struct { + Name string + expectedError bool + expectedErrorInfo error + expectedResult string + expectedTermInfo *model.TermInfo + url string + } + + expectedTermInfo := &model.TermInfo{ + TermId: f("201501"), + Term: f("201501"), + SchoolYear: f("2015"), + Events: []*model.TermEvent{ + { + Name: f("学生注册"), + StartDate: f("2015-08-29"), + EndDate: f("2015-08-30"), + }, + { + Name: f("学生补考"), + StartDate: f("2015-08-29"), + EndDate: f("2015-09-06"), + }, + { + Name: f("正式上课"), + StartDate: f("2015-08-31"), + EndDate: f("2015-08-31"), + }, + { + Name: f("新生报到"), + StartDate: f("2015-09-07"), + EndDate: f("2015-09-07"), + }, + { + Name: f("校运会"), + StartDate: f("2015-11-12"), + EndDate: f("2015-11-14"), + }, + { + Name: f("期末考试"), + StartDate: f("2016-01-16"), + EndDate: f("2016-01-22"), + }, + { + Name: f("寒假"), + StartDate: f("2016-01-23"), + EndDate: f("2016-02-28"), + }, + }, + } + + data, err := sonic.Marshal(expectedTermInfo) + assert.Nil(t, err) + + testCases := []TestCase{ + { + Name: "GetTermSuccessfully", + expectedError: false, + expectedErrorInfo: nil, + expectedResult: `{"code":"10000","message":"Success","data":` + string(data) + `}`, + expectedTermInfo: expectedTermInfo, + url: "/api/v1/terms/info?term=201501", + }, + { + Name: "GetTermError", + expectedError: true, + expectedErrorInfo: errors.New("etTermRPC: RPC called failed"), + expectedResult: `{"code":"50001","message":"etTermRPC: RPC called failed"}`, + expectedTermInfo: nil, + url: "/api/v1/terms/info?term=201501", + }, + { + Name: "BindAndValidateError", + expectedError: false, + expectedErrorInfo: nil, + expectedResult: `{"code":"20001","message":"参数错误, 'term' field is a 'required' parameter,` + + ` but the request body does not have this parameter 'term'"}`, + expectedTermInfo: nil, + url: "/api/v1/terms/info", + }, + } + + router := route.NewEngine(&config.Options{}) + router.GET("/api/v1/terms/info", GetTerm) + + defer mockey.UnPatchAll() + for _, tc := range testCases { + mockey.PatchConvey(tc.Name, t, func() { + mockey.Mock(rpc.GetTermRPC).To(func(ctx context.Context, req *common.TermRequest) (*model.TermInfo, error) { + return tc.expectedTermInfo, tc.expectedErrorInfo + }).Build() + + result := ut.PerformRequest(router, "GET", tc.url, nil) + assert.Equal(t, consts.StatusOK, result.Result().StatusCode()) + assert.Equal(t, tc.expectedResult, string(result.Result().Body())) + }) + } +} + +func TestGetTermsList(t *testing.T) { + f := func(str string) *string { + return &str + } + + type TestCase struct { + Name string + expectedError bool + expectedErrorInfo error + expectedResult string + expectedTermInfo *model.TermList + } + + expectedTermList := &model.TermList{ + CurrentTerm: f("202401"), + Terms: []*model.Term{ + { + TermId: f("2024012024082620250117"), + SchoolYear: f("2024"), + Term: f("202401"), + StartDate: f("2024-08-26"), + EndDate: f("2025-01-17"), + }, + { + TermId: f("2024022025022420250704"), + SchoolYear: f("2024"), + Term: f("202402"), + StartDate: f("2025-02-24"), + EndDate: f("2025-07-04"), + }, + }, + } + + data, err := sonic.Marshal(expectedTermList) + assert.Nil(t, err) + + testCases := []TestCase{ + { + Name: "GetTermsListSuccessfully", + expectedError: false, + expectedErrorInfo: nil, + expectedResult: `{"code":"10000","message":"Success","data":` + string(data) + `}`, + expectedTermInfo: expectedTermList, + }, + { + Name: "GetTermsListError", + expectedError: true, + expectedErrorInfo: errors.New("etTermRPC: RPC called failed"), + expectedResult: `{"code":"50001","message":"etTermRPC: RPC called failed"}`, + expectedTermInfo: nil, + }, + } + + router := route.NewEngine(&config.Options{}) + router.GET("/api/v1/terms/list", GetTermsList) + + defer mockey.UnPatchAll() + for _, tc := range testCases { + mockey.PatchConvey(tc.Name, t, func() { + mockey.Mock(rpc.GetTermsListRPC).To(func(ctx context.Context, req *common.TermListRequest) (*model.TermList, error) { + return tc.expectedTermInfo, tc.expectedErrorInfo + }).Build() + url := "/api/v1/terms/list" + result := ut.PerformRequest(router, "GET", url, nil) + assert.Equal(t, consts.StatusOK, result.Result().StatusCode()) + assert.Equal(t, tc.expectedResult, string(result.Result().Body())) + }) + } +} diff --git a/api/handler/api/paper_service_test.go b/api/handler/api/paper_service_test.go index 856f50ac..e9925a5a 100644 --- a/api/handler/api/paper_service_test.go +++ b/api/handler/api/paper_service_test.go @@ -96,9 +96,9 @@ func TestListDirFiles(t *testing.T) { ExpectUpYunResult *model.UpYunFileDir Path string } - + basePath := "/C语言" expectedUpYunResult := &model.UpYunFileDir{ - BasePath: "/C语言", + BasePath: &basePath, Files: []string{ "10份练习.zip", "200912填空题(含答案).doc", @@ -260,9 +260,9 @@ func TestListDirFilesForAndroid(t *testing.T) { ExpectUpYunResult *model.UpYunFileDir Path string } - + basePath := "/C语言" expectedUpYunResult := &model.UpYunFileDir{ - BasePath: "/C语言", + BasePath: &basePath, Files: []string{ "10份练习.zip", "200912填空题(含答案).doc", diff --git a/api/model/api/api.go b/api/model/api/api.go index ce4f6373..80f9bb66 100644 --- a/api/model/api/api.go +++ b/api/model/api/api.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by thriftgo (0.3.18). DO NOT EDIT. +// Code generated by thriftgo (0.3.17). DO NOT EDIT. package api @@ -222,7 +222,6 @@ func (p *EmptyClassroomRequest) ReadField4(iprot thrift.TProtocol) error { } func (p *EmptyClassroomRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("EmptyClassroomRequest"); err != nil { goto WriteStructBeginError @@ -446,7 +445,6 @@ func (p *EmptyClassroomResponse) ReadField1(iprot thrift.TProtocol) error { } func (p *EmptyClassroomResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("EmptyClassroomResponse"); err != nil { goto WriteStructBeginError @@ -604,7 +602,6 @@ func (p *ExamRoomInfoRequest) ReadField1(iprot thrift.TProtocol) error { } func (p *ExamRoomInfoRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("ExamRoomInfoRequest"); err != nil { goto WriteStructBeginError @@ -765,7 +762,6 @@ func (p *ExamRoomInfoResponse) ReadField1(iprot thrift.TProtocol) error { } func (p *ExamRoomInfoResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("ExamRoomInfoResponse"); err != nil { goto WriteStructBeginError @@ -955,7 +951,6 @@ func (p *GetLoginDataRequest) ReadField2(iprot thrift.TProtocol) error { } func (p *GetLoginDataRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GetLoginDataRequest"); err != nil { goto WriteStructBeginError @@ -1169,7 +1164,6 @@ func (p *GetLoginDataResponse) ReadField2(iprot thrift.TProtocol) error { } func (p *GetLoginDataResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GetLoginDataResponse"); err != nil { goto WriteStructBeginError @@ -1347,7 +1341,6 @@ func (p *ValidateCodeRequest) ReadField1(iprot thrift.TProtocol) error { } func (p *ValidateCodeRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("ValidateCodeRequest"); err != nil { goto WriteStructBeginError @@ -1455,7 +1448,6 @@ ReadStructEndError: } func (p *ValidateCodeResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("ValidateCodeResponse"); err != nil { goto WriteStructBeginError } @@ -1581,7 +1573,6 @@ func (p *ValidateCodeForAndroidRequest) ReadField1(iprot thrift.TProtocol) error } func (p *ValidateCodeForAndroidRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("ValidateCodeForAndroidRequest"); err != nil { goto WriteStructBeginError @@ -1689,7 +1680,6 @@ ReadStructEndError: } func (p *ValidateCodeForAndroidResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("ValidateCodeForAndroidResponse"); err != nil { goto WriteStructBeginError } @@ -1773,7 +1763,6 @@ ReadStructEndError: } func (p *GetAccessTokenRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetAccessTokenRequest"); err != nil { goto WriteStructBeginError } @@ -1915,7 +1904,6 @@ func (p *GetAccessTokenResponse) ReadField2(iprot thrift.TProtocol) error { } func (p *GetAccessTokenResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GetAccessTokenResponse"); err != nil { goto WriteStructBeginError @@ -2044,7 +2032,6 @@ ReadStructEndError: } func (p *RefreshTokenRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("RefreshTokenRequest"); err != nil { goto WriteStructBeginError } @@ -2186,7 +2173,6 @@ func (p *RefreshTokenResponse) ReadField2(iprot thrift.TProtocol) error { } func (p *RefreshTokenResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("RefreshTokenResponse"); err != nil { goto WriteStructBeginError @@ -2315,7 +2301,6 @@ ReadStructEndError: } func (p *TestAuthRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("TestAuthRequest"); err != nil { goto WriteStructBeginError } @@ -2432,7 +2417,6 @@ func (p *TestAuthResponse) ReadField1(iprot thrift.TProtocol) error { } func (p *TestAuthResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("TestAuthResponse"); err != nil { goto WriteStructBeginError @@ -2582,7 +2566,6 @@ func (p *CourseListRequest) ReadField1(iprot thrift.TProtocol) error { } func (p *CourseListRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("CourseListRequest"); err != nil { goto WriteStructBeginError @@ -2781,7 +2764,6 @@ func (p *CourseListResponse) ReadField2(iprot thrift.TProtocol) error { } func (p *CourseListResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("CourseListResponse"); err != nil { goto WriteStructBeginError @@ -3300,7 +3282,6 @@ func (p *CreateImageRequest) ReadField12(iprot thrift.TProtocol) error { } func (p *CreateImageRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("CreateImageRequest"); err != nil { goto WriteStructBeginError @@ -3711,7 +3692,6 @@ func (p *CreateImageResponse) ReadField2(iprot thrift.TProtocol) error { } func (p *CreateImageResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("CreateImageResponse"); err != nil { goto WriteStructBeginError @@ -3883,7 +3863,6 @@ func (p *GetImageRequest) ReadField1(iprot thrift.TProtocol) error { } func (p *GetImageRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GetImageRequest"); err != nil { goto WriteStructBeginError @@ -4061,7 +4040,6 @@ func (p *GetImageResponse) ReadField2(iprot thrift.TProtocol) error { } func (p *GetImageResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GetImageResponse"); err != nil { goto WriteStructBeginError @@ -4593,7 +4571,6 @@ func (p *ChangeImagePropertyRequest) ReadField12(iprot thrift.TProtocol) error { } func (p *ChangeImagePropertyRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("ChangeImagePropertyRequest"); err != nil { goto WriteStructBeginError @@ -5006,7 +4983,6 @@ func (p *ChangeImagePropertyResponse) ReadField2(iprot thrift.TProtocol) error { } func (p *ChangeImagePropertyResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("ChangeImagePropertyResponse"); err != nil { goto WriteStructBeginError @@ -5203,7 +5179,6 @@ func (p *ChangeImageRequest) ReadField2(iprot thrift.TProtocol) error { } func (p *ChangeImageRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("ChangeImageRequest"); err != nil { goto WriteStructBeginError @@ -5402,7 +5377,6 @@ func (p *ChangeImageResponse) ReadField2(iprot thrift.TProtocol) error { } func (p *ChangeImageResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("ChangeImageResponse"); err != nil { goto WriteStructBeginError @@ -5574,7 +5548,6 @@ func (p *DeleteImageRequest) ReadField1(iprot thrift.TProtocol) error { } func (p *DeleteImageRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("DeleteImageRequest"); err != nil { goto WriteStructBeginError @@ -5721,7 +5694,6 @@ func (p *DeleteImageResponse) ReadField1(iprot thrift.TProtocol) error { } func (p *DeleteImageResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("DeleteImageResponse"); err != nil { goto WriteStructBeginError @@ -5968,7 +5940,6 @@ func (p *MobileGetImageRequest) ReadField4(iprot thrift.TProtocol) error { } func (p *MobileGetImageRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("MobileGetImageRequest"); err != nil { goto WriteStructBeginError @@ -6260,7 +6231,6 @@ func (p *MobileGetImageResponse) ReadField3(iprot thrift.TProtocol) error { } func (p *MobileGetImageResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("MobileGetImageResponse"); err != nil { goto WriteStructBeginError @@ -6463,7 +6433,6 @@ func (p *AddImagePointTimeRequest) ReadField1(iprot thrift.TProtocol) error { } func (p *AddImagePointTimeRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("AddImagePointTimeRequest"); err != nil { goto WriteStructBeginError @@ -6641,7 +6610,6 @@ func (p *AddImagePointTimeResponse) ReadField2(iprot thrift.TProtocol) error { } func (p *AddImagePointTimeResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("AddImagePointTimeResponse"); err != nil { goto WriteStructBeginError @@ -6814,7 +6782,6 @@ func (p *ListDirFilesRequest) ReadField1(iprot thrift.TProtocol) error { } func (p *ListDirFilesRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("ListDirFilesRequest"); err != nil { goto WriteStructBeginError @@ -6969,7 +6936,6 @@ func (p *ListDirFilesResponse) ReadField1(iprot thrift.TProtocol) error { } func (p *ListDirFilesResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("ListDirFilesResponse"); err != nil { goto WriteStructBeginError @@ -7118,7 +7084,6 @@ func (p *GetDownloadUrlRequest) ReadField1(iprot thrift.TProtocol) error { } func (p *GetDownloadUrlRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GetDownloadUrlRequest"); err != nil { goto WriteStructBeginError @@ -7267,7 +7232,6 @@ func (p *GetDownloadUrlResponse) ReadField1(iprot thrift.TProtocol) error { } func (p *GetDownloadUrlResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GetDownloadUrlResponse"); err != nil { goto WriteStructBeginError @@ -7417,7 +7381,6 @@ func (p *ListDirFilesForAndroidRequest) ReadField1(iprot thrift.TProtocol) error } func (p *ListDirFilesForAndroidRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("ListDirFilesForAndroidRequest"); err != nil { goto WriteStructBeginError @@ -7525,7 +7488,6 @@ ReadStructEndError: } func (p *ListDirFilesForAndroidResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("ListDirFilesForAndroidResponse"); err != nil { goto WriteStructBeginError } @@ -7650,7 +7612,6 @@ func (p *GetDownloadUrlForAndroidRequest) ReadField1(iprot thrift.TProtocol) err } func (p *GetDownloadUrlForAndroidRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GetDownloadUrlForAndroidRequest"); err != nil { goto WriteStructBeginError @@ -7758,7 +7719,6 @@ ReadStructEndError: } func (p *GetDownloadUrlForAndroidResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetDownloadUrlForAndroidResponse"); err != nil { goto WriteStructBeginError } @@ -7843,7 +7803,6 @@ ReadStructEndError: } func (p *GetScoresRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetScoresRequest"); err != nil { goto WriteStructBeginError } @@ -7980,7 +7939,6 @@ func (p *GetScoresResponse) ReadField1(iprot thrift.TProtocol) error { } func (p *GetScoresResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GetScoresResponse"); err != nil { goto WriteStructBeginError @@ -8096,7 +8054,6 @@ ReadStructEndError: } func (p *GetGPARequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetGPARequest"); err != nil { goto WriteStructBeginError } @@ -8227,7 +8184,6 @@ func (p *GetGPAResponse) ReadField1(iprot thrift.TProtocol) error { } func (p *GetGPAResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GetGPAResponse"); err != nil { goto WriteStructBeginError @@ -8335,7 +8291,6 @@ ReadStructEndError: } func (p *GetCreditRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetCreditRequest"); err != nil { goto WriteStructBeginError } @@ -8472,7 +8427,6 @@ func (p *GetCreditResponse) ReadField1(iprot thrift.TProtocol) error { } func (p *GetCreditResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GetCreditResponse"); err != nil { goto WriteStructBeginError @@ -8588,7 +8542,6 @@ ReadStructEndError: } func (p *GetUnifiedExamRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetUnifiedExamRequest"); err != nil { goto WriteStructBeginError } @@ -8725,7 +8678,6 @@ func (p *GetUnifiedExamResponse) ReadField1(iprot thrift.TProtocol) error { } func (p *GetUnifiedExamResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GetUnifiedExamResponse"); err != nil { goto WriteStructBeginError @@ -8883,7 +8835,6 @@ func (p *LoginRequest) ReadField1(iprot thrift.TProtocol) error { } func (p *LoginRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("LoginRequest"); err != nil { goto WriteStructBeginError @@ -9030,7 +8981,6 @@ func (p *LoginResponse) ReadField1(iprot thrift.TProtocol) error { } func (p *LoginResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("LoginResponse"); err != nil { goto WriteStructBeginError @@ -9339,7 +9289,6 @@ func (p *UploadRequest) ReadField6(iprot thrift.TProtocol) error { } func (p *UploadRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("UploadRequest"); err != nil { goto WriteStructBeginError @@ -9591,7 +9540,6 @@ func (p *UploadResponse) ReadField1(iprot thrift.TProtocol) error { } func (p *UploadResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("UploadResponse"); err != nil { goto WriteStructBeginError @@ -9740,7 +9688,6 @@ func (p *UploadParamsRequest) ReadField1(iprot thrift.TProtocol) error { } func (p *UploadParamsRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("UploadParamsRequest"); err != nil { goto WriteStructBeginError @@ -9955,7 +9902,6 @@ func (p *UploadParamsResponse) ReadField3(iprot thrift.TProtocol) error { } func (p *UploadParamsResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("UploadParamsResponse"); err != nil { goto WriteStructBeginError @@ -10111,7 +10057,6 @@ ReadStructEndError: } func (p *DownloadReleaseApkRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("DownloadReleaseApkRequest"); err != nil { goto WriteStructBeginError } @@ -10237,7 +10182,6 @@ func (p *DownloadReleaseApkResponse) ReadField1(iprot thrift.TProtocol) error { } func (p *DownloadReleaseApkResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("DownloadReleaseApkResponse"); err != nil { goto WriteStructBeginError @@ -10347,7 +10291,6 @@ ReadStructEndError: } func (p *DownloadBetaApkRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("DownloadBetaApkRequest"); err != nil { goto WriteStructBeginError } @@ -10473,7 +10416,6 @@ func (p *DownloadBetaApkResponse) ReadField1(iprot thrift.TProtocol) error { } func (p *DownloadBetaApkResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("DownloadBetaApkResponse"); err != nil { goto WriteStructBeginError @@ -10583,7 +10525,6 @@ ReadStructEndError: } func (p *GetReleaseVersionRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetReleaseVersionRequest"); err != nil { goto WriteStructBeginError } @@ -10842,7 +10783,6 @@ func (p *GetReleaseVersionResponse) ReadField5(iprot thrift.TProtocol) error { } func (p *GetReleaseVersionResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GetReleaseVersionResponse"); err != nil { goto WriteStructBeginError @@ -11044,7 +10984,6 @@ ReadStructEndError: } func (p *GetBetaVersionRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetBetaVersionRequest"); err != nil { goto WriteStructBeginError } @@ -11303,7 +11242,6 @@ func (p *GetBetaVersionResponse) ReadField5(iprot thrift.TProtocol) error { } func (p *GetBetaVersionResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GetBetaVersionResponse"); err != nil { goto WriteStructBeginError @@ -11717,7 +11655,6 @@ func (p *GetSettingRequest) ReadField6(iprot thrift.TProtocol) error { } func (p *GetSettingRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GetSettingRequest"); err != nil { goto WriteStructBeginError @@ -12006,7 +11943,6 @@ func (p *GetSettingResponse) ReadField2(iprot thrift.TProtocol) error { } func (p *GetSettingResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GetSettingResponse"); err != nil { goto WriteStructBeginError @@ -12383,7 +12319,6 @@ func (p *GetTestRequest) ReadField7(iprot thrift.TProtocol) error { } func (p *GetTestRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GetTestRequest"); err != nil { goto WriteStructBeginError @@ -12695,7 +12630,6 @@ func (p *GetTestResponse) ReadField2(iprot thrift.TProtocol) error { } func (p *GetTestResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GetTestResponse"); err != nil { goto WriteStructBeginError @@ -12824,7 +12758,6 @@ ReadStructEndError: } func (p *GetCloudRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetCloudRequest"); err != nil { goto WriteStructBeginError } @@ -12972,7 +12905,6 @@ func (p *GetCloudResponse) ReadField2(iprot thrift.TProtocol) error { } func (p *GetCloudResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GetCloudResponse"); err != nil { goto WriteStructBeginError @@ -13176,7 +13108,6 @@ func (p *SetCloudRequest) ReadField2(iprot thrift.TProtocol) error { } func (p *SetCloudRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("SetCloudRequest"); err != nil { goto WriteStructBeginError @@ -13344,7 +13275,6 @@ func (p *SetCloudResponse) ReadField1(iprot thrift.TProtocol) error { } func (p *SetCloudResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("SetCloudResponse"); err != nil { goto WriteStructBeginError @@ -13452,7 +13382,6 @@ ReadStructEndError: } func (p *GetDumpRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetDumpRequest"); err != nil { goto WriteStructBeginError } @@ -13600,7 +13529,6 @@ func (p *GetDumpResponse) ReadField2(iprot thrift.TProtocol) error { } func (p *GetDumpResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GetDumpResponse"); err != nil { goto WriteStructBeginError @@ -13732,7 +13660,6 @@ ReadStructEndError: } func (p *GetCSSRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetCSSRequest"); err != nil { goto WriteStructBeginError } @@ -13849,7 +13776,6 @@ func (p *GetCSSResponse) ReadField1(iprot thrift.TProtocol) error { } func (p *GetCSSResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GetCSSResponse"); err != nil { goto WriteStructBeginError @@ -13957,7 +13883,6 @@ ReadStructEndError: } func (p *GetHtmlRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetHtmlRequest"); err != nil { goto WriteStructBeginError } @@ -14074,7 +13999,6 @@ func (p *GetHtmlResponse) ReadField1(iprot thrift.TProtocol) error { } func (p *GetHtmlResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GetHtmlResponse"); err != nil { goto WriteStructBeginError @@ -14182,7 +14106,6 @@ ReadStructEndError: } func (p *GetUserAgreementRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetUserAgreementRequest"); err != nil { goto WriteStructBeginError } @@ -14299,7 +14222,6 @@ func (p *GetUserAgreementResponse) ReadField1(iprot thrift.TProtocol) error { } func (p *GetUserAgreementResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GetUserAgreementResponse"); err != nil { goto WriteStructBeginError @@ -14352,1426 +14274,1373 @@ func (p *GetUserAgreementResponse) String() string { } -type ClassRoomService interface { - GetEmptyClassrooms(ctx context.Context, request *EmptyClassroomRequest) (r *EmptyClassroomResponse, err error) - - GetExamRoomInfo(ctx context.Context, request *ExamRoomInfoRequest) (r *ExamRoomInfoResponse, err error) +// 学期列表 +type TermListRequest struct { } -type ClassRoomServiceClient struct { - c thrift.TClient +func NewTermListRequest() *TermListRequest { + return &TermListRequest{} } -func NewClassRoomServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *ClassRoomServiceClient { - return &ClassRoomServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), - } +func (p *TermListRequest) InitDefault() { } -func NewClassRoomServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *ClassRoomServiceClient { - return &ClassRoomServiceClient{ - c: thrift.NewTStandardClient(iprot, oprot), +var fieldIDToName_TermListRequest = map[int16]string{} + +func (p *TermListRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } -} -func NewClassRoomServiceClient(c thrift.TClient) *ClassRoomServiceClient { - return &ClassRoomServiceClient{ - c: c, + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldTypeError + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError } -} -func (p *ClassRoomServiceClient) Client_() thrift.TClient { - return p.c + 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) +SkipFieldTypeError: + return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, 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 *ClassRoomServiceClient) GetEmptyClassrooms(ctx context.Context, request *EmptyClassroomRequest) (r *EmptyClassroomResponse, err error) { - var _args ClassRoomServiceGetEmptyClassroomsArgs - _args.Request = request - var _result ClassRoomServiceGetEmptyClassroomsResult - if err = p.Client_().Call(ctx, "GetEmptyClassrooms", &_args, &_result); err != nil { - return +func (p *TermListRequest) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("TermListRequest"); err != nil { + goto WriteStructBeginError } - return _result.GetSuccess(), nil -} -func (p *ClassRoomServiceClient) GetExamRoomInfo(ctx context.Context, request *ExamRoomInfoRequest) (r *ExamRoomInfoResponse, err error) { - var _args ClassRoomServiceGetExamRoomInfoArgs - _args.Request = request - var _result ClassRoomServiceGetExamRoomInfoResult - if err = p.Client_().Call(ctx, "GetExamRoomInfo", &_args, &_result); err != nil { - return + if p != nil { } - return _result.GetSuccess(), nil + 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) +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 UserService interface { - GetLoginData(ctx context.Context, request *GetLoginDataRequest) (r *GetLoginDataResponse, err error) - - ValidateCode(ctx context.Context, request *ValidateCodeRequest) (r *ValidateCodeResponse, err error) - - ValidateCodeForAndroid(ctx context.Context, request *ValidateCodeForAndroidRequest) (r *ValidateCodeForAndroidResponse, err error) - - GetToken(ctx context.Context, request *GetAccessTokenRequest) (r *GetAccessTokenResponse, err error) - - RefreshToken(ctx context.Context, request *RefreshTokenRequest) (r *RefreshTokenResponse, err error) +func (p *TermListRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TermListRequest(%+v)", *p) - TestAuth(ctx context.Context, request *TestAuthRequest) (r *TestAuthResponse, err error) } -type UserServiceClient struct { - c thrift.TClient +type TermListResponse struct { + Base *model.BaseResp `thrift:"base,1,required" form:"base,required" json:"base,required" query:"base,required"` + TermLists *model.TermList `thrift:"term_lists,2,required" form:"term_lists,required" json:"term_lists,required" query:"term_lists,required"` } -func NewUserServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *UserServiceClient { - return &UserServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), - } +func NewTermListResponse() *TermListResponse { + return &TermListResponse{} } -func NewUserServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *UserServiceClient { - return &UserServiceClient{ - c: thrift.NewTStandardClient(iprot, oprot), - } +func (p *TermListResponse) InitDefault() { } -func NewUserServiceClient(c thrift.TClient) *UserServiceClient { - return &UserServiceClient{ - c: c, +var TermListResponse_Base_DEFAULT *model.BaseResp + +func (p *TermListResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return TermListResponse_Base_DEFAULT } + return p.Base } -func (p *UserServiceClient) Client_() thrift.TClient { - return p.c -} +var TermListResponse_TermLists_DEFAULT *model.TermList -func (p *UserServiceClient) GetLoginData(ctx context.Context, request *GetLoginDataRequest) (r *GetLoginDataResponse, err error) { - var _args UserServiceGetLoginDataArgs - _args.Request = request - var _result UserServiceGetLoginDataResult - if err = p.Client_().Call(ctx, "GetLoginData", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} -func (p *UserServiceClient) ValidateCode(ctx context.Context, request *ValidateCodeRequest) (r *ValidateCodeResponse, err error) { - var _args UserServiceValidateCodeArgs - _args.Request = request - var _result UserServiceValidateCodeResult - if err = p.Client_().Call(ctx, "ValidateCode", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} -func (p *UserServiceClient) ValidateCodeForAndroid(ctx context.Context, request *ValidateCodeForAndroidRequest) (r *ValidateCodeForAndroidResponse, err error) { - var _args UserServiceValidateCodeForAndroidArgs - _args.Request = request - var _result UserServiceValidateCodeForAndroidResult - if err = p.Client_().Call(ctx, "ValidateCodeForAndroid", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} -func (p *UserServiceClient) GetToken(ctx context.Context, request *GetAccessTokenRequest) (r *GetAccessTokenResponse, err error) { - var _args UserServiceGetTokenArgs - _args.Request = request - var _result UserServiceGetTokenResult - if err = p.Client_().Call(ctx, "GetToken", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} -func (p *UserServiceClient) RefreshToken(ctx context.Context, request *RefreshTokenRequest) (r *RefreshTokenResponse, err error) { - var _args UserServiceRefreshTokenArgs - _args.Request = request - var _result UserServiceRefreshTokenResult - if err = p.Client_().Call(ctx, "RefreshToken", &_args, &_result); err != nil { - return +func (p *TermListResponse) GetTermLists() (v *model.TermList) { + if !p.IsSetTermLists() { + return TermListResponse_TermLists_DEFAULT } - return _result.GetSuccess(), nil + return p.TermLists } -func (p *UserServiceClient) TestAuth(ctx context.Context, request *TestAuthRequest) (r *TestAuthResponse, err error) { - var _args UserServiceTestAuthArgs - _args.Request = request - var _result UserServiceTestAuthResult - if err = p.Client_().Call(ctx, "TestAuth", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil + +var fieldIDToName_TermListResponse = map[int16]string{ + 1: "base", + 2: "term_lists", } -type CourseService interface { - GetCourseList(ctx context.Context, req *CourseListRequest) (r *CourseListResponse, err error) +func (p *TermListResponse) IsSetBase() bool { + return p.Base != nil } -type CourseServiceClient struct { - c thrift.TClient +func (p *TermListResponse) IsSetTermLists() bool { + return p.TermLists != nil } -func NewCourseServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *CourseServiceClient { - return &CourseServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), - } -} +func (p *TermListResponse) Read(iprot thrift.TProtocol) (err error) { -func NewCourseServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *CourseServiceClient { - return &CourseServiceClient{ - c: thrift.NewTStandardClient(iprot, oprot), - } -} + var fieldTypeId thrift.TType + var fieldId int16 + var issetBase bool = false + var issetTermLists bool = false -func NewCourseServiceClient(c thrift.TClient) *CourseServiceClient { - return &CourseServiceClient{ - c: c, + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } -} -func (p *CourseServiceClient) Client_() thrift.TClient { - return p.c -} + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } -func (p *CourseServiceClient) GetCourseList(ctx context.Context, req *CourseListRequest) (r *CourseListResponse, err error) { - var _args CourseServiceGetCourseListArgs - _args.Req = req - var _result CourseServiceGetCourseListResult - if err = p.Client_().Call(ctx, "GetCourseList", &_args, &_result); err != nil { - return + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetBase = true + } 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 + } + issetTermLists = true + } 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 _result.GetSuccess(), nil -} - -type LaunchScreenService interface { - CreateImage(ctx context.Context, req *CreateImageRequest) (r *CreateImageResponse, err error) - - GetImage(ctx context.Context, req *GetImageRequest) (r *GetImageResponse, err error) - - ChangeImageProperty(ctx context.Context, req *ChangeImagePropertyRequest) (r *ChangeImagePropertyResponse, err error) - - ChangeImage(ctx context.Context, req *ChangeImageRequest) (r *ChangeImageResponse, err error) - - DeleteImage(ctx context.Context, req *DeleteImageRequest) (r *DeleteImageResponse, err error) - MobileGetImage(ctx context.Context, req *MobileGetImageRequest) (r *MobileGetImageResponse, err error) + if !issetBase { + fieldId = 1 + goto RequiredFieldNotSetError + } - AddImagePointTime(ctx context.Context, req *AddImagePointTimeRequest) (r *AddImagePointTimeResponse, err error) -} + if !issetTermLists { + fieldId = 2 + goto RequiredFieldNotSetError + } + 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_TermListResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -type LaunchScreenServiceClient struct { - c thrift.TClient +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) +RequiredFieldNotSetError: + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TermListResponse[fieldId])) } -func NewLaunchScreenServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *LaunchScreenServiceClient { - return &LaunchScreenServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), +func (p *TermListResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err } + p.Base = _field + return nil } - -func NewLaunchScreenServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *LaunchScreenServiceClient { - return &LaunchScreenServiceClient{ - c: thrift.NewTStandardClient(iprot, oprot), +func (p *TermListResponse) ReadField2(iprot thrift.TProtocol) error { + _field := model.NewTermList() + if err := _field.Read(iprot); err != nil { + return err } + p.TermLists = _field + return nil } -func NewLaunchScreenServiceClient(c thrift.TClient) *LaunchScreenServiceClient { - return &LaunchScreenServiceClient{ - c: c, +func (p *TermListResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("TermListResponse"); err != nil { + goto WriteStructBeginError } -} - -func (p *LaunchScreenServiceClient) Client_() thrift.TClient { - return p.c -} - -func (p *LaunchScreenServiceClient) CreateImage(ctx context.Context, req *CreateImageRequest) (r *CreateImageResponse, err error) { - var _args LaunchScreenServiceCreateImageArgs - _args.Req = req - var _result LaunchScreenServiceCreateImageResult - if err = p.Client_().Call(ctx, "CreateImage", &_args, &_result); err != nil { - return + 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 + } } - return _result.GetSuccess(), nil -} -func (p *LaunchScreenServiceClient) GetImage(ctx context.Context, req *GetImageRequest) (r *GetImageResponse, err error) { - var _args LaunchScreenServiceGetImageArgs - _args.Req = req - var _result LaunchScreenServiceGetImageResult - if err = p.Client_().Call(ctx, "GetImage", &_args, &_result); err != nil { - return + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError } - return _result.GetSuccess(), nil -} -func (p *LaunchScreenServiceClient) ChangeImageProperty(ctx context.Context, req *ChangeImagePropertyRequest) (r *ChangeImagePropertyResponse, err error) { - var _args LaunchScreenServiceChangeImagePropertyArgs - _args.Req = req - var _result LaunchScreenServiceChangeImagePropertyResult - if err = p.Client_().Call(ctx, "ChangeImageProperty", &_args, &_result); err != nil { - return + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError } - return _result.GetSuccess(), nil + 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 *LaunchScreenServiceClient) ChangeImage(ctx context.Context, req *ChangeImageRequest) (r *ChangeImageResponse, err error) { - var _args LaunchScreenServiceChangeImageArgs - _args.Req = req - var _result LaunchScreenServiceChangeImageResult - if err = p.Client_().Call(ctx, "ChangeImage", &_args, &_result); err != nil { - return + +func (p *TermListResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError } - return _result.GetSuccess(), nil -} -func (p *LaunchScreenServiceClient) DeleteImage(ctx context.Context, req *DeleteImageRequest) (r *DeleteImageResponse, err error) { - var _args LaunchScreenServiceDeleteImageArgs - _args.Req = req - var _result LaunchScreenServiceDeleteImageResult - if err = p.Client_().Call(ctx, "DeleteImage", &_args, &_result); err != nil { - return + if err := p.Base.Write(oprot); err != nil { + return err } - return _result.GetSuccess(), nil -} -func (p *LaunchScreenServiceClient) MobileGetImage(ctx context.Context, req *MobileGetImageRequest) (r *MobileGetImageResponse, err error) { - var _args LaunchScreenServiceMobileGetImageArgs - _args.Req = req - var _result LaunchScreenServiceMobileGetImageResult - if err = p.Client_().Call(ctx, "MobileGetImage", &_args, &_result); err != nil { - return + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError } - return _result.GetSuccess(), nil + 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 *LaunchScreenServiceClient) AddImagePointTime(ctx context.Context, req *AddImagePointTimeRequest) (r *AddImagePointTimeResponse, err error) { - var _args LaunchScreenServiceAddImagePointTimeArgs - _args.Req = req - var _result LaunchScreenServiceAddImagePointTimeResult - if err = p.Client_().Call(ctx, "AddImagePointTime", &_args, &_result); err != nil { - return + +func (p *TermListResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("term_lists", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError } - return _result.GetSuccess(), nil + if err := p.TermLists.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) } -type PaperService interface { - ListDirFiles(ctx context.Context, req *ListDirFilesRequest) (r *ListDirFilesResponse, err error) - - GetDownloadUrl(ctx context.Context, req *GetDownloadUrlRequest) (r *GetDownloadUrlResponse, err error) - // 兼容安卓 - ListDirFilesForAndroid(ctx context.Context, req *ListDirFilesForAndroidRequest) (r *ListDirFilesForAndroidResponse, err error) +func (p *TermListResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TermListResponse(%+v)", *p) - GetDownloadUrlForAndroid(ctx context.Context, req *GetDownloadUrlForAndroidRequest) (r *GetDownloadUrlForAndroidResponse, err error) } -type PaperServiceClient struct { - c thrift.TClient +// 学期信息 +type TermRequest struct { + Term string `thrift:"term,1,required" form:"term,required" json:"term,required" query:"term,required"` } -func NewPaperServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *PaperServiceClient { - return &PaperServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), - } +func NewTermRequest() *TermRequest { + return &TermRequest{} } -func NewPaperServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *PaperServiceClient { - return &PaperServiceClient{ - c: thrift.NewTStandardClient(iprot, oprot), - } +func (p *TermRequest) InitDefault() { } -func NewPaperServiceClient(c thrift.TClient) *PaperServiceClient { - return &PaperServiceClient{ - c: c, - } +func (p *TermRequest) GetTerm() (v string) { + return p.Term } -func (p *PaperServiceClient) Client_() thrift.TClient { - return p.c +var fieldIDToName_TermRequest = map[int16]string{ + 1: "term", } -func (p *PaperServiceClient) ListDirFiles(ctx context.Context, req *ListDirFilesRequest) (r *ListDirFilesResponse, err error) { - var _args PaperServiceListDirFilesArgs - _args.Req = req - var _result PaperServiceListDirFilesResult - if err = p.Client_().Call(ctx, "ListDirFiles", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} -func (p *PaperServiceClient) GetDownloadUrl(ctx context.Context, req *GetDownloadUrlRequest) (r *GetDownloadUrlResponse, err error) { - var _args PaperServiceGetDownloadUrlArgs - _args.Req = req - var _result PaperServiceGetDownloadUrlResult - if err = p.Client_().Call(ctx, "GetDownloadUrl", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} -func (p *PaperServiceClient) ListDirFilesForAndroid(ctx context.Context, req *ListDirFilesForAndroidRequest) (r *ListDirFilesForAndroidResponse, err error) { - var _args PaperServiceListDirFilesForAndroidArgs - _args.Req = req - var _result PaperServiceListDirFilesForAndroidResult - if err = p.Client_().Call(ctx, "ListDirFilesForAndroid", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} -func (p *PaperServiceClient) GetDownloadUrlForAndroid(ctx context.Context, req *GetDownloadUrlForAndroidRequest) (r *GetDownloadUrlForAndroidResponse, err error) { - var _args PaperServiceGetDownloadUrlForAndroidArgs - _args.Req = req - var _result PaperServiceGetDownloadUrlForAndroidResult - if err = p.Client_().Call(ctx, "GetDownloadUrlForAndroid", &_args, &_result); err != nil { - return +func (p *TermRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetTerm bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } - return _result.GetSuccess(), nil -} -type AcademicService interface { - GetScores(ctx context.Context, req *GetScoresRequest) (r *GetScoresResponse, err error) + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } - GetGPA(ctx context.Context, req *GetGPARequest) (r *GetGPAResponse, err error) + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetTerm = true + } 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 + } - GetCredit(ctx context.Context, req *GetCreditRequest) (r *GetCreditResponse, err error) + if !issetTerm { + fieldId = 1 + goto RequiredFieldNotSetError + } + 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_TermRequest[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - GetUnifiedExam(ctx context.Context, req *GetUnifiedExamRequest) (r *GetUnifiedExamResponse, err error) +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) +RequiredFieldNotSetError: + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TermRequest[fieldId])) } -type AcademicServiceClient struct { - c thrift.TClient -} +func (p *TermRequest) ReadField1(iprot thrift.TProtocol) error { -func NewAcademicServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *AcademicServiceClient { - return &AcademicServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v } + p.Term = _field + return nil } -func NewAcademicServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *AcademicServiceClient { - return &AcademicServiceClient{ - c: thrift.NewTStandardClient(iprot, oprot), +func (p *TermRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("TermRequest"); err != nil { + goto WriteStructBeginError } -} - -func NewAcademicServiceClient(c thrift.TClient) *AcademicServiceClient { - return &AcademicServiceClient{ - c: c, + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } } -} - -func (p *AcademicServiceClient) Client_() thrift.TClient { - return p.c -} - -func (p *AcademicServiceClient) GetScores(ctx context.Context, req *GetScoresRequest) (r *GetScoresResponse, err error) { - var _args AcademicServiceGetScoresArgs - _args.Req = req - var _result AcademicServiceGetScoresResult - if err = p.Client_().Call(ctx, "GetScores", &_args, &_result); err != nil { - return + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError } - return _result.GetSuccess(), nil -} -func (p *AcademicServiceClient) GetGPA(ctx context.Context, req *GetGPARequest) (r *GetGPAResponse, err error) { - var _args AcademicServiceGetGPAArgs - _args.Req = req - var _result AcademicServiceGetGPAResult - if err = p.Client_().Call(ctx, "GetGPA", &_args, &_result); err != nil { - return + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError } - return _result.GetSuccess(), nil + 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 *AcademicServiceClient) GetCredit(ctx context.Context, req *GetCreditRequest) (r *GetCreditResponse, err error) { - var _args AcademicServiceGetCreditArgs - _args.Req = req - var _result AcademicServiceGetCreditResult - if err = p.Client_().Call(ctx, "GetCredit", &_args, &_result); err != nil { - return + +func (p *TermRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("term", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError } - return _result.GetSuccess(), nil -} -func (p *AcademicServiceClient) GetUnifiedExam(ctx context.Context, req *GetUnifiedExamRequest) (r *GetUnifiedExamResponse, err error) { - var _args AcademicServiceGetUnifiedExamArgs - _args.Req = req - var _result AcademicServiceGetUnifiedExamResult - if err = p.Client_().Call(ctx, "GetUnifiedExam", &_args, &_result); err != nil { - return + if err := oprot.WriteString(p.Term); err != nil { + return err } - return _result.GetSuccess(), nil + 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) } -type VersionService interface { - Login(ctx context.Context, req *LoginRequest) (r *LoginResponse, err error) - - UploadVersion(ctx context.Context, req *UploadRequest) (r *UploadResponse, err error) - - UploadParams(ctx context.Context, req *UploadParamsRequest) (r *UploadParamsResponse, err error) - - DownloadReleaseApk(ctx context.Context, req *DownloadReleaseApkRequest) (r *DownloadReleaseApkResponse, err error) - - DownloadBetaApk(ctx context.Context, req *DownloadBetaApkRequest) (r *DownloadBetaApkResponse, err error) - - GetReleaseVersion(ctx context.Context, req *GetReleaseVersionRequest) (r *GetReleaseVersionResponse, err error) - - GetBetaVersion(ctx context.Context, req *GetBetaVersionRequest) (r *GetBetaVersionResponse, err error) - - GetSetting(ctx context.Context, req *GetSettingRequest) (r *GetSettingResponse, err error) - - GetTest(ctx context.Context, req *GetTestRequest) (r *GetTestResponse, err error) +func (p *TermRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TermRequest(%+v)", *p) - GetCloud(ctx context.Context, req *GetCloudRequest) (r *GetCloudResponse, err error) +} - SetCloud(ctx context.Context, req *SetCloudRequest) (r *SetCloudResponse, err error) +type TermResponse struct { + Base *model.BaseResp `thrift:"base,1,required" form:"base,required" json:"base,required" query:"base,required"` + TermInfo *model.TermInfo `thrift:"term_info,2,required" form:"term_info,required" json:"term_info,required" query:"term_info,required"` +} - GetDump(ctx context.Context, req *GetDumpRequest) (r *GetDumpResponse, err error) +func NewTermResponse() *TermResponse { + return &TermResponse{} } -type VersionServiceClient struct { - c thrift.TClient +func (p *TermResponse) InitDefault() { } -func NewVersionServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *VersionServiceClient { - return &VersionServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), +var TermResponse_Base_DEFAULT *model.BaseResp + +func (p *TermResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return TermResponse_Base_DEFAULT } + return p.Base } -func NewVersionServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *VersionServiceClient { - return &VersionServiceClient{ - c: thrift.NewTStandardClient(iprot, oprot), +var TermResponse_TermInfo_DEFAULT *model.TermInfo + +func (p *TermResponse) GetTermInfo() (v *model.TermInfo) { + if !p.IsSetTermInfo() { + return TermResponse_TermInfo_DEFAULT } + return p.TermInfo } -func NewVersionServiceClient(c thrift.TClient) *VersionServiceClient { - return &VersionServiceClient{ - c: c, - } +var fieldIDToName_TermResponse = map[int16]string{ + 1: "base", + 2: "term_info", } -func (p *VersionServiceClient) Client_() thrift.TClient { - return p.c +func (p *TermResponse) IsSetBase() bool { + return p.Base != nil } -func (p *VersionServiceClient) Login(ctx context.Context, req *LoginRequest) (r *LoginResponse, err error) { - var _args VersionServiceLoginArgs - _args.Req = req - var _result VersionServiceLoginResult - if err = p.Client_().Call(ctx, "Login", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil +func (p *TermResponse) IsSetTermInfo() bool { + return p.TermInfo != nil } -func (p *VersionServiceClient) UploadVersion(ctx context.Context, req *UploadRequest) (r *UploadResponse, err error) { - var _args VersionServiceUploadVersionArgs - _args.Req = req - var _result VersionServiceUploadVersionResult - if err = p.Client_().Call(ctx, "UploadVersion", &_args, &_result); err != nil { - return + +func (p *TermResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetBase bool = false + var issetTermInfo bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } - return _result.GetSuccess(), nil -} -func (p *VersionServiceClient) UploadParams(ctx context.Context, req *UploadParamsRequest) (r *UploadParamsResponse, err error) { - var _args VersionServiceUploadParamsArgs - _args.Req = req - var _result VersionServiceUploadParamsResult - if err = p.Client_().Call(ctx, "UploadParams", &_args, &_result); err != nil { - return + + 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 + } + issetBase = true + } 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 + } + issetTermInfo = true + } 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 + } } - return _result.GetSuccess(), nil -} -func (p *VersionServiceClient) DownloadReleaseApk(ctx context.Context, req *DownloadReleaseApkRequest) (r *DownloadReleaseApkResponse, err error) { - var _args VersionServiceDownloadReleaseApkArgs - _args.Req = req - var _result VersionServiceDownloadReleaseApkResult - if err = p.Client_().Call(ctx, "DownloadReleaseApk", &_args, &_result); err != nil { - return + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError } - return _result.GetSuccess(), nil -} -func (p *VersionServiceClient) DownloadBetaApk(ctx context.Context, req *DownloadBetaApkRequest) (r *DownloadBetaApkResponse, err error) { - var _args VersionServiceDownloadBetaApkArgs - _args.Req = req - var _result VersionServiceDownloadBetaApkResult - if err = p.Client_().Call(ctx, "DownloadBetaApk", &_args, &_result); err != nil { - return + + if !issetBase { + fieldId = 1 + goto RequiredFieldNotSetError } - return _result.GetSuccess(), nil -} -func (p *VersionServiceClient) GetReleaseVersion(ctx context.Context, req *GetReleaseVersionRequest) (r *GetReleaseVersionResponse, err error) { - var _args VersionServiceGetReleaseVersionArgs - _args.Req = req - var _result VersionServiceGetReleaseVersionResult - if err = p.Client_().Call(ctx, "GetReleaseVersion", &_args, &_result); err != nil { - return + + if !issetTermInfo { + fieldId = 2 + goto RequiredFieldNotSetError } - return _result.GetSuccess(), nil + 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_TermResponse[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) +RequiredFieldNotSetError: + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TermResponse[fieldId])) } -func (p *VersionServiceClient) GetBetaVersion(ctx context.Context, req *GetBetaVersionRequest) (r *GetBetaVersionResponse, err error) { - var _args VersionServiceGetBetaVersionArgs - _args.Req = req - var _result VersionServiceGetBetaVersionResult - if err = p.Client_().Call(ctx, "GetBetaVersion", &_args, &_result); err != nil { - return + +func (p *TermResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err } - return _result.GetSuccess(), nil + p.Base = _field + return nil } -func (p *VersionServiceClient) GetSetting(ctx context.Context, req *GetSettingRequest) (r *GetSettingResponse, err error) { - var _args VersionServiceGetSettingArgs - _args.Req = req - var _result VersionServiceGetSettingResult - if err = p.Client_().Call(ctx, "GetSetting", &_args, &_result); err != nil { - return +func (p *TermResponse) ReadField2(iprot thrift.TProtocol) error { + _field := model.NewTermInfo() + if err := _field.Read(iprot); err != nil { + return err } - return _result.GetSuccess(), nil + p.TermInfo = _field + return nil } -func (p *VersionServiceClient) GetTest(ctx context.Context, req *GetTestRequest) (r *GetTestResponse, err error) { - var _args VersionServiceGetTestArgs - _args.Req = req - var _result VersionServiceGetTestResult - if err = p.Client_().Call(ctx, "GetTest", &_args, &_result); err != nil { - return + +func (p *TermResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("TermResponse"); err != nil { + goto WriteStructBeginError } - return _result.GetSuccess(), nil -} -func (p *VersionServiceClient) GetCloud(ctx context.Context, req *GetCloudRequest) (r *GetCloudResponse, err error) { - var _args VersionServiceGetCloudArgs - _args.Req = req - var _result VersionServiceGetCloudResult - if err = p.Client_().Call(ctx, "GetCloud", &_args, &_result); err != nil { - return + 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 + } } - return _result.GetSuccess(), nil + 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 *VersionServiceClient) SetCloud(ctx context.Context, req *SetCloudRequest) (r *SetCloudResponse, err error) { - var _args VersionServiceSetCloudArgs - _args.Req = req - var _result VersionServiceSetCloudResult - if err = p.Client_().Call(ctx, "SetCloud", &_args, &_result); err != nil { - return + +func (p *TermResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError } - return _result.GetSuccess(), nil + 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 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *VersionServiceClient) GetDump(ctx context.Context, req *GetDumpRequest) (r *GetDumpResponse, err error) { - var _args VersionServiceGetDumpArgs - _args.Req = req - var _result VersionServiceGetDumpResult - if err = p.Client_().Call(ctx, "GetDump", &_args, &_result); err != nil { - return + +func (p *TermResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("term_info", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError } - return _result.GetSuccess(), nil + if err := p.TermInfo.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) } -type CommonService interface { - GetCSS(ctx context.Context, req *GetCSSRequest) (r *GetCSSResponse, err error) +func (p *TermResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TermResponse(%+v)", *p) - GetHtml(ctx context.Context, req *GetHtmlRequest) (r *GetHtmlResponse, err error) +} - GetUserAgreement(ctx context.Context, req *GetUserAgreementRequest) (r *GetUserAgreementResponse, err error) +type ClassRoomService interface { + GetEmptyClassrooms(ctx context.Context, request *EmptyClassroomRequest) (r *EmptyClassroomResponse, err error) + + GetExamRoomInfo(ctx context.Context, request *ExamRoomInfoRequest) (r *ExamRoomInfoResponse, err error) } -type CommonServiceClient struct { +type ClassRoomServiceClient struct { c thrift.TClient } -func NewCommonServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *CommonServiceClient { - return &CommonServiceClient{ +func NewClassRoomServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *ClassRoomServiceClient { + return &ClassRoomServiceClient{ c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), } } -func NewCommonServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *CommonServiceClient { - return &CommonServiceClient{ +func NewClassRoomServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *ClassRoomServiceClient { + return &ClassRoomServiceClient{ c: thrift.NewTStandardClient(iprot, oprot), } } -func NewCommonServiceClient(c thrift.TClient) *CommonServiceClient { - return &CommonServiceClient{ +func NewClassRoomServiceClient(c thrift.TClient) *ClassRoomServiceClient { + return &ClassRoomServiceClient{ c: c, } } -func (p *CommonServiceClient) Client_() thrift.TClient { +func (p *ClassRoomServiceClient) Client_() thrift.TClient { return p.c } -func (p *CommonServiceClient) GetCSS(ctx context.Context, req *GetCSSRequest) (r *GetCSSResponse, err error) { - var _args CommonServiceGetCSSArgs - _args.Req = req - var _result CommonServiceGetCSSResult - if err = p.Client_().Call(ctx, "GetCSS", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} -func (p *CommonServiceClient) GetHtml(ctx context.Context, req *GetHtmlRequest) (r *GetHtmlResponse, err error) { - var _args CommonServiceGetHtmlArgs - _args.Req = req - var _result CommonServiceGetHtmlResult - if err = p.Client_().Call(ctx, "GetHtml", &_args, &_result); err != nil { +func (p *ClassRoomServiceClient) GetEmptyClassrooms(ctx context.Context, request *EmptyClassroomRequest) (r *EmptyClassroomResponse, err error) { + var _args ClassRoomServiceGetEmptyClassroomsArgs + _args.Request = request + var _result ClassRoomServiceGetEmptyClassroomsResult + if err = p.Client_().Call(ctx, "GetEmptyClassrooms", &_args, &_result); err != nil { return } return _result.GetSuccess(), nil } -func (p *CommonServiceClient) GetUserAgreement(ctx context.Context, req *GetUserAgreementRequest) (r *GetUserAgreementResponse, err error) { - var _args CommonServiceGetUserAgreementArgs - _args.Req = req - var _result CommonServiceGetUserAgreementResult - if err = p.Client_().Call(ctx, "GetUserAgreement", &_args, &_result); err != nil { +func (p *ClassRoomServiceClient) GetExamRoomInfo(ctx context.Context, request *ExamRoomInfoRequest) (r *ExamRoomInfoResponse, err error) { + var _args ClassRoomServiceGetExamRoomInfoArgs + _args.Request = request + var _result ClassRoomServiceGetExamRoomInfoResult + if err = p.Client_().Call(ctx, "GetExamRoomInfo", &_args, &_result); err != nil { return } return _result.GetSuccess(), nil } -type ClassRoomServiceProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler ClassRoomService -} +type UserService interface { + GetLoginData(ctx context.Context, request *GetLoginDataRequest) (r *GetLoginDataResponse, err error) -func (p *ClassRoomServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor -} + ValidateCode(ctx context.Context, request *ValidateCodeRequest) (r *ValidateCodeResponse, err error) -func (p *ClassRoomServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok -} + ValidateCodeForAndroid(ctx context.Context, request *ValidateCodeForAndroidRequest) (r *ValidateCodeForAndroidResponse, err error) -func (p *ClassRoomServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap + GetToken(ctx context.Context, request *GetAccessTokenRequest) (r *GetAccessTokenResponse, err error) + + RefreshToken(ctx context.Context, request *RefreshTokenRequest) (r *RefreshTokenResponse, err error) + + TestAuth(ctx context.Context, request *TestAuthRequest) (r *TestAuthResponse, err error) } -func NewClassRoomServiceProcessor(handler ClassRoomService) *ClassRoomServiceProcessor { - self := &ClassRoomServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} - self.AddToProcessorMap("GetEmptyClassrooms", &classRoomServiceProcessorGetEmptyClassrooms{handler: handler}) - self.AddToProcessorMap("GetExamRoomInfo", &classRoomServiceProcessorGetExamRoomInfo{handler: handler}) - return self +type UserServiceClient struct { + c thrift.TClient } -func (p *ClassRoomServiceProcessor) 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) + +func NewUserServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *UserServiceClient { + return &UserServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), } - 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 classRoomServiceProcessorGetEmptyClassrooms struct { - handler ClassRoomService +func NewUserServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *UserServiceClient { + return &UserServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } } -func (p *classRoomServiceProcessorGetEmptyClassrooms) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := ClassRoomServiceGetEmptyClassroomsArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetEmptyClassrooms", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func NewUserServiceClient(c thrift.TClient) *UserServiceClient { + return &UserServiceClient{ + c: c, } +} - iprot.ReadMessageEnd() - var err2 error - result := ClassRoomServiceGetEmptyClassroomsResult{} - var retval *EmptyClassroomResponse - if retval, err2 = p.handler.GetEmptyClassrooms(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetEmptyClassrooms: "+err2.Error()) - oprot.WriteMessageBegin("GetEmptyClassrooms", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval +func (p *UserServiceClient) Client_() thrift.TClient { + return p.c +} + +func (p *UserServiceClient) GetLoginData(ctx context.Context, request *GetLoginDataRequest) (r *GetLoginDataResponse, err error) { + var _args UserServiceGetLoginDataArgs + _args.Request = request + var _result UserServiceGetLoginDataResult + if err = p.Client_().Call(ctx, "GetLoginData", &_args, &_result); err != nil { + return } - if err2 = oprot.WriteMessageBegin("GetEmptyClassrooms", thrift.REPLY, seqId); err2 != nil { - err = err2 + return _result.GetSuccess(), nil +} +func (p *UserServiceClient) ValidateCode(ctx context.Context, request *ValidateCodeRequest) (r *ValidateCodeResponse, err error) { + var _args UserServiceValidateCodeArgs + _args.Request = request + var _result UserServiceValidateCodeResult + if err = p.Client_().Call(ctx, "ValidateCode", &_args, &_result); err != nil { + return } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + return _result.GetSuccess(), nil +} +func (p *UserServiceClient) ValidateCodeForAndroid(ctx context.Context, request *ValidateCodeForAndroidRequest) (r *ValidateCodeForAndroidResponse, err error) { + var _args UserServiceValidateCodeForAndroidArgs + _args.Request = request + var _result UserServiceValidateCodeForAndroidResult + if err = p.Client_().Call(ctx, "ValidateCodeForAndroid", &_args, &_result); err != nil { + return } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + return _result.GetSuccess(), nil +} +func (p *UserServiceClient) GetToken(ctx context.Context, request *GetAccessTokenRequest) (r *GetAccessTokenResponse, err error) { + var _args UserServiceGetTokenArgs + _args.Request = request + var _result UserServiceGetTokenResult + if err = p.Client_().Call(ctx, "GetToken", &_args, &_result); err != nil { + return } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + return _result.GetSuccess(), nil +} +func (p *UserServiceClient) RefreshToken(ctx context.Context, request *RefreshTokenRequest) (r *RefreshTokenResponse, err error) { + var _args UserServiceRefreshTokenArgs + _args.Request = request + var _result UserServiceRefreshTokenResult + if err = p.Client_().Call(ctx, "RefreshToken", &_args, &_result); err != nil { + return } - if err != nil { + return _result.GetSuccess(), nil +} +func (p *UserServiceClient) TestAuth(ctx context.Context, request *TestAuthRequest) (r *TestAuthResponse, err error) { + var _args UserServiceTestAuthArgs + _args.Request = request + var _result UserServiceTestAuthResult + if err = p.Client_().Call(ctx, "TestAuth", &_args, &_result); err != nil { return } - return true, err + return _result.GetSuccess(), nil } -type classRoomServiceProcessorGetExamRoomInfo struct { - handler ClassRoomService +type CourseService interface { + GetCourseList(ctx context.Context, req *CourseListRequest) (r *CourseListResponse, err error) } -func (p *classRoomServiceProcessorGetExamRoomInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := ClassRoomServiceGetExamRoomInfoArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetExamRoomInfo", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } +type CourseServiceClient struct { + c thrift.TClient +} - iprot.ReadMessageEnd() - var err2 error - result := ClassRoomServiceGetExamRoomInfoResult{} - var retval *ExamRoomInfoResponse - if retval, err2 = p.handler.GetExamRoomInfo(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetExamRoomInfo: "+err2.Error()) - oprot.WriteMessageBegin("GetExamRoomInfo", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("GetExamRoomInfo", 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 +func NewCourseServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *CourseServiceClient { + return &CourseServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), } - return true, err } -type ClassRoomServiceGetEmptyClassroomsArgs struct { - Request *EmptyClassroomRequest `thrift:"request,1"` +func NewCourseServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *CourseServiceClient { + return &CourseServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } } -func NewClassRoomServiceGetEmptyClassroomsArgs() *ClassRoomServiceGetEmptyClassroomsArgs { - return &ClassRoomServiceGetEmptyClassroomsArgs{} +func NewCourseServiceClient(c thrift.TClient) *CourseServiceClient { + return &CourseServiceClient{ + c: c, + } } -func (p *ClassRoomServiceGetEmptyClassroomsArgs) InitDefault() { +func (p *CourseServiceClient) Client_() thrift.TClient { + return p.c } -var ClassRoomServiceGetEmptyClassroomsArgs_Request_DEFAULT *EmptyClassroomRequest - -func (p *ClassRoomServiceGetEmptyClassroomsArgs) GetRequest() (v *EmptyClassroomRequest) { - if !p.IsSetRequest() { - return ClassRoomServiceGetEmptyClassroomsArgs_Request_DEFAULT +func (p *CourseServiceClient) GetCourseList(ctx context.Context, req *CourseListRequest) (r *CourseListResponse, err error) { + var _args CourseServiceGetCourseListArgs + _args.Req = req + var _result CourseServiceGetCourseListResult + if err = p.Client_().Call(ctx, "GetCourseList", &_args, &_result); err != nil { + return } - return p.Request + return _result.GetSuccess(), nil } -var fieldIDToName_ClassRoomServiceGetEmptyClassroomsArgs = map[int16]string{ - 1: "request", +type LaunchScreenService interface { + CreateImage(ctx context.Context, req *CreateImageRequest) (r *CreateImageResponse, err error) + + GetImage(ctx context.Context, req *GetImageRequest) (r *GetImageResponse, err error) + + ChangeImageProperty(ctx context.Context, req *ChangeImagePropertyRequest) (r *ChangeImagePropertyResponse, err error) + + ChangeImage(ctx context.Context, req *ChangeImageRequest) (r *ChangeImageResponse, err error) + + DeleteImage(ctx context.Context, req *DeleteImageRequest) (r *DeleteImageResponse, err error) + + MobileGetImage(ctx context.Context, req *MobileGetImageRequest) (r *MobileGetImageResponse, err error) + + AddImagePointTime(ctx context.Context, req *AddImagePointTimeRequest) (r *AddImagePointTimeResponse, err error) } -func (p *ClassRoomServiceGetEmptyClassroomsArgs) IsSetRequest() bool { - return p.Request != nil +type LaunchScreenServiceClient struct { + c thrift.TClient } -func (p *ClassRoomServiceGetEmptyClassroomsArgs) Read(iprot thrift.TProtocol) (err error) { +func NewLaunchScreenServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *LaunchScreenServiceClient { + return &LaunchScreenServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} - var fieldTypeId thrift.TType - var fieldId int16 +func NewLaunchScreenServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *LaunchScreenServiceClient { + return &LaunchScreenServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError +func NewLaunchScreenServiceClient(c thrift.TClient) *LaunchScreenServiceClient { + return &LaunchScreenServiceClient{ + c: c, } +} - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } +func (p *LaunchScreenServiceClient) Client_() thrift.TClient { + return p.c +} - 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 - } +func (p *LaunchScreenServiceClient) CreateImage(ctx context.Context, req *CreateImageRequest) (r *CreateImageResponse, err error) { + var _args LaunchScreenServiceCreateImageArgs + _args.Req = req + var _result LaunchScreenServiceCreateImageResult + if err = p.Client_().Call(ctx, "CreateImage", &_args, &_result); err != nil { + return } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError + return _result.GetSuccess(), nil +} +func (p *LaunchScreenServiceClient) GetImage(ctx context.Context, req *GetImageRequest) (r *GetImageResponse, err error) { + var _args LaunchScreenServiceGetImageArgs + _args.Req = req + var _result LaunchScreenServiceGetImageResult + if err = p.Client_().Call(ctx, "GetImage", &_args, &_result); err != nil { + return } - - 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_ClassRoomServiceGetEmptyClassroomsArgs[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) + return _result.GetSuccess(), nil } - -func (p *ClassRoomServiceGetEmptyClassroomsArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewEmptyClassroomRequest() - if err := _field.Read(iprot); err != nil { - return err +func (p *LaunchScreenServiceClient) ChangeImageProperty(ctx context.Context, req *ChangeImagePropertyRequest) (r *ChangeImagePropertyResponse, err error) { + var _args LaunchScreenServiceChangeImagePropertyArgs + _args.Req = req + var _result LaunchScreenServiceChangeImagePropertyResult + if err = p.Client_().Call(ctx, "ChangeImageProperty", &_args, &_result); err != nil { + return } - p.Request = _field - return nil + return _result.GetSuccess(), nil } - -func (p *ClassRoomServiceGetEmptyClassroomsArgs) Write(oprot thrift.TProtocol) (err error) { - - var fieldId int16 - if err = oprot.WriteStructBegin("GetEmptyClassrooms_args"); err != nil { - goto WriteStructBeginError +func (p *LaunchScreenServiceClient) ChangeImage(ctx context.Context, req *ChangeImageRequest) (r *ChangeImageResponse, err error) { + var _args LaunchScreenServiceChangeImageArgs + _args.Req = req + var _result LaunchScreenServiceChangeImageResult + if err = p.Client_().Call(ctx, "ChangeImage", &_args, &_result); err != nil { + return } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } + return _result.GetSuccess(), nil +} +func (p *LaunchScreenServiceClient) DeleteImage(ctx context.Context, req *DeleteImageRequest) (r *DeleteImageResponse, err error) { + var _args LaunchScreenServiceDeleteImageArgs + _args.Req = req + var _result LaunchScreenServiceDeleteImageResult + if err = p.Client_().Call(ctx, "DeleteImage", &_args, &_result); err != nil { + return } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError + return _result.GetSuccess(), nil +} +func (p *LaunchScreenServiceClient) MobileGetImage(ctx context.Context, req *MobileGetImageRequest) (r *MobileGetImageResponse, err error) { + var _args LaunchScreenServiceMobileGetImageArgs + _args.Req = req + var _result LaunchScreenServiceMobileGetImageResult + if err = p.Client_().Call(ctx, "MobileGetImage", &_args, &_result); err != nil { + return } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError + return _result.GetSuccess(), nil +} +func (p *LaunchScreenServiceClient) AddImagePointTime(ctx context.Context, req *AddImagePointTimeRequest) (r *AddImagePointTimeResponse, err error) { + var _args LaunchScreenServiceAddImagePointTimeArgs + _args.Req = req + var _result LaunchScreenServiceAddImagePointTimeResult + if err = p.Client_().Call(ctx, "AddImagePointTime", &_args, &_result); err != nil { + return } - 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) + return _result.GetSuccess(), nil } -func (p *ClassRoomServiceGetEmptyClassroomsArgs) 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 +type PaperService interface { + ListDirFiles(ctx context.Context, req *ListDirFilesRequest) (r *ListDirFilesResponse, err error) + + GetDownloadUrl(ctx context.Context, req *GetDownloadUrlRequest) (r *GetDownloadUrlResponse, err error) + // 兼容安卓 + ListDirFilesForAndroid(ctx context.Context, req *ListDirFilesForAndroidRequest) (r *ListDirFilesForAndroidResponse, err error) + + GetDownloadUrlForAndroid(ctx context.Context, req *GetDownloadUrlForAndroidRequest) (r *GetDownloadUrlForAndroidResponse, err error) +} + +type PaperServiceClient struct { + c thrift.TClient +} + +func NewPaperServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *PaperServiceClient { + return &PaperServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), } - 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 *ClassRoomServiceGetEmptyClassroomsArgs) String() string { - if p == nil { - return "" +func NewPaperServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *PaperServiceClient { + return &PaperServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), } - return fmt.Sprintf("ClassRoomServiceGetEmptyClassroomsArgs(%+v)", *p) +} +func NewPaperServiceClient(c thrift.TClient) *PaperServiceClient { + return &PaperServiceClient{ + c: c, + } } -type ClassRoomServiceGetEmptyClassroomsResult struct { - Success *EmptyClassroomResponse `thrift:"success,0,optional"` +func (p *PaperServiceClient) Client_() thrift.TClient { + return p.c } -func NewClassRoomServiceGetEmptyClassroomsResult() *ClassRoomServiceGetEmptyClassroomsResult { - return &ClassRoomServiceGetEmptyClassroomsResult{} +func (p *PaperServiceClient) ListDirFiles(ctx context.Context, req *ListDirFilesRequest) (r *ListDirFilesResponse, err error) { + var _args PaperServiceListDirFilesArgs + _args.Req = req + var _result PaperServiceListDirFilesResult + if err = p.Client_().Call(ctx, "ListDirFiles", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *PaperServiceClient) GetDownloadUrl(ctx context.Context, req *GetDownloadUrlRequest) (r *GetDownloadUrlResponse, err error) { + var _args PaperServiceGetDownloadUrlArgs + _args.Req = req + var _result PaperServiceGetDownloadUrlResult + if err = p.Client_().Call(ctx, "GetDownloadUrl", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *PaperServiceClient) ListDirFilesForAndroid(ctx context.Context, req *ListDirFilesForAndroidRequest) (r *ListDirFilesForAndroidResponse, err error) { + var _args PaperServiceListDirFilesForAndroidArgs + _args.Req = req + var _result PaperServiceListDirFilesForAndroidResult + if err = p.Client_().Call(ctx, "ListDirFilesForAndroid", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *PaperServiceClient) GetDownloadUrlForAndroid(ctx context.Context, req *GetDownloadUrlForAndroidRequest) (r *GetDownloadUrlForAndroidResponse, err error) { + var _args PaperServiceGetDownloadUrlForAndroidArgs + _args.Req = req + var _result PaperServiceGetDownloadUrlForAndroidResult + if err = p.Client_().Call(ctx, "GetDownloadUrlForAndroid", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil } -func (p *ClassRoomServiceGetEmptyClassroomsResult) InitDefault() { +type AcademicService interface { + GetScores(ctx context.Context, req *GetScoresRequest) (r *GetScoresResponse, err error) + + GetGPA(ctx context.Context, req *GetGPARequest) (r *GetGPAResponse, err error) + + GetCredit(ctx context.Context, req *GetCreditRequest) (r *GetCreditResponse, err error) + + GetUnifiedExam(ctx context.Context, req *GetUnifiedExamRequest) (r *GetUnifiedExamResponse, err error) } -var ClassRoomServiceGetEmptyClassroomsResult_Success_DEFAULT *EmptyClassroomResponse +type AcademicServiceClient struct { + c thrift.TClient +} -func (p *ClassRoomServiceGetEmptyClassroomsResult) GetSuccess() (v *EmptyClassroomResponse) { - if !p.IsSetSuccess() { - return ClassRoomServiceGetEmptyClassroomsResult_Success_DEFAULT +func NewAcademicServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *AcademicServiceClient { + return &AcademicServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), } - return p.Success } -var fieldIDToName_ClassRoomServiceGetEmptyClassroomsResult = map[int16]string{ - 0: "success", +func NewAcademicServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *AcademicServiceClient { + return &AcademicServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } } -func (p *ClassRoomServiceGetEmptyClassroomsResult) IsSetSuccess() bool { - return p.Success != nil +func NewAcademicServiceClient(c thrift.TClient) *AcademicServiceClient { + return &AcademicServiceClient{ + c: c, + } } -func (p *ClassRoomServiceGetEmptyClassroomsResult) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 +func (p *AcademicServiceClient) Client_() thrift.TClient { + return p.c +} - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError +func (p *AcademicServiceClient) GetScores(ctx context.Context, req *GetScoresRequest) (r *GetScoresResponse, err error) { + var _args AcademicServiceGetScoresArgs + _args.Req = req + var _result AcademicServiceGetScoresResult + if err = p.Client_().Call(ctx, "GetScores", &_args, &_result); err != nil { + return } - - 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_ClassRoomServiceGetEmptyClassroomsResult[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) + return _result.GetSuccess(), nil } - -func (p *ClassRoomServiceGetEmptyClassroomsResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewEmptyClassroomResponse() - if err := _field.Read(iprot); err != nil { - return err +func (p *AcademicServiceClient) GetGPA(ctx context.Context, req *GetGPARequest) (r *GetGPAResponse, err error) { + var _args AcademicServiceGetGPAArgs + _args.Req = req + var _result AcademicServiceGetGPAResult + if err = p.Client_().Call(ctx, "GetGPA", &_args, &_result); err != nil { + return } - p.Success = _field - return nil + return _result.GetSuccess(), nil } - -func (p *ClassRoomServiceGetEmptyClassroomsResult) Write(oprot thrift.TProtocol) (err error) { - - var fieldId int16 - if err = oprot.WriteStructBegin("GetEmptyClassrooms_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 +func (p *AcademicServiceClient) GetCredit(ctx context.Context, req *GetCreditRequest) (r *GetCreditResponse, err error) { + var _args AcademicServiceGetCreditArgs + _args.Req = req + var _result AcademicServiceGetCreditResult + if err = p.Client_().Call(ctx, "GetCredit", &_args, &_result); err != nil { + return } - 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) + return _result.GetSuccess(), nil } - -func (p *ClassRoomServiceGetEmptyClassroomsResult) 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 - } +func (p *AcademicServiceClient) GetUnifiedExam(ctx context.Context, req *GetUnifiedExamRequest) (r *GetUnifiedExamResponse, err error) { + var _args AcademicServiceGetUnifiedExamArgs + _args.Req = req + var _result AcademicServiceGetUnifiedExamResult + if err = p.Client_().Call(ctx, "GetUnifiedExam", &_args, &_result); err != nil { + return } - 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) + return _result.GetSuccess(), nil } -func (p *ClassRoomServiceGetEmptyClassroomsResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ClassRoomServiceGetEmptyClassroomsResult(%+v)", *p) +type VersionService interface { + Login(ctx context.Context, req *LoginRequest) (r *LoginResponse, err error) -} + UploadVersion(ctx context.Context, req *UploadRequest) (r *UploadResponse, err error) -type ClassRoomServiceGetExamRoomInfoArgs struct { - Request *ExamRoomInfoRequest `thrift:"request,1"` -} + UploadParams(ctx context.Context, req *UploadParamsRequest) (r *UploadParamsResponse, err error) -func NewClassRoomServiceGetExamRoomInfoArgs() *ClassRoomServiceGetExamRoomInfoArgs { - return &ClassRoomServiceGetExamRoomInfoArgs{} -} + DownloadReleaseApk(ctx context.Context, req *DownloadReleaseApkRequest) (r *DownloadReleaseApkResponse, err error) -func (p *ClassRoomServiceGetExamRoomInfoArgs) InitDefault() { -} + DownloadBetaApk(ctx context.Context, req *DownloadBetaApkRequest) (r *DownloadBetaApkResponse, err error) -var ClassRoomServiceGetExamRoomInfoArgs_Request_DEFAULT *ExamRoomInfoRequest + GetReleaseVersion(ctx context.Context, req *GetReleaseVersionRequest) (r *GetReleaseVersionResponse, err error) -func (p *ClassRoomServiceGetExamRoomInfoArgs) GetRequest() (v *ExamRoomInfoRequest) { - if !p.IsSetRequest() { - return ClassRoomServiceGetExamRoomInfoArgs_Request_DEFAULT - } - return p.Request -} + GetBetaVersion(ctx context.Context, req *GetBetaVersionRequest) (r *GetBetaVersionResponse, err error) -var fieldIDToName_ClassRoomServiceGetExamRoomInfoArgs = map[int16]string{ - 1: "request", -} + GetSetting(ctx context.Context, req *GetSettingRequest) (r *GetSettingResponse, err error) -func (p *ClassRoomServiceGetExamRoomInfoArgs) IsSetRequest() bool { - return p.Request != nil -} + GetTest(ctx context.Context, req *GetTestRequest) (r *GetTestResponse, err error) -func (p *ClassRoomServiceGetExamRoomInfoArgs) Read(iprot thrift.TProtocol) (err error) { + GetCloud(ctx context.Context, req *GetCloudRequest) (r *GetCloudResponse, err error) - var fieldTypeId thrift.TType - var fieldId int16 + SetCloud(ctx context.Context, req *SetCloudRequest) (r *SetCloudResponse, err error) - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } + GetDump(ctx context.Context, req *GetDumpRequest) (r *GetDumpResponse, err error) +} - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } +type VersionServiceClient struct { + c thrift.TClient +} - 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 +func NewVersionServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *VersionServiceClient { + return &VersionServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), } +} - 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_ClassRoomServiceGetExamRoomInfoArgs[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 NewVersionServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *VersionServiceClient { + return &VersionServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } } -func (p *ClassRoomServiceGetExamRoomInfoArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewExamRoomInfoRequest() - if err := _field.Read(iprot); err != nil { - return err +func NewVersionServiceClient(c thrift.TClient) *VersionServiceClient { + return &VersionServiceClient{ + c: c, } - p.Request = _field - return nil } -func (p *ClassRoomServiceGetExamRoomInfoArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceClient) Client_() thrift.TClient { + return p.c +} - var fieldId int16 - if err = oprot.WriteStructBegin("GetExamRoomInfo_args"); err != nil { - goto WriteStructBeginError +func (p *VersionServiceClient) Login(ctx context.Context, req *LoginRequest) (r *LoginResponse, err error) { + var _args VersionServiceLoginArgs + _args.Req = req + var _result VersionServiceLoginResult + if err = p.Client_().Call(ctx, "Login", &_args, &_result); err != nil { + return } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } + return _result.GetSuccess(), nil +} +func (p *VersionServiceClient) UploadVersion(ctx context.Context, req *UploadRequest) (r *UploadResponse, err error) { + var _args VersionServiceUploadVersionArgs + _args.Req = req + var _result VersionServiceUploadVersionResult + if err = p.Client_().Call(ctx, "UploadVersion", &_args, &_result); err != nil { + return } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError + return _result.GetSuccess(), nil +} +func (p *VersionServiceClient) UploadParams(ctx context.Context, req *UploadParamsRequest) (r *UploadParamsResponse, err error) { + var _args VersionServiceUploadParamsArgs + _args.Req = req + var _result VersionServiceUploadParamsResult + if err = p.Client_().Call(ctx, "UploadParams", &_args, &_result); err != nil { + return } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError + return _result.GetSuccess(), nil +} +func (p *VersionServiceClient) DownloadReleaseApk(ctx context.Context, req *DownloadReleaseApkRequest) (r *DownloadReleaseApkResponse, err error) { + var _args VersionServiceDownloadReleaseApkArgs + _args.Req = req + var _result VersionServiceDownloadReleaseApkResult + if err = p.Client_().Call(ctx, "DownloadReleaseApk", &_args, &_result); err != nil { + return } - 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) + return _result.GetSuccess(), nil } - -func (p *ClassRoomServiceGetExamRoomInfoArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError +func (p *VersionServiceClient) DownloadBetaApk(ctx context.Context, req *DownloadBetaApkRequest) (r *DownloadBetaApkResponse, err error) { + var _args VersionServiceDownloadBetaApkArgs + _args.Req = req + var _result VersionServiceDownloadBetaApkResult + if err = p.Client_().Call(ctx, "DownloadBetaApk", &_args, &_result); err != nil { + return } - if err := p.Request.Write(oprot); err != nil { - return err + return _result.GetSuccess(), nil +} +func (p *VersionServiceClient) GetReleaseVersion(ctx context.Context, req *GetReleaseVersionRequest) (r *GetReleaseVersionResponse, err error) { + var _args VersionServiceGetReleaseVersionArgs + _args.Req = req + var _result VersionServiceGetReleaseVersionResult + if err = p.Client_().Call(ctx, "GetReleaseVersion", &_args, &_result); err != nil { + return } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError + return _result.GetSuccess(), nil +} +func (p *VersionServiceClient) GetBetaVersion(ctx context.Context, req *GetBetaVersionRequest) (r *GetBetaVersionResponse, err error) { + var _args VersionServiceGetBetaVersionArgs + _args.Req = req + var _result VersionServiceGetBetaVersionResult + if err = p.Client_().Call(ctx, "GetBetaVersion", &_args, &_result); err != nil { + return } - 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) + return _result.GetSuccess(), nil } - -func (p *ClassRoomServiceGetExamRoomInfoArgs) String() string { - if p == nil { - return "" +func (p *VersionServiceClient) GetSetting(ctx context.Context, req *GetSettingRequest) (r *GetSettingResponse, err error) { + var _args VersionServiceGetSettingArgs + _args.Req = req + var _result VersionServiceGetSettingResult + if err = p.Client_().Call(ctx, "GetSetting", &_args, &_result); err != nil { + return } - return fmt.Sprintf("ClassRoomServiceGetExamRoomInfoArgs(%+v)", *p) - + return _result.GetSuccess(), nil } - -type ClassRoomServiceGetExamRoomInfoResult struct { - Success *ExamRoomInfoResponse `thrift:"success,0,optional"` +func (p *VersionServiceClient) GetTest(ctx context.Context, req *GetTestRequest) (r *GetTestResponse, err error) { + var _args VersionServiceGetTestArgs + _args.Req = req + var _result VersionServiceGetTestResult + if err = p.Client_().Call(ctx, "GetTest", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil } - -func NewClassRoomServiceGetExamRoomInfoResult() *ClassRoomServiceGetExamRoomInfoResult { - return &ClassRoomServiceGetExamRoomInfoResult{} +func (p *VersionServiceClient) GetCloud(ctx context.Context, req *GetCloudRequest) (r *GetCloudResponse, err error) { + var _args VersionServiceGetCloudArgs + _args.Req = req + var _result VersionServiceGetCloudResult + if err = p.Client_().Call(ctx, "GetCloud", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil } - -func (p *ClassRoomServiceGetExamRoomInfoResult) InitDefault() { +func (p *VersionServiceClient) SetCloud(ctx context.Context, req *SetCloudRequest) (r *SetCloudResponse, err error) { + var _args VersionServiceSetCloudArgs + _args.Req = req + var _result VersionServiceSetCloudResult + if err = p.Client_().Call(ctx, "SetCloud", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil } - -var ClassRoomServiceGetExamRoomInfoResult_Success_DEFAULT *ExamRoomInfoResponse - -func (p *ClassRoomServiceGetExamRoomInfoResult) GetSuccess() (v *ExamRoomInfoResponse) { - if !p.IsSetSuccess() { - return ClassRoomServiceGetExamRoomInfoResult_Success_DEFAULT +func (p *VersionServiceClient) GetDump(ctx context.Context, req *GetDumpRequest) (r *GetDumpResponse, err error) { + var _args VersionServiceGetDumpArgs + _args.Req = req + var _result VersionServiceGetDumpResult + if err = p.Client_().Call(ctx, "GetDump", &_args, &_result); err != nil { + return } - return p.Success + return _result.GetSuccess(), nil } -var fieldIDToName_ClassRoomServiceGetExamRoomInfoResult = map[int16]string{ - 0: "success", -} +type CommonService interface { + GetCSS(ctx context.Context, req *GetCSSRequest) (r *GetCSSResponse, err error) -func (p *ClassRoomServiceGetExamRoomInfoResult) IsSetSuccess() bool { - return p.Success != nil -} + GetHtml(ctx context.Context, req *GetHtmlRequest) (r *GetHtmlResponse, err error) -func (p *ClassRoomServiceGetExamRoomInfoResult) Read(iprot thrift.TProtocol) (err error) { + GetUserAgreement(ctx context.Context, req *GetUserAgreementRequest) (r *GetUserAgreementResponse, err error) + // 学期信息:学期列表 + GetTermsList(ctx context.Context, req *TermListRequest) (r *TermListResponse, err error) + // 学期信息:学期详情 + GetTerm(ctx context.Context, req *TermRequest) (r *TermResponse, err error) +} - var fieldTypeId thrift.TType - var fieldId int16 +type CommonServiceClient struct { + c thrift.TClient +} - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError +func NewCommonServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *CommonServiceClient { + return &CommonServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), } +} - 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 +func NewCommonServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *CommonServiceClient { + return &CommonServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), } - - 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_ClassRoomServiceGetExamRoomInfoResult[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 *ClassRoomServiceGetExamRoomInfoResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewExamRoomInfoResponse() - if err := _field.Read(iprot); err != nil { - return err +func NewCommonServiceClient(c thrift.TClient) *CommonServiceClient { + return &CommonServiceClient{ + c: c, } - p.Success = _field - return nil } -func (p *ClassRoomServiceGetExamRoomInfoResult) Write(oprot thrift.TProtocol) (err error) { +func (p *CommonServiceClient) Client_() thrift.TClient { + return p.c +} - var fieldId int16 - if err = oprot.WriteStructBegin("GetExamRoomInfo_result"); err != nil { - goto WriteStructBeginError +func (p *CommonServiceClient) GetCSS(ctx context.Context, req *GetCSSRequest) (r *GetCSSResponse, err error) { + var _args CommonServiceGetCSSArgs + _args.Req = req + var _result CommonServiceGetCSSResult + if err = p.Client_().Call(ctx, "GetCSS", &_args, &_result); err != nil { + return } - if p != nil { - if err = p.writeField0(oprot); err != nil { - fieldId = 0 - goto WriteFieldError - } + return _result.GetSuccess(), nil +} +func (p *CommonServiceClient) GetHtml(ctx context.Context, req *GetHtmlRequest) (r *GetHtmlResponse, err error) { + var _args CommonServiceGetHtmlArgs + _args.Req = req + var _result CommonServiceGetHtmlResult + if err = p.Client_().Call(ctx, "GetHtml", &_args, &_result); err != nil { + return } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError + return _result.GetSuccess(), nil +} +func (p *CommonServiceClient) GetUserAgreement(ctx context.Context, req *GetUserAgreementRequest) (r *GetUserAgreementResponse, err error) { + var _args CommonServiceGetUserAgreementArgs + _args.Req = req + var _result CommonServiceGetUserAgreementResult + if err = p.Client_().Call(ctx, "GetUserAgreement", &_args, &_result); err != nil { + return } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError + return _result.GetSuccess(), nil +} +func (p *CommonServiceClient) GetTermsList(ctx context.Context, req *TermListRequest) (r *TermListResponse, err error) { + var _args CommonServiceGetTermsListArgs + _args.Req = req + var _result CommonServiceGetTermsListResult + if err = p.Client_().Call(ctx, "GetTermsList", &_args, &_result); err != nil { + return } - 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) + return _result.GetSuccess(), nil } - -func (p *ClassRoomServiceGetExamRoomInfoResult) 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 *ClassRoomServiceGetExamRoomInfoResult) String() string { - if p == nil { - return "" +func (p *CommonServiceClient) GetTerm(ctx context.Context, req *TermRequest) (r *TermResponse, err error) { + var _args CommonServiceGetTermArgs + _args.Req = req + var _result CommonServiceGetTermResult + if err = p.Client_().Call(ctx, "GetTerm", &_args, &_result); err != nil { + return } - return fmt.Sprintf("ClassRoomServiceGetExamRoomInfoResult(%+v)", *p) - + return _result.GetSuccess(), nil } -type UserServiceProcessor struct { +type ClassRoomServiceProcessor struct { processorMap map[string]thrift.TProcessorFunction - handler UserService + handler ClassRoomService } -func (p *UserServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { +func (p *ClassRoomServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { p.processorMap[key] = processor } -func (p *UserServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { +func (p *ClassRoomServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { processor, ok = p.processorMap[key] return processor, ok } -func (p *UserServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { +func (p *ClassRoomServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { return p.processorMap } -func NewUserServiceProcessor(handler UserService) *UserServiceProcessor { - self := &UserServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} - self.AddToProcessorMap("GetLoginData", &userServiceProcessorGetLoginData{handler: handler}) - self.AddToProcessorMap("ValidateCode", &userServiceProcessorValidateCode{handler: handler}) - self.AddToProcessorMap("ValidateCodeForAndroid", &userServiceProcessorValidateCodeForAndroid{handler: handler}) - self.AddToProcessorMap("GetToken", &userServiceProcessorGetToken{handler: handler}) - self.AddToProcessorMap("RefreshToken", &userServiceProcessorRefreshToken{handler: handler}) - self.AddToProcessorMap("TestAuth", &userServiceProcessorTestAuth{handler: handler}) +func NewClassRoomServiceProcessor(handler ClassRoomService) *ClassRoomServiceProcessor { + self := &ClassRoomServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self.AddToProcessorMap("GetEmptyClassrooms", &classRoomServiceProcessorGetEmptyClassrooms{handler: handler}) + self.AddToProcessorMap("GetExamRoomInfo", &classRoomServiceProcessorGetExamRoomInfo{handler: handler}) return self } -func (p *UserServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { +func (p *ClassRoomServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { name, _, seqId, err := iprot.ReadMessageBegin() if err != nil { return false, err @@ -15789,16 +15658,16 @@ func (p *UserServiceProcessor) Process(ctx context.Context, iprot, oprot thrift. return false, x } -type userServiceProcessorGetLoginData struct { - handler UserService +type classRoomServiceProcessorGetEmptyClassrooms struct { + handler ClassRoomService } -func (p *userServiceProcessorGetLoginData) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UserServiceGetLoginDataArgs{} +func (p *classRoomServiceProcessorGetEmptyClassrooms) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := ClassRoomServiceGetEmptyClassroomsArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetLoginData", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("GetEmptyClassrooms", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -15807,11 +15676,11 @@ func (p *userServiceProcessorGetLoginData) Process(ctx context.Context, seqId in iprot.ReadMessageEnd() var err2 error - result := UserServiceGetLoginDataResult{} - var retval *GetLoginDataResponse - if retval, err2 = p.handler.GetLoginData(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetLoginData: "+err2.Error()) - oprot.WriteMessageBegin("GetLoginData", thrift.EXCEPTION, seqId) + result := ClassRoomServiceGetEmptyClassroomsResult{} + var retval *EmptyClassroomResponse + if retval, err2 = p.handler.GetEmptyClassrooms(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetEmptyClassrooms: "+err2.Error()) + oprot.WriteMessageBegin("GetEmptyClassrooms", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -15819,7 +15688,7 @@ func (p *userServiceProcessorGetLoginData) Process(ctx context.Context, seqId in } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("GetLoginData", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("GetEmptyClassrooms", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -15837,16 +15706,16 @@ func (p *userServiceProcessorGetLoginData) Process(ctx context.Context, seqId in return true, err } -type userServiceProcessorValidateCode struct { - handler UserService +type classRoomServiceProcessorGetExamRoomInfo struct { + handler ClassRoomService } -func (p *userServiceProcessorValidateCode) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UserServiceValidateCodeArgs{} +func (p *classRoomServiceProcessorGetExamRoomInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := ClassRoomServiceGetExamRoomInfoArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("ValidateCode", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("GetExamRoomInfo", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -15855,11 +15724,11 @@ func (p *userServiceProcessorValidateCode) Process(ctx context.Context, seqId in iprot.ReadMessageEnd() var err2 error - result := UserServiceValidateCodeResult{} - var retval *ValidateCodeResponse - if retval, err2 = p.handler.ValidateCode(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ValidateCode: "+err2.Error()) - oprot.WriteMessageBegin("ValidateCode", thrift.EXCEPTION, seqId) + result := ClassRoomServiceGetExamRoomInfoResult{} + var retval *ExamRoomInfoResponse + if retval, err2 = p.handler.GetExamRoomInfo(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetExamRoomInfo: "+err2.Error()) + oprot.WriteMessageBegin("GetExamRoomInfo", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -15867,7 +15736,7 @@ func (p *userServiceProcessorValidateCode) Process(ctx context.Context, seqId in } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("ValidateCode", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("GetExamRoomInfo", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -15885,230 +15754,38 @@ func (p *userServiceProcessorValidateCode) Process(ctx context.Context, seqId in return true, err } -type userServiceProcessorValidateCodeForAndroid struct { - handler UserService +type ClassRoomServiceGetEmptyClassroomsArgs struct { + Request *EmptyClassroomRequest `thrift:"request,1"` } -func (p *userServiceProcessorValidateCodeForAndroid) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UserServiceValidateCodeForAndroidArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("ValidateCodeForAndroid", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := UserServiceValidateCodeForAndroidResult{} - var retval *ValidateCodeForAndroidResponse - if retval, err2 = p.handler.ValidateCodeForAndroid(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ValidateCodeForAndroid: "+err2.Error()) - oprot.WriteMessageBegin("ValidateCodeForAndroid", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("ValidateCodeForAndroid", 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 +func NewClassRoomServiceGetEmptyClassroomsArgs() *ClassRoomServiceGetEmptyClassroomsArgs { + return &ClassRoomServiceGetEmptyClassroomsArgs{} } -type userServiceProcessorGetToken struct { - handler UserService +func (p *ClassRoomServiceGetEmptyClassroomsArgs) InitDefault() { } -func (p *userServiceProcessorGetToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UserServiceGetTokenArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetToken", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } +var ClassRoomServiceGetEmptyClassroomsArgs_Request_DEFAULT *EmptyClassroomRequest - iprot.ReadMessageEnd() - var err2 error - result := UserServiceGetTokenResult{} - var retval *GetAccessTokenResponse - if retval, err2 = p.handler.GetToken(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetToken: "+err2.Error()) - oprot.WriteMessageBegin("GetToken", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("GetToken", 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 +func (p *ClassRoomServiceGetEmptyClassroomsArgs) GetRequest() (v *EmptyClassroomRequest) { + if !p.IsSetRequest() { + return ClassRoomServiceGetEmptyClassroomsArgs_Request_DEFAULT } - return true, err + return p.Request } -type userServiceProcessorRefreshToken struct { - handler UserService +var fieldIDToName_ClassRoomServiceGetEmptyClassroomsArgs = map[int16]string{ + 1: "request", } -func (p *userServiceProcessorRefreshToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UserServiceRefreshTokenArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("RefreshToken", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := UserServiceRefreshTokenResult{} - var retval *RefreshTokenResponse - if retval, err2 = p.handler.RefreshToken(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing RefreshToken: "+err2.Error()) - oprot.WriteMessageBegin("RefreshToken", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("RefreshToken", 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 +func (p *ClassRoomServiceGetEmptyClassroomsArgs) IsSetRequest() bool { + return p.Request != nil } -type userServiceProcessorTestAuth struct { - handler UserService -} +func (p *ClassRoomServiceGetEmptyClassroomsArgs) Read(iprot thrift.TProtocol) (err error) { -func (p *userServiceProcessorTestAuth) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UserServiceTestAuthArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("TestAuth", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := UserServiceTestAuthResult{} - var retval *TestAuthResponse - if retval, err2 = p.handler.TestAuth(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing TestAuth: "+err2.Error()) - oprot.WriteMessageBegin("TestAuth", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("TestAuth", 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 UserServiceGetLoginDataArgs struct { - Request *GetLoginDataRequest `thrift:"request,1"` -} - -func NewUserServiceGetLoginDataArgs() *UserServiceGetLoginDataArgs { - return &UserServiceGetLoginDataArgs{} -} - -func (p *UserServiceGetLoginDataArgs) InitDefault() { -} - -var UserServiceGetLoginDataArgs_Request_DEFAULT *GetLoginDataRequest - -func (p *UserServiceGetLoginDataArgs) GetRequest() (v *GetLoginDataRequest) { - if !p.IsSetRequest() { - return UserServiceGetLoginDataArgs_Request_DEFAULT - } - return p.Request -} - -var fieldIDToName_UserServiceGetLoginDataArgs = map[int16]string{ - 1: "request", -} - -func (p *UserServiceGetLoginDataArgs) IsSetRequest() bool { - return p.Request != nil -} - -func (p *UserServiceGetLoginDataArgs) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 + var fieldTypeId thrift.TType + var fieldId int16 if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -16151,7 +15828,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_UserServiceGetLoginDataArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ClassRoomServiceGetEmptyClassroomsArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -16161,8 +15838,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UserServiceGetLoginDataArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetLoginDataRequest() +func (p *ClassRoomServiceGetEmptyClassroomsArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewEmptyClassroomRequest() if err := _field.Read(iprot); err != nil { return err } @@ -16170,10 +15847,9 @@ func (p *UserServiceGetLoginDataArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *UserServiceGetLoginDataArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *ClassRoomServiceGetEmptyClassroomsArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetLoginData_args"); err != nil { + if err = oprot.WriteStructBegin("GetEmptyClassrooms_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -16199,7 +15875,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UserServiceGetLoginDataArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *ClassRoomServiceGetEmptyClassroomsArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -16216,43 +15892,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UserServiceGetLoginDataArgs) String() string { +func (p *ClassRoomServiceGetEmptyClassroomsArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceGetLoginDataArgs(%+v)", *p) + return fmt.Sprintf("ClassRoomServiceGetEmptyClassroomsArgs(%+v)", *p) } -type UserServiceGetLoginDataResult struct { - Success *GetLoginDataResponse `thrift:"success,0,optional"` +type ClassRoomServiceGetEmptyClassroomsResult struct { + Success *EmptyClassroomResponse `thrift:"success,0,optional"` } -func NewUserServiceGetLoginDataResult() *UserServiceGetLoginDataResult { - return &UserServiceGetLoginDataResult{} +func NewClassRoomServiceGetEmptyClassroomsResult() *ClassRoomServiceGetEmptyClassroomsResult { + return &ClassRoomServiceGetEmptyClassroomsResult{} } -func (p *UserServiceGetLoginDataResult) InitDefault() { +func (p *ClassRoomServiceGetEmptyClassroomsResult) InitDefault() { } -var UserServiceGetLoginDataResult_Success_DEFAULT *GetLoginDataResponse +var ClassRoomServiceGetEmptyClassroomsResult_Success_DEFAULT *EmptyClassroomResponse -func (p *UserServiceGetLoginDataResult) GetSuccess() (v *GetLoginDataResponse) { +func (p *ClassRoomServiceGetEmptyClassroomsResult) GetSuccess() (v *EmptyClassroomResponse) { if !p.IsSetSuccess() { - return UserServiceGetLoginDataResult_Success_DEFAULT + return ClassRoomServiceGetEmptyClassroomsResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UserServiceGetLoginDataResult = map[int16]string{ +var fieldIDToName_ClassRoomServiceGetEmptyClassroomsResult = map[int16]string{ 0: "success", } -func (p *UserServiceGetLoginDataResult) IsSetSuccess() bool { +func (p *ClassRoomServiceGetEmptyClassroomsResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UserServiceGetLoginDataResult) Read(iprot thrift.TProtocol) (err error) { +func (p *ClassRoomServiceGetEmptyClassroomsResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -16298,7 +15974,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_UserServiceGetLoginDataResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ClassRoomServiceGetEmptyClassroomsResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -16308,8 +15984,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UserServiceGetLoginDataResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetLoginDataResponse() +func (p *ClassRoomServiceGetEmptyClassroomsResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewEmptyClassroomResponse() if err := _field.Read(iprot); err != nil { return err } @@ -16317,10 +15993,9 @@ func (p *UserServiceGetLoginDataResult) ReadField0(iprot thrift.TProtocol) error return nil } -func (p *UserServiceGetLoginDataResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *ClassRoomServiceGetEmptyClassroomsResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetLoginData_result"); err != nil { + if err = oprot.WriteStructBegin("GetEmptyClassrooms_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -16346,7 +16021,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UserServiceGetLoginDataResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *ClassRoomServiceGetEmptyClassroomsResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -16365,43 +16040,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UserServiceGetLoginDataResult) String() string { +func (p *ClassRoomServiceGetEmptyClassroomsResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceGetLoginDataResult(%+v)", *p) + return fmt.Sprintf("ClassRoomServiceGetEmptyClassroomsResult(%+v)", *p) } -type UserServiceValidateCodeArgs struct { - Request *ValidateCodeRequest `thrift:"request,1"` +type ClassRoomServiceGetExamRoomInfoArgs struct { + Request *ExamRoomInfoRequest `thrift:"request,1"` } -func NewUserServiceValidateCodeArgs() *UserServiceValidateCodeArgs { - return &UserServiceValidateCodeArgs{} +func NewClassRoomServiceGetExamRoomInfoArgs() *ClassRoomServiceGetExamRoomInfoArgs { + return &ClassRoomServiceGetExamRoomInfoArgs{} } -func (p *UserServiceValidateCodeArgs) InitDefault() { +func (p *ClassRoomServiceGetExamRoomInfoArgs) InitDefault() { } -var UserServiceValidateCodeArgs_Request_DEFAULT *ValidateCodeRequest +var ClassRoomServiceGetExamRoomInfoArgs_Request_DEFAULT *ExamRoomInfoRequest -func (p *UserServiceValidateCodeArgs) GetRequest() (v *ValidateCodeRequest) { +func (p *ClassRoomServiceGetExamRoomInfoArgs) GetRequest() (v *ExamRoomInfoRequest) { if !p.IsSetRequest() { - return UserServiceValidateCodeArgs_Request_DEFAULT + return ClassRoomServiceGetExamRoomInfoArgs_Request_DEFAULT } return p.Request } -var fieldIDToName_UserServiceValidateCodeArgs = map[int16]string{ +var fieldIDToName_ClassRoomServiceGetExamRoomInfoArgs = map[int16]string{ 1: "request", } -func (p *UserServiceValidateCodeArgs) IsSetRequest() bool { +func (p *ClassRoomServiceGetExamRoomInfoArgs) IsSetRequest() bool { return p.Request != nil } -func (p *UserServiceValidateCodeArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *ClassRoomServiceGetExamRoomInfoArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -16447,7 +16122,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_UserServiceValidateCodeArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ClassRoomServiceGetExamRoomInfoArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -16457,8 +16132,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UserServiceValidateCodeArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewValidateCodeRequest() +func (p *ClassRoomServiceGetExamRoomInfoArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewExamRoomInfoRequest() if err := _field.Read(iprot); err != nil { return err } @@ -16466,10 +16141,9 @@ func (p *UserServiceValidateCodeArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *UserServiceValidateCodeArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *ClassRoomServiceGetExamRoomInfoArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ValidateCode_args"); err != nil { + if err = oprot.WriteStructBegin("GetExamRoomInfo_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -16495,7 +16169,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UserServiceValidateCodeArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *ClassRoomServiceGetExamRoomInfoArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -16512,43 +16186,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UserServiceValidateCodeArgs) String() string { +func (p *ClassRoomServiceGetExamRoomInfoArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceValidateCodeArgs(%+v)", *p) + return fmt.Sprintf("ClassRoomServiceGetExamRoomInfoArgs(%+v)", *p) } -type UserServiceValidateCodeResult struct { - Success *ValidateCodeResponse `thrift:"success,0,optional"` +type ClassRoomServiceGetExamRoomInfoResult struct { + Success *ExamRoomInfoResponse `thrift:"success,0,optional"` } -func NewUserServiceValidateCodeResult() *UserServiceValidateCodeResult { - return &UserServiceValidateCodeResult{} +func NewClassRoomServiceGetExamRoomInfoResult() *ClassRoomServiceGetExamRoomInfoResult { + return &ClassRoomServiceGetExamRoomInfoResult{} } -func (p *UserServiceValidateCodeResult) InitDefault() { +func (p *ClassRoomServiceGetExamRoomInfoResult) InitDefault() { } -var UserServiceValidateCodeResult_Success_DEFAULT *ValidateCodeResponse +var ClassRoomServiceGetExamRoomInfoResult_Success_DEFAULT *ExamRoomInfoResponse -func (p *UserServiceValidateCodeResult) GetSuccess() (v *ValidateCodeResponse) { +func (p *ClassRoomServiceGetExamRoomInfoResult) GetSuccess() (v *ExamRoomInfoResponse) { if !p.IsSetSuccess() { - return UserServiceValidateCodeResult_Success_DEFAULT + return ClassRoomServiceGetExamRoomInfoResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UserServiceValidateCodeResult = map[int16]string{ +var fieldIDToName_ClassRoomServiceGetExamRoomInfoResult = map[int16]string{ 0: "success", } -func (p *UserServiceValidateCodeResult) IsSetSuccess() bool { +func (p *ClassRoomServiceGetExamRoomInfoResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UserServiceValidateCodeResult) Read(iprot thrift.TProtocol) (err error) { +func (p *ClassRoomServiceGetExamRoomInfoResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -16594,7 +16268,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_UserServiceValidateCodeResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ClassRoomServiceGetExamRoomInfoResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -16604,8 +16278,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UserServiceValidateCodeResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewValidateCodeResponse() +func (p *ClassRoomServiceGetExamRoomInfoResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewExamRoomInfoResponse() if err := _field.Read(iprot); err != nil { return err } @@ -16613,10 +16287,9 @@ func (p *UserServiceValidateCodeResult) ReadField0(iprot thrift.TProtocol) error return nil } -func (p *UserServiceValidateCodeResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *ClassRoomServiceGetExamRoomInfoResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ValidateCode_result"); err != nil { + if err = oprot.WriteStructBegin("GetExamRoomInfo_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -16642,7 +16315,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UserServiceValidateCodeResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *ClassRoomServiceGetExamRoomInfoResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -16661,339 +16334,377 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UserServiceValidateCodeResult) String() string { +func (p *ClassRoomServiceGetExamRoomInfoResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceValidateCodeResult(%+v)", *p) + return fmt.Sprintf("ClassRoomServiceGetExamRoomInfoResult(%+v)", *p) } -type UserServiceValidateCodeForAndroidArgs struct { - Request *ValidateCodeForAndroidRequest `thrift:"request,1"` +type UserServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler UserService } -func NewUserServiceValidateCodeForAndroidArgs() *UserServiceValidateCodeForAndroidArgs { - return &UserServiceValidateCodeForAndroidArgs{} +func (p *UserServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor } -func (p *UserServiceValidateCodeForAndroidArgs) InitDefault() { +func (p *UserServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok } -var UserServiceValidateCodeForAndroidArgs_Request_DEFAULT *ValidateCodeForAndroidRequest - -func (p *UserServiceValidateCodeForAndroidArgs) GetRequest() (v *ValidateCodeForAndroidRequest) { - if !p.IsSetRequest() { - return UserServiceValidateCodeForAndroidArgs_Request_DEFAULT - } - return p.Request +func (p *UserServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap } -var fieldIDToName_UserServiceValidateCodeForAndroidArgs = map[int16]string{ - 1: "request", +func NewUserServiceProcessor(handler UserService) *UserServiceProcessor { + self := &UserServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self.AddToProcessorMap("GetLoginData", &userServiceProcessorGetLoginData{handler: handler}) + self.AddToProcessorMap("ValidateCode", &userServiceProcessorValidateCode{handler: handler}) + self.AddToProcessorMap("ValidateCodeForAndroid", &userServiceProcessorValidateCodeForAndroid{handler: handler}) + self.AddToProcessorMap("GetToken", &userServiceProcessorGetToken{handler: handler}) + self.AddToProcessorMap("RefreshToken", &userServiceProcessorRefreshToken{handler: handler}) + self.AddToProcessorMap("TestAuth", &userServiceProcessorTestAuth{handler: handler}) + return self } - -func (p *UserServiceValidateCodeForAndroidArgs) IsSetRequest() bool { - return p.Request != nil +func (p *UserServiceProcessor) 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 } -func (p *UserServiceValidateCodeForAndroidArgs) Read(iprot thrift.TProtocol) (err error) { +type userServiceProcessorGetLoginData struct { + handler UserService +} - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError +func (p *userServiceProcessorGetLoginData) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := UserServiceGetLoginDataArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetLoginData", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err } - 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 - } + iprot.ReadMessageEnd() + var err2 error + result := UserServiceGetLoginDataResult{} + var retval *GetLoginDataResponse + if retval, err2 = p.handler.GetLoginData(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetLoginData: "+err2.Error()) + oprot.WriteMessageBegin("GetLoginData", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError + if err2 = oprot.WriteMessageBegin("GetLoginData", thrift.REPLY, seqId); err2 != nil { + err = err2 } - - 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_UserServiceValidateCodeForAndroidArgs[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 *UserServiceValidateCodeForAndroidArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewValidateCodeForAndroidRequest() - if err := _field.Read(iprot); err != nil { - return err + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 } - p.Request = _field - return nil + 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 } -func (p *UserServiceValidateCodeForAndroidArgs) Write(oprot thrift.TProtocol) (err error) { +type userServiceProcessorValidateCode struct { + handler UserService +} - var fieldId int16 - if err = oprot.WriteStructBegin("ValidateCodeForAndroid_args"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } +func (p *userServiceProcessorValidateCode) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := UserServiceValidateCodeArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("ValidateCode", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError + + iprot.ReadMessageEnd() + var err2 error + result := UserServiceValidateCodeResult{} + var retval *ValidateCodeResponse + if retval, err2 = p.handler.ValidateCode(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ValidateCode: "+err2.Error()) + oprot.WriteMessageBegin("ValidateCode", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError + if err2 = oprot.WriteMessageBegin("ValidateCode", thrift.REPLY, seqId); err2 != nil { + err = err2 } - 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 *UserServiceValidateCodeForAndroidArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 } - if err := p.Request.Write(oprot); err != nil { - return err + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 } - 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 *UserServiceValidateCodeForAndroidArgs) String() string { - if p == nil { - return "" + if err != nil { + return } - return fmt.Sprintf("UserServiceValidateCodeForAndroidArgs(%+v)", *p) - -} - -type UserServiceValidateCodeForAndroidResult struct { - Success *ValidateCodeForAndroidResponse `thrift:"success,0,optional"` -} - -func NewUserServiceValidateCodeForAndroidResult() *UserServiceValidateCodeForAndroidResult { - return &UserServiceValidateCodeForAndroidResult{} + return true, err } -func (p *UserServiceValidateCodeForAndroidResult) InitDefault() { +type userServiceProcessorValidateCodeForAndroid struct { + handler UserService } -var UserServiceValidateCodeForAndroidResult_Success_DEFAULT *ValidateCodeForAndroidResponse - -func (p *UserServiceValidateCodeForAndroidResult) GetSuccess() (v *ValidateCodeForAndroidResponse) { - if !p.IsSetSuccess() { - return UserServiceValidateCodeForAndroidResult_Success_DEFAULT +func (p *userServiceProcessorValidateCodeForAndroid) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := UserServiceValidateCodeForAndroidArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("ValidateCodeForAndroid", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err } - return p.Success -} -var fieldIDToName_UserServiceValidateCodeForAndroidResult = map[int16]string{ - 0: "success", + iprot.ReadMessageEnd() + var err2 error + result := UserServiceValidateCodeForAndroidResult{} + var retval *ValidateCodeForAndroidResponse + if retval, err2 = p.handler.ValidateCodeForAndroid(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ValidateCodeForAndroid: "+err2.Error()) + oprot.WriteMessageBegin("ValidateCodeForAndroid", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("ValidateCodeForAndroid", 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 } -func (p *UserServiceValidateCodeForAndroidResult) IsSetSuccess() bool { - return p.Success != nil +type userServiceProcessorGetToken struct { + handler UserService } -func (p *UserServiceValidateCodeForAndroidResult) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError +func (p *userServiceProcessorGetToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := UserServiceGetTokenArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetToken", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err } - 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 - } + iprot.ReadMessageEnd() + var err2 error + result := UserServiceGetTokenResult{} + var retval *GetAccessTokenResponse + if retval, err2 = p.handler.GetToken(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetToken: "+err2.Error()) + oprot.WriteMessageBegin("GetToken", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError + if err2 = oprot.WriteMessageBegin("GetToken", thrift.REPLY, seqId); err2 != nil { + err = err2 } - - 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_UserServiceValidateCodeForAndroidResult[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) + 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 } -func (p *UserServiceValidateCodeForAndroidResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewValidateCodeForAndroidResponse() - if err := _field.Read(iprot); err != nil { - return err - } - p.Success = _field - return nil +type userServiceProcessorRefreshToken struct { + handler UserService } -func (p *UserServiceValidateCodeForAndroidResult) Write(oprot thrift.TProtocol) (err error) { +func (p *userServiceProcessorRefreshToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := UserServiceRefreshTokenArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("RefreshToken", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } - var fieldId int16 - if err = oprot.WriteStructBegin("ValidateCodeForAndroid_result"); err != nil { - goto WriteStructBeginError + iprot.ReadMessageEnd() + var err2 error + result := UserServiceRefreshTokenResult{} + var retval *RefreshTokenResponse + if retval, err2 = p.handler.RefreshToken(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing RefreshToken: "+err2.Error()) + oprot.WriteMessageBegin("RefreshToken", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval } - if p != nil { - if err = p.writeField0(oprot); err != nil { - fieldId = 0 - goto WriteFieldError - } + if err2 = oprot.WriteMessageBegin("RefreshToken", thrift.REPLY, seqId); err2 != nil { + err = err2 } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 } - 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) + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err } -func (p *UserServiceValidateCodeForAndroidResult) 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) +type userServiceProcessorTestAuth struct { + handler UserService } -func (p *UserServiceValidateCodeForAndroidResult) String() string { - if p == nil { - return "" +func (p *userServiceProcessorTestAuth) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := UserServiceTestAuthArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("TestAuth", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err } - return fmt.Sprintf("UserServiceValidateCodeForAndroidResult(%+v)", *p) + iprot.ReadMessageEnd() + var err2 error + result := UserServiceTestAuthResult{} + var retval *TestAuthResponse + if retval, err2 = p.handler.TestAuth(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing TestAuth: "+err2.Error()) + oprot.WriteMessageBegin("TestAuth", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("TestAuth", 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 UserServiceGetTokenArgs struct { - Request *GetAccessTokenRequest `thrift:"request,1"` +type UserServiceGetLoginDataArgs struct { + Request *GetLoginDataRequest `thrift:"request,1"` } -func NewUserServiceGetTokenArgs() *UserServiceGetTokenArgs { - return &UserServiceGetTokenArgs{} +func NewUserServiceGetLoginDataArgs() *UserServiceGetLoginDataArgs { + return &UserServiceGetLoginDataArgs{} } -func (p *UserServiceGetTokenArgs) InitDefault() { +func (p *UserServiceGetLoginDataArgs) InitDefault() { } -var UserServiceGetTokenArgs_Request_DEFAULT *GetAccessTokenRequest +var UserServiceGetLoginDataArgs_Request_DEFAULT *GetLoginDataRequest -func (p *UserServiceGetTokenArgs) GetRequest() (v *GetAccessTokenRequest) { +func (p *UserServiceGetLoginDataArgs) GetRequest() (v *GetLoginDataRequest) { if !p.IsSetRequest() { - return UserServiceGetTokenArgs_Request_DEFAULT + return UserServiceGetLoginDataArgs_Request_DEFAULT } return p.Request } -var fieldIDToName_UserServiceGetTokenArgs = map[int16]string{ +var fieldIDToName_UserServiceGetLoginDataArgs = map[int16]string{ 1: "request", } -func (p *UserServiceGetTokenArgs) IsSetRequest() bool { +func (p *UserServiceGetLoginDataArgs) IsSetRequest() bool { return p.Request != nil } -func (p *UserServiceGetTokenArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceGetLoginDataArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -17039,7 +16750,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_UserServiceGetTokenArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UserServiceGetLoginDataArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -17049,8 +16760,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UserServiceGetTokenArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetAccessTokenRequest() +func (p *UserServiceGetLoginDataArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetLoginDataRequest() if err := _field.Read(iprot); err != nil { return err } @@ -17058,10 +16769,9 @@ func (p *UserServiceGetTokenArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *UserServiceGetTokenArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *UserServiceGetLoginDataArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetToken_args"); err != nil { + if err = oprot.WriteStructBegin("GetLoginData_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -17087,7 +16797,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UserServiceGetTokenArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *UserServiceGetLoginDataArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -17104,43 +16814,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UserServiceGetTokenArgs) String() string { +func (p *UserServiceGetLoginDataArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceGetTokenArgs(%+v)", *p) + return fmt.Sprintf("UserServiceGetLoginDataArgs(%+v)", *p) } -type UserServiceGetTokenResult struct { - Success *GetAccessTokenResponse `thrift:"success,0,optional"` +type UserServiceGetLoginDataResult struct { + Success *GetLoginDataResponse `thrift:"success,0,optional"` } -func NewUserServiceGetTokenResult() *UserServiceGetTokenResult { - return &UserServiceGetTokenResult{} +func NewUserServiceGetLoginDataResult() *UserServiceGetLoginDataResult { + return &UserServiceGetLoginDataResult{} } -func (p *UserServiceGetTokenResult) InitDefault() { +func (p *UserServiceGetLoginDataResult) InitDefault() { } -var UserServiceGetTokenResult_Success_DEFAULT *GetAccessTokenResponse +var UserServiceGetLoginDataResult_Success_DEFAULT *GetLoginDataResponse -func (p *UserServiceGetTokenResult) GetSuccess() (v *GetAccessTokenResponse) { +func (p *UserServiceGetLoginDataResult) GetSuccess() (v *GetLoginDataResponse) { if !p.IsSetSuccess() { - return UserServiceGetTokenResult_Success_DEFAULT + return UserServiceGetLoginDataResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UserServiceGetTokenResult = map[int16]string{ +var fieldIDToName_UserServiceGetLoginDataResult = map[int16]string{ 0: "success", } -func (p *UserServiceGetTokenResult) IsSetSuccess() bool { +func (p *UserServiceGetLoginDataResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UserServiceGetTokenResult) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceGetLoginDataResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -17186,7 +16896,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_UserServiceGetTokenResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UserServiceGetLoginDataResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -17196,8 +16906,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UserServiceGetTokenResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetAccessTokenResponse() +func (p *UserServiceGetLoginDataResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetLoginDataResponse() if err := _field.Read(iprot); err != nil { return err } @@ -17205,10 +16915,9 @@ func (p *UserServiceGetTokenResult) ReadField0(iprot thrift.TProtocol) error { return nil } -func (p *UserServiceGetTokenResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *UserServiceGetLoginDataResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetToken_result"); err != nil { + if err = oprot.WriteStructBegin("GetLoginData_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -17234,7 +16943,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UserServiceGetTokenResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *UserServiceGetLoginDataResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -17253,43 +16962,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UserServiceGetTokenResult) String() string { +func (p *UserServiceGetLoginDataResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceGetTokenResult(%+v)", *p) + return fmt.Sprintf("UserServiceGetLoginDataResult(%+v)", *p) } -type UserServiceRefreshTokenArgs struct { - Request *RefreshTokenRequest `thrift:"request,1"` +type UserServiceValidateCodeArgs struct { + Request *ValidateCodeRequest `thrift:"request,1"` } -func NewUserServiceRefreshTokenArgs() *UserServiceRefreshTokenArgs { - return &UserServiceRefreshTokenArgs{} +func NewUserServiceValidateCodeArgs() *UserServiceValidateCodeArgs { + return &UserServiceValidateCodeArgs{} } -func (p *UserServiceRefreshTokenArgs) InitDefault() { +func (p *UserServiceValidateCodeArgs) InitDefault() { } -var UserServiceRefreshTokenArgs_Request_DEFAULT *RefreshTokenRequest +var UserServiceValidateCodeArgs_Request_DEFAULT *ValidateCodeRequest -func (p *UserServiceRefreshTokenArgs) GetRequest() (v *RefreshTokenRequest) { +func (p *UserServiceValidateCodeArgs) GetRequest() (v *ValidateCodeRequest) { if !p.IsSetRequest() { - return UserServiceRefreshTokenArgs_Request_DEFAULT + return UserServiceValidateCodeArgs_Request_DEFAULT } return p.Request } -var fieldIDToName_UserServiceRefreshTokenArgs = map[int16]string{ +var fieldIDToName_UserServiceValidateCodeArgs = map[int16]string{ 1: "request", } -func (p *UserServiceRefreshTokenArgs) IsSetRequest() bool { +func (p *UserServiceValidateCodeArgs) IsSetRequest() bool { return p.Request != nil } -func (p *UserServiceRefreshTokenArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceValidateCodeArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -17335,7 +17044,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_UserServiceRefreshTokenArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UserServiceValidateCodeArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -17345,8 +17054,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UserServiceRefreshTokenArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewRefreshTokenRequest() +func (p *UserServiceValidateCodeArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewValidateCodeRequest() if err := _field.Read(iprot); err != nil { return err } @@ -17354,10 +17063,9 @@ func (p *UserServiceRefreshTokenArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *UserServiceRefreshTokenArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *UserServiceValidateCodeArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("RefreshToken_args"); err != nil { + if err = oprot.WriteStructBegin("ValidateCode_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -17383,7 +17091,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UserServiceRefreshTokenArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *UserServiceValidateCodeArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -17400,43 +17108,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UserServiceRefreshTokenArgs) String() string { +func (p *UserServiceValidateCodeArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceRefreshTokenArgs(%+v)", *p) + return fmt.Sprintf("UserServiceValidateCodeArgs(%+v)", *p) } -type UserServiceRefreshTokenResult struct { - Success *RefreshTokenResponse `thrift:"success,0,optional"` +type UserServiceValidateCodeResult struct { + Success *ValidateCodeResponse `thrift:"success,0,optional"` } -func NewUserServiceRefreshTokenResult() *UserServiceRefreshTokenResult { - return &UserServiceRefreshTokenResult{} +func NewUserServiceValidateCodeResult() *UserServiceValidateCodeResult { + return &UserServiceValidateCodeResult{} } -func (p *UserServiceRefreshTokenResult) InitDefault() { +func (p *UserServiceValidateCodeResult) InitDefault() { } -var UserServiceRefreshTokenResult_Success_DEFAULT *RefreshTokenResponse +var UserServiceValidateCodeResult_Success_DEFAULT *ValidateCodeResponse -func (p *UserServiceRefreshTokenResult) GetSuccess() (v *RefreshTokenResponse) { +func (p *UserServiceValidateCodeResult) GetSuccess() (v *ValidateCodeResponse) { if !p.IsSetSuccess() { - return UserServiceRefreshTokenResult_Success_DEFAULT + return UserServiceValidateCodeResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UserServiceRefreshTokenResult = map[int16]string{ +var fieldIDToName_UserServiceValidateCodeResult = map[int16]string{ 0: "success", } -func (p *UserServiceRefreshTokenResult) IsSetSuccess() bool { +func (p *UserServiceValidateCodeResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UserServiceRefreshTokenResult) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceValidateCodeResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -17482,7 +17190,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_UserServiceRefreshTokenResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UserServiceValidateCodeResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -17492,8 +17200,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UserServiceRefreshTokenResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewRefreshTokenResponse() +func (p *UserServiceValidateCodeResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewValidateCodeResponse() if err := _field.Read(iprot); err != nil { return err } @@ -17501,10 +17209,9 @@ func (p *UserServiceRefreshTokenResult) ReadField0(iprot thrift.TProtocol) error return nil } -func (p *UserServiceRefreshTokenResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *UserServiceValidateCodeResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("RefreshToken_result"); err != nil { + if err = oprot.WriteStructBegin("ValidateCode_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -17530,7 +17237,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UserServiceRefreshTokenResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *UserServiceValidateCodeResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -17549,43 +17256,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UserServiceRefreshTokenResult) String() string { +func (p *UserServiceValidateCodeResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceRefreshTokenResult(%+v)", *p) + return fmt.Sprintf("UserServiceValidateCodeResult(%+v)", *p) } -type UserServiceTestAuthArgs struct { - Request *TestAuthRequest `thrift:"request,1"` +type UserServiceValidateCodeForAndroidArgs struct { + Request *ValidateCodeForAndroidRequest `thrift:"request,1"` } -func NewUserServiceTestAuthArgs() *UserServiceTestAuthArgs { - return &UserServiceTestAuthArgs{} +func NewUserServiceValidateCodeForAndroidArgs() *UserServiceValidateCodeForAndroidArgs { + return &UserServiceValidateCodeForAndroidArgs{} } -func (p *UserServiceTestAuthArgs) InitDefault() { +func (p *UserServiceValidateCodeForAndroidArgs) InitDefault() { } -var UserServiceTestAuthArgs_Request_DEFAULT *TestAuthRequest +var UserServiceValidateCodeForAndroidArgs_Request_DEFAULT *ValidateCodeForAndroidRequest -func (p *UserServiceTestAuthArgs) GetRequest() (v *TestAuthRequest) { +func (p *UserServiceValidateCodeForAndroidArgs) GetRequest() (v *ValidateCodeForAndroidRequest) { if !p.IsSetRequest() { - return UserServiceTestAuthArgs_Request_DEFAULT + return UserServiceValidateCodeForAndroidArgs_Request_DEFAULT } return p.Request } -var fieldIDToName_UserServiceTestAuthArgs = map[int16]string{ +var fieldIDToName_UserServiceValidateCodeForAndroidArgs = map[int16]string{ 1: "request", } -func (p *UserServiceTestAuthArgs) IsSetRequest() bool { +func (p *UserServiceValidateCodeForAndroidArgs) IsSetRequest() bool { return p.Request != nil } -func (p *UserServiceTestAuthArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceValidateCodeForAndroidArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -17631,7 +17338,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_UserServiceTestAuthArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UserServiceValidateCodeForAndroidArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -17641,8 +17348,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UserServiceTestAuthArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewTestAuthRequest() +func (p *UserServiceValidateCodeForAndroidArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewValidateCodeForAndroidRequest() if err := _field.Read(iprot); err != nil { return err } @@ -17650,10 +17357,9 @@ func (p *UserServiceTestAuthArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *UserServiceTestAuthArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *UserServiceValidateCodeForAndroidArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("TestAuth_args"); err != nil { + if err = oprot.WriteStructBegin("ValidateCodeForAndroid_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -17679,7 +17385,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UserServiceTestAuthArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *UserServiceValidateCodeForAndroidArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -17696,43 +17402,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UserServiceTestAuthArgs) String() string { +func (p *UserServiceValidateCodeForAndroidArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceTestAuthArgs(%+v)", *p) + return fmt.Sprintf("UserServiceValidateCodeForAndroidArgs(%+v)", *p) } -type UserServiceTestAuthResult struct { - Success *TestAuthResponse `thrift:"success,0,optional"` +type UserServiceValidateCodeForAndroidResult struct { + Success *ValidateCodeForAndroidResponse `thrift:"success,0,optional"` } -func NewUserServiceTestAuthResult() *UserServiceTestAuthResult { - return &UserServiceTestAuthResult{} +func NewUserServiceValidateCodeForAndroidResult() *UserServiceValidateCodeForAndroidResult { + return &UserServiceValidateCodeForAndroidResult{} } -func (p *UserServiceTestAuthResult) InitDefault() { +func (p *UserServiceValidateCodeForAndroidResult) InitDefault() { } -var UserServiceTestAuthResult_Success_DEFAULT *TestAuthResponse +var UserServiceValidateCodeForAndroidResult_Success_DEFAULT *ValidateCodeForAndroidResponse -func (p *UserServiceTestAuthResult) GetSuccess() (v *TestAuthResponse) { +func (p *UserServiceValidateCodeForAndroidResult) GetSuccess() (v *ValidateCodeForAndroidResponse) { if !p.IsSetSuccess() { - return UserServiceTestAuthResult_Success_DEFAULT + return UserServiceValidateCodeForAndroidResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UserServiceTestAuthResult = map[int16]string{ +var fieldIDToName_UserServiceValidateCodeForAndroidResult = map[int16]string{ 0: "success", } -func (p *UserServiceTestAuthResult) IsSetSuccess() bool { +func (p *UserServiceValidateCodeForAndroidResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UserServiceTestAuthResult) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceValidateCodeForAndroidResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -17778,7 +17484,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_UserServiceTestAuthResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UserServiceValidateCodeForAndroidResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -17788,8 +17494,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UserServiceTestAuthResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewTestAuthResponse() +func (p *UserServiceValidateCodeForAndroidResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewValidateCodeForAndroidResponse() if err := _field.Read(iprot); err != nil { return err } @@ -17797,10 +17503,9 @@ func (p *UserServiceTestAuthResult) ReadField0(iprot thrift.TProtocol) error { return nil } -func (p *UserServiceTestAuthResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *UserServiceValidateCodeForAndroidResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("TestAuth_result"); err != nil { + if err = oprot.WriteStructBegin("ValidateCodeForAndroid_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -17826,7 +17531,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UserServiceTestAuthResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *UserServiceValidateCodeForAndroidResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -17845,138 +17550,49 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UserServiceTestAuthResult) String() string { +func (p *UserServiceValidateCodeForAndroidResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceTestAuthResult(%+v)", *p) + return fmt.Sprintf("UserServiceValidateCodeForAndroidResult(%+v)", *p) } -type CourseServiceProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler CourseService +type UserServiceGetTokenArgs struct { + Request *GetAccessTokenRequest `thrift:"request,1"` } -func (p *CourseServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor +func NewUserServiceGetTokenArgs() *UserServiceGetTokenArgs { + return &UserServiceGetTokenArgs{} } -func (p *CourseServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok +func (p *UserServiceGetTokenArgs) InitDefault() { } -func (p *CourseServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap -} +var UserServiceGetTokenArgs_Request_DEFAULT *GetAccessTokenRequest -func NewCourseServiceProcessor(handler CourseService) *CourseServiceProcessor { - self := &CourseServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} - self.AddToProcessorMap("GetCourseList", &courseServiceProcessorGetCourseList{handler: handler}) - return self -} -func (p *CourseServiceProcessor) 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) +func (p *UserServiceGetTokenArgs) GetRequest() (v *GetAccessTokenRequest) { + if !p.IsSetRequest() { + return UserServiceGetTokenArgs_Request_DEFAULT } - 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 + return p.Request } -type courseServiceProcessorGetCourseList struct { - handler CourseService +var fieldIDToName_UserServiceGetTokenArgs = map[int16]string{ + 1: "request", } -func (p *courseServiceProcessorGetCourseList) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := CourseServiceGetCourseListArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetCourseList", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := CourseServiceGetCourseListResult{} - var retval *CourseListResponse - if retval, err2 = p.handler.GetCourseList(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCourseList: "+err2.Error()) - oprot.WriteMessageBegin("GetCourseList", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("GetCourseList", 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 CourseServiceGetCourseListArgs struct { - Req *CourseListRequest `thrift:"req,1"` -} - -func NewCourseServiceGetCourseListArgs() *CourseServiceGetCourseListArgs { - return &CourseServiceGetCourseListArgs{} -} - -func (p *CourseServiceGetCourseListArgs) InitDefault() { -} - -var CourseServiceGetCourseListArgs_Req_DEFAULT *CourseListRequest - -func (p *CourseServiceGetCourseListArgs) GetReq() (v *CourseListRequest) { - if !p.IsSetReq() { - return CourseServiceGetCourseListArgs_Req_DEFAULT - } - return p.Req -} - -var fieldIDToName_CourseServiceGetCourseListArgs = map[int16]string{ - 1: "req", -} - -func (p *CourseServiceGetCourseListArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *CourseServiceGetCourseListArgs) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError +func (p *UserServiceGetTokenArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *UserServiceGetTokenArgs) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } for { @@ -18016,7 +17632,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_CourseServiceGetCourseListArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UserServiceGetTokenArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -18026,19 +17642,18 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *CourseServiceGetCourseListArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewCourseListRequest() +func (p *UserServiceGetTokenArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetAccessTokenRequest() if err := _field.Read(iprot); err != nil { return err } - p.Req = _field + p.Request = _field return nil } -func (p *CourseServiceGetCourseListArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *UserServiceGetTokenArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetCourseList_args"); err != nil { + if err = oprot.WriteStructBegin("GetToken_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -18064,11 +17679,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *CourseServiceGetCourseListArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { +func (p *UserServiceGetTokenArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } - if err := p.Req.Write(oprot); err != nil { + if err := p.Request.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -18081,43 +17696,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *CourseServiceGetCourseListArgs) String() string { +func (p *UserServiceGetTokenArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("CourseServiceGetCourseListArgs(%+v)", *p) + return fmt.Sprintf("UserServiceGetTokenArgs(%+v)", *p) } -type CourseServiceGetCourseListResult struct { - Success *CourseListResponse `thrift:"success,0,optional"` +type UserServiceGetTokenResult struct { + Success *GetAccessTokenResponse `thrift:"success,0,optional"` } -func NewCourseServiceGetCourseListResult() *CourseServiceGetCourseListResult { - return &CourseServiceGetCourseListResult{} +func NewUserServiceGetTokenResult() *UserServiceGetTokenResult { + return &UserServiceGetTokenResult{} } -func (p *CourseServiceGetCourseListResult) InitDefault() { +func (p *UserServiceGetTokenResult) InitDefault() { } -var CourseServiceGetCourseListResult_Success_DEFAULT *CourseListResponse +var UserServiceGetTokenResult_Success_DEFAULT *GetAccessTokenResponse -func (p *CourseServiceGetCourseListResult) GetSuccess() (v *CourseListResponse) { +func (p *UserServiceGetTokenResult) GetSuccess() (v *GetAccessTokenResponse) { if !p.IsSetSuccess() { - return CourseServiceGetCourseListResult_Success_DEFAULT + return UserServiceGetTokenResult_Success_DEFAULT } return p.Success } -var fieldIDToName_CourseServiceGetCourseListResult = map[int16]string{ +var fieldIDToName_UserServiceGetTokenResult = map[int16]string{ 0: "success", } -func (p *CourseServiceGetCourseListResult) IsSetSuccess() bool { +func (p *UserServiceGetTokenResult) IsSetSuccess() bool { return p.Success != nil } -func (p *CourseServiceGetCourseListResult) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceGetTokenResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -18163,7 +17778,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_CourseServiceGetCourseListResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UserServiceGetTokenResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -18173,8 +17788,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *CourseServiceGetCourseListResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewCourseListResponse() +func (p *UserServiceGetTokenResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetAccessTokenResponse() if err := _field.Read(iprot); err != nil { return err } @@ -18182,10 +17797,9 @@ func (p *CourseServiceGetCourseListResult) ReadField0(iprot thrift.TProtocol) er return nil } -func (p *CourseServiceGetCourseListResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *UserServiceGetTokenResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetCourseList_result"); err != nil { + if err = oprot.WriteStructBegin("GetToken_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -18211,7 +17825,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *CourseServiceGetCourseListResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *UserServiceGetTokenResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -18230,426 +17844,337 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *CourseServiceGetCourseListResult) String() string { +func (p *UserServiceGetTokenResult) String() string { if p == nil { return "" } - return fmt.Sprintf("CourseServiceGetCourseListResult(%+v)", *p) + return fmt.Sprintf("UserServiceGetTokenResult(%+v)", *p) } -type LaunchScreenServiceProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler LaunchScreenService +type UserServiceRefreshTokenArgs struct { + Request *RefreshTokenRequest `thrift:"request,1"` } -func (p *LaunchScreenServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor +func NewUserServiceRefreshTokenArgs() *UserServiceRefreshTokenArgs { + return &UserServiceRefreshTokenArgs{} } -func (p *LaunchScreenServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok +func (p *UserServiceRefreshTokenArgs) InitDefault() { } -func (p *LaunchScreenServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap -} +var UserServiceRefreshTokenArgs_Request_DEFAULT *RefreshTokenRequest -func NewLaunchScreenServiceProcessor(handler LaunchScreenService) *LaunchScreenServiceProcessor { - self := &LaunchScreenServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} - self.AddToProcessorMap("CreateImage", &launchScreenServiceProcessorCreateImage{handler: handler}) - self.AddToProcessorMap("GetImage", &launchScreenServiceProcessorGetImage{handler: handler}) - self.AddToProcessorMap("ChangeImageProperty", &launchScreenServiceProcessorChangeImageProperty{handler: handler}) - self.AddToProcessorMap("ChangeImage", &launchScreenServiceProcessorChangeImage{handler: handler}) - self.AddToProcessorMap("DeleteImage", &launchScreenServiceProcessorDeleteImage{handler: handler}) - self.AddToProcessorMap("MobileGetImage", &launchScreenServiceProcessorMobileGetImage{handler: handler}) - self.AddToProcessorMap("AddImagePointTime", &launchScreenServiceProcessorAddImagePointTime{handler: handler}) - return self -} -func (p *LaunchScreenServiceProcessor) 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) +func (p *UserServiceRefreshTokenArgs) GetRequest() (v *RefreshTokenRequest) { + if !p.IsSetRequest() { + return UserServiceRefreshTokenArgs_Request_DEFAULT } - 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 + return p.Request } -type launchScreenServiceProcessorCreateImage struct { - handler LaunchScreenService +var fieldIDToName_UserServiceRefreshTokenArgs = map[int16]string{ + 1: "request", } -func (p *launchScreenServiceProcessorCreateImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := LaunchScreenServiceCreateImageArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("CreateImage", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := LaunchScreenServiceCreateImageResult{} - var retval *CreateImageResponse - if retval, err2 = p.handler.CreateImage(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CreateImage: "+err2.Error()) - oprot.WriteMessageBegin("CreateImage", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("CreateImage", 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 +func (p *UserServiceRefreshTokenArgs) IsSetRequest() bool { + return p.Request != nil } -type launchScreenServiceProcessorGetImage struct { - handler LaunchScreenService -} +func (p *UserServiceRefreshTokenArgs) Read(iprot thrift.TProtocol) (err error) { -func (p *launchScreenServiceProcessorGetImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := LaunchScreenServiceGetImageArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetImage", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } + var fieldTypeId thrift.TType + var fieldId int16 - iprot.ReadMessageEnd() - var err2 error - result := LaunchScreenServiceGetImageResult{} - var retval *GetImageResponse - if retval, err2 = p.handler.GetImage(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetImage: "+err2.Error()) - oprot.WriteMessageBegin("GetImage", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("GetImage", 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 _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + + 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 != nil { - return + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError } - return true, err -} -type launchScreenServiceProcessorChangeImageProperty struct { - handler LaunchScreenService + 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_UserServiceRefreshTokenArgs[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 *launchScreenServiceProcessorChangeImageProperty) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := LaunchScreenServiceChangeImagePropertyArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("ChangeImageProperty", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *UserServiceRefreshTokenArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewRefreshTokenRequest() + if err := _field.Read(iprot); err != nil { + return err } + p.Request = _field + return nil +} - iprot.ReadMessageEnd() - var err2 error - result := LaunchScreenServiceChangeImagePropertyResult{} - var retval *ChangeImagePropertyResponse - if retval, err2 = p.handler.ChangeImageProperty(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ChangeImageProperty: "+err2.Error()) - oprot.WriteMessageBegin("ChangeImageProperty", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval +func (p *UserServiceRefreshTokenArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("RefreshToken_args"); err != nil { + goto WriteStructBeginError } - if err2 = oprot.WriteMessageBegin("ChangeImageProperty", thrift.REPLY, seqId); err2 != nil { - err = err2 + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + 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 *UserServiceRefreshTokenArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError } - if err != nil { - return + if err := p.Request.Write(oprot); err != nil { + return err } - return true, 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) } -type launchScreenServiceProcessorChangeImage struct { - handler LaunchScreenService +func (p *UserServiceRefreshTokenArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UserServiceRefreshTokenArgs(%+v)", *p) + } -func (p *launchScreenServiceProcessorChangeImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := LaunchScreenServiceChangeImageArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("ChangeImage", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } +type UserServiceRefreshTokenResult struct { + Success *RefreshTokenResponse `thrift:"success,0,optional"` +} - iprot.ReadMessageEnd() - var err2 error - result := LaunchScreenServiceChangeImageResult{} - var retval *ChangeImageResponse - if retval, err2 = p.handler.ChangeImage(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ChangeImage: "+err2.Error()) - oprot.WriteMessageBegin("ChangeImage", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("ChangeImage", 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 +func NewUserServiceRefreshTokenResult() *UserServiceRefreshTokenResult { + return &UserServiceRefreshTokenResult{} } -type launchScreenServiceProcessorDeleteImage struct { - handler LaunchScreenService +func (p *UserServiceRefreshTokenResult) InitDefault() { } -func (p *launchScreenServiceProcessorDeleteImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := LaunchScreenServiceDeleteImageArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("DeleteImage", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } +var UserServiceRefreshTokenResult_Success_DEFAULT *RefreshTokenResponse - iprot.ReadMessageEnd() - var err2 error - result := LaunchScreenServiceDeleteImageResult{} - var retval *DeleteImageResponse - if retval, err2 = p.handler.DeleteImage(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing DeleteImage: "+err2.Error()) - oprot.WriteMessageBegin("DeleteImage", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("DeleteImage", 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 +func (p *UserServiceRefreshTokenResult) GetSuccess() (v *RefreshTokenResponse) { + if !p.IsSetSuccess() { + return UserServiceRefreshTokenResult_Success_DEFAULT } - return true, err + return p.Success } -type launchScreenServiceProcessorMobileGetImage struct { - handler LaunchScreenService +var fieldIDToName_UserServiceRefreshTokenResult = map[int16]string{ + 0: "success", } -func (p *launchScreenServiceProcessorMobileGetImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := LaunchScreenServiceMobileGetImageArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("MobileGetImage", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *UserServiceRefreshTokenResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *UserServiceRefreshTokenResult) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } - iprot.ReadMessageEnd() - var err2 error - result := LaunchScreenServiceMobileGetImageResult{} - var retval *MobileGetImageResponse - if retval, err2 = p.handler.MobileGetImage(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing MobileGetImage: "+err2.Error()) - oprot.WriteMessageBegin("MobileGetImage", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("MobileGetImage", 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 + 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 != nil { - return + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError } - return true, err -} -type launchScreenServiceProcessorAddImagePointTime struct { - handler LaunchScreenService + 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_UserServiceRefreshTokenResult[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 *launchScreenServiceProcessorAddImagePointTime) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := LaunchScreenServiceAddImagePointTimeArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("AddImagePointTime", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *UserServiceRefreshTokenResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewRefreshTokenResponse() + if err := _field.Read(iprot); err != nil { + return err } + p.Success = _field + return nil +} - iprot.ReadMessageEnd() - var err2 error - result := LaunchScreenServiceAddImagePointTimeResult{} - var retval *AddImagePointTimeResponse - if retval, err2 = p.handler.AddImagePointTime(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing AddImagePointTime: "+err2.Error()) - oprot.WriteMessageBegin("AddImagePointTime", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval +func (p *UserServiceRefreshTokenResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("RefreshToken_result"); err != nil { + goto WriteStructBeginError } - if err2 = oprot.WriteMessageBegin("AddImagePointTime", thrift.REPLY, seqId); err2 != nil { - err = err2 + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + 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 *UserServiceRefreshTokenResult) 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 + } } - if err != nil { - return + 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 *UserServiceRefreshTokenResult) String() string { + if p == nil { + return "" } - return true, err + return fmt.Sprintf("UserServiceRefreshTokenResult(%+v)", *p) + } -type LaunchScreenServiceCreateImageArgs struct { - Req *CreateImageRequest `thrift:"req,1"` +type UserServiceTestAuthArgs struct { + Request *TestAuthRequest `thrift:"request,1"` } -func NewLaunchScreenServiceCreateImageArgs() *LaunchScreenServiceCreateImageArgs { - return &LaunchScreenServiceCreateImageArgs{} +func NewUserServiceTestAuthArgs() *UserServiceTestAuthArgs { + return &UserServiceTestAuthArgs{} } -func (p *LaunchScreenServiceCreateImageArgs) InitDefault() { +func (p *UserServiceTestAuthArgs) InitDefault() { } -var LaunchScreenServiceCreateImageArgs_Req_DEFAULT *CreateImageRequest +var UserServiceTestAuthArgs_Request_DEFAULT *TestAuthRequest -func (p *LaunchScreenServiceCreateImageArgs) GetReq() (v *CreateImageRequest) { - if !p.IsSetReq() { - return LaunchScreenServiceCreateImageArgs_Req_DEFAULT +func (p *UserServiceTestAuthArgs) GetRequest() (v *TestAuthRequest) { + if !p.IsSetRequest() { + return UserServiceTestAuthArgs_Request_DEFAULT } - return p.Req + return p.Request } -var fieldIDToName_LaunchScreenServiceCreateImageArgs = map[int16]string{ - 1: "req", +var fieldIDToName_UserServiceTestAuthArgs = map[int16]string{ + 1: "request", } -func (p *LaunchScreenServiceCreateImageArgs) IsSetReq() bool { - return p.Req != nil +func (p *UserServiceTestAuthArgs) IsSetRequest() bool { + return p.Request != nil } -func (p *LaunchScreenServiceCreateImageArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceTestAuthArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -18695,7 +18220,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_LaunchScreenServiceCreateImageArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UserServiceTestAuthArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -18705,19 +18230,18 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *LaunchScreenServiceCreateImageArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewCreateImageRequest() +func (p *UserServiceTestAuthArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewTestAuthRequest() if err := _field.Read(iprot); err != nil { return err } - p.Req = _field + p.Request = _field return nil } -func (p *LaunchScreenServiceCreateImageArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *UserServiceTestAuthArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("CreateImage_args"); err != nil { + if err = oprot.WriteStructBegin("TestAuth_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -18743,11 +18267,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *LaunchScreenServiceCreateImageArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { +func (p *UserServiceTestAuthArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } - if err := p.Req.Write(oprot); err != nil { + if err := p.Request.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -18760,43 +18284,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *LaunchScreenServiceCreateImageArgs) String() string { +func (p *UserServiceTestAuthArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceCreateImageArgs(%+v)", *p) + return fmt.Sprintf("UserServiceTestAuthArgs(%+v)", *p) } -type LaunchScreenServiceCreateImageResult struct { - Success *CreateImageResponse `thrift:"success,0,optional"` +type UserServiceTestAuthResult struct { + Success *TestAuthResponse `thrift:"success,0,optional"` } -func NewLaunchScreenServiceCreateImageResult() *LaunchScreenServiceCreateImageResult { - return &LaunchScreenServiceCreateImageResult{} +func NewUserServiceTestAuthResult() *UserServiceTestAuthResult { + return &UserServiceTestAuthResult{} } -func (p *LaunchScreenServiceCreateImageResult) InitDefault() { +func (p *UserServiceTestAuthResult) InitDefault() { } -var LaunchScreenServiceCreateImageResult_Success_DEFAULT *CreateImageResponse +var UserServiceTestAuthResult_Success_DEFAULT *TestAuthResponse -func (p *LaunchScreenServiceCreateImageResult) GetSuccess() (v *CreateImageResponse) { +func (p *UserServiceTestAuthResult) GetSuccess() (v *TestAuthResponse) { if !p.IsSetSuccess() { - return LaunchScreenServiceCreateImageResult_Success_DEFAULT + return UserServiceTestAuthResult_Success_DEFAULT } return p.Success } -var fieldIDToName_LaunchScreenServiceCreateImageResult = map[int16]string{ +var fieldIDToName_UserServiceTestAuthResult = map[int16]string{ 0: "success", } -func (p *LaunchScreenServiceCreateImageResult) IsSetSuccess() bool { +func (p *UserServiceTestAuthResult) IsSetSuccess() bool { return p.Success != nil } -func (p *LaunchScreenServiceCreateImageResult) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceTestAuthResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -18842,7 +18366,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_LaunchScreenServiceCreateImageResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UserServiceTestAuthResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -18852,8 +18376,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *LaunchScreenServiceCreateImageResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewCreateImageResponse() +func (p *UserServiceTestAuthResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewTestAuthResponse() if err := _field.Read(iprot); err != nil { return err } @@ -18861,10 +18385,9 @@ func (p *LaunchScreenServiceCreateImageResult) ReadField0(iprot thrift.TProtocol return nil } -func (p *LaunchScreenServiceCreateImageResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *UserServiceTestAuthResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("CreateImage_result"); err != nil { + if err = oprot.WriteStructBegin("TestAuth_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -18890,7 +18413,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *LaunchScreenServiceCreateImageResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *UserServiceTestAuthResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -18909,43 +18432,132 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *LaunchScreenServiceCreateImageResult) String() string { +func (p *UserServiceTestAuthResult) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceCreateImageResult(%+v)", *p) - -} + return fmt.Sprintf("UserServiceTestAuthResult(%+v)", *p) -type LaunchScreenServiceGetImageArgs struct { - Req *GetImageRequest `thrift:"req,1"` } -func NewLaunchScreenServiceGetImageArgs() *LaunchScreenServiceGetImageArgs { - return &LaunchScreenServiceGetImageArgs{} +type CourseServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler CourseService } -func (p *LaunchScreenServiceGetImageArgs) InitDefault() { +func (p *CourseServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor } -var LaunchScreenServiceGetImageArgs_Req_DEFAULT *GetImageRequest +func (p *CourseServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} -func (p *LaunchScreenServiceGetImageArgs) GetReq() (v *GetImageRequest) { +func (p *CourseServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewCourseServiceProcessor(handler CourseService) *CourseServiceProcessor { + self := &CourseServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self.AddToProcessorMap("GetCourseList", &courseServiceProcessorGetCourseList{handler: handler}) + return self +} +func (p *CourseServiceProcessor) 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 courseServiceProcessorGetCourseList struct { + handler CourseService +} + +func (p *courseServiceProcessorGetCourseList) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := CourseServiceGetCourseListArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetCourseList", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := CourseServiceGetCourseListResult{} + var retval *CourseListResponse + if retval, err2 = p.handler.GetCourseList(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCourseList: "+err2.Error()) + oprot.WriteMessageBegin("GetCourseList", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetCourseList", 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 CourseServiceGetCourseListArgs struct { + Req *CourseListRequest `thrift:"req,1"` +} + +func NewCourseServiceGetCourseListArgs() *CourseServiceGetCourseListArgs { + return &CourseServiceGetCourseListArgs{} +} + +func (p *CourseServiceGetCourseListArgs) InitDefault() { +} + +var CourseServiceGetCourseListArgs_Req_DEFAULT *CourseListRequest + +func (p *CourseServiceGetCourseListArgs) GetReq() (v *CourseListRequest) { if !p.IsSetReq() { - return LaunchScreenServiceGetImageArgs_Req_DEFAULT + return CourseServiceGetCourseListArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_LaunchScreenServiceGetImageArgs = map[int16]string{ +var fieldIDToName_CourseServiceGetCourseListArgs = map[int16]string{ 1: "req", } -func (p *LaunchScreenServiceGetImageArgs) IsSetReq() bool { +func (p *CourseServiceGetCourseListArgs) IsSetReq() bool { return p.Req != nil } -func (p *LaunchScreenServiceGetImageArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *CourseServiceGetCourseListArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -18991,7 +18603,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_LaunchScreenServiceGetImageArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CourseServiceGetCourseListArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -19001,8 +18613,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *LaunchScreenServiceGetImageArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetImageRequest() +func (p *CourseServiceGetCourseListArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewCourseListRequest() if err := _field.Read(iprot); err != nil { return err } @@ -19010,10 +18622,9 @@ func (p *LaunchScreenServiceGetImageArgs) ReadField1(iprot thrift.TProtocol) err return nil } -func (p *LaunchScreenServiceGetImageArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *CourseServiceGetCourseListArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetImage_args"); err != nil { + if err = oprot.WriteStructBegin("GetCourseList_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -19039,7 +18650,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *LaunchScreenServiceGetImageArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *CourseServiceGetCourseListArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -19056,43 +18667,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *LaunchScreenServiceGetImageArgs) String() string { +func (p *CourseServiceGetCourseListArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceGetImageArgs(%+v)", *p) + return fmt.Sprintf("CourseServiceGetCourseListArgs(%+v)", *p) } -type LaunchScreenServiceGetImageResult struct { - Success *GetImageResponse `thrift:"success,0,optional"` +type CourseServiceGetCourseListResult struct { + Success *CourseListResponse `thrift:"success,0,optional"` } -func NewLaunchScreenServiceGetImageResult() *LaunchScreenServiceGetImageResult { - return &LaunchScreenServiceGetImageResult{} +func NewCourseServiceGetCourseListResult() *CourseServiceGetCourseListResult { + return &CourseServiceGetCourseListResult{} } -func (p *LaunchScreenServiceGetImageResult) InitDefault() { +func (p *CourseServiceGetCourseListResult) InitDefault() { } -var LaunchScreenServiceGetImageResult_Success_DEFAULT *GetImageResponse +var CourseServiceGetCourseListResult_Success_DEFAULT *CourseListResponse -func (p *LaunchScreenServiceGetImageResult) GetSuccess() (v *GetImageResponse) { +func (p *CourseServiceGetCourseListResult) GetSuccess() (v *CourseListResponse) { if !p.IsSetSuccess() { - return LaunchScreenServiceGetImageResult_Success_DEFAULT + return CourseServiceGetCourseListResult_Success_DEFAULT } return p.Success } -var fieldIDToName_LaunchScreenServiceGetImageResult = map[int16]string{ +var fieldIDToName_CourseServiceGetCourseListResult = map[int16]string{ 0: "success", } -func (p *LaunchScreenServiceGetImageResult) IsSetSuccess() bool { +func (p *CourseServiceGetCourseListResult) IsSetSuccess() bool { return p.Success != nil } -func (p *LaunchScreenServiceGetImageResult) Read(iprot thrift.TProtocol) (err error) { +func (p *CourseServiceGetCourseListResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -19138,7 +18749,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_LaunchScreenServiceGetImageResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CourseServiceGetCourseListResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -19148,8 +18759,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *LaunchScreenServiceGetImageResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetImageResponse() +func (p *CourseServiceGetCourseListResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewCourseListResponse() if err := _field.Read(iprot); err != nil { return err } @@ -19157,10 +18768,9 @@ func (p *LaunchScreenServiceGetImageResult) ReadField0(iprot thrift.TProtocol) e return nil } -func (p *LaunchScreenServiceGetImageResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *CourseServiceGetCourseListResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetImage_result"); err != nil { + if err = oprot.WriteStructBegin("GetCourseList_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -19186,7 +18796,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *LaunchScreenServiceGetImageResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *CourseServiceGetCourseListResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -19205,190 +18815,426 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *LaunchScreenServiceGetImageResult) String() string { +func (p *CourseServiceGetCourseListResult) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceGetImageResult(%+v)", *p) + return fmt.Sprintf("CourseServiceGetCourseListResult(%+v)", *p) } -type LaunchScreenServiceChangeImagePropertyArgs struct { - Req *ChangeImagePropertyRequest `thrift:"req,1"` +type LaunchScreenServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler LaunchScreenService } -func NewLaunchScreenServiceChangeImagePropertyArgs() *LaunchScreenServiceChangeImagePropertyArgs { - return &LaunchScreenServiceChangeImagePropertyArgs{} +func (p *LaunchScreenServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor } -func (p *LaunchScreenServiceChangeImagePropertyArgs) InitDefault() { +func (p *LaunchScreenServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok } -var LaunchScreenServiceChangeImagePropertyArgs_Req_DEFAULT *ChangeImagePropertyRequest - -func (p *LaunchScreenServiceChangeImagePropertyArgs) GetReq() (v *ChangeImagePropertyRequest) { - if !p.IsSetReq() { - return LaunchScreenServiceChangeImagePropertyArgs_Req_DEFAULT - } - return p.Req +func (p *LaunchScreenServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap } -var fieldIDToName_LaunchScreenServiceChangeImagePropertyArgs = map[int16]string{ - 1: "req", +func NewLaunchScreenServiceProcessor(handler LaunchScreenService) *LaunchScreenServiceProcessor { + self := &LaunchScreenServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self.AddToProcessorMap("CreateImage", &launchScreenServiceProcessorCreateImage{handler: handler}) + self.AddToProcessorMap("GetImage", &launchScreenServiceProcessorGetImage{handler: handler}) + self.AddToProcessorMap("ChangeImageProperty", &launchScreenServiceProcessorChangeImageProperty{handler: handler}) + self.AddToProcessorMap("ChangeImage", &launchScreenServiceProcessorChangeImage{handler: handler}) + self.AddToProcessorMap("DeleteImage", &launchScreenServiceProcessorDeleteImage{handler: handler}) + self.AddToProcessorMap("MobileGetImage", &launchScreenServiceProcessorMobileGetImage{handler: handler}) + self.AddToProcessorMap("AddImagePointTime", &launchScreenServiceProcessorAddImagePointTime{handler: handler}) + return self } - -func (p *LaunchScreenServiceChangeImagePropertyArgs) IsSetReq() bool { - return p.Req != nil +func (p *LaunchScreenServiceProcessor) 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 } -func (p *LaunchScreenServiceChangeImagePropertyArgs) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 +type launchScreenServiceProcessorCreateImage struct { + handler LaunchScreenService +} - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError +func (p *launchScreenServiceProcessorCreateImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceCreateImageArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("CreateImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err } - 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 - } + iprot.ReadMessageEnd() + var err2 error + result := LaunchScreenServiceCreateImageResult{} + var retval *CreateImageResponse + if retval, err2 = p.handler.CreateImage(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CreateImage: "+err2.Error()) + oprot.WriteMessageBegin("CreateImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError + if err2 = oprot.WriteMessageBegin("CreateImage", thrift.REPLY, seqId); err2 != nil { + err = err2 } - - 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_LaunchScreenServiceChangeImagePropertyArgs[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 *LaunchScreenServiceChangeImagePropertyArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewChangeImagePropertyRequest() - if err := _field.Read(iprot); err != nil { - return err + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 } - p.Req = _field - return nil + 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 } -func (p *LaunchScreenServiceChangeImagePropertyArgs) Write(oprot thrift.TProtocol) (err error) { +type launchScreenServiceProcessorGetImage struct { + handler LaunchScreenService +} - var fieldId int16 - if err = oprot.WriteStructBegin("ChangeImageProperty_args"); err != nil { - goto WriteStructBeginError +func (p *launchScreenServiceProcessorGetImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceGetImageArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } + + iprot.ReadMessageEnd() + var err2 error + result := LaunchScreenServiceGetImageResult{} + var retval *GetImageResponse + if retval, err2 = p.handler.GetImage(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetImage: "+err2.Error()) + oprot.WriteMessageBegin("GetImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError + if err2 = oprot.WriteMessageBegin("GetImage", thrift.REPLY, seqId); err2 != nil { + err = err2 } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 } - 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 *LaunchScreenServiceChangeImagePropertyArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 } - if err := p.Req.Write(oprot); err != nil { - return err + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError + if err != nil { + return } - 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) + return true, err } -func (p *LaunchScreenServiceChangeImagePropertyArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("LaunchScreenServiceChangeImagePropertyArgs(%+v)", *p) - +type launchScreenServiceProcessorChangeImageProperty struct { + handler LaunchScreenService } -type LaunchScreenServiceChangeImagePropertyResult struct { - Success *ChangeImagePropertyResponse `thrift:"success,0,optional"` -} +func (p *launchScreenServiceProcessorChangeImageProperty) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceChangeImagePropertyArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("ChangeImageProperty", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } -func NewLaunchScreenServiceChangeImagePropertyResult() *LaunchScreenServiceChangeImagePropertyResult { - return &LaunchScreenServiceChangeImagePropertyResult{} + iprot.ReadMessageEnd() + var err2 error + result := LaunchScreenServiceChangeImagePropertyResult{} + var retval *ChangeImagePropertyResponse + if retval, err2 = p.handler.ChangeImageProperty(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ChangeImageProperty: "+err2.Error()) + oprot.WriteMessageBegin("ChangeImageProperty", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("ChangeImageProperty", 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 } -func (p *LaunchScreenServiceChangeImagePropertyResult) InitDefault() { +type launchScreenServiceProcessorChangeImage struct { + handler LaunchScreenService } -var LaunchScreenServiceChangeImagePropertyResult_Success_DEFAULT *ChangeImagePropertyResponse +func (p *launchScreenServiceProcessorChangeImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceChangeImageArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("ChangeImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } -func (p *LaunchScreenServiceChangeImagePropertyResult) GetSuccess() (v *ChangeImagePropertyResponse) { - if !p.IsSetSuccess() { - return LaunchScreenServiceChangeImagePropertyResult_Success_DEFAULT + iprot.ReadMessageEnd() + var err2 error + result := LaunchScreenServiceChangeImageResult{} + var retval *ChangeImageResponse + if retval, err2 = p.handler.ChangeImage(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ChangeImage: "+err2.Error()) + oprot.WriteMessageBegin("ChangeImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval } - return p.Success + if err2 = oprot.WriteMessageBegin("ChangeImage", 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 } -var fieldIDToName_LaunchScreenServiceChangeImagePropertyResult = map[int16]string{ - 0: "success", +type launchScreenServiceProcessorDeleteImage struct { + handler LaunchScreenService } -func (p *LaunchScreenServiceChangeImagePropertyResult) IsSetSuccess() bool { - return p.Success != nil -} +func (p *launchScreenServiceProcessorDeleteImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceDeleteImageArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("DeleteImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } -func (p *LaunchScreenServiceChangeImagePropertyResult) Read(iprot thrift.TProtocol) (err error) { + iprot.ReadMessageEnd() + var err2 error + result := LaunchScreenServiceDeleteImageResult{} + var retval *DeleteImageResponse + if retval, err2 = p.handler.DeleteImage(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing DeleteImage: "+err2.Error()) + oprot.WriteMessageBegin("DeleteImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("DeleteImage", 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 launchScreenServiceProcessorMobileGetImage struct { + handler LaunchScreenService +} + +func (p *launchScreenServiceProcessorMobileGetImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceMobileGetImageArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("MobileGetImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := LaunchScreenServiceMobileGetImageResult{} + var retval *MobileGetImageResponse + if retval, err2 = p.handler.MobileGetImage(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing MobileGetImage: "+err2.Error()) + oprot.WriteMessageBegin("MobileGetImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("MobileGetImage", 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 launchScreenServiceProcessorAddImagePointTime struct { + handler LaunchScreenService +} + +func (p *launchScreenServiceProcessorAddImagePointTime) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceAddImagePointTimeArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("AddImagePointTime", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := LaunchScreenServiceAddImagePointTimeResult{} + var retval *AddImagePointTimeResponse + if retval, err2 = p.handler.AddImagePointTime(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing AddImagePointTime: "+err2.Error()) + oprot.WriteMessageBegin("AddImagePointTime", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("AddImagePointTime", 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 LaunchScreenServiceCreateImageArgs struct { + Req *CreateImageRequest `thrift:"req,1"` +} + +func NewLaunchScreenServiceCreateImageArgs() *LaunchScreenServiceCreateImageArgs { + return &LaunchScreenServiceCreateImageArgs{} +} + +func (p *LaunchScreenServiceCreateImageArgs) InitDefault() { +} + +var LaunchScreenServiceCreateImageArgs_Req_DEFAULT *CreateImageRequest + +func (p *LaunchScreenServiceCreateImageArgs) GetReq() (v *CreateImageRequest) { + if !p.IsSetReq() { + return LaunchScreenServiceCreateImageArgs_Req_DEFAULT + } + return p.Req +} + +var fieldIDToName_LaunchScreenServiceCreateImageArgs = map[int16]string{ + 1: "req", +} + +func (p *LaunchScreenServiceCreateImageArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *LaunchScreenServiceCreateImageArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -19407,9 +19253,9 @@ func (p *LaunchScreenServiceChangeImagePropertyResult) Read(iprot thrift.TProtoc } switch fieldId { - case 0: + case 1: if fieldTypeId == thrift.STRUCT { - if err = p.ReadField0(iprot); err != nil { + if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } } else if err = iprot.Skip(fieldTypeId); err != nil { @@ -19434,7 +19280,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_LaunchScreenServiceChangeImagePropertyResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LaunchScreenServiceCreateImageArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -19444,24 +19290,23 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *LaunchScreenServiceChangeImagePropertyResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewChangeImagePropertyResponse() +func (p *LaunchScreenServiceCreateImageArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewCreateImageRequest() if err := _field.Read(iprot); err != nil { return err } - p.Success = _field + p.Req = _field return nil } -func (p *LaunchScreenServiceChangeImagePropertyResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *LaunchScreenServiceCreateImageArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ChangeImageProperty_result"); err != nil { + if err = oprot.WriteStructBegin("CreateImage_args"); err != nil { goto WriteStructBeginError } if p != nil { - if err = p.writeField0(oprot); err != nil { - fieldId = 0 + if err = p.writeField1(oprot); err != nil { + fieldId = 1 goto WriteFieldError } } @@ -19482,62 +19327,60 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *LaunchScreenServiceChangeImagePropertyResult) 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 - } +func (p *LaunchScreenServiceCreateImageArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError } return nil WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *LaunchScreenServiceChangeImagePropertyResult) String() string { +func (p *LaunchScreenServiceCreateImageArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceChangeImagePropertyResult(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceCreateImageArgs(%+v)", *p) } -type LaunchScreenServiceChangeImageArgs struct { - Req *ChangeImageRequest `thrift:"req,1"` +type LaunchScreenServiceCreateImageResult struct { + Success *CreateImageResponse `thrift:"success,0,optional"` } -func NewLaunchScreenServiceChangeImageArgs() *LaunchScreenServiceChangeImageArgs { - return &LaunchScreenServiceChangeImageArgs{} +func NewLaunchScreenServiceCreateImageResult() *LaunchScreenServiceCreateImageResult { + return &LaunchScreenServiceCreateImageResult{} } -func (p *LaunchScreenServiceChangeImageArgs) InitDefault() { +func (p *LaunchScreenServiceCreateImageResult) InitDefault() { } -var LaunchScreenServiceChangeImageArgs_Req_DEFAULT *ChangeImageRequest +var LaunchScreenServiceCreateImageResult_Success_DEFAULT *CreateImageResponse -func (p *LaunchScreenServiceChangeImageArgs) GetReq() (v *ChangeImageRequest) { - if !p.IsSetReq() { - return LaunchScreenServiceChangeImageArgs_Req_DEFAULT +func (p *LaunchScreenServiceCreateImageResult) GetSuccess() (v *CreateImageResponse) { + if !p.IsSetSuccess() { + return LaunchScreenServiceCreateImageResult_Success_DEFAULT } - return p.Req + return p.Success } -var fieldIDToName_LaunchScreenServiceChangeImageArgs = map[int16]string{ - 1: "req", +var fieldIDToName_LaunchScreenServiceCreateImageResult = map[int16]string{ + 0: "success", } -func (p *LaunchScreenServiceChangeImageArgs) IsSetReq() bool { - return p.Req != nil +func (p *LaunchScreenServiceCreateImageResult) IsSetSuccess() bool { + return p.Success != nil } -func (p *LaunchScreenServiceChangeImageArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceCreateImageResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -19556,9 +19399,9 @@ func (p *LaunchScreenServiceChangeImageArgs) Read(iprot thrift.TProtocol) (err e } switch fieldId { - case 1: + case 0: if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { + if err = p.ReadField0(iprot); err != nil { goto ReadFieldError } } else if err = iprot.Skip(fieldTypeId); err != nil { @@ -19583,7 +19426,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_LaunchScreenServiceChangeImageArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LaunchScreenServiceCreateImageResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -19593,166 +19436,18 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *LaunchScreenServiceChangeImageArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewChangeImageRequest() +func (p *LaunchScreenServiceCreateImageResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewCreateImageResponse() if err := _field.Read(iprot); err != nil { return err } - p.Req = _field + p.Success = _field return nil } -func (p *LaunchScreenServiceChangeImageArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *LaunchScreenServiceCreateImageResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ChangeImage_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 *LaunchScreenServiceChangeImageArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.Req.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *LaunchScreenServiceChangeImageArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("LaunchScreenServiceChangeImageArgs(%+v)", *p) - -} - -type LaunchScreenServiceChangeImageResult struct { - Success *ChangeImageResponse `thrift:"success,0,optional"` -} - -func NewLaunchScreenServiceChangeImageResult() *LaunchScreenServiceChangeImageResult { - return &LaunchScreenServiceChangeImageResult{} -} - -func (p *LaunchScreenServiceChangeImageResult) InitDefault() { -} - -var LaunchScreenServiceChangeImageResult_Success_DEFAULT *ChangeImageResponse - -func (p *LaunchScreenServiceChangeImageResult) GetSuccess() (v *ChangeImageResponse) { - if !p.IsSetSuccess() { - return LaunchScreenServiceChangeImageResult_Success_DEFAULT - } - return p.Success -} - -var fieldIDToName_LaunchScreenServiceChangeImageResult = map[int16]string{ - 0: "success", -} - -func (p *LaunchScreenServiceChangeImageResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *LaunchScreenServiceChangeImageResult) 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_LaunchScreenServiceChangeImageResult[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 *LaunchScreenServiceChangeImageResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewChangeImageResponse() - if err := _field.Read(iprot); err != nil { - return err - } - p.Success = _field - return nil -} - -func (p *LaunchScreenServiceChangeImageResult) Write(oprot thrift.TProtocol) (err error) { - - var fieldId int16 - if err = oprot.WriteStructBegin("ChangeImage_result"); err != nil { + if err = oprot.WriteStructBegin("CreateImage_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -19778,7 +19473,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *LaunchScreenServiceChangeImageResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceCreateImageResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -19797,43 +19492,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *LaunchScreenServiceChangeImageResult) String() string { +func (p *LaunchScreenServiceCreateImageResult) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceChangeImageResult(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceCreateImageResult(%+v)", *p) } -type LaunchScreenServiceDeleteImageArgs struct { - Req *DeleteImageRequest `thrift:"req,1"` +type LaunchScreenServiceGetImageArgs struct { + Req *GetImageRequest `thrift:"req,1"` } -func NewLaunchScreenServiceDeleteImageArgs() *LaunchScreenServiceDeleteImageArgs { - return &LaunchScreenServiceDeleteImageArgs{} +func NewLaunchScreenServiceGetImageArgs() *LaunchScreenServiceGetImageArgs { + return &LaunchScreenServiceGetImageArgs{} } -func (p *LaunchScreenServiceDeleteImageArgs) InitDefault() { +func (p *LaunchScreenServiceGetImageArgs) InitDefault() { } -var LaunchScreenServiceDeleteImageArgs_Req_DEFAULT *DeleteImageRequest +var LaunchScreenServiceGetImageArgs_Req_DEFAULT *GetImageRequest -func (p *LaunchScreenServiceDeleteImageArgs) GetReq() (v *DeleteImageRequest) { +func (p *LaunchScreenServiceGetImageArgs) GetReq() (v *GetImageRequest) { if !p.IsSetReq() { - return LaunchScreenServiceDeleteImageArgs_Req_DEFAULT + return LaunchScreenServiceGetImageArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_LaunchScreenServiceDeleteImageArgs = map[int16]string{ +var fieldIDToName_LaunchScreenServiceGetImageArgs = map[int16]string{ 1: "req", } -func (p *LaunchScreenServiceDeleteImageArgs) IsSetReq() bool { +func (p *LaunchScreenServiceGetImageArgs) IsSetReq() bool { return p.Req != nil } -func (p *LaunchScreenServiceDeleteImageArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceGetImageArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -19879,7 +19574,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_LaunchScreenServiceDeleteImageArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LaunchScreenServiceGetImageArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -19889,8 +19584,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *LaunchScreenServiceDeleteImageArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewDeleteImageRequest() +func (p *LaunchScreenServiceGetImageArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetImageRequest() if err := _field.Read(iprot); err != nil { return err } @@ -19898,10 +19593,9 @@ func (p *LaunchScreenServiceDeleteImageArgs) ReadField1(iprot thrift.TProtocol) return nil } -func (p *LaunchScreenServiceDeleteImageArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *LaunchScreenServiceGetImageArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("DeleteImage_args"); err != nil { + if err = oprot.WriteStructBegin("GetImage_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -19927,7 +19621,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *LaunchScreenServiceDeleteImageArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceGetImageArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -19944,43 +19638,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *LaunchScreenServiceDeleteImageArgs) String() string { +func (p *LaunchScreenServiceGetImageArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceDeleteImageArgs(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceGetImageArgs(%+v)", *p) } -type LaunchScreenServiceDeleteImageResult struct { - Success *DeleteImageResponse `thrift:"success,0,optional"` +type LaunchScreenServiceGetImageResult struct { + Success *GetImageResponse `thrift:"success,0,optional"` } -func NewLaunchScreenServiceDeleteImageResult() *LaunchScreenServiceDeleteImageResult { - return &LaunchScreenServiceDeleteImageResult{} +func NewLaunchScreenServiceGetImageResult() *LaunchScreenServiceGetImageResult { + return &LaunchScreenServiceGetImageResult{} } -func (p *LaunchScreenServiceDeleteImageResult) InitDefault() { +func (p *LaunchScreenServiceGetImageResult) InitDefault() { } -var LaunchScreenServiceDeleteImageResult_Success_DEFAULT *DeleteImageResponse +var LaunchScreenServiceGetImageResult_Success_DEFAULT *GetImageResponse -func (p *LaunchScreenServiceDeleteImageResult) GetSuccess() (v *DeleteImageResponse) { +func (p *LaunchScreenServiceGetImageResult) GetSuccess() (v *GetImageResponse) { if !p.IsSetSuccess() { - return LaunchScreenServiceDeleteImageResult_Success_DEFAULT + return LaunchScreenServiceGetImageResult_Success_DEFAULT } return p.Success } -var fieldIDToName_LaunchScreenServiceDeleteImageResult = map[int16]string{ +var fieldIDToName_LaunchScreenServiceGetImageResult = map[int16]string{ 0: "success", } -func (p *LaunchScreenServiceDeleteImageResult) IsSetSuccess() bool { +func (p *LaunchScreenServiceGetImageResult) IsSetSuccess() bool { return p.Success != nil } -func (p *LaunchScreenServiceDeleteImageResult) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceGetImageResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -20026,7 +19720,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_LaunchScreenServiceDeleteImageResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LaunchScreenServiceGetImageResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -20036,8 +19730,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *LaunchScreenServiceDeleteImageResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewDeleteImageResponse() +func (p *LaunchScreenServiceGetImageResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetImageResponse() if err := _field.Read(iprot); err != nil { return err } @@ -20045,10 +19739,9 @@ func (p *LaunchScreenServiceDeleteImageResult) ReadField0(iprot thrift.TProtocol return nil } -func (p *LaunchScreenServiceDeleteImageResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *LaunchScreenServiceGetImageResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("DeleteImage_result"); err != nil { + if err = oprot.WriteStructBegin("GetImage_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -20074,7 +19767,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *LaunchScreenServiceDeleteImageResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceGetImageResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -20093,43 +19786,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *LaunchScreenServiceDeleteImageResult) String() string { +func (p *LaunchScreenServiceGetImageResult) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceDeleteImageResult(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceGetImageResult(%+v)", *p) } -type LaunchScreenServiceMobileGetImageArgs struct { - Req *MobileGetImageRequest `thrift:"req,1"` +type LaunchScreenServiceChangeImagePropertyArgs struct { + Req *ChangeImagePropertyRequest `thrift:"req,1"` } -func NewLaunchScreenServiceMobileGetImageArgs() *LaunchScreenServiceMobileGetImageArgs { - return &LaunchScreenServiceMobileGetImageArgs{} +func NewLaunchScreenServiceChangeImagePropertyArgs() *LaunchScreenServiceChangeImagePropertyArgs { + return &LaunchScreenServiceChangeImagePropertyArgs{} } -func (p *LaunchScreenServiceMobileGetImageArgs) InitDefault() { +func (p *LaunchScreenServiceChangeImagePropertyArgs) InitDefault() { } -var LaunchScreenServiceMobileGetImageArgs_Req_DEFAULT *MobileGetImageRequest +var LaunchScreenServiceChangeImagePropertyArgs_Req_DEFAULT *ChangeImagePropertyRequest -func (p *LaunchScreenServiceMobileGetImageArgs) GetReq() (v *MobileGetImageRequest) { +func (p *LaunchScreenServiceChangeImagePropertyArgs) GetReq() (v *ChangeImagePropertyRequest) { if !p.IsSetReq() { - return LaunchScreenServiceMobileGetImageArgs_Req_DEFAULT + return LaunchScreenServiceChangeImagePropertyArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_LaunchScreenServiceMobileGetImageArgs = map[int16]string{ +var fieldIDToName_LaunchScreenServiceChangeImagePropertyArgs = map[int16]string{ 1: "req", } -func (p *LaunchScreenServiceMobileGetImageArgs) IsSetReq() bool { +func (p *LaunchScreenServiceChangeImagePropertyArgs) IsSetReq() bool { return p.Req != nil } -func (p *LaunchScreenServiceMobileGetImageArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceChangeImagePropertyArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -20175,7 +19868,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_LaunchScreenServiceMobileGetImageArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LaunchScreenServiceChangeImagePropertyArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -20185,8 +19878,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *LaunchScreenServiceMobileGetImageArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewMobileGetImageRequest() +func (p *LaunchScreenServiceChangeImagePropertyArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewChangeImagePropertyRequest() if err := _field.Read(iprot); err != nil { return err } @@ -20194,10 +19887,9 @@ func (p *LaunchScreenServiceMobileGetImageArgs) ReadField1(iprot thrift.TProtoco return nil } -func (p *LaunchScreenServiceMobileGetImageArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *LaunchScreenServiceChangeImagePropertyArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("MobileGetImage_args"); err != nil { + if err = oprot.WriteStructBegin("ChangeImageProperty_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -20223,7 +19915,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *LaunchScreenServiceMobileGetImageArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceChangeImagePropertyArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -20240,43 +19932,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *LaunchScreenServiceMobileGetImageArgs) String() string { +func (p *LaunchScreenServiceChangeImagePropertyArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceMobileGetImageArgs(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceChangeImagePropertyArgs(%+v)", *p) } -type LaunchScreenServiceMobileGetImageResult struct { - Success *MobileGetImageResponse `thrift:"success,0,optional"` +type LaunchScreenServiceChangeImagePropertyResult struct { + Success *ChangeImagePropertyResponse `thrift:"success,0,optional"` } -func NewLaunchScreenServiceMobileGetImageResult() *LaunchScreenServiceMobileGetImageResult { - return &LaunchScreenServiceMobileGetImageResult{} +func NewLaunchScreenServiceChangeImagePropertyResult() *LaunchScreenServiceChangeImagePropertyResult { + return &LaunchScreenServiceChangeImagePropertyResult{} } -func (p *LaunchScreenServiceMobileGetImageResult) InitDefault() { +func (p *LaunchScreenServiceChangeImagePropertyResult) InitDefault() { } -var LaunchScreenServiceMobileGetImageResult_Success_DEFAULT *MobileGetImageResponse +var LaunchScreenServiceChangeImagePropertyResult_Success_DEFAULT *ChangeImagePropertyResponse -func (p *LaunchScreenServiceMobileGetImageResult) GetSuccess() (v *MobileGetImageResponse) { +func (p *LaunchScreenServiceChangeImagePropertyResult) GetSuccess() (v *ChangeImagePropertyResponse) { if !p.IsSetSuccess() { - return LaunchScreenServiceMobileGetImageResult_Success_DEFAULT + return LaunchScreenServiceChangeImagePropertyResult_Success_DEFAULT } return p.Success } -var fieldIDToName_LaunchScreenServiceMobileGetImageResult = map[int16]string{ +var fieldIDToName_LaunchScreenServiceChangeImagePropertyResult = map[int16]string{ 0: "success", } -func (p *LaunchScreenServiceMobileGetImageResult) IsSetSuccess() bool { +func (p *LaunchScreenServiceChangeImagePropertyResult) IsSetSuccess() bool { return p.Success != nil } -func (p *LaunchScreenServiceMobileGetImageResult) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceChangeImagePropertyResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -20322,7 +20014,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_LaunchScreenServiceMobileGetImageResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LaunchScreenServiceChangeImagePropertyResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -20332,8 +20024,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *LaunchScreenServiceMobileGetImageResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewMobileGetImageResponse() +func (p *LaunchScreenServiceChangeImagePropertyResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewChangeImagePropertyResponse() if err := _field.Read(iprot); err != nil { return err } @@ -20341,10 +20033,9 @@ func (p *LaunchScreenServiceMobileGetImageResult) ReadField0(iprot thrift.TProto return nil } -func (p *LaunchScreenServiceMobileGetImageResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *LaunchScreenServiceChangeImagePropertyResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("MobileGetImage_result"); err != nil { + if err = oprot.WriteStructBegin("ChangeImageProperty_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -20370,7 +20061,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *LaunchScreenServiceMobileGetImageResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceChangeImagePropertyResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -20389,43 +20080,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *LaunchScreenServiceMobileGetImageResult) String() string { +func (p *LaunchScreenServiceChangeImagePropertyResult) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceMobileGetImageResult(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceChangeImagePropertyResult(%+v)", *p) } -type LaunchScreenServiceAddImagePointTimeArgs struct { - Req *AddImagePointTimeRequest `thrift:"req,1"` +type LaunchScreenServiceChangeImageArgs struct { + Req *ChangeImageRequest `thrift:"req,1"` } -func NewLaunchScreenServiceAddImagePointTimeArgs() *LaunchScreenServiceAddImagePointTimeArgs { - return &LaunchScreenServiceAddImagePointTimeArgs{} +func NewLaunchScreenServiceChangeImageArgs() *LaunchScreenServiceChangeImageArgs { + return &LaunchScreenServiceChangeImageArgs{} } -func (p *LaunchScreenServiceAddImagePointTimeArgs) InitDefault() { +func (p *LaunchScreenServiceChangeImageArgs) InitDefault() { } -var LaunchScreenServiceAddImagePointTimeArgs_Req_DEFAULT *AddImagePointTimeRequest +var LaunchScreenServiceChangeImageArgs_Req_DEFAULT *ChangeImageRequest -func (p *LaunchScreenServiceAddImagePointTimeArgs) GetReq() (v *AddImagePointTimeRequest) { +func (p *LaunchScreenServiceChangeImageArgs) GetReq() (v *ChangeImageRequest) { if !p.IsSetReq() { - return LaunchScreenServiceAddImagePointTimeArgs_Req_DEFAULT + return LaunchScreenServiceChangeImageArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_LaunchScreenServiceAddImagePointTimeArgs = map[int16]string{ +var fieldIDToName_LaunchScreenServiceChangeImageArgs = map[int16]string{ 1: "req", } -func (p *LaunchScreenServiceAddImagePointTimeArgs) IsSetReq() bool { +func (p *LaunchScreenServiceChangeImageArgs) IsSetReq() bool { return p.Req != nil } -func (p *LaunchScreenServiceAddImagePointTimeArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceChangeImageArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -20471,7 +20162,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_LaunchScreenServiceAddImagePointTimeArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LaunchScreenServiceChangeImageArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -20481,8 +20172,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *LaunchScreenServiceAddImagePointTimeArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewAddImagePointTimeRequest() +func (p *LaunchScreenServiceChangeImageArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewChangeImageRequest() if err := _field.Read(iprot); err != nil { return err } @@ -20490,10 +20181,9 @@ func (p *LaunchScreenServiceAddImagePointTimeArgs) ReadField1(iprot thrift.TProt return nil } -func (p *LaunchScreenServiceAddImagePointTimeArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *LaunchScreenServiceChangeImageArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("AddImagePointTime_args"); err != nil { + if err = oprot.WriteStructBegin("ChangeImage_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -20519,7 +20209,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *LaunchScreenServiceAddImagePointTimeArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceChangeImageArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -20536,43 +20226,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *LaunchScreenServiceAddImagePointTimeArgs) String() string { +func (p *LaunchScreenServiceChangeImageArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceAddImagePointTimeArgs(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceChangeImageArgs(%+v)", *p) } -type LaunchScreenServiceAddImagePointTimeResult struct { - Success *AddImagePointTimeResponse `thrift:"success,0,optional"` +type LaunchScreenServiceChangeImageResult struct { + Success *ChangeImageResponse `thrift:"success,0,optional"` } -func NewLaunchScreenServiceAddImagePointTimeResult() *LaunchScreenServiceAddImagePointTimeResult { - return &LaunchScreenServiceAddImagePointTimeResult{} +func NewLaunchScreenServiceChangeImageResult() *LaunchScreenServiceChangeImageResult { + return &LaunchScreenServiceChangeImageResult{} } -func (p *LaunchScreenServiceAddImagePointTimeResult) InitDefault() { +func (p *LaunchScreenServiceChangeImageResult) InitDefault() { } -var LaunchScreenServiceAddImagePointTimeResult_Success_DEFAULT *AddImagePointTimeResponse +var LaunchScreenServiceChangeImageResult_Success_DEFAULT *ChangeImageResponse -func (p *LaunchScreenServiceAddImagePointTimeResult) GetSuccess() (v *AddImagePointTimeResponse) { +func (p *LaunchScreenServiceChangeImageResult) GetSuccess() (v *ChangeImageResponse) { if !p.IsSetSuccess() { - return LaunchScreenServiceAddImagePointTimeResult_Success_DEFAULT + return LaunchScreenServiceChangeImageResult_Success_DEFAULT } return p.Success } -var fieldIDToName_LaunchScreenServiceAddImagePointTimeResult = map[int16]string{ +var fieldIDToName_LaunchScreenServiceChangeImageResult = map[int16]string{ 0: "success", } -func (p *LaunchScreenServiceAddImagePointTimeResult) IsSetSuccess() bool { +func (p *LaunchScreenServiceChangeImageResult) IsSetSuccess() bool { return p.Success != nil } -func (p *LaunchScreenServiceAddImagePointTimeResult) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceChangeImageResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -20618,7 +20308,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_LaunchScreenServiceAddImagePointTimeResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LaunchScreenServiceChangeImageResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -20628,8 +20318,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *LaunchScreenServiceAddImagePointTimeResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewAddImagePointTimeResponse() +func (p *LaunchScreenServiceChangeImageResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewChangeImageResponse() if err := _field.Read(iprot); err != nil { return err } @@ -20637,10 +20327,9 @@ func (p *LaunchScreenServiceAddImagePointTimeResult) ReadField0(iprot thrift.TPr return nil } -func (p *LaunchScreenServiceAddImagePointTimeResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *LaunchScreenServiceChangeImageResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("AddImagePointTime_result"); err != nil { + if err = oprot.WriteStructBegin("ChangeImage_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -20666,7 +20355,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *LaunchScreenServiceAddImagePointTimeResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceChangeImageResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -20685,285 +20374,49 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *LaunchScreenServiceAddImagePointTimeResult) String() string { +func (p *LaunchScreenServiceChangeImageResult) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceAddImagePointTimeResult(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceChangeImageResult(%+v)", *p) } -type PaperServiceProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler PaperService +type LaunchScreenServiceDeleteImageArgs struct { + Req *DeleteImageRequest `thrift:"req,1"` } -func (p *PaperServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor +func NewLaunchScreenServiceDeleteImageArgs() *LaunchScreenServiceDeleteImageArgs { + return &LaunchScreenServiceDeleteImageArgs{} } -func (p *PaperServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok +func (p *LaunchScreenServiceDeleteImageArgs) InitDefault() { } -func (p *PaperServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap -} +var LaunchScreenServiceDeleteImageArgs_Req_DEFAULT *DeleteImageRequest -func NewPaperServiceProcessor(handler PaperService) *PaperServiceProcessor { - self := &PaperServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} - self.AddToProcessorMap("ListDirFiles", &paperServiceProcessorListDirFiles{handler: handler}) - self.AddToProcessorMap("GetDownloadUrl", &paperServiceProcessorGetDownloadUrl{handler: handler}) - self.AddToProcessorMap("ListDirFilesForAndroid", &paperServiceProcessorListDirFilesForAndroid{handler: handler}) - self.AddToProcessorMap("GetDownloadUrlForAndroid", &paperServiceProcessorGetDownloadUrlForAndroid{handler: handler}) - return self -} -func (p *PaperServiceProcessor) 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) +func (p *LaunchScreenServiceDeleteImageArgs) GetReq() (v *DeleteImageRequest) { + if !p.IsSetReq() { + return LaunchScreenServiceDeleteImageArgs_Req_DEFAULT } - 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 + return p.Req } -type paperServiceProcessorListDirFiles struct { - handler PaperService +var fieldIDToName_LaunchScreenServiceDeleteImageArgs = map[int16]string{ + 1: "req", } -func (p *paperServiceProcessorListDirFiles) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := PaperServiceListDirFilesArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("ListDirFiles", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := PaperServiceListDirFilesResult{} - var retval *ListDirFilesResponse - if retval, err2 = p.handler.ListDirFiles(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ListDirFiles: "+err2.Error()) - oprot.WriteMessageBegin("ListDirFiles", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("ListDirFiles", 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 +func (p *LaunchScreenServiceDeleteImageArgs) IsSetReq() bool { + return p.Req != nil } -type paperServiceProcessorGetDownloadUrl struct { - handler PaperService -} +func (p *LaunchScreenServiceDeleteImageArgs) Read(iprot thrift.TProtocol) (err error) { -func (p *paperServiceProcessorGetDownloadUrl) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := PaperServiceGetDownloadUrlArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetDownloadUrl", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } + var fieldTypeId thrift.TType + var fieldId int16 - iprot.ReadMessageEnd() - var err2 error - result := PaperServiceGetDownloadUrlResult{} - var retval *GetDownloadUrlResponse - if retval, err2 = p.handler.GetDownloadUrl(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetDownloadUrl: "+err2.Error()) - oprot.WriteMessageBegin("GetDownloadUrl", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("GetDownloadUrl", 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 paperServiceProcessorListDirFilesForAndroid struct { - handler PaperService -} - -func (p *paperServiceProcessorListDirFilesForAndroid) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := PaperServiceListDirFilesForAndroidArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("ListDirFilesForAndroid", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := PaperServiceListDirFilesForAndroidResult{} - var retval *ListDirFilesForAndroidResponse - if retval, err2 = p.handler.ListDirFilesForAndroid(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ListDirFilesForAndroid: "+err2.Error()) - oprot.WriteMessageBegin("ListDirFilesForAndroid", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("ListDirFilesForAndroid", 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 paperServiceProcessorGetDownloadUrlForAndroid struct { - handler PaperService -} - -func (p *paperServiceProcessorGetDownloadUrlForAndroid) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := PaperServiceGetDownloadUrlForAndroidArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetDownloadUrlForAndroid", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := PaperServiceGetDownloadUrlForAndroidResult{} - var retval *GetDownloadUrlForAndroidResponse - if retval, err2 = p.handler.GetDownloadUrlForAndroid(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetDownloadUrlForAndroid: "+err2.Error()) - oprot.WriteMessageBegin("GetDownloadUrlForAndroid", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("GetDownloadUrlForAndroid", 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 PaperServiceListDirFilesArgs struct { - Req *ListDirFilesRequest `thrift:"req,1"` -} - -func NewPaperServiceListDirFilesArgs() *PaperServiceListDirFilesArgs { - return &PaperServiceListDirFilesArgs{} -} - -func (p *PaperServiceListDirFilesArgs) InitDefault() { -} - -var PaperServiceListDirFilesArgs_Req_DEFAULT *ListDirFilesRequest - -func (p *PaperServiceListDirFilesArgs) GetReq() (v *ListDirFilesRequest) { - if !p.IsSetReq() { - return PaperServiceListDirFilesArgs_Req_DEFAULT - } - return p.Req -} - -var fieldIDToName_PaperServiceListDirFilesArgs = map[int16]string{ - 1: "req", -} - -func (p *PaperServiceListDirFilesArgs) IsSetReq() bool { - return p.Req != nil -} - -func (p *PaperServiceListDirFilesArgs) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } for { @@ -21003,7 +20456,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_PaperServiceListDirFilesArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LaunchScreenServiceDeleteImageArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -21013,8 +20466,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *PaperServiceListDirFilesArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewListDirFilesRequest() +func (p *LaunchScreenServiceDeleteImageArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewDeleteImageRequest() if err := _field.Read(iprot); err != nil { return err } @@ -21022,10 +20475,9 @@ func (p *PaperServiceListDirFilesArgs) ReadField1(iprot thrift.TProtocol) error return nil } -func (p *PaperServiceListDirFilesArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *LaunchScreenServiceDeleteImageArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ListDirFiles_args"); err != nil { + if err = oprot.WriteStructBegin("DeleteImage_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -21051,7 +20503,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *PaperServiceListDirFilesArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceDeleteImageArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -21068,43 +20520,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *PaperServiceListDirFilesArgs) String() string { +func (p *LaunchScreenServiceDeleteImageArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("PaperServiceListDirFilesArgs(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceDeleteImageArgs(%+v)", *p) } -type PaperServiceListDirFilesResult struct { - Success *ListDirFilesResponse `thrift:"success,0,optional"` +type LaunchScreenServiceDeleteImageResult struct { + Success *DeleteImageResponse `thrift:"success,0,optional"` } -func NewPaperServiceListDirFilesResult() *PaperServiceListDirFilesResult { - return &PaperServiceListDirFilesResult{} +func NewLaunchScreenServiceDeleteImageResult() *LaunchScreenServiceDeleteImageResult { + return &LaunchScreenServiceDeleteImageResult{} } -func (p *PaperServiceListDirFilesResult) InitDefault() { +func (p *LaunchScreenServiceDeleteImageResult) InitDefault() { } -var PaperServiceListDirFilesResult_Success_DEFAULT *ListDirFilesResponse +var LaunchScreenServiceDeleteImageResult_Success_DEFAULT *DeleteImageResponse -func (p *PaperServiceListDirFilesResult) GetSuccess() (v *ListDirFilesResponse) { +func (p *LaunchScreenServiceDeleteImageResult) GetSuccess() (v *DeleteImageResponse) { if !p.IsSetSuccess() { - return PaperServiceListDirFilesResult_Success_DEFAULT + return LaunchScreenServiceDeleteImageResult_Success_DEFAULT } return p.Success } -var fieldIDToName_PaperServiceListDirFilesResult = map[int16]string{ +var fieldIDToName_LaunchScreenServiceDeleteImageResult = map[int16]string{ 0: "success", } -func (p *PaperServiceListDirFilesResult) IsSetSuccess() bool { +func (p *LaunchScreenServiceDeleteImageResult) IsSetSuccess() bool { return p.Success != nil } -func (p *PaperServiceListDirFilesResult) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceDeleteImageResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -21150,7 +20602,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_PaperServiceListDirFilesResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LaunchScreenServiceDeleteImageResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -21160,8 +20612,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *PaperServiceListDirFilesResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewListDirFilesResponse() +func (p *LaunchScreenServiceDeleteImageResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewDeleteImageResponse() if err := _field.Read(iprot); err != nil { return err } @@ -21169,10 +20621,9 @@ func (p *PaperServiceListDirFilesResult) ReadField0(iprot thrift.TProtocol) erro return nil } -func (p *PaperServiceListDirFilesResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *LaunchScreenServiceDeleteImageResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ListDirFiles_result"); err != nil { + if err = oprot.WriteStructBegin("DeleteImage_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -21198,7 +20649,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *PaperServiceListDirFilesResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceDeleteImageResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -21217,43 +20668,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *PaperServiceListDirFilesResult) String() string { +func (p *LaunchScreenServiceDeleteImageResult) String() string { if p == nil { return "" } - return fmt.Sprintf("PaperServiceListDirFilesResult(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceDeleteImageResult(%+v)", *p) } -type PaperServiceGetDownloadUrlArgs struct { - Req *GetDownloadUrlRequest `thrift:"req,1"` +type LaunchScreenServiceMobileGetImageArgs struct { + Req *MobileGetImageRequest `thrift:"req,1"` } -func NewPaperServiceGetDownloadUrlArgs() *PaperServiceGetDownloadUrlArgs { - return &PaperServiceGetDownloadUrlArgs{} +func NewLaunchScreenServiceMobileGetImageArgs() *LaunchScreenServiceMobileGetImageArgs { + return &LaunchScreenServiceMobileGetImageArgs{} } -func (p *PaperServiceGetDownloadUrlArgs) InitDefault() { +func (p *LaunchScreenServiceMobileGetImageArgs) InitDefault() { } -var PaperServiceGetDownloadUrlArgs_Req_DEFAULT *GetDownloadUrlRequest +var LaunchScreenServiceMobileGetImageArgs_Req_DEFAULT *MobileGetImageRequest -func (p *PaperServiceGetDownloadUrlArgs) GetReq() (v *GetDownloadUrlRequest) { +func (p *LaunchScreenServiceMobileGetImageArgs) GetReq() (v *MobileGetImageRequest) { if !p.IsSetReq() { - return PaperServiceGetDownloadUrlArgs_Req_DEFAULT + return LaunchScreenServiceMobileGetImageArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_PaperServiceGetDownloadUrlArgs = map[int16]string{ +var fieldIDToName_LaunchScreenServiceMobileGetImageArgs = map[int16]string{ 1: "req", } -func (p *PaperServiceGetDownloadUrlArgs) IsSetReq() bool { +func (p *LaunchScreenServiceMobileGetImageArgs) IsSetReq() bool { return p.Req != nil } -func (p *PaperServiceGetDownloadUrlArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceMobileGetImageArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -21299,7 +20750,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_PaperServiceGetDownloadUrlArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LaunchScreenServiceMobileGetImageArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -21309,8 +20760,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *PaperServiceGetDownloadUrlArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetDownloadUrlRequest() +func (p *LaunchScreenServiceMobileGetImageArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewMobileGetImageRequest() if err := _field.Read(iprot); err != nil { return err } @@ -21318,10 +20769,9 @@ func (p *PaperServiceGetDownloadUrlArgs) ReadField1(iprot thrift.TProtocol) erro return nil } -func (p *PaperServiceGetDownloadUrlArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *LaunchScreenServiceMobileGetImageArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetDownloadUrl_args"); err != nil { + if err = oprot.WriteStructBegin("MobileGetImage_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -21347,7 +20797,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *PaperServiceGetDownloadUrlArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceMobileGetImageArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -21364,43 +20814,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *PaperServiceGetDownloadUrlArgs) String() string { +func (p *LaunchScreenServiceMobileGetImageArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("PaperServiceGetDownloadUrlArgs(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceMobileGetImageArgs(%+v)", *p) } -type PaperServiceGetDownloadUrlResult struct { - Success *GetDownloadUrlResponse `thrift:"success,0,optional"` +type LaunchScreenServiceMobileGetImageResult struct { + Success *MobileGetImageResponse `thrift:"success,0,optional"` } -func NewPaperServiceGetDownloadUrlResult() *PaperServiceGetDownloadUrlResult { - return &PaperServiceGetDownloadUrlResult{} +func NewLaunchScreenServiceMobileGetImageResult() *LaunchScreenServiceMobileGetImageResult { + return &LaunchScreenServiceMobileGetImageResult{} } -func (p *PaperServiceGetDownloadUrlResult) InitDefault() { +func (p *LaunchScreenServiceMobileGetImageResult) InitDefault() { } -var PaperServiceGetDownloadUrlResult_Success_DEFAULT *GetDownloadUrlResponse +var LaunchScreenServiceMobileGetImageResult_Success_DEFAULT *MobileGetImageResponse -func (p *PaperServiceGetDownloadUrlResult) GetSuccess() (v *GetDownloadUrlResponse) { +func (p *LaunchScreenServiceMobileGetImageResult) GetSuccess() (v *MobileGetImageResponse) { if !p.IsSetSuccess() { - return PaperServiceGetDownloadUrlResult_Success_DEFAULT + return LaunchScreenServiceMobileGetImageResult_Success_DEFAULT } return p.Success } -var fieldIDToName_PaperServiceGetDownloadUrlResult = map[int16]string{ +var fieldIDToName_LaunchScreenServiceMobileGetImageResult = map[int16]string{ 0: "success", } -func (p *PaperServiceGetDownloadUrlResult) IsSetSuccess() bool { +func (p *LaunchScreenServiceMobileGetImageResult) IsSetSuccess() bool { return p.Success != nil } -func (p *PaperServiceGetDownloadUrlResult) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceMobileGetImageResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -21446,7 +20896,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_PaperServiceGetDownloadUrlResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LaunchScreenServiceMobileGetImageResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -21456,8 +20906,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *PaperServiceGetDownloadUrlResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetDownloadUrlResponse() +func (p *LaunchScreenServiceMobileGetImageResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewMobileGetImageResponse() if err := _field.Read(iprot); err != nil { return err } @@ -21465,10 +20915,9 @@ func (p *PaperServiceGetDownloadUrlResult) ReadField0(iprot thrift.TProtocol) er return nil } -func (p *PaperServiceGetDownloadUrlResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *LaunchScreenServiceMobileGetImageResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetDownloadUrl_result"); err != nil { + if err = oprot.WriteStructBegin("MobileGetImage_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -21494,7 +20943,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *PaperServiceGetDownloadUrlResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceMobileGetImageResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -21513,43 +20962,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *PaperServiceGetDownloadUrlResult) String() string { +func (p *LaunchScreenServiceMobileGetImageResult) String() string { if p == nil { return "" } - return fmt.Sprintf("PaperServiceGetDownloadUrlResult(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceMobileGetImageResult(%+v)", *p) } -type PaperServiceListDirFilesForAndroidArgs struct { - Req *ListDirFilesForAndroidRequest `thrift:"req,1"` +type LaunchScreenServiceAddImagePointTimeArgs struct { + Req *AddImagePointTimeRequest `thrift:"req,1"` } -func NewPaperServiceListDirFilesForAndroidArgs() *PaperServiceListDirFilesForAndroidArgs { - return &PaperServiceListDirFilesForAndroidArgs{} +func NewLaunchScreenServiceAddImagePointTimeArgs() *LaunchScreenServiceAddImagePointTimeArgs { + return &LaunchScreenServiceAddImagePointTimeArgs{} } -func (p *PaperServiceListDirFilesForAndroidArgs) InitDefault() { +func (p *LaunchScreenServiceAddImagePointTimeArgs) InitDefault() { } -var PaperServiceListDirFilesForAndroidArgs_Req_DEFAULT *ListDirFilesForAndroidRequest +var LaunchScreenServiceAddImagePointTimeArgs_Req_DEFAULT *AddImagePointTimeRequest -func (p *PaperServiceListDirFilesForAndroidArgs) GetReq() (v *ListDirFilesForAndroidRequest) { +func (p *LaunchScreenServiceAddImagePointTimeArgs) GetReq() (v *AddImagePointTimeRequest) { if !p.IsSetReq() { - return PaperServiceListDirFilesForAndroidArgs_Req_DEFAULT + return LaunchScreenServiceAddImagePointTimeArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_PaperServiceListDirFilesForAndroidArgs = map[int16]string{ +var fieldIDToName_LaunchScreenServiceAddImagePointTimeArgs = map[int16]string{ 1: "req", } -func (p *PaperServiceListDirFilesForAndroidArgs) IsSetReq() bool { +func (p *LaunchScreenServiceAddImagePointTimeArgs) IsSetReq() bool { return p.Req != nil } -func (p *PaperServiceListDirFilesForAndroidArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceAddImagePointTimeArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -21595,7 +21044,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_PaperServiceListDirFilesForAndroidArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LaunchScreenServiceAddImagePointTimeArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -21605,8 +21054,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *PaperServiceListDirFilesForAndroidArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewListDirFilesForAndroidRequest() +func (p *LaunchScreenServiceAddImagePointTimeArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewAddImagePointTimeRequest() if err := _field.Read(iprot); err != nil { return err } @@ -21614,10 +21063,9 @@ func (p *PaperServiceListDirFilesForAndroidArgs) ReadField1(iprot thrift.TProtoc return nil } -func (p *PaperServiceListDirFilesForAndroidArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *LaunchScreenServiceAddImagePointTimeArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ListDirFilesForAndroid_args"); err != nil { + if err = oprot.WriteStructBegin("AddImagePointTime_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -21643,7 +21091,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *PaperServiceListDirFilesForAndroidArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceAddImagePointTimeArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -21660,43 +21108,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *PaperServiceListDirFilesForAndroidArgs) String() string { +func (p *LaunchScreenServiceAddImagePointTimeArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("PaperServiceListDirFilesForAndroidArgs(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceAddImagePointTimeArgs(%+v)", *p) } -type PaperServiceListDirFilesForAndroidResult struct { - Success *ListDirFilesForAndroidResponse `thrift:"success,0,optional"` +type LaunchScreenServiceAddImagePointTimeResult struct { + Success *AddImagePointTimeResponse `thrift:"success,0,optional"` } -func NewPaperServiceListDirFilesForAndroidResult() *PaperServiceListDirFilesForAndroidResult { - return &PaperServiceListDirFilesForAndroidResult{} +func NewLaunchScreenServiceAddImagePointTimeResult() *LaunchScreenServiceAddImagePointTimeResult { + return &LaunchScreenServiceAddImagePointTimeResult{} } -func (p *PaperServiceListDirFilesForAndroidResult) InitDefault() { +func (p *LaunchScreenServiceAddImagePointTimeResult) InitDefault() { } -var PaperServiceListDirFilesForAndroidResult_Success_DEFAULT *ListDirFilesForAndroidResponse +var LaunchScreenServiceAddImagePointTimeResult_Success_DEFAULT *AddImagePointTimeResponse -func (p *PaperServiceListDirFilesForAndroidResult) GetSuccess() (v *ListDirFilesForAndroidResponse) { +func (p *LaunchScreenServiceAddImagePointTimeResult) GetSuccess() (v *AddImagePointTimeResponse) { if !p.IsSetSuccess() { - return PaperServiceListDirFilesForAndroidResult_Success_DEFAULT + return LaunchScreenServiceAddImagePointTimeResult_Success_DEFAULT } return p.Success } -var fieldIDToName_PaperServiceListDirFilesForAndroidResult = map[int16]string{ +var fieldIDToName_LaunchScreenServiceAddImagePointTimeResult = map[int16]string{ 0: "success", } -func (p *PaperServiceListDirFilesForAndroidResult) IsSetSuccess() bool { +func (p *LaunchScreenServiceAddImagePointTimeResult) IsSetSuccess() bool { return p.Success != nil } -func (p *PaperServiceListDirFilesForAndroidResult) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceAddImagePointTimeResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -21742,7 +21190,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_PaperServiceListDirFilesForAndroidResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LaunchScreenServiceAddImagePointTimeResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -21752,8 +21200,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *PaperServiceListDirFilesForAndroidResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewListDirFilesForAndroidResponse() +func (p *LaunchScreenServiceAddImagePointTimeResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewAddImagePointTimeResponse() if err := _field.Read(iprot); err != nil { return err } @@ -21761,10 +21209,9 @@ func (p *PaperServiceListDirFilesForAndroidResult) ReadField0(iprot thrift.TProt return nil } -func (p *PaperServiceListDirFilesForAndroidResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *LaunchScreenServiceAddImagePointTimeResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ListDirFilesForAndroid_result"); err != nil { + if err = oprot.WriteStructBegin("AddImagePointTime_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -21790,7 +21237,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *PaperServiceListDirFilesForAndroidResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceAddImagePointTimeResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -21809,190 +21256,279 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *PaperServiceListDirFilesForAndroidResult) String() string { +func (p *LaunchScreenServiceAddImagePointTimeResult) String() string { if p == nil { return "" } - return fmt.Sprintf("PaperServiceListDirFilesForAndroidResult(%+v)", *p) - -} + return fmt.Sprintf("LaunchScreenServiceAddImagePointTimeResult(%+v)", *p) -type PaperServiceGetDownloadUrlForAndroidArgs struct { - Req *GetDownloadUrlForAndroidRequest `thrift:"req,1"` } -func NewPaperServiceGetDownloadUrlForAndroidArgs() *PaperServiceGetDownloadUrlForAndroidArgs { - return &PaperServiceGetDownloadUrlForAndroidArgs{} +type PaperServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler PaperService } -func (p *PaperServiceGetDownloadUrlForAndroidArgs) InitDefault() { +func (p *PaperServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor } -var PaperServiceGetDownloadUrlForAndroidArgs_Req_DEFAULT *GetDownloadUrlForAndroidRequest - -func (p *PaperServiceGetDownloadUrlForAndroidArgs) GetReq() (v *GetDownloadUrlForAndroidRequest) { - if !p.IsSetReq() { - return PaperServiceGetDownloadUrlForAndroidArgs_Req_DEFAULT - } - return p.Req +func (p *PaperServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok } -var fieldIDToName_PaperServiceGetDownloadUrlForAndroidArgs = map[int16]string{ - 1: "req", +func (p *PaperServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap } -func (p *PaperServiceGetDownloadUrlForAndroidArgs) IsSetReq() bool { - return p.Req != nil +func NewPaperServiceProcessor(handler PaperService) *PaperServiceProcessor { + self := &PaperServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self.AddToProcessorMap("ListDirFiles", &paperServiceProcessorListDirFiles{handler: handler}) + self.AddToProcessorMap("GetDownloadUrl", &paperServiceProcessorGetDownloadUrl{handler: handler}) + self.AddToProcessorMap("ListDirFilesForAndroid", &paperServiceProcessorListDirFilesForAndroid{handler: handler}) + self.AddToProcessorMap("GetDownloadUrlForAndroid", &paperServiceProcessorGetDownloadUrlForAndroid{handler: handler}) + return self } - -func (p *PaperServiceGetDownloadUrlForAndroidArgs) 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 - } +func (p *PaperServiceProcessor) 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 err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(ctx, seqId, iprot, oprot) } - - 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_PaperServiceGetDownloadUrlForAndroidArgs[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) + 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 } -func (p *PaperServiceGetDownloadUrlForAndroidArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetDownloadUrlForAndroidRequest() - if err := _field.Read(iprot); err != nil { - return err - } - p.Req = _field - return nil +type paperServiceProcessorListDirFiles struct { + handler PaperService } -func (p *PaperServiceGetDownloadUrlForAndroidArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *paperServiceProcessorListDirFiles) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := PaperServiceListDirFilesArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("ListDirFiles", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } - var fieldId int16 - if err = oprot.WriteStructBegin("GetDownloadUrlForAndroid_args"); err != nil { - goto WriteStructBeginError + iprot.ReadMessageEnd() + var err2 error + result := PaperServiceListDirFilesResult{} + var retval *ListDirFilesResponse + if retval, err2 = p.handler.ListDirFiles(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ListDirFiles: "+err2.Error()) + oprot.WriteMessageBegin("ListDirFiles", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } + if err2 = oprot.WriteMessageBegin("ListDirFiles", thrift.REPLY, seqId); err2 != nil { + err = err2 } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 } - 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) + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err } -func (p *PaperServiceGetDownloadUrlForAndroidArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError +type paperServiceProcessorGetDownloadUrl struct { + handler PaperService +} + +func (p *paperServiceProcessorGetDownloadUrl) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := PaperServiceGetDownloadUrlArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetDownloadUrl", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err } - if err := p.Req.Write(oprot); err != nil { - return err + + iprot.ReadMessageEnd() + var err2 error + result := PaperServiceGetDownloadUrlResult{} + var retval *GetDownloadUrlResponse + if retval, err2 = p.handler.GetDownloadUrl(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetDownloadUrl: "+err2.Error()) + oprot.WriteMessageBegin("GetDownloadUrl", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError + if err2 = oprot.WriteMessageBegin("GetDownloadUrl", thrift.REPLY, seqId); err2 != nil { + err = err2 } - 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) + 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 } -func (p *PaperServiceGetDownloadUrlForAndroidArgs) String() string { - if p == nil { - return "" +type paperServiceProcessorListDirFilesForAndroid struct { + handler PaperService +} + +func (p *paperServiceProcessorListDirFilesForAndroid) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := PaperServiceListDirFilesForAndroidArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("ListDirFilesForAndroid", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err } - return fmt.Sprintf("PaperServiceGetDownloadUrlForAndroidArgs(%+v)", *p) + iprot.ReadMessageEnd() + var err2 error + result := PaperServiceListDirFilesForAndroidResult{} + var retval *ListDirFilesForAndroidResponse + if retval, err2 = p.handler.ListDirFilesForAndroid(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ListDirFilesForAndroid: "+err2.Error()) + oprot.WriteMessageBegin("ListDirFilesForAndroid", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("ListDirFilesForAndroid", 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 PaperServiceGetDownloadUrlForAndroidResult struct { - Success *GetDownloadUrlForAndroidResponse `thrift:"success,0,optional"` +type paperServiceProcessorGetDownloadUrlForAndroid struct { + handler PaperService } -func NewPaperServiceGetDownloadUrlForAndroidResult() *PaperServiceGetDownloadUrlForAndroidResult { - return &PaperServiceGetDownloadUrlForAndroidResult{} +func (p *paperServiceProcessorGetDownloadUrlForAndroid) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := PaperServiceGetDownloadUrlForAndroidArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetDownloadUrlForAndroid", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := PaperServiceGetDownloadUrlForAndroidResult{} + var retval *GetDownloadUrlForAndroidResponse + if retval, err2 = p.handler.GetDownloadUrlForAndroid(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetDownloadUrlForAndroid: "+err2.Error()) + oprot.WriteMessageBegin("GetDownloadUrlForAndroid", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetDownloadUrlForAndroid", 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 } -func (p *PaperServiceGetDownloadUrlForAndroidResult) InitDefault() { +type PaperServiceListDirFilesArgs struct { + Req *ListDirFilesRequest `thrift:"req,1"` } -var PaperServiceGetDownloadUrlForAndroidResult_Success_DEFAULT *GetDownloadUrlForAndroidResponse +func NewPaperServiceListDirFilesArgs() *PaperServiceListDirFilesArgs { + return &PaperServiceListDirFilesArgs{} +} -func (p *PaperServiceGetDownloadUrlForAndroidResult) GetSuccess() (v *GetDownloadUrlForAndroidResponse) { - if !p.IsSetSuccess() { - return PaperServiceGetDownloadUrlForAndroidResult_Success_DEFAULT +func (p *PaperServiceListDirFilesArgs) InitDefault() { +} + +var PaperServiceListDirFilesArgs_Req_DEFAULT *ListDirFilesRequest + +func (p *PaperServiceListDirFilesArgs) GetReq() (v *ListDirFilesRequest) { + if !p.IsSetReq() { + return PaperServiceListDirFilesArgs_Req_DEFAULT } - return p.Success + return p.Req } -var fieldIDToName_PaperServiceGetDownloadUrlForAndroidResult = map[int16]string{ - 0: "success", +var fieldIDToName_PaperServiceListDirFilesArgs = map[int16]string{ + 1: "req", } -func (p *PaperServiceGetDownloadUrlForAndroidResult) IsSetSuccess() bool { - return p.Success != nil +func (p *PaperServiceListDirFilesArgs) IsSetReq() bool { + return p.Req != nil } -func (p *PaperServiceGetDownloadUrlForAndroidResult) Read(iprot thrift.TProtocol) (err error) { +func (p *PaperServiceListDirFilesArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -22011,9 +21547,9 @@ func (p *PaperServiceGetDownloadUrlForAndroidResult) Read(iprot thrift.TProtocol } switch fieldId { - case 0: + case 1: if fieldTypeId == thrift.STRUCT { - if err = p.ReadField0(iprot); err != nil { + if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } } else if err = iprot.Skip(fieldTypeId); err != nil { @@ -22038,7 +21574,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_PaperServiceGetDownloadUrlForAndroidResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaperServiceListDirFilesArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -22048,24 +21584,23 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *PaperServiceGetDownloadUrlForAndroidResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetDownloadUrlForAndroidResponse() +func (p *PaperServiceListDirFilesArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewListDirFilesRequest() if err := _field.Read(iprot); err != nil { return err } - p.Success = _field + p.Req = _field return nil } -func (p *PaperServiceGetDownloadUrlForAndroidResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *PaperServiceListDirFilesArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetDownloadUrlForAndroid_result"); err != nil { + if err = oprot.WriteStructBegin("ListDirFiles_args"); err != nil { goto WriteStructBeginError } if p != nil { - if err = p.writeField0(oprot); err != nil { - fieldId = 0 + if err = p.writeField1(oprot); err != nil { + fieldId = 1 goto WriteFieldError } } @@ -22086,298 +21621,208 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *PaperServiceGetDownloadUrlForAndroidResult) 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 - } +func (p *PaperServiceListDirFilesArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError } return nil WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *PaperServiceGetDownloadUrlForAndroidResult) String() string { +func (p *PaperServiceListDirFilesArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("PaperServiceGetDownloadUrlForAndroidResult(%+v)", *p) + return fmt.Sprintf("PaperServiceListDirFilesArgs(%+v)", *p) } -type AcademicServiceProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler AcademicService +type PaperServiceListDirFilesResult struct { + Success *ListDirFilesResponse `thrift:"success,0,optional"` } -func (p *AcademicServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor +func NewPaperServiceListDirFilesResult() *PaperServiceListDirFilesResult { + return &PaperServiceListDirFilesResult{} } -func (p *AcademicServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok +func (p *PaperServiceListDirFilesResult) InitDefault() { } -func (p *AcademicServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap -} +var PaperServiceListDirFilesResult_Success_DEFAULT *ListDirFilesResponse -func NewAcademicServiceProcessor(handler AcademicService) *AcademicServiceProcessor { - self := &AcademicServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} - self.AddToProcessorMap("GetScores", &academicServiceProcessorGetScores{handler: handler}) - self.AddToProcessorMap("GetGPA", &academicServiceProcessorGetGPA{handler: handler}) - self.AddToProcessorMap("GetCredit", &academicServiceProcessorGetCredit{handler: handler}) - self.AddToProcessorMap("GetUnifiedExam", &academicServiceProcessorGetUnifiedExam{handler: handler}) - return self -} -func (p *AcademicServiceProcessor) 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) +func (p *PaperServiceListDirFilesResult) GetSuccess() (v *ListDirFilesResponse) { + if !p.IsSetSuccess() { + return PaperServiceListDirFilesResult_Success_DEFAULT } - 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 + return p.Success } -type academicServiceProcessorGetScores struct { - handler AcademicService +var fieldIDToName_PaperServiceListDirFilesResult = map[int16]string{ + 0: "success", } -func (p *academicServiceProcessorGetScores) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AcademicServiceGetScoresArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetScores", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } +func (p *PaperServiceListDirFilesResult) IsSetSuccess() bool { + return p.Success != nil +} - iprot.ReadMessageEnd() - var err2 error - result := AcademicServiceGetScoresResult{} - var retval *GetScoresResponse - if retval, err2 = p.handler.GetScores(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetScores: "+err2.Error()) - oprot.WriteMessageBegin("GetScores", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("GetScores", 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 *PaperServiceListDirFilesResult) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + + 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 != nil { - return + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError } - return true, err -} -type academicServiceProcessorGetGPA struct { - handler AcademicService + 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_PaperServiceListDirFilesResult[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 *academicServiceProcessorGetGPA) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AcademicServiceGetGPAArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetGPA", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *PaperServiceListDirFilesResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewListDirFilesResponse() + if err := _field.Read(iprot); err != nil { + return err } + p.Success = _field + return nil +} - iprot.ReadMessageEnd() - var err2 error - result := AcademicServiceGetGPAResult{} - var retval *GetGPAResponse - if retval, err2 = p.handler.GetGPA(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetGPA: "+err2.Error()) - oprot.WriteMessageBegin("GetGPA", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval +func (p *PaperServiceListDirFilesResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ListDirFiles_result"); err != nil { + goto WriteStructBeginError } - if err2 = oprot.WriteMessageBegin("GetGPA", thrift.REPLY, seqId); err2 != nil { - err = err2 + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + 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 *PaperServiceListDirFilesResult) 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 + } } - if err != nil { - return + 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 *PaperServiceListDirFilesResult) String() string { + if p == nil { + return "" } - return true, err + return fmt.Sprintf("PaperServiceListDirFilesResult(%+v)", *p) + } -type academicServiceProcessorGetCredit struct { - handler AcademicService +type PaperServiceGetDownloadUrlArgs struct { + Req *GetDownloadUrlRequest `thrift:"req,1"` } -func (p *academicServiceProcessorGetCredit) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AcademicServiceGetCreditArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetCredit", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func NewPaperServiceGetDownloadUrlArgs() *PaperServiceGetDownloadUrlArgs { + return &PaperServiceGetDownloadUrlArgs{} +} + +func (p *PaperServiceGetDownloadUrlArgs) InitDefault() { +} + +var PaperServiceGetDownloadUrlArgs_Req_DEFAULT *GetDownloadUrlRequest + +func (p *PaperServiceGetDownloadUrlArgs) GetReq() (v *GetDownloadUrlRequest) { + if !p.IsSetReq() { + return PaperServiceGetDownloadUrlArgs_Req_DEFAULT } + return p.Req +} - iprot.ReadMessageEnd() - var err2 error - result := AcademicServiceGetCreditResult{} - var retval *GetCreditResponse - if retval, err2 = p.handler.GetCredit(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCredit: "+err2.Error()) - oprot.WriteMessageBegin("GetCredit", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("GetCredit", 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 academicServiceProcessorGetUnifiedExam struct { - handler AcademicService -} - -func (p *academicServiceProcessorGetUnifiedExam) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AcademicServiceGetUnifiedExamArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetUnifiedExam", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := AcademicServiceGetUnifiedExamResult{} - var retval *GetUnifiedExamResponse - if retval, err2 = p.handler.GetUnifiedExam(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetUnifiedExam: "+err2.Error()) - oprot.WriteMessageBegin("GetUnifiedExam", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("GetUnifiedExam", 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 AcademicServiceGetScoresArgs struct { - Req *GetScoresRequest `thrift:"req,1"` -} - -func NewAcademicServiceGetScoresArgs() *AcademicServiceGetScoresArgs { - return &AcademicServiceGetScoresArgs{} -} - -func (p *AcademicServiceGetScoresArgs) InitDefault() { -} - -var AcademicServiceGetScoresArgs_Req_DEFAULT *GetScoresRequest - -func (p *AcademicServiceGetScoresArgs) GetReq() (v *GetScoresRequest) { - if !p.IsSetReq() { - return AcademicServiceGetScoresArgs_Req_DEFAULT - } - return p.Req -} - -var fieldIDToName_AcademicServiceGetScoresArgs = map[int16]string{ +var fieldIDToName_PaperServiceGetDownloadUrlArgs = map[int16]string{ 1: "req", } -func (p *AcademicServiceGetScoresArgs) IsSetReq() bool { +func (p *PaperServiceGetDownloadUrlArgs) IsSetReq() bool { return p.Req != nil } -func (p *AcademicServiceGetScoresArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *PaperServiceGetDownloadUrlArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -22423,7 +21868,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_AcademicServiceGetScoresArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaperServiceGetDownloadUrlArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -22433,8 +21878,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *AcademicServiceGetScoresArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetScoresRequest() +func (p *PaperServiceGetDownloadUrlArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetDownloadUrlRequest() if err := _field.Read(iprot); err != nil { return err } @@ -22442,10 +21887,9 @@ func (p *AcademicServiceGetScoresArgs) ReadField1(iprot thrift.TProtocol) error return nil } -func (p *AcademicServiceGetScoresArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *PaperServiceGetDownloadUrlArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetScores_args"); err != nil { + if err = oprot.WriteStructBegin("GetDownloadUrl_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -22471,7 +21915,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *AcademicServiceGetScoresArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *PaperServiceGetDownloadUrlArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -22488,43 +21932,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *AcademicServiceGetScoresArgs) String() string { +func (p *PaperServiceGetDownloadUrlArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("AcademicServiceGetScoresArgs(%+v)", *p) + return fmt.Sprintf("PaperServiceGetDownloadUrlArgs(%+v)", *p) } -type AcademicServiceGetScoresResult struct { - Success *GetScoresResponse `thrift:"success,0,optional"` +type PaperServiceGetDownloadUrlResult struct { + Success *GetDownloadUrlResponse `thrift:"success,0,optional"` } -func NewAcademicServiceGetScoresResult() *AcademicServiceGetScoresResult { - return &AcademicServiceGetScoresResult{} +func NewPaperServiceGetDownloadUrlResult() *PaperServiceGetDownloadUrlResult { + return &PaperServiceGetDownloadUrlResult{} } -func (p *AcademicServiceGetScoresResult) InitDefault() { +func (p *PaperServiceGetDownloadUrlResult) InitDefault() { } -var AcademicServiceGetScoresResult_Success_DEFAULT *GetScoresResponse +var PaperServiceGetDownloadUrlResult_Success_DEFAULT *GetDownloadUrlResponse -func (p *AcademicServiceGetScoresResult) GetSuccess() (v *GetScoresResponse) { +func (p *PaperServiceGetDownloadUrlResult) GetSuccess() (v *GetDownloadUrlResponse) { if !p.IsSetSuccess() { - return AcademicServiceGetScoresResult_Success_DEFAULT + return PaperServiceGetDownloadUrlResult_Success_DEFAULT } return p.Success } -var fieldIDToName_AcademicServiceGetScoresResult = map[int16]string{ +var fieldIDToName_PaperServiceGetDownloadUrlResult = map[int16]string{ 0: "success", } -func (p *AcademicServiceGetScoresResult) IsSetSuccess() bool { +func (p *PaperServiceGetDownloadUrlResult) IsSetSuccess() bool { return p.Success != nil } -func (p *AcademicServiceGetScoresResult) Read(iprot thrift.TProtocol) (err error) { +func (p *PaperServiceGetDownloadUrlResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -22570,7 +22014,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_AcademicServiceGetScoresResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaperServiceGetDownloadUrlResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -22580,8 +22024,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *AcademicServiceGetScoresResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetScoresResponse() +func (p *PaperServiceGetDownloadUrlResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetDownloadUrlResponse() if err := _field.Read(iprot); err != nil { return err } @@ -22589,10 +22033,9 @@ func (p *AcademicServiceGetScoresResult) ReadField0(iprot thrift.TProtocol) erro return nil } -func (p *AcademicServiceGetScoresResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *PaperServiceGetDownloadUrlResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetScores_result"); err != nil { + if err = oprot.WriteStructBegin("GetDownloadUrl_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -22618,7 +22061,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *AcademicServiceGetScoresResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *PaperServiceGetDownloadUrlResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -22637,43 +22080,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *AcademicServiceGetScoresResult) String() string { +func (p *PaperServiceGetDownloadUrlResult) String() string { if p == nil { return "" } - return fmt.Sprintf("AcademicServiceGetScoresResult(%+v)", *p) + return fmt.Sprintf("PaperServiceGetDownloadUrlResult(%+v)", *p) } -type AcademicServiceGetGPAArgs struct { - Req *GetGPARequest `thrift:"req,1"` +type PaperServiceListDirFilesForAndroidArgs struct { + Req *ListDirFilesForAndroidRequest `thrift:"req,1"` } -func NewAcademicServiceGetGPAArgs() *AcademicServiceGetGPAArgs { - return &AcademicServiceGetGPAArgs{} +func NewPaperServiceListDirFilesForAndroidArgs() *PaperServiceListDirFilesForAndroidArgs { + return &PaperServiceListDirFilesForAndroidArgs{} } -func (p *AcademicServiceGetGPAArgs) InitDefault() { +func (p *PaperServiceListDirFilesForAndroidArgs) InitDefault() { } -var AcademicServiceGetGPAArgs_Req_DEFAULT *GetGPARequest +var PaperServiceListDirFilesForAndroidArgs_Req_DEFAULT *ListDirFilesForAndroidRequest -func (p *AcademicServiceGetGPAArgs) GetReq() (v *GetGPARequest) { +func (p *PaperServiceListDirFilesForAndroidArgs) GetReq() (v *ListDirFilesForAndroidRequest) { if !p.IsSetReq() { - return AcademicServiceGetGPAArgs_Req_DEFAULT + return PaperServiceListDirFilesForAndroidArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_AcademicServiceGetGPAArgs = map[int16]string{ +var fieldIDToName_PaperServiceListDirFilesForAndroidArgs = map[int16]string{ 1: "req", } -func (p *AcademicServiceGetGPAArgs) IsSetReq() bool { +func (p *PaperServiceListDirFilesForAndroidArgs) IsSetReq() bool { return p.Req != nil } -func (p *AcademicServiceGetGPAArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *PaperServiceListDirFilesForAndroidArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -22719,7 +22162,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_AcademicServiceGetGPAArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaperServiceListDirFilesForAndroidArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -22729,8 +22172,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *AcademicServiceGetGPAArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetGPARequest() +func (p *PaperServiceListDirFilesForAndroidArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewListDirFilesForAndroidRequest() if err := _field.Read(iprot); err != nil { return err } @@ -22738,10 +22181,9 @@ func (p *AcademicServiceGetGPAArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *AcademicServiceGetGPAArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *PaperServiceListDirFilesForAndroidArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetGPA_args"); err != nil { + if err = oprot.WriteStructBegin("ListDirFilesForAndroid_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -22767,7 +22209,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *AcademicServiceGetGPAArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *PaperServiceListDirFilesForAndroidArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -22784,43 +22226,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *AcademicServiceGetGPAArgs) String() string { +func (p *PaperServiceListDirFilesForAndroidArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("AcademicServiceGetGPAArgs(%+v)", *p) + return fmt.Sprintf("PaperServiceListDirFilesForAndroidArgs(%+v)", *p) } -type AcademicServiceGetGPAResult struct { - Success *GetGPAResponse `thrift:"success,0,optional"` +type PaperServiceListDirFilesForAndroidResult struct { + Success *ListDirFilesForAndroidResponse `thrift:"success,0,optional"` } -func NewAcademicServiceGetGPAResult() *AcademicServiceGetGPAResult { - return &AcademicServiceGetGPAResult{} +func NewPaperServiceListDirFilesForAndroidResult() *PaperServiceListDirFilesForAndroidResult { + return &PaperServiceListDirFilesForAndroidResult{} } -func (p *AcademicServiceGetGPAResult) InitDefault() { +func (p *PaperServiceListDirFilesForAndroidResult) InitDefault() { } -var AcademicServiceGetGPAResult_Success_DEFAULT *GetGPAResponse +var PaperServiceListDirFilesForAndroidResult_Success_DEFAULT *ListDirFilesForAndroidResponse -func (p *AcademicServiceGetGPAResult) GetSuccess() (v *GetGPAResponse) { +func (p *PaperServiceListDirFilesForAndroidResult) GetSuccess() (v *ListDirFilesForAndroidResponse) { if !p.IsSetSuccess() { - return AcademicServiceGetGPAResult_Success_DEFAULT + return PaperServiceListDirFilesForAndroidResult_Success_DEFAULT } return p.Success } -var fieldIDToName_AcademicServiceGetGPAResult = map[int16]string{ +var fieldIDToName_PaperServiceListDirFilesForAndroidResult = map[int16]string{ 0: "success", } -func (p *AcademicServiceGetGPAResult) IsSetSuccess() bool { +func (p *PaperServiceListDirFilesForAndroidResult) IsSetSuccess() bool { return p.Success != nil } -func (p *AcademicServiceGetGPAResult) Read(iprot thrift.TProtocol) (err error) { +func (p *PaperServiceListDirFilesForAndroidResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -22866,7 +22308,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_AcademicServiceGetGPAResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaperServiceListDirFilesForAndroidResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -22876,8 +22318,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *AcademicServiceGetGPAResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetGPAResponse() +func (p *PaperServiceListDirFilesForAndroidResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewListDirFilesForAndroidResponse() if err := _field.Read(iprot); err != nil { return err } @@ -22885,10 +22327,9 @@ func (p *AcademicServiceGetGPAResult) ReadField0(iprot thrift.TProtocol) error { return nil } -func (p *AcademicServiceGetGPAResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *PaperServiceListDirFilesForAndroidResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetGPA_result"); err != nil { + if err = oprot.WriteStructBegin("ListDirFilesForAndroid_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -22914,7 +22355,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *AcademicServiceGetGPAResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *PaperServiceListDirFilesForAndroidResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -22933,43 +22374,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *AcademicServiceGetGPAResult) String() string { +func (p *PaperServiceListDirFilesForAndroidResult) String() string { if p == nil { return "" } - return fmt.Sprintf("AcademicServiceGetGPAResult(%+v)", *p) + return fmt.Sprintf("PaperServiceListDirFilesForAndroidResult(%+v)", *p) } -type AcademicServiceGetCreditArgs struct { - Req *GetCreditRequest `thrift:"req,1"` +type PaperServiceGetDownloadUrlForAndroidArgs struct { + Req *GetDownloadUrlForAndroidRequest `thrift:"req,1"` } -func NewAcademicServiceGetCreditArgs() *AcademicServiceGetCreditArgs { - return &AcademicServiceGetCreditArgs{} +func NewPaperServiceGetDownloadUrlForAndroidArgs() *PaperServiceGetDownloadUrlForAndroidArgs { + return &PaperServiceGetDownloadUrlForAndroidArgs{} } -func (p *AcademicServiceGetCreditArgs) InitDefault() { +func (p *PaperServiceGetDownloadUrlForAndroidArgs) InitDefault() { } -var AcademicServiceGetCreditArgs_Req_DEFAULT *GetCreditRequest +var PaperServiceGetDownloadUrlForAndroidArgs_Req_DEFAULT *GetDownloadUrlForAndroidRequest -func (p *AcademicServiceGetCreditArgs) GetReq() (v *GetCreditRequest) { +func (p *PaperServiceGetDownloadUrlForAndroidArgs) GetReq() (v *GetDownloadUrlForAndroidRequest) { if !p.IsSetReq() { - return AcademicServiceGetCreditArgs_Req_DEFAULT + return PaperServiceGetDownloadUrlForAndroidArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_AcademicServiceGetCreditArgs = map[int16]string{ +var fieldIDToName_PaperServiceGetDownloadUrlForAndroidArgs = map[int16]string{ 1: "req", } -func (p *AcademicServiceGetCreditArgs) IsSetReq() bool { +func (p *PaperServiceGetDownloadUrlForAndroidArgs) IsSetReq() bool { return p.Req != nil } -func (p *AcademicServiceGetCreditArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *PaperServiceGetDownloadUrlForAndroidArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -23015,7 +22456,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_AcademicServiceGetCreditArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaperServiceGetDownloadUrlForAndroidArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -23025,8 +22466,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *AcademicServiceGetCreditArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetCreditRequest() +func (p *PaperServiceGetDownloadUrlForAndroidArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetDownloadUrlForAndroidRequest() if err := _field.Read(iprot); err != nil { return err } @@ -23034,10 +22475,9 @@ func (p *AcademicServiceGetCreditArgs) ReadField1(iprot thrift.TProtocol) error return nil } -func (p *AcademicServiceGetCreditArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *PaperServiceGetDownloadUrlForAndroidArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetCredit_args"); err != nil { + if err = oprot.WriteStructBegin("GetDownloadUrlForAndroid_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -23063,7 +22503,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *AcademicServiceGetCreditArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *PaperServiceGetDownloadUrlForAndroidArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -23080,43 +22520,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *AcademicServiceGetCreditArgs) String() string { +func (p *PaperServiceGetDownloadUrlForAndroidArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("AcademicServiceGetCreditArgs(%+v)", *p) + return fmt.Sprintf("PaperServiceGetDownloadUrlForAndroidArgs(%+v)", *p) } -type AcademicServiceGetCreditResult struct { - Success *GetCreditResponse `thrift:"success,0,optional"` +type PaperServiceGetDownloadUrlForAndroidResult struct { + Success *GetDownloadUrlForAndroidResponse `thrift:"success,0,optional"` } -func NewAcademicServiceGetCreditResult() *AcademicServiceGetCreditResult { - return &AcademicServiceGetCreditResult{} +func NewPaperServiceGetDownloadUrlForAndroidResult() *PaperServiceGetDownloadUrlForAndroidResult { + return &PaperServiceGetDownloadUrlForAndroidResult{} } -func (p *AcademicServiceGetCreditResult) InitDefault() { +func (p *PaperServiceGetDownloadUrlForAndroidResult) InitDefault() { } -var AcademicServiceGetCreditResult_Success_DEFAULT *GetCreditResponse +var PaperServiceGetDownloadUrlForAndroidResult_Success_DEFAULT *GetDownloadUrlForAndroidResponse -func (p *AcademicServiceGetCreditResult) GetSuccess() (v *GetCreditResponse) { +func (p *PaperServiceGetDownloadUrlForAndroidResult) GetSuccess() (v *GetDownloadUrlForAndroidResponse) { if !p.IsSetSuccess() { - return AcademicServiceGetCreditResult_Success_DEFAULT + return PaperServiceGetDownloadUrlForAndroidResult_Success_DEFAULT } return p.Success } -var fieldIDToName_AcademicServiceGetCreditResult = map[int16]string{ +var fieldIDToName_PaperServiceGetDownloadUrlForAndroidResult = map[int16]string{ 0: "success", } -func (p *AcademicServiceGetCreditResult) IsSetSuccess() bool { +func (p *PaperServiceGetDownloadUrlForAndroidResult) IsSetSuccess() bool { return p.Success != nil } -func (p *AcademicServiceGetCreditResult) Read(iprot thrift.TProtocol) (err error) { +func (p *PaperServiceGetDownloadUrlForAndroidResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -23162,7 +22602,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_AcademicServiceGetCreditResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaperServiceGetDownloadUrlForAndroidResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -23172,8 +22612,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *AcademicServiceGetCreditResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetCreditResponse() +func (p *PaperServiceGetDownloadUrlForAndroidResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetDownloadUrlForAndroidResponse() if err := _field.Read(iprot); err != nil { return err } @@ -23181,10 +22621,9 @@ func (p *AcademicServiceGetCreditResult) ReadField0(iprot thrift.TProtocol) erro return nil } -func (p *AcademicServiceGetCreditResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *PaperServiceGetDownloadUrlForAndroidResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetCredit_result"); err != nil { + if err = oprot.WriteStructBegin("GetDownloadUrlForAndroid_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -23210,7 +22649,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *AcademicServiceGetCreditResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *PaperServiceGetDownloadUrlForAndroidResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -23229,190 +22668,279 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *AcademicServiceGetCreditResult) String() string { +func (p *PaperServiceGetDownloadUrlForAndroidResult) String() string { if p == nil { return "" } - return fmt.Sprintf("AcademicServiceGetCreditResult(%+v)", *p) - -} + return fmt.Sprintf("PaperServiceGetDownloadUrlForAndroidResult(%+v)", *p) -type AcademicServiceGetUnifiedExamArgs struct { - Req *GetUnifiedExamRequest `thrift:"req,1"` } -func NewAcademicServiceGetUnifiedExamArgs() *AcademicServiceGetUnifiedExamArgs { - return &AcademicServiceGetUnifiedExamArgs{} +type AcademicServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler AcademicService } -func (p *AcademicServiceGetUnifiedExamArgs) InitDefault() { +func (p *AcademicServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor } -var AcademicServiceGetUnifiedExamArgs_Req_DEFAULT *GetUnifiedExamRequest - -func (p *AcademicServiceGetUnifiedExamArgs) GetReq() (v *GetUnifiedExamRequest) { - if !p.IsSetReq() { - return AcademicServiceGetUnifiedExamArgs_Req_DEFAULT - } - return p.Req +func (p *AcademicServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok } -var fieldIDToName_AcademicServiceGetUnifiedExamArgs = map[int16]string{ - 1: "req", +func (p *AcademicServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap } -func (p *AcademicServiceGetUnifiedExamArgs) IsSetReq() bool { - return p.Req != nil +func NewAcademicServiceProcessor(handler AcademicService) *AcademicServiceProcessor { + self := &AcademicServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self.AddToProcessorMap("GetScores", &academicServiceProcessorGetScores{handler: handler}) + self.AddToProcessorMap("GetGPA", &academicServiceProcessorGetGPA{handler: handler}) + self.AddToProcessorMap("GetCredit", &academicServiceProcessorGetCredit{handler: handler}) + self.AddToProcessorMap("GetUnifiedExam", &academicServiceProcessorGetUnifiedExam{handler: handler}) + return self } - -func (p *AcademicServiceGetUnifiedExamArgs) 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 - } +func (p *AcademicServiceProcessor) 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 err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(ctx, seqId, iprot, oprot) } - - 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_AcademicServiceGetUnifiedExamArgs[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) + 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 } -func (p *AcademicServiceGetUnifiedExamArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetUnifiedExamRequest() - if err := _field.Read(iprot); err != nil { - return err - } - p.Req = _field - return nil +type academicServiceProcessorGetScores struct { + handler AcademicService } -func (p *AcademicServiceGetUnifiedExamArgs) Write(oprot thrift.TProtocol) (err error) { - - var fieldId int16 - if err = oprot.WriteStructBegin("GetUnifiedExam_args"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } +func (p *academicServiceProcessorGetScores) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AcademicServiceGetScoresArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetScores", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError + + iprot.ReadMessageEnd() + var err2 error + result := AcademicServiceGetScoresResult{} + var retval *GetScoresResponse + if retval, err2 = p.handler.GetScores(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetScores: "+err2.Error()) + oprot.WriteMessageBegin("GetScores", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError + if err2 = oprot.WriteMessageBegin("GetScores", thrift.REPLY, seqId); err2 != nil { + err = err2 } - 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 *AcademicServiceGetUnifiedExamArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 } - if err := p.Req.Write(oprot); err != nil { - return err + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 } - 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 *AcademicServiceGetUnifiedExamArgs) String() string { - if p == nil { - return "" + if err != nil { + return } - return fmt.Sprintf("AcademicServiceGetUnifiedExamArgs(%+v)", *p) - -} - -type AcademicServiceGetUnifiedExamResult struct { - Success *GetUnifiedExamResponse `thrift:"success,0,optional"` -} - -func NewAcademicServiceGetUnifiedExamResult() *AcademicServiceGetUnifiedExamResult { - return &AcademicServiceGetUnifiedExamResult{} + return true, err } -func (p *AcademicServiceGetUnifiedExamResult) InitDefault() { +type academicServiceProcessorGetGPA struct { + handler AcademicService } -var AcademicServiceGetUnifiedExamResult_Success_DEFAULT *GetUnifiedExamResponse +func (p *academicServiceProcessorGetGPA) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AcademicServiceGetGPAArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetGPA", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } -func (p *AcademicServiceGetUnifiedExamResult) GetSuccess() (v *GetUnifiedExamResponse) { - if !p.IsSetSuccess() { - return AcademicServiceGetUnifiedExamResult_Success_DEFAULT + iprot.ReadMessageEnd() + var err2 error + result := AcademicServiceGetGPAResult{} + var retval *GetGPAResponse + if retval, err2 = p.handler.GetGPA(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetGPA: "+err2.Error()) + oprot.WriteMessageBegin("GetGPA", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval } - return p.Success + if err2 = oprot.WriteMessageBegin("GetGPA", 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 } -var fieldIDToName_AcademicServiceGetUnifiedExamResult = map[int16]string{ - 0: "success", +type academicServiceProcessorGetCredit struct { + handler AcademicService } -func (p *AcademicServiceGetUnifiedExamResult) IsSetSuccess() bool { - return p.Success != nil +func (p *academicServiceProcessorGetCredit) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AcademicServiceGetCreditArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetCredit", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := AcademicServiceGetCreditResult{} + var retval *GetCreditResponse + if retval, err2 = p.handler.GetCredit(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCredit: "+err2.Error()) + oprot.WriteMessageBegin("GetCredit", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetCredit", 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 } -func (p *AcademicServiceGetUnifiedExamResult) Read(iprot thrift.TProtocol) (err error) { +type academicServiceProcessorGetUnifiedExam struct { + handler AcademicService +} + +func (p *academicServiceProcessorGetUnifiedExam) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AcademicServiceGetUnifiedExamArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetUnifiedExam", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := AcademicServiceGetUnifiedExamResult{} + var retval *GetUnifiedExamResponse + if retval, err2 = p.handler.GetUnifiedExam(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetUnifiedExam: "+err2.Error()) + oprot.WriteMessageBegin("GetUnifiedExam", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetUnifiedExam", 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 AcademicServiceGetScoresArgs struct { + Req *GetScoresRequest `thrift:"req,1"` +} + +func NewAcademicServiceGetScoresArgs() *AcademicServiceGetScoresArgs { + return &AcademicServiceGetScoresArgs{} +} + +func (p *AcademicServiceGetScoresArgs) InitDefault() { +} + +var AcademicServiceGetScoresArgs_Req_DEFAULT *GetScoresRequest + +func (p *AcademicServiceGetScoresArgs) GetReq() (v *GetScoresRequest) { + if !p.IsSetReq() { + return AcademicServiceGetScoresArgs_Req_DEFAULT + } + return p.Req +} + +var fieldIDToName_AcademicServiceGetScoresArgs = map[int16]string{ + 1: "req", +} + +func (p *AcademicServiceGetScoresArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AcademicServiceGetScoresArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -23431,9 +22959,9 @@ func (p *AcademicServiceGetUnifiedExamResult) Read(iprot thrift.TProtocol) (err } switch fieldId { - case 0: + case 1: if fieldTypeId == thrift.STRUCT { - if err = p.ReadField0(iprot); err != nil { + if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } } else if err = iprot.Skip(fieldTypeId); err != nil { @@ -23458,7 +22986,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_AcademicServiceGetUnifiedExamResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AcademicServiceGetScoresArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -23468,24 +22996,23 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *AcademicServiceGetUnifiedExamResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetUnifiedExamResponse() +func (p *AcademicServiceGetScoresArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetScoresRequest() if err := _field.Read(iprot); err != nil { return err } - p.Success = _field + p.Req = _field return nil } -func (p *AcademicServiceGetUnifiedExamResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *AcademicServiceGetScoresArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetUnifiedExam_result"); err != nil { + if err = oprot.WriteStructBegin("GetScores_args"); err != nil { goto WriteStructBeginError } if p != nil { - if err = p.writeField0(oprot); err != nil { - fieldId = 0 + if err = p.writeField1(oprot); err != nil { + fieldId = 1 goto WriteFieldError } } @@ -23506,391 +23033,1419 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *AcademicServiceGetUnifiedExamResult) 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 - } +func (p *AcademicServiceGetScoresArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError } return nil WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *AcademicServiceGetUnifiedExamResult) String() string { +func (p *AcademicServiceGetScoresArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("AcademicServiceGetUnifiedExamResult(%+v)", *p) + return fmt.Sprintf("AcademicServiceGetScoresArgs(%+v)", *p) } -type VersionServiceProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler VersionService +type AcademicServiceGetScoresResult struct { + Success *GetScoresResponse `thrift:"success,0,optional"` } -func (p *VersionServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor +func NewAcademicServiceGetScoresResult() *AcademicServiceGetScoresResult { + return &AcademicServiceGetScoresResult{} } -func (p *VersionServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok +func (p *AcademicServiceGetScoresResult) InitDefault() { } -func (p *VersionServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap +var AcademicServiceGetScoresResult_Success_DEFAULT *GetScoresResponse + +func (p *AcademicServiceGetScoresResult) GetSuccess() (v *GetScoresResponse) { + if !p.IsSetSuccess() { + return AcademicServiceGetScoresResult_Success_DEFAULT + } + return p.Success } -func NewVersionServiceProcessor(handler VersionService) *VersionServiceProcessor { - self := &VersionServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} - self.AddToProcessorMap("Login", &versionServiceProcessorLogin{handler: handler}) - self.AddToProcessorMap("UploadVersion", &versionServiceProcessorUploadVersion{handler: handler}) - self.AddToProcessorMap("UploadParams", &versionServiceProcessorUploadParams{handler: handler}) - self.AddToProcessorMap("DownloadReleaseApk", &versionServiceProcessorDownloadReleaseApk{handler: handler}) - self.AddToProcessorMap("DownloadBetaApk", &versionServiceProcessorDownloadBetaApk{handler: handler}) - self.AddToProcessorMap("GetReleaseVersion", &versionServiceProcessorGetReleaseVersion{handler: handler}) - self.AddToProcessorMap("GetBetaVersion", &versionServiceProcessorGetBetaVersion{handler: handler}) - self.AddToProcessorMap("GetSetting", &versionServiceProcessorGetSetting{handler: handler}) - self.AddToProcessorMap("GetTest", &versionServiceProcessorGetTest{handler: handler}) - self.AddToProcessorMap("GetCloud", &versionServiceProcessorGetCloud{handler: handler}) - self.AddToProcessorMap("SetCloud", &versionServiceProcessorSetCloud{handler: handler}) - self.AddToProcessorMap("GetDump", &versionServiceProcessorGetDump{handler: handler}) - return self -} -func (p *VersionServiceProcessor) 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 +var fieldIDToName_AcademicServiceGetScoresResult = map[int16]string{ + 0: "success", } -type versionServiceProcessorLogin struct { - handler VersionService +func (p *AcademicServiceGetScoresResult) IsSetSuccess() bool { + return p.Success != nil } -func (p *versionServiceProcessorLogin) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := VersionServiceLoginArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("Login", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } +func (p *AcademicServiceGetScoresResult) Read(iprot thrift.TProtocol) (err error) { - iprot.ReadMessageEnd() - var err2 error - result := VersionServiceLoginResult{} - var retval *LoginResponse - if retval, err2 = p.handler.Login(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing Login: "+err2.Error()) - oprot.WriteMessageBegin("Login", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("Login", 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 + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + + 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 != nil { - return + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError } - return true, err -} -type versionServiceProcessorUploadVersion struct { - handler VersionService + 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_AcademicServiceGetScoresResult[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 *versionServiceProcessorUploadVersion) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := VersionServiceUploadVersionArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("UploadVersion", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *AcademicServiceGetScoresResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetScoresResponse() + if err := _field.Read(iprot); err != nil { + return err } + p.Success = _field + return nil +} - iprot.ReadMessageEnd() - var err2 error - result := VersionServiceUploadVersionResult{} - var retval *UploadResponse - if retval, err2 = p.handler.UploadVersion(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing UploadVersion: "+err2.Error()) - oprot.WriteMessageBegin("UploadVersion", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("UploadVersion", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 +func (p *AcademicServiceGetScoresResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetScores_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 versionServiceProcessorUploadParams struct { - handler VersionService +func (p *AcademicServiceGetScoresResult) 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 *versionServiceProcessorUploadParams) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := VersionServiceUploadParamsArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("UploadParams", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *AcademicServiceGetScoresResult) String() string { + if p == nil { + return "" } + return fmt.Sprintf("AcademicServiceGetScoresResult(%+v)", *p) - iprot.ReadMessageEnd() - var err2 error - result := VersionServiceUploadParamsResult{} - var retval *UploadParamsResponse - if retval, err2 = p.handler.UploadParams(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing UploadParams: "+err2.Error()) - oprot.WriteMessageBegin("UploadParams", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("UploadParams", 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 versionServiceProcessorDownloadReleaseApk struct { - handler VersionService +type AcademicServiceGetGPAArgs struct { + Req *GetGPARequest `thrift:"req,1"` } -func (p *versionServiceProcessorDownloadReleaseApk) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := VersionServiceDownloadReleaseApkArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("DownloadReleaseApk", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } +func NewAcademicServiceGetGPAArgs() *AcademicServiceGetGPAArgs { + return &AcademicServiceGetGPAArgs{} +} - iprot.ReadMessageEnd() - var err2 error - result := VersionServiceDownloadReleaseApkResult{} - var retval *DownloadReleaseApkResponse - if retval, err2 = p.handler.DownloadReleaseApk(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing DownloadReleaseApk: "+err2.Error()) - oprot.WriteMessageBegin("DownloadReleaseApk", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("DownloadReleaseApk", 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 +func (p *AcademicServiceGetGPAArgs) InitDefault() { +} + +var AcademicServiceGetGPAArgs_Req_DEFAULT *GetGPARequest + +func (p *AcademicServiceGetGPAArgs) GetReq() (v *GetGPARequest) { + if !p.IsSetReq() { + return AcademicServiceGetGPAArgs_Req_DEFAULT } - return true, err + return p.Req } -type versionServiceProcessorDownloadBetaApk struct { - handler VersionService +var fieldIDToName_AcademicServiceGetGPAArgs = map[int16]string{ + 1: "req", } -func (p *versionServiceProcessorDownloadBetaApk) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := VersionServiceDownloadBetaApkArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("DownloadBetaApk", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } +func (p *AcademicServiceGetGPAArgs) IsSetReq() bool { + return p.Req != nil +} - iprot.ReadMessageEnd() - var err2 error - result := VersionServiceDownloadBetaApkResult{} - var retval *DownloadBetaApkResponse - if retval, err2 = p.handler.DownloadBetaApk(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing DownloadBetaApk: "+err2.Error()) - oprot.WriteMessageBegin("DownloadBetaApk", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("DownloadBetaApk", 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 *AcademicServiceGetGPAArgs) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + + 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 != nil { - return + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError } - return true, err -} -type versionServiceProcessorGetReleaseVersion struct { - handler VersionService + 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_AcademicServiceGetGPAArgs[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 *versionServiceProcessorGetReleaseVersion) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := VersionServiceGetReleaseVersionArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetReleaseVersion", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *AcademicServiceGetGPAArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetGPARequest() + if err := _field.Read(iprot); err != nil { + return err } + p.Req = _field + return nil +} - iprot.ReadMessageEnd() - var err2 error - result := VersionServiceGetReleaseVersionResult{} - var retval *GetReleaseVersionResponse - if retval, err2 = p.handler.GetReleaseVersion(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetReleaseVersion: "+err2.Error()) - oprot.WriteMessageBegin("GetReleaseVersion", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval +func (p *AcademicServiceGetGPAArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetGPA_args"); err != nil { + goto WriteStructBeginError } - if err2 = oprot.WriteMessageBegin("GetReleaseVersion", thrift.REPLY, seqId); err2 != nil { - err = err2 + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + 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 *AcademicServiceGetGPAArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError } - if err != nil { - return + if err := p.Req.Write(oprot); err != nil { + return err } - return true, 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) } -type versionServiceProcessorGetBetaVersion struct { - handler VersionService +func (p *AcademicServiceGetGPAArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AcademicServiceGetGPAArgs(%+v)", *p) + } -func (p *versionServiceProcessorGetBetaVersion) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := VersionServiceGetBetaVersionArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetBetaVersion", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +type AcademicServiceGetGPAResult struct { + Success *GetGPAResponse `thrift:"success,0,optional"` +} + +func NewAcademicServiceGetGPAResult() *AcademicServiceGetGPAResult { + return &AcademicServiceGetGPAResult{} +} + +func (p *AcademicServiceGetGPAResult) InitDefault() { +} + +var AcademicServiceGetGPAResult_Success_DEFAULT *GetGPAResponse + +func (p *AcademicServiceGetGPAResult) GetSuccess() (v *GetGPAResponse) { + if !p.IsSetSuccess() { + return AcademicServiceGetGPAResult_Success_DEFAULT } + return p.Success +} - iprot.ReadMessageEnd() - var err2 error +var fieldIDToName_AcademicServiceGetGPAResult = map[int16]string{ + 0: "success", +} + +func (p *AcademicServiceGetGPAResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AcademicServiceGetGPAResult) 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_AcademicServiceGetGPAResult[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 *AcademicServiceGetGPAResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetGPAResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *AcademicServiceGetGPAResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetGPA_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 *AcademicServiceGetGPAResult) 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 *AcademicServiceGetGPAResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AcademicServiceGetGPAResult(%+v)", *p) + +} + +type AcademicServiceGetCreditArgs struct { + Req *GetCreditRequest `thrift:"req,1"` +} + +func NewAcademicServiceGetCreditArgs() *AcademicServiceGetCreditArgs { + return &AcademicServiceGetCreditArgs{} +} + +func (p *AcademicServiceGetCreditArgs) InitDefault() { +} + +var AcademicServiceGetCreditArgs_Req_DEFAULT *GetCreditRequest + +func (p *AcademicServiceGetCreditArgs) GetReq() (v *GetCreditRequest) { + if !p.IsSetReq() { + return AcademicServiceGetCreditArgs_Req_DEFAULT + } + return p.Req +} + +var fieldIDToName_AcademicServiceGetCreditArgs = map[int16]string{ + 1: "req", +} + +func (p *AcademicServiceGetCreditArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AcademicServiceGetCreditArgs) 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_AcademicServiceGetCreditArgs[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 *AcademicServiceGetCreditArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetCreditRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *AcademicServiceGetCreditArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetCredit_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 *AcademicServiceGetCreditArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *AcademicServiceGetCreditArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AcademicServiceGetCreditArgs(%+v)", *p) + +} + +type AcademicServiceGetCreditResult struct { + Success *GetCreditResponse `thrift:"success,0,optional"` +} + +func NewAcademicServiceGetCreditResult() *AcademicServiceGetCreditResult { + return &AcademicServiceGetCreditResult{} +} + +func (p *AcademicServiceGetCreditResult) InitDefault() { +} + +var AcademicServiceGetCreditResult_Success_DEFAULT *GetCreditResponse + +func (p *AcademicServiceGetCreditResult) GetSuccess() (v *GetCreditResponse) { + if !p.IsSetSuccess() { + return AcademicServiceGetCreditResult_Success_DEFAULT + } + return p.Success +} + +var fieldIDToName_AcademicServiceGetCreditResult = map[int16]string{ + 0: "success", +} + +func (p *AcademicServiceGetCreditResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AcademicServiceGetCreditResult) 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_AcademicServiceGetCreditResult[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 *AcademicServiceGetCreditResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetCreditResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *AcademicServiceGetCreditResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetCredit_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 *AcademicServiceGetCreditResult) 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 *AcademicServiceGetCreditResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AcademicServiceGetCreditResult(%+v)", *p) + +} + +type AcademicServiceGetUnifiedExamArgs struct { + Req *GetUnifiedExamRequest `thrift:"req,1"` +} + +func NewAcademicServiceGetUnifiedExamArgs() *AcademicServiceGetUnifiedExamArgs { + return &AcademicServiceGetUnifiedExamArgs{} +} + +func (p *AcademicServiceGetUnifiedExamArgs) InitDefault() { +} + +var AcademicServiceGetUnifiedExamArgs_Req_DEFAULT *GetUnifiedExamRequest + +func (p *AcademicServiceGetUnifiedExamArgs) GetReq() (v *GetUnifiedExamRequest) { + if !p.IsSetReq() { + return AcademicServiceGetUnifiedExamArgs_Req_DEFAULT + } + return p.Req +} + +var fieldIDToName_AcademicServiceGetUnifiedExamArgs = map[int16]string{ + 1: "req", +} + +func (p *AcademicServiceGetUnifiedExamArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AcademicServiceGetUnifiedExamArgs) 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_AcademicServiceGetUnifiedExamArgs[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 *AcademicServiceGetUnifiedExamArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetUnifiedExamRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *AcademicServiceGetUnifiedExamArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetUnifiedExam_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 *AcademicServiceGetUnifiedExamArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *AcademicServiceGetUnifiedExamArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AcademicServiceGetUnifiedExamArgs(%+v)", *p) + +} + +type AcademicServiceGetUnifiedExamResult struct { + Success *GetUnifiedExamResponse `thrift:"success,0,optional"` +} + +func NewAcademicServiceGetUnifiedExamResult() *AcademicServiceGetUnifiedExamResult { + return &AcademicServiceGetUnifiedExamResult{} +} + +func (p *AcademicServiceGetUnifiedExamResult) InitDefault() { +} + +var AcademicServiceGetUnifiedExamResult_Success_DEFAULT *GetUnifiedExamResponse + +func (p *AcademicServiceGetUnifiedExamResult) GetSuccess() (v *GetUnifiedExamResponse) { + if !p.IsSetSuccess() { + return AcademicServiceGetUnifiedExamResult_Success_DEFAULT + } + return p.Success +} + +var fieldIDToName_AcademicServiceGetUnifiedExamResult = map[int16]string{ + 0: "success", +} + +func (p *AcademicServiceGetUnifiedExamResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AcademicServiceGetUnifiedExamResult) 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_AcademicServiceGetUnifiedExamResult[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 *AcademicServiceGetUnifiedExamResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetUnifiedExamResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *AcademicServiceGetUnifiedExamResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetUnifiedExam_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 *AcademicServiceGetUnifiedExamResult) 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 *AcademicServiceGetUnifiedExamResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AcademicServiceGetUnifiedExamResult(%+v)", *p) + +} + +type VersionServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler VersionService +} + +func (p *VersionServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *VersionServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *VersionServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewVersionServiceProcessor(handler VersionService) *VersionServiceProcessor { + self := &VersionServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self.AddToProcessorMap("Login", &versionServiceProcessorLogin{handler: handler}) + self.AddToProcessorMap("UploadVersion", &versionServiceProcessorUploadVersion{handler: handler}) + self.AddToProcessorMap("UploadParams", &versionServiceProcessorUploadParams{handler: handler}) + self.AddToProcessorMap("DownloadReleaseApk", &versionServiceProcessorDownloadReleaseApk{handler: handler}) + self.AddToProcessorMap("DownloadBetaApk", &versionServiceProcessorDownloadBetaApk{handler: handler}) + self.AddToProcessorMap("GetReleaseVersion", &versionServiceProcessorGetReleaseVersion{handler: handler}) + self.AddToProcessorMap("GetBetaVersion", &versionServiceProcessorGetBetaVersion{handler: handler}) + self.AddToProcessorMap("GetSetting", &versionServiceProcessorGetSetting{handler: handler}) + self.AddToProcessorMap("GetTest", &versionServiceProcessorGetTest{handler: handler}) + self.AddToProcessorMap("GetCloud", &versionServiceProcessorGetCloud{handler: handler}) + self.AddToProcessorMap("SetCloud", &versionServiceProcessorSetCloud{handler: handler}) + self.AddToProcessorMap("GetDump", &versionServiceProcessorGetDump{handler: handler}) + return self +} +func (p *VersionServiceProcessor) 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 versionServiceProcessorLogin struct { + handler VersionService +} + +func (p *versionServiceProcessorLogin) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := VersionServiceLoginArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("Login", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := VersionServiceLoginResult{} + var retval *LoginResponse + if retval, err2 = p.handler.Login(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing Login: "+err2.Error()) + oprot.WriteMessageBegin("Login", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("Login", 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 versionServiceProcessorUploadVersion struct { + handler VersionService +} + +func (p *versionServiceProcessorUploadVersion) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := VersionServiceUploadVersionArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("UploadVersion", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := VersionServiceUploadVersionResult{} + var retval *UploadResponse + if retval, err2 = p.handler.UploadVersion(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing UploadVersion: "+err2.Error()) + oprot.WriteMessageBegin("UploadVersion", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("UploadVersion", 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 versionServiceProcessorUploadParams struct { + handler VersionService +} + +func (p *versionServiceProcessorUploadParams) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := VersionServiceUploadParamsArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("UploadParams", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := VersionServiceUploadParamsResult{} + var retval *UploadParamsResponse + if retval, err2 = p.handler.UploadParams(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing UploadParams: "+err2.Error()) + oprot.WriteMessageBegin("UploadParams", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("UploadParams", 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 versionServiceProcessorDownloadReleaseApk struct { + handler VersionService +} + +func (p *versionServiceProcessorDownloadReleaseApk) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := VersionServiceDownloadReleaseApkArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("DownloadReleaseApk", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := VersionServiceDownloadReleaseApkResult{} + var retval *DownloadReleaseApkResponse + if retval, err2 = p.handler.DownloadReleaseApk(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing DownloadReleaseApk: "+err2.Error()) + oprot.WriteMessageBegin("DownloadReleaseApk", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("DownloadReleaseApk", 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 versionServiceProcessorDownloadBetaApk struct { + handler VersionService +} + +func (p *versionServiceProcessorDownloadBetaApk) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := VersionServiceDownloadBetaApkArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("DownloadBetaApk", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := VersionServiceDownloadBetaApkResult{} + var retval *DownloadBetaApkResponse + if retval, err2 = p.handler.DownloadBetaApk(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing DownloadBetaApk: "+err2.Error()) + oprot.WriteMessageBegin("DownloadBetaApk", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("DownloadBetaApk", 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 versionServiceProcessorGetReleaseVersion struct { + handler VersionService +} + +func (p *versionServiceProcessorGetReleaseVersion) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := VersionServiceGetReleaseVersionArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetReleaseVersion", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := VersionServiceGetReleaseVersionResult{} + var retval *GetReleaseVersionResponse + if retval, err2 = p.handler.GetReleaseVersion(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetReleaseVersion: "+err2.Error()) + oprot.WriteMessageBegin("GetReleaseVersion", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetReleaseVersion", 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 versionServiceProcessorGetBetaVersion struct { + handler VersionService +} + +func (p *versionServiceProcessorGetBetaVersion) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := VersionServiceGetBetaVersionArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetBetaVersion", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error result := VersionServiceGetBetaVersionResult{} var retval *GetBetaVersionResponse if retval, err2 = p.handler.GetBetaVersion(ctx, args.Req); err2 != nil { @@ -23903,293 +24458,881 @@ func (p *versionServiceProcessorGetBetaVersion) Process(ctx context.Context, seq } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("GetBetaVersion", thrift.REPLY, seqId); err2 != nil { - err = err2 + if err2 = oprot.WriteMessageBegin("GetBetaVersion", 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 versionServiceProcessorGetSetting struct { + handler VersionService +} + +func (p *versionServiceProcessorGetSetting) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := VersionServiceGetSettingArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetSetting", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := VersionServiceGetSettingResult{} + var retval *GetSettingResponse + if retval, err2 = p.handler.GetSetting(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetSetting: "+err2.Error()) + oprot.WriteMessageBegin("GetSetting", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetSetting", 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 versionServiceProcessorGetTest struct { + handler VersionService +} + +func (p *versionServiceProcessorGetTest) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := VersionServiceGetTestArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetTest", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := VersionServiceGetTestResult{} + var retval *GetTestResponse + if retval, err2 = p.handler.GetTest(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTest: "+err2.Error()) + oprot.WriteMessageBegin("GetTest", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetTest", 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 versionServiceProcessorGetCloud struct { + handler VersionService +} + +func (p *versionServiceProcessorGetCloud) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := VersionServiceGetCloudArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetCloud", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := VersionServiceGetCloudResult{} + var retval *GetCloudResponse + if retval, err2 = p.handler.GetCloud(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCloud: "+err2.Error()) + oprot.WriteMessageBegin("GetCloud", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetCloud", 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 versionServiceProcessorSetCloud struct { + handler VersionService +} + +func (p *versionServiceProcessorSetCloud) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := VersionServiceSetCloudArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("SetCloud", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := VersionServiceSetCloudResult{} + var retval *SetCloudResponse + if retval, err2 = p.handler.SetCloud(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing SetCloud: "+err2.Error()) + oprot.WriteMessageBegin("SetCloud", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("SetCloud", 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 versionServiceProcessorGetDump struct { + handler VersionService +} + +func (p *versionServiceProcessorGetDump) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := VersionServiceGetDumpArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetDump", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := VersionServiceGetDumpResult{} + var retval *GetDumpResponse + if retval, err2 = p.handler.GetDump(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetDump: "+err2.Error()) + oprot.WriteMessageBegin("GetDump", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetDump", 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 VersionServiceLoginArgs struct { + Req *LoginRequest `thrift:"req,1"` +} + +func NewVersionServiceLoginArgs() *VersionServiceLoginArgs { + return &VersionServiceLoginArgs{} +} + +func (p *VersionServiceLoginArgs) InitDefault() { +} + +var VersionServiceLoginArgs_Req_DEFAULT *LoginRequest + +func (p *VersionServiceLoginArgs) GetReq() (v *LoginRequest) { + if !p.IsSetReq() { + return VersionServiceLoginArgs_Req_DEFAULT + } + return p.Req +} + +var fieldIDToName_VersionServiceLoginArgs = map[int16]string{ + 1: "req", +} + +func (p *VersionServiceLoginArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *VersionServiceLoginArgs) 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_VersionServiceLoginArgs[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 *VersionServiceLoginArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewLoginRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *VersionServiceLoginArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Login_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 *VersionServiceLoginArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *VersionServiceLoginArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VersionServiceLoginArgs(%+v)", *p) + +} + +type VersionServiceLoginResult struct { + Success *LoginResponse `thrift:"success,0,optional"` +} + +func NewVersionServiceLoginResult() *VersionServiceLoginResult { + return &VersionServiceLoginResult{} +} + +func (p *VersionServiceLoginResult) InitDefault() { +} + +var VersionServiceLoginResult_Success_DEFAULT *LoginResponse + +func (p *VersionServiceLoginResult) GetSuccess() (v *LoginResponse) { + if !p.IsSetSuccess() { + return VersionServiceLoginResult_Success_DEFAULT + } + return p.Success +} + +var fieldIDToName_VersionServiceLoginResult = map[int16]string{ + 0: "success", +} + +func (p *VersionServiceLoginResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *VersionServiceLoginResult) 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 } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + + 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_VersionServiceLoginResult[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 *VersionServiceLoginResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewLoginResponse() + if err := _field.Read(iprot); err != nil { + return err } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + p.Success = _field + return nil +} + +func (p *VersionServiceLoginResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Login_result"); err != nil { + goto WriteStructBeginError } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } } - if err != nil { - return + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError } - return true, err + 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) } -type versionServiceProcessorGetSetting struct { - handler VersionService +func (p *VersionServiceLoginResult) 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 *versionServiceProcessorGetSetting) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := VersionServiceGetSettingArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetSetting", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *VersionServiceLoginResult) String() string { + if p == nil { + return "" } + return fmt.Sprintf("VersionServiceLoginResult(%+v)", *p) - iprot.ReadMessageEnd() - var err2 error - result := VersionServiceGetSettingResult{} - var retval *GetSettingResponse - if retval, err2 = p.handler.GetSetting(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetSetting: "+err2.Error()) - oprot.WriteMessageBegin("GetSetting", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval +} + +type VersionServiceUploadVersionArgs struct { + Req *UploadRequest `thrift:"req,1"` +} + +func NewVersionServiceUploadVersionArgs() *VersionServiceUploadVersionArgs { + return &VersionServiceUploadVersionArgs{} +} + +func (p *VersionServiceUploadVersionArgs) InitDefault() { +} + +var VersionServiceUploadVersionArgs_Req_DEFAULT *UploadRequest + +func (p *VersionServiceUploadVersionArgs) GetReq() (v *UploadRequest) { + if !p.IsSetReq() { + return VersionServiceUploadVersionArgs_Req_DEFAULT } - if err2 = oprot.WriteMessageBegin("GetSetting", thrift.REPLY, seqId); err2 != nil { - err = err2 + return p.Req +} + +var fieldIDToName_VersionServiceUploadVersionArgs = map[int16]string{ + 1: "req", +} + +func (p *VersionServiceUploadVersionArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *VersionServiceUploadVersionArgs) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + + 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 err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + 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_VersionServiceUploadVersionArgs[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 *VersionServiceUploadVersionArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewUploadRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *VersionServiceUploadVersionArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("UploadVersion_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 *VersionServiceUploadVersionArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + if err := p.Req.Write(oprot); err != nil { + return err } - if err != nil { - return + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError } - return true, err + 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) } -type versionServiceProcessorGetTest struct { - handler VersionService +func (p *VersionServiceUploadVersionArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VersionServiceUploadVersionArgs(%+v)", *p) + } -func (p *versionServiceProcessorGetTest) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := VersionServiceGetTestArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetTest", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } +type VersionServiceUploadVersionResult struct { + Success *UploadResponse `thrift:"success,0,optional"` +} - iprot.ReadMessageEnd() - var err2 error - result := VersionServiceGetTestResult{} - var retval *GetTestResponse - if retval, err2 = p.handler.GetTest(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTest: "+err2.Error()) - oprot.WriteMessageBegin("GetTest", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("GetTest", 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 +func NewVersionServiceUploadVersionResult() *VersionServiceUploadVersionResult { + return &VersionServiceUploadVersionResult{} } -type versionServiceProcessorGetCloud struct { - handler VersionService +func (p *VersionServiceUploadVersionResult) InitDefault() { } -func (p *versionServiceProcessorGetCloud) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := VersionServiceGetCloudArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetCloud", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } +var VersionServiceUploadVersionResult_Success_DEFAULT *UploadResponse - iprot.ReadMessageEnd() - var err2 error - result := VersionServiceGetCloudResult{} - var retval *GetCloudResponse - if retval, err2 = p.handler.GetCloud(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCloud: "+err2.Error()) - oprot.WriteMessageBegin("GetCloud", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("GetCloud", 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 +func (p *VersionServiceUploadVersionResult) GetSuccess() (v *UploadResponse) { + if !p.IsSetSuccess() { + return VersionServiceUploadVersionResult_Success_DEFAULT } - return true, err + return p.Success } -type versionServiceProcessorSetCloud struct { - handler VersionService +var fieldIDToName_VersionServiceUploadVersionResult = map[int16]string{ + 0: "success", } -func (p *versionServiceProcessorSetCloud) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := VersionServiceSetCloudArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("SetCloud", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } +func (p *VersionServiceUploadVersionResult) IsSetSuccess() bool { + return p.Success != nil +} - iprot.ReadMessageEnd() - var err2 error - result := VersionServiceSetCloudResult{} - var retval *SetCloudResponse - if retval, err2 = p.handler.SetCloud(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing SetCloud: "+err2.Error()) - oprot.WriteMessageBegin("SetCloud", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("SetCloud", 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 *VersionServiceUploadVersionResult) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + + 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 != nil { - return + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError } - return true, err -} -type versionServiceProcessorGetDump struct { - handler VersionService + 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_VersionServiceUploadVersionResult[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 *versionServiceProcessorGetDump) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := VersionServiceGetDumpArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetDump", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *VersionServiceUploadVersionResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewUploadResponse() + if err := _field.Read(iprot); err != nil { + return err } + p.Success = _field + return nil +} - iprot.ReadMessageEnd() - var err2 error - result := VersionServiceGetDumpResult{} - var retval *GetDumpResponse - if retval, err2 = p.handler.GetDump(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetDump: "+err2.Error()) - oprot.WriteMessageBegin("GetDump", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval +func (p *VersionServiceUploadVersionResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("UploadVersion_result"); err != nil { + goto WriteStructBeginError } - if err2 = oprot.WriteMessageBegin("GetDump", thrift.REPLY, seqId); err2 != nil { - err = err2 + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + 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 *VersionServiceUploadVersionResult) 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 + } } - if err != nil { - return + 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 *VersionServiceUploadVersionResult) String() string { + if p == nil { + return "" } - return true, err + return fmt.Sprintf("VersionServiceUploadVersionResult(%+v)", *p) + } -type VersionServiceLoginArgs struct { - Req *LoginRequest `thrift:"req,1"` +type VersionServiceUploadParamsArgs struct { + Req *UploadParamsRequest `thrift:"req,1"` } -func NewVersionServiceLoginArgs() *VersionServiceLoginArgs { - return &VersionServiceLoginArgs{} +func NewVersionServiceUploadParamsArgs() *VersionServiceUploadParamsArgs { + return &VersionServiceUploadParamsArgs{} } -func (p *VersionServiceLoginArgs) InitDefault() { +func (p *VersionServiceUploadParamsArgs) InitDefault() { } -var VersionServiceLoginArgs_Req_DEFAULT *LoginRequest +var VersionServiceUploadParamsArgs_Req_DEFAULT *UploadParamsRequest -func (p *VersionServiceLoginArgs) GetReq() (v *LoginRequest) { +func (p *VersionServiceUploadParamsArgs) GetReq() (v *UploadParamsRequest) { if !p.IsSetReq() { - return VersionServiceLoginArgs_Req_DEFAULT + return VersionServiceUploadParamsArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_VersionServiceLoginArgs = map[int16]string{ +var fieldIDToName_VersionServiceUploadParamsArgs = map[int16]string{ 1: "req", } -func (p *VersionServiceLoginArgs) IsSetReq() bool { +func (p *VersionServiceUploadParamsArgs) IsSetReq() bool { return p.Req != nil } -func (p *VersionServiceLoginArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceUploadParamsArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -24235,7 +25378,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_VersionServiceLoginArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceUploadParamsArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -24245,8 +25388,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *VersionServiceLoginArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewLoginRequest() +func (p *VersionServiceUploadParamsArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewUploadParamsRequest() if err := _field.Read(iprot); err != nil { return err } @@ -24254,10 +25397,9 @@ func (p *VersionServiceLoginArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *VersionServiceLoginArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *VersionServiceUploadParamsArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("Login_args"); err != nil { + if err = oprot.WriteStructBegin("UploadParams_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -24283,7 +25425,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *VersionServiceLoginArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceUploadParamsArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -24300,43 +25442,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *VersionServiceLoginArgs) String() string { +func (p *VersionServiceUploadParamsArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("VersionServiceLoginArgs(%+v)", *p) + return fmt.Sprintf("VersionServiceUploadParamsArgs(%+v)", *p) } -type VersionServiceLoginResult struct { - Success *LoginResponse `thrift:"success,0,optional"` +type VersionServiceUploadParamsResult struct { + Success *UploadParamsResponse `thrift:"success,0,optional"` } -func NewVersionServiceLoginResult() *VersionServiceLoginResult { - return &VersionServiceLoginResult{} +func NewVersionServiceUploadParamsResult() *VersionServiceUploadParamsResult { + return &VersionServiceUploadParamsResult{} } -func (p *VersionServiceLoginResult) InitDefault() { +func (p *VersionServiceUploadParamsResult) InitDefault() { } -var VersionServiceLoginResult_Success_DEFAULT *LoginResponse +var VersionServiceUploadParamsResult_Success_DEFAULT *UploadParamsResponse -func (p *VersionServiceLoginResult) GetSuccess() (v *LoginResponse) { +func (p *VersionServiceUploadParamsResult) GetSuccess() (v *UploadParamsResponse) { if !p.IsSetSuccess() { - return VersionServiceLoginResult_Success_DEFAULT + return VersionServiceUploadParamsResult_Success_DEFAULT } return p.Success } -var fieldIDToName_VersionServiceLoginResult = map[int16]string{ +var fieldIDToName_VersionServiceUploadParamsResult = map[int16]string{ 0: "success", } -func (p *VersionServiceLoginResult) IsSetSuccess() bool { +func (p *VersionServiceUploadParamsResult) IsSetSuccess() bool { return p.Success != nil } -func (p *VersionServiceLoginResult) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceUploadParamsResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -24382,7 +25524,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_VersionServiceLoginResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceUploadParamsResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -24392,8 +25534,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *VersionServiceLoginResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewLoginResponse() +func (p *VersionServiceUploadParamsResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewUploadParamsResponse() if err := _field.Read(iprot); err != nil { return err } @@ -24401,10 +25543,9 @@ func (p *VersionServiceLoginResult) ReadField0(iprot thrift.TProtocol) error { return nil } -func (p *VersionServiceLoginResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *VersionServiceUploadParamsResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("Login_result"); err != nil { + if err = oprot.WriteStructBegin("UploadParams_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -24430,7 +25571,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *VersionServiceLoginResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceUploadParamsResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -24449,43 +25590,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *VersionServiceLoginResult) String() string { +func (p *VersionServiceUploadParamsResult) String() string { if p == nil { return "" } - return fmt.Sprintf("VersionServiceLoginResult(%+v)", *p) + return fmt.Sprintf("VersionServiceUploadParamsResult(%+v)", *p) } -type VersionServiceUploadVersionArgs struct { - Req *UploadRequest `thrift:"req,1"` +type VersionServiceDownloadReleaseApkArgs struct { + Req *DownloadReleaseApkRequest `thrift:"req,1"` } -func NewVersionServiceUploadVersionArgs() *VersionServiceUploadVersionArgs { - return &VersionServiceUploadVersionArgs{} +func NewVersionServiceDownloadReleaseApkArgs() *VersionServiceDownloadReleaseApkArgs { + return &VersionServiceDownloadReleaseApkArgs{} } -func (p *VersionServiceUploadVersionArgs) InitDefault() { +func (p *VersionServiceDownloadReleaseApkArgs) InitDefault() { } -var VersionServiceUploadVersionArgs_Req_DEFAULT *UploadRequest +var VersionServiceDownloadReleaseApkArgs_Req_DEFAULT *DownloadReleaseApkRequest -func (p *VersionServiceUploadVersionArgs) GetReq() (v *UploadRequest) { +func (p *VersionServiceDownloadReleaseApkArgs) GetReq() (v *DownloadReleaseApkRequest) { if !p.IsSetReq() { - return VersionServiceUploadVersionArgs_Req_DEFAULT + return VersionServiceDownloadReleaseApkArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_VersionServiceUploadVersionArgs = map[int16]string{ +var fieldIDToName_VersionServiceDownloadReleaseApkArgs = map[int16]string{ 1: "req", } -func (p *VersionServiceUploadVersionArgs) IsSetReq() bool { +func (p *VersionServiceDownloadReleaseApkArgs) IsSetReq() bool { return p.Req != nil } -func (p *VersionServiceUploadVersionArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceDownloadReleaseApkArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -24531,7 +25672,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_VersionServiceUploadVersionArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceDownloadReleaseApkArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -24541,8 +25682,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *VersionServiceUploadVersionArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewUploadRequest() +func (p *VersionServiceDownloadReleaseApkArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewDownloadReleaseApkRequest() if err := _field.Read(iprot); err != nil { return err } @@ -24550,10 +25691,9 @@ func (p *VersionServiceUploadVersionArgs) ReadField1(iprot thrift.TProtocol) err return nil } -func (p *VersionServiceUploadVersionArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *VersionServiceDownloadReleaseApkArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("UploadVersion_args"); err != nil { + if err = oprot.WriteStructBegin("DownloadReleaseApk_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -24579,7 +25719,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *VersionServiceUploadVersionArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceDownloadReleaseApkArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -24596,43 +25736,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *VersionServiceUploadVersionArgs) String() string { +func (p *VersionServiceDownloadReleaseApkArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("VersionServiceUploadVersionArgs(%+v)", *p) + return fmt.Sprintf("VersionServiceDownloadReleaseApkArgs(%+v)", *p) } -type VersionServiceUploadVersionResult struct { - Success *UploadResponse `thrift:"success,0,optional"` +type VersionServiceDownloadReleaseApkResult struct { + Success *DownloadReleaseApkResponse `thrift:"success,0,optional"` } -func NewVersionServiceUploadVersionResult() *VersionServiceUploadVersionResult { - return &VersionServiceUploadVersionResult{} +func NewVersionServiceDownloadReleaseApkResult() *VersionServiceDownloadReleaseApkResult { + return &VersionServiceDownloadReleaseApkResult{} } -func (p *VersionServiceUploadVersionResult) InitDefault() { +func (p *VersionServiceDownloadReleaseApkResult) InitDefault() { } -var VersionServiceUploadVersionResult_Success_DEFAULT *UploadResponse +var VersionServiceDownloadReleaseApkResult_Success_DEFAULT *DownloadReleaseApkResponse -func (p *VersionServiceUploadVersionResult) GetSuccess() (v *UploadResponse) { +func (p *VersionServiceDownloadReleaseApkResult) GetSuccess() (v *DownloadReleaseApkResponse) { if !p.IsSetSuccess() { - return VersionServiceUploadVersionResult_Success_DEFAULT + return VersionServiceDownloadReleaseApkResult_Success_DEFAULT } return p.Success } -var fieldIDToName_VersionServiceUploadVersionResult = map[int16]string{ +var fieldIDToName_VersionServiceDownloadReleaseApkResult = map[int16]string{ 0: "success", } -func (p *VersionServiceUploadVersionResult) IsSetSuccess() bool { +func (p *VersionServiceDownloadReleaseApkResult) IsSetSuccess() bool { return p.Success != nil } -func (p *VersionServiceUploadVersionResult) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceDownloadReleaseApkResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -24678,7 +25818,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_VersionServiceUploadVersionResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceDownloadReleaseApkResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -24688,8 +25828,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *VersionServiceUploadVersionResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewUploadResponse() +func (p *VersionServiceDownloadReleaseApkResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewDownloadReleaseApkResponse() if err := _field.Read(iprot); err != nil { return err } @@ -24697,10 +25837,9 @@ func (p *VersionServiceUploadVersionResult) ReadField0(iprot thrift.TProtocol) e return nil } -func (p *VersionServiceUploadVersionResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *VersionServiceDownloadReleaseApkResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("UploadVersion_result"); err != nil { + if err = oprot.WriteStructBegin("DownloadReleaseApk_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -24726,7 +25865,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *VersionServiceUploadVersionResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceDownloadReleaseApkResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -24745,43 +25884,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *VersionServiceUploadVersionResult) String() string { +func (p *VersionServiceDownloadReleaseApkResult) String() string { if p == nil { return "" } - return fmt.Sprintf("VersionServiceUploadVersionResult(%+v)", *p) + return fmt.Sprintf("VersionServiceDownloadReleaseApkResult(%+v)", *p) } -type VersionServiceUploadParamsArgs struct { - Req *UploadParamsRequest `thrift:"req,1"` +type VersionServiceDownloadBetaApkArgs struct { + Req *DownloadBetaApkRequest `thrift:"req,1"` } -func NewVersionServiceUploadParamsArgs() *VersionServiceUploadParamsArgs { - return &VersionServiceUploadParamsArgs{} +func NewVersionServiceDownloadBetaApkArgs() *VersionServiceDownloadBetaApkArgs { + return &VersionServiceDownloadBetaApkArgs{} } -func (p *VersionServiceUploadParamsArgs) InitDefault() { +func (p *VersionServiceDownloadBetaApkArgs) InitDefault() { } -var VersionServiceUploadParamsArgs_Req_DEFAULT *UploadParamsRequest +var VersionServiceDownloadBetaApkArgs_Req_DEFAULT *DownloadBetaApkRequest -func (p *VersionServiceUploadParamsArgs) GetReq() (v *UploadParamsRequest) { +func (p *VersionServiceDownloadBetaApkArgs) GetReq() (v *DownloadBetaApkRequest) { if !p.IsSetReq() { - return VersionServiceUploadParamsArgs_Req_DEFAULT + return VersionServiceDownloadBetaApkArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_VersionServiceUploadParamsArgs = map[int16]string{ +var fieldIDToName_VersionServiceDownloadBetaApkArgs = map[int16]string{ 1: "req", } -func (p *VersionServiceUploadParamsArgs) IsSetReq() bool { +func (p *VersionServiceDownloadBetaApkArgs) IsSetReq() bool { return p.Req != nil } -func (p *VersionServiceUploadParamsArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceDownloadBetaApkArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -24827,7 +25966,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_VersionServiceUploadParamsArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceDownloadBetaApkArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -24837,8 +25976,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *VersionServiceUploadParamsArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewUploadParamsRequest() +func (p *VersionServiceDownloadBetaApkArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewDownloadBetaApkRequest() if err := _field.Read(iprot); err != nil { return err } @@ -24846,10 +25985,9 @@ func (p *VersionServiceUploadParamsArgs) ReadField1(iprot thrift.TProtocol) erro return nil } -func (p *VersionServiceUploadParamsArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *VersionServiceDownloadBetaApkArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("UploadParams_args"); err != nil { + if err = oprot.WriteStructBegin("DownloadBetaApk_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -24875,7 +26013,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *VersionServiceUploadParamsArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceDownloadBetaApkArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -24892,43 +26030,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *VersionServiceUploadParamsArgs) String() string { +func (p *VersionServiceDownloadBetaApkArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("VersionServiceUploadParamsArgs(%+v)", *p) + return fmt.Sprintf("VersionServiceDownloadBetaApkArgs(%+v)", *p) } -type VersionServiceUploadParamsResult struct { - Success *UploadParamsResponse `thrift:"success,0,optional"` +type VersionServiceDownloadBetaApkResult struct { + Success *DownloadBetaApkResponse `thrift:"success,0,optional"` } -func NewVersionServiceUploadParamsResult() *VersionServiceUploadParamsResult { - return &VersionServiceUploadParamsResult{} +func NewVersionServiceDownloadBetaApkResult() *VersionServiceDownloadBetaApkResult { + return &VersionServiceDownloadBetaApkResult{} } -func (p *VersionServiceUploadParamsResult) InitDefault() { +func (p *VersionServiceDownloadBetaApkResult) InitDefault() { } -var VersionServiceUploadParamsResult_Success_DEFAULT *UploadParamsResponse +var VersionServiceDownloadBetaApkResult_Success_DEFAULT *DownloadBetaApkResponse -func (p *VersionServiceUploadParamsResult) GetSuccess() (v *UploadParamsResponse) { +func (p *VersionServiceDownloadBetaApkResult) GetSuccess() (v *DownloadBetaApkResponse) { if !p.IsSetSuccess() { - return VersionServiceUploadParamsResult_Success_DEFAULT + return VersionServiceDownloadBetaApkResult_Success_DEFAULT } return p.Success } -var fieldIDToName_VersionServiceUploadParamsResult = map[int16]string{ +var fieldIDToName_VersionServiceDownloadBetaApkResult = map[int16]string{ 0: "success", } -func (p *VersionServiceUploadParamsResult) IsSetSuccess() bool { +func (p *VersionServiceDownloadBetaApkResult) IsSetSuccess() bool { return p.Success != nil } -func (p *VersionServiceUploadParamsResult) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceDownloadBetaApkResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -24974,7 +26112,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_VersionServiceUploadParamsResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceDownloadBetaApkResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -24984,8 +26122,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *VersionServiceUploadParamsResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewUploadParamsResponse() +func (p *VersionServiceDownloadBetaApkResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewDownloadBetaApkResponse() if err := _field.Read(iprot); err != nil { return err } @@ -24993,10 +26131,9 @@ func (p *VersionServiceUploadParamsResult) ReadField0(iprot thrift.TProtocol) er return nil } -func (p *VersionServiceUploadParamsResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *VersionServiceDownloadBetaApkResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("UploadParams_result"); err != nil { + if err = oprot.WriteStructBegin("DownloadBetaApk_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -25022,7 +26159,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *VersionServiceUploadParamsResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceDownloadBetaApkResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -25041,43 +26178,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *VersionServiceUploadParamsResult) String() string { +func (p *VersionServiceDownloadBetaApkResult) String() string { if p == nil { return "" } - return fmt.Sprintf("VersionServiceUploadParamsResult(%+v)", *p) + return fmt.Sprintf("VersionServiceDownloadBetaApkResult(%+v)", *p) } -type VersionServiceDownloadReleaseApkArgs struct { - Req *DownloadReleaseApkRequest `thrift:"req,1"` +type VersionServiceGetReleaseVersionArgs struct { + Req *GetReleaseVersionRequest `thrift:"req,1"` } -func NewVersionServiceDownloadReleaseApkArgs() *VersionServiceDownloadReleaseApkArgs { - return &VersionServiceDownloadReleaseApkArgs{} +func NewVersionServiceGetReleaseVersionArgs() *VersionServiceGetReleaseVersionArgs { + return &VersionServiceGetReleaseVersionArgs{} } -func (p *VersionServiceDownloadReleaseApkArgs) InitDefault() { +func (p *VersionServiceGetReleaseVersionArgs) InitDefault() { } -var VersionServiceDownloadReleaseApkArgs_Req_DEFAULT *DownloadReleaseApkRequest +var VersionServiceGetReleaseVersionArgs_Req_DEFAULT *GetReleaseVersionRequest -func (p *VersionServiceDownloadReleaseApkArgs) GetReq() (v *DownloadReleaseApkRequest) { +func (p *VersionServiceGetReleaseVersionArgs) GetReq() (v *GetReleaseVersionRequest) { if !p.IsSetReq() { - return VersionServiceDownloadReleaseApkArgs_Req_DEFAULT + return VersionServiceGetReleaseVersionArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_VersionServiceDownloadReleaseApkArgs = map[int16]string{ +var fieldIDToName_VersionServiceGetReleaseVersionArgs = map[int16]string{ 1: "req", } -func (p *VersionServiceDownloadReleaseApkArgs) IsSetReq() bool { +func (p *VersionServiceGetReleaseVersionArgs) IsSetReq() bool { return p.Req != nil } -func (p *VersionServiceDownloadReleaseApkArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetReleaseVersionArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -25123,7 +26260,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_VersionServiceDownloadReleaseApkArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetReleaseVersionArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -25133,8 +26270,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *VersionServiceDownloadReleaseApkArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewDownloadReleaseApkRequest() +func (p *VersionServiceGetReleaseVersionArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetReleaseVersionRequest() if err := _field.Read(iprot); err != nil { return err } @@ -25142,10 +26279,9 @@ func (p *VersionServiceDownloadReleaseApkArgs) ReadField1(iprot thrift.TProtocol return nil } -func (p *VersionServiceDownloadReleaseApkArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *VersionServiceGetReleaseVersionArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("DownloadReleaseApk_args"); err != nil { + if err = oprot.WriteStructBegin("GetReleaseVersion_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -25171,7 +26307,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *VersionServiceDownloadReleaseApkArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetReleaseVersionArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -25188,43 +26324,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *VersionServiceDownloadReleaseApkArgs) String() string { +func (p *VersionServiceGetReleaseVersionArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("VersionServiceDownloadReleaseApkArgs(%+v)", *p) + return fmt.Sprintf("VersionServiceGetReleaseVersionArgs(%+v)", *p) } -type VersionServiceDownloadReleaseApkResult struct { - Success *DownloadReleaseApkResponse `thrift:"success,0,optional"` +type VersionServiceGetReleaseVersionResult struct { + Success *GetReleaseVersionResponse `thrift:"success,0,optional"` } -func NewVersionServiceDownloadReleaseApkResult() *VersionServiceDownloadReleaseApkResult { - return &VersionServiceDownloadReleaseApkResult{} +func NewVersionServiceGetReleaseVersionResult() *VersionServiceGetReleaseVersionResult { + return &VersionServiceGetReleaseVersionResult{} } -func (p *VersionServiceDownloadReleaseApkResult) InitDefault() { +func (p *VersionServiceGetReleaseVersionResult) InitDefault() { } -var VersionServiceDownloadReleaseApkResult_Success_DEFAULT *DownloadReleaseApkResponse +var VersionServiceGetReleaseVersionResult_Success_DEFAULT *GetReleaseVersionResponse -func (p *VersionServiceDownloadReleaseApkResult) GetSuccess() (v *DownloadReleaseApkResponse) { +func (p *VersionServiceGetReleaseVersionResult) GetSuccess() (v *GetReleaseVersionResponse) { if !p.IsSetSuccess() { - return VersionServiceDownloadReleaseApkResult_Success_DEFAULT + return VersionServiceGetReleaseVersionResult_Success_DEFAULT } return p.Success } -var fieldIDToName_VersionServiceDownloadReleaseApkResult = map[int16]string{ +var fieldIDToName_VersionServiceGetReleaseVersionResult = map[int16]string{ 0: "success", } -func (p *VersionServiceDownloadReleaseApkResult) IsSetSuccess() bool { +func (p *VersionServiceGetReleaseVersionResult) IsSetSuccess() bool { return p.Success != nil } -func (p *VersionServiceDownloadReleaseApkResult) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetReleaseVersionResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -25270,7 +26406,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_VersionServiceDownloadReleaseApkResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetReleaseVersionResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -25280,8 +26416,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *VersionServiceDownloadReleaseApkResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewDownloadReleaseApkResponse() +func (p *VersionServiceGetReleaseVersionResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetReleaseVersionResponse() if err := _field.Read(iprot); err != nil { return err } @@ -25289,10 +26425,9 @@ func (p *VersionServiceDownloadReleaseApkResult) ReadField0(iprot thrift.TProtoc return nil } -func (p *VersionServiceDownloadReleaseApkResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *VersionServiceGetReleaseVersionResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("DownloadReleaseApk_result"); err != nil { + if err = oprot.WriteStructBegin("GetReleaseVersion_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -25318,7 +26453,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *VersionServiceDownloadReleaseApkResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetReleaseVersionResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -25337,43 +26472,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *VersionServiceDownloadReleaseApkResult) String() string { +func (p *VersionServiceGetReleaseVersionResult) String() string { if p == nil { return "" } - return fmt.Sprintf("VersionServiceDownloadReleaseApkResult(%+v)", *p) + return fmt.Sprintf("VersionServiceGetReleaseVersionResult(%+v)", *p) } -type VersionServiceDownloadBetaApkArgs struct { - Req *DownloadBetaApkRequest `thrift:"req,1"` +type VersionServiceGetBetaVersionArgs struct { + Req *GetBetaVersionRequest `thrift:"req,1"` } -func NewVersionServiceDownloadBetaApkArgs() *VersionServiceDownloadBetaApkArgs { - return &VersionServiceDownloadBetaApkArgs{} +func NewVersionServiceGetBetaVersionArgs() *VersionServiceGetBetaVersionArgs { + return &VersionServiceGetBetaVersionArgs{} } -func (p *VersionServiceDownloadBetaApkArgs) InitDefault() { +func (p *VersionServiceGetBetaVersionArgs) InitDefault() { } -var VersionServiceDownloadBetaApkArgs_Req_DEFAULT *DownloadBetaApkRequest +var VersionServiceGetBetaVersionArgs_Req_DEFAULT *GetBetaVersionRequest -func (p *VersionServiceDownloadBetaApkArgs) GetReq() (v *DownloadBetaApkRequest) { +func (p *VersionServiceGetBetaVersionArgs) GetReq() (v *GetBetaVersionRequest) { if !p.IsSetReq() { - return VersionServiceDownloadBetaApkArgs_Req_DEFAULT + return VersionServiceGetBetaVersionArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_VersionServiceDownloadBetaApkArgs = map[int16]string{ +var fieldIDToName_VersionServiceGetBetaVersionArgs = map[int16]string{ 1: "req", } -func (p *VersionServiceDownloadBetaApkArgs) IsSetReq() bool { +func (p *VersionServiceGetBetaVersionArgs) IsSetReq() bool { return p.Req != nil } -func (p *VersionServiceDownloadBetaApkArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetBetaVersionArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -25419,7 +26554,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_VersionServiceDownloadBetaApkArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetBetaVersionArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -25429,8 +26564,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *VersionServiceDownloadBetaApkArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewDownloadBetaApkRequest() +func (p *VersionServiceGetBetaVersionArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetBetaVersionRequest() if err := _field.Read(iprot); err != nil { return err } @@ -25438,10 +26573,9 @@ func (p *VersionServiceDownloadBetaApkArgs) ReadField1(iprot thrift.TProtocol) e return nil } -func (p *VersionServiceDownloadBetaApkArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *VersionServiceGetBetaVersionArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("DownloadBetaApk_args"); err != nil { + if err = oprot.WriteStructBegin("GetBetaVersion_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -25467,7 +26601,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *VersionServiceDownloadBetaApkArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetBetaVersionArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -25484,43 +26618,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *VersionServiceDownloadBetaApkArgs) String() string { +func (p *VersionServiceGetBetaVersionArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("VersionServiceDownloadBetaApkArgs(%+v)", *p) + return fmt.Sprintf("VersionServiceGetBetaVersionArgs(%+v)", *p) } -type VersionServiceDownloadBetaApkResult struct { - Success *DownloadBetaApkResponse `thrift:"success,0,optional"` +type VersionServiceGetBetaVersionResult struct { + Success *GetBetaVersionResponse `thrift:"success,0,optional"` } -func NewVersionServiceDownloadBetaApkResult() *VersionServiceDownloadBetaApkResult { - return &VersionServiceDownloadBetaApkResult{} +func NewVersionServiceGetBetaVersionResult() *VersionServiceGetBetaVersionResult { + return &VersionServiceGetBetaVersionResult{} } -func (p *VersionServiceDownloadBetaApkResult) InitDefault() { +func (p *VersionServiceGetBetaVersionResult) InitDefault() { } -var VersionServiceDownloadBetaApkResult_Success_DEFAULT *DownloadBetaApkResponse +var VersionServiceGetBetaVersionResult_Success_DEFAULT *GetBetaVersionResponse -func (p *VersionServiceDownloadBetaApkResult) GetSuccess() (v *DownloadBetaApkResponse) { +func (p *VersionServiceGetBetaVersionResult) GetSuccess() (v *GetBetaVersionResponse) { if !p.IsSetSuccess() { - return VersionServiceDownloadBetaApkResult_Success_DEFAULT + return VersionServiceGetBetaVersionResult_Success_DEFAULT } return p.Success } -var fieldIDToName_VersionServiceDownloadBetaApkResult = map[int16]string{ +var fieldIDToName_VersionServiceGetBetaVersionResult = map[int16]string{ 0: "success", } -func (p *VersionServiceDownloadBetaApkResult) IsSetSuccess() bool { +func (p *VersionServiceGetBetaVersionResult) IsSetSuccess() bool { return p.Success != nil } -func (p *VersionServiceDownloadBetaApkResult) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetBetaVersionResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -25566,7 +26700,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_VersionServiceDownloadBetaApkResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetBetaVersionResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -25576,8 +26710,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *VersionServiceDownloadBetaApkResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewDownloadBetaApkResponse() +func (p *VersionServiceGetBetaVersionResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetBetaVersionResponse() if err := _field.Read(iprot); err != nil { return err } @@ -25585,10 +26719,9 @@ func (p *VersionServiceDownloadBetaApkResult) ReadField0(iprot thrift.TProtocol) return nil } -func (p *VersionServiceDownloadBetaApkResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *VersionServiceGetBetaVersionResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("DownloadBetaApk_result"); err != nil { + if err = oprot.WriteStructBegin("GetBetaVersion_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -25614,7 +26747,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *VersionServiceDownloadBetaApkResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetBetaVersionResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -25633,43 +26766,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *VersionServiceDownloadBetaApkResult) String() string { +func (p *VersionServiceGetBetaVersionResult) String() string { if p == nil { return "" } - return fmt.Sprintf("VersionServiceDownloadBetaApkResult(%+v)", *p) + return fmt.Sprintf("VersionServiceGetBetaVersionResult(%+v)", *p) } -type VersionServiceGetReleaseVersionArgs struct { - Req *GetReleaseVersionRequest `thrift:"req,1"` +type VersionServiceGetSettingArgs struct { + Req *GetSettingRequest `thrift:"req,1"` } -func NewVersionServiceGetReleaseVersionArgs() *VersionServiceGetReleaseVersionArgs { - return &VersionServiceGetReleaseVersionArgs{} +func NewVersionServiceGetSettingArgs() *VersionServiceGetSettingArgs { + return &VersionServiceGetSettingArgs{} } -func (p *VersionServiceGetReleaseVersionArgs) InitDefault() { +func (p *VersionServiceGetSettingArgs) InitDefault() { } -var VersionServiceGetReleaseVersionArgs_Req_DEFAULT *GetReleaseVersionRequest +var VersionServiceGetSettingArgs_Req_DEFAULT *GetSettingRequest -func (p *VersionServiceGetReleaseVersionArgs) GetReq() (v *GetReleaseVersionRequest) { +func (p *VersionServiceGetSettingArgs) GetReq() (v *GetSettingRequest) { if !p.IsSetReq() { - return VersionServiceGetReleaseVersionArgs_Req_DEFAULT + return VersionServiceGetSettingArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_VersionServiceGetReleaseVersionArgs = map[int16]string{ +var fieldIDToName_VersionServiceGetSettingArgs = map[int16]string{ 1: "req", } -func (p *VersionServiceGetReleaseVersionArgs) IsSetReq() bool { +func (p *VersionServiceGetSettingArgs) IsSetReq() bool { return p.Req != nil } -func (p *VersionServiceGetReleaseVersionArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetSettingArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -25715,7 +26848,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_VersionServiceGetReleaseVersionArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetSettingArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -25725,8 +26858,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *VersionServiceGetReleaseVersionArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetReleaseVersionRequest() +func (p *VersionServiceGetSettingArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetSettingRequest() if err := _field.Read(iprot); err != nil { return err } @@ -25734,10 +26867,9 @@ func (p *VersionServiceGetReleaseVersionArgs) ReadField1(iprot thrift.TProtocol) return nil } -func (p *VersionServiceGetReleaseVersionArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *VersionServiceGetSettingArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetReleaseVersion_args"); err != nil { + if err = oprot.WriteStructBegin("GetSetting_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -25763,7 +26895,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *VersionServiceGetReleaseVersionArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetSettingArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -25780,43 +26912,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *VersionServiceGetReleaseVersionArgs) String() string { +func (p *VersionServiceGetSettingArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("VersionServiceGetReleaseVersionArgs(%+v)", *p) + return fmt.Sprintf("VersionServiceGetSettingArgs(%+v)", *p) } -type VersionServiceGetReleaseVersionResult struct { - Success *GetReleaseVersionResponse `thrift:"success,0,optional"` +type VersionServiceGetSettingResult struct { + Success *GetSettingResponse `thrift:"success,0,optional"` } -func NewVersionServiceGetReleaseVersionResult() *VersionServiceGetReleaseVersionResult { - return &VersionServiceGetReleaseVersionResult{} +func NewVersionServiceGetSettingResult() *VersionServiceGetSettingResult { + return &VersionServiceGetSettingResult{} } -func (p *VersionServiceGetReleaseVersionResult) InitDefault() { +func (p *VersionServiceGetSettingResult) InitDefault() { } -var VersionServiceGetReleaseVersionResult_Success_DEFAULT *GetReleaseVersionResponse +var VersionServiceGetSettingResult_Success_DEFAULT *GetSettingResponse -func (p *VersionServiceGetReleaseVersionResult) GetSuccess() (v *GetReleaseVersionResponse) { +func (p *VersionServiceGetSettingResult) GetSuccess() (v *GetSettingResponse) { if !p.IsSetSuccess() { - return VersionServiceGetReleaseVersionResult_Success_DEFAULT + return VersionServiceGetSettingResult_Success_DEFAULT } return p.Success } -var fieldIDToName_VersionServiceGetReleaseVersionResult = map[int16]string{ +var fieldIDToName_VersionServiceGetSettingResult = map[int16]string{ 0: "success", } -func (p *VersionServiceGetReleaseVersionResult) IsSetSuccess() bool { +func (p *VersionServiceGetSettingResult) IsSetSuccess() bool { return p.Success != nil } -func (p *VersionServiceGetReleaseVersionResult) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetSettingResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -25862,7 +26994,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_VersionServiceGetReleaseVersionResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetSettingResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -25872,8 +27004,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *VersionServiceGetReleaseVersionResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetReleaseVersionResponse() +func (p *VersionServiceGetSettingResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetSettingResponse() if err := _field.Read(iprot); err != nil { return err } @@ -25881,10 +27013,9 @@ func (p *VersionServiceGetReleaseVersionResult) ReadField0(iprot thrift.TProtoco return nil } -func (p *VersionServiceGetReleaseVersionResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *VersionServiceGetSettingResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetReleaseVersion_result"); err != nil { + if err = oprot.WriteStructBegin("GetSetting_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -25910,7 +27041,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *VersionServiceGetReleaseVersionResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetSettingResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -25929,43 +27060,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *VersionServiceGetReleaseVersionResult) String() string { +func (p *VersionServiceGetSettingResult) String() string { if p == nil { return "" } - return fmt.Sprintf("VersionServiceGetReleaseVersionResult(%+v)", *p) + return fmt.Sprintf("VersionServiceGetSettingResult(%+v)", *p) } -type VersionServiceGetBetaVersionArgs struct { - Req *GetBetaVersionRequest `thrift:"req,1"` +type VersionServiceGetTestArgs struct { + Req *GetTestRequest `thrift:"req,1"` } -func NewVersionServiceGetBetaVersionArgs() *VersionServiceGetBetaVersionArgs { - return &VersionServiceGetBetaVersionArgs{} +func NewVersionServiceGetTestArgs() *VersionServiceGetTestArgs { + return &VersionServiceGetTestArgs{} } -func (p *VersionServiceGetBetaVersionArgs) InitDefault() { +func (p *VersionServiceGetTestArgs) InitDefault() { } -var VersionServiceGetBetaVersionArgs_Req_DEFAULT *GetBetaVersionRequest +var VersionServiceGetTestArgs_Req_DEFAULT *GetTestRequest -func (p *VersionServiceGetBetaVersionArgs) GetReq() (v *GetBetaVersionRequest) { +func (p *VersionServiceGetTestArgs) GetReq() (v *GetTestRequest) { if !p.IsSetReq() { - return VersionServiceGetBetaVersionArgs_Req_DEFAULT + return VersionServiceGetTestArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_VersionServiceGetBetaVersionArgs = map[int16]string{ +var fieldIDToName_VersionServiceGetTestArgs = map[int16]string{ 1: "req", } -func (p *VersionServiceGetBetaVersionArgs) IsSetReq() bool { +func (p *VersionServiceGetTestArgs) IsSetReq() bool { return p.Req != nil } -func (p *VersionServiceGetBetaVersionArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetTestArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -26011,7 +27142,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_VersionServiceGetBetaVersionArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetTestArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -26021,8 +27152,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *VersionServiceGetBetaVersionArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetBetaVersionRequest() +func (p *VersionServiceGetTestArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetTestRequest() if err := _field.Read(iprot); err != nil { return err } @@ -26030,10 +27161,9 @@ func (p *VersionServiceGetBetaVersionArgs) ReadField1(iprot thrift.TProtocol) er return nil } -func (p *VersionServiceGetBetaVersionArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *VersionServiceGetTestArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetBetaVersion_args"); err != nil { + if err = oprot.WriteStructBegin("GetTest_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -26059,7 +27189,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *VersionServiceGetBetaVersionArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetTestArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -26076,43 +27206,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *VersionServiceGetBetaVersionArgs) String() string { +func (p *VersionServiceGetTestArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("VersionServiceGetBetaVersionArgs(%+v)", *p) + return fmt.Sprintf("VersionServiceGetTestArgs(%+v)", *p) } -type VersionServiceGetBetaVersionResult struct { - Success *GetBetaVersionResponse `thrift:"success,0,optional"` +type VersionServiceGetTestResult struct { + Success *GetTestResponse `thrift:"success,0,optional"` } -func NewVersionServiceGetBetaVersionResult() *VersionServiceGetBetaVersionResult { - return &VersionServiceGetBetaVersionResult{} +func NewVersionServiceGetTestResult() *VersionServiceGetTestResult { + return &VersionServiceGetTestResult{} } -func (p *VersionServiceGetBetaVersionResult) InitDefault() { +func (p *VersionServiceGetTestResult) InitDefault() { } -var VersionServiceGetBetaVersionResult_Success_DEFAULT *GetBetaVersionResponse +var VersionServiceGetTestResult_Success_DEFAULT *GetTestResponse -func (p *VersionServiceGetBetaVersionResult) GetSuccess() (v *GetBetaVersionResponse) { +func (p *VersionServiceGetTestResult) GetSuccess() (v *GetTestResponse) { if !p.IsSetSuccess() { - return VersionServiceGetBetaVersionResult_Success_DEFAULT + return VersionServiceGetTestResult_Success_DEFAULT } return p.Success } -var fieldIDToName_VersionServiceGetBetaVersionResult = map[int16]string{ +var fieldIDToName_VersionServiceGetTestResult = map[int16]string{ 0: "success", } -func (p *VersionServiceGetBetaVersionResult) IsSetSuccess() bool { +func (p *VersionServiceGetTestResult) IsSetSuccess() bool { return p.Success != nil } -func (p *VersionServiceGetBetaVersionResult) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetTestResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -26158,7 +27288,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_VersionServiceGetBetaVersionResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetTestResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -26168,8 +27298,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *VersionServiceGetBetaVersionResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetBetaVersionResponse() +func (p *VersionServiceGetTestResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetTestResponse() if err := _field.Read(iprot); err != nil { return err } @@ -26177,10 +27307,9 @@ func (p *VersionServiceGetBetaVersionResult) ReadField0(iprot thrift.TProtocol) return nil } -func (p *VersionServiceGetBetaVersionResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *VersionServiceGetTestResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetBetaVersion_result"); err != nil { + if err = oprot.WriteStructBegin("GetTest_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -26206,7 +27335,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *VersionServiceGetBetaVersionResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetTestResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -26225,43 +27354,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *VersionServiceGetBetaVersionResult) String() string { +func (p *VersionServiceGetTestResult) String() string { if p == nil { return "" } - return fmt.Sprintf("VersionServiceGetBetaVersionResult(%+v)", *p) + return fmt.Sprintf("VersionServiceGetTestResult(%+v)", *p) } -type VersionServiceGetSettingArgs struct { - Req *GetSettingRequest `thrift:"req,1"` +type VersionServiceGetCloudArgs struct { + Req *GetCloudRequest `thrift:"req,1"` } -func NewVersionServiceGetSettingArgs() *VersionServiceGetSettingArgs { - return &VersionServiceGetSettingArgs{} +func NewVersionServiceGetCloudArgs() *VersionServiceGetCloudArgs { + return &VersionServiceGetCloudArgs{} } -func (p *VersionServiceGetSettingArgs) InitDefault() { +func (p *VersionServiceGetCloudArgs) InitDefault() { } -var VersionServiceGetSettingArgs_Req_DEFAULT *GetSettingRequest +var VersionServiceGetCloudArgs_Req_DEFAULT *GetCloudRequest -func (p *VersionServiceGetSettingArgs) GetReq() (v *GetSettingRequest) { +func (p *VersionServiceGetCloudArgs) GetReq() (v *GetCloudRequest) { if !p.IsSetReq() { - return VersionServiceGetSettingArgs_Req_DEFAULT + return VersionServiceGetCloudArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_VersionServiceGetSettingArgs = map[int16]string{ +var fieldIDToName_VersionServiceGetCloudArgs = map[int16]string{ 1: "req", } -func (p *VersionServiceGetSettingArgs) IsSetReq() bool { +func (p *VersionServiceGetCloudArgs) IsSetReq() bool { return p.Req != nil } -func (p *VersionServiceGetSettingArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetCloudArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -26307,7 +27436,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_VersionServiceGetSettingArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetCloudArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -26317,8 +27446,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *VersionServiceGetSettingArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetSettingRequest() +func (p *VersionServiceGetCloudArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetCloudRequest() if err := _field.Read(iprot); err != nil { return err } @@ -26326,10 +27455,9 @@ func (p *VersionServiceGetSettingArgs) ReadField1(iprot thrift.TProtocol) error return nil } -func (p *VersionServiceGetSettingArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *VersionServiceGetCloudArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetSetting_args"); err != nil { + if err = oprot.WriteStructBegin("GetCloud_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -26355,7 +27483,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *VersionServiceGetSettingArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetCloudArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -26372,43 +27500,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *VersionServiceGetSettingArgs) String() string { +func (p *VersionServiceGetCloudArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("VersionServiceGetSettingArgs(%+v)", *p) + return fmt.Sprintf("VersionServiceGetCloudArgs(%+v)", *p) } -type VersionServiceGetSettingResult struct { - Success *GetSettingResponse `thrift:"success,0,optional"` +type VersionServiceGetCloudResult struct { + Success *GetCloudResponse `thrift:"success,0,optional"` } -func NewVersionServiceGetSettingResult() *VersionServiceGetSettingResult { - return &VersionServiceGetSettingResult{} +func NewVersionServiceGetCloudResult() *VersionServiceGetCloudResult { + return &VersionServiceGetCloudResult{} } -func (p *VersionServiceGetSettingResult) InitDefault() { +func (p *VersionServiceGetCloudResult) InitDefault() { } -var VersionServiceGetSettingResult_Success_DEFAULT *GetSettingResponse +var VersionServiceGetCloudResult_Success_DEFAULT *GetCloudResponse -func (p *VersionServiceGetSettingResult) GetSuccess() (v *GetSettingResponse) { +func (p *VersionServiceGetCloudResult) GetSuccess() (v *GetCloudResponse) { if !p.IsSetSuccess() { - return VersionServiceGetSettingResult_Success_DEFAULT + return VersionServiceGetCloudResult_Success_DEFAULT } return p.Success } -var fieldIDToName_VersionServiceGetSettingResult = map[int16]string{ +var fieldIDToName_VersionServiceGetCloudResult = map[int16]string{ 0: "success", } -func (p *VersionServiceGetSettingResult) IsSetSuccess() bool { +func (p *VersionServiceGetCloudResult) IsSetSuccess() bool { return p.Success != nil } -func (p *VersionServiceGetSettingResult) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetCloudResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -26454,7 +27582,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_VersionServiceGetSettingResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetCloudResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -26464,8 +27592,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *VersionServiceGetSettingResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetSettingResponse() +func (p *VersionServiceGetCloudResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetCloudResponse() if err := _field.Read(iprot); err != nil { return err } @@ -26473,10 +27601,9 @@ func (p *VersionServiceGetSettingResult) ReadField0(iprot thrift.TProtocol) erro return nil } -func (p *VersionServiceGetSettingResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *VersionServiceGetCloudResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetSetting_result"); err != nil { + if err = oprot.WriteStructBegin("GetCloud_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -26502,7 +27629,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *VersionServiceGetSettingResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetCloudResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -26521,43 +27648,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *VersionServiceGetSettingResult) String() string { +func (p *VersionServiceGetCloudResult) String() string { if p == nil { return "" } - return fmt.Sprintf("VersionServiceGetSettingResult(%+v)", *p) + return fmt.Sprintf("VersionServiceGetCloudResult(%+v)", *p) } -type VersionServiceGetTestArgs struct { - Req *GetTestRequest `thrift:"req,1"` +type VersionServiceSetCloudArgs struct { + Req *SetCloudRequest `thrift:"req,1"` } -func NewVersionServiceGetTestArgs() *VersionServiceGetTestArgs { - return &VersionServiceGetTestArgs{} +func NewVersionServiceSetCloudArgs() *VersionServiceSetCloudArgs { + return &VersionServiceSetCloudArgs{} } -func (p *VersionServiceGetTestArgs) InitDefault() { +func (p *VersionServiceSetCloudArgs) InitDefault() { } -var VersionServiceGetTestArgs_Req_DEFAULT *GetTestRequest +var VersionServiceSetCloudArgs_Req_DEFAULT *SetCloudRequest -func (p *VersionServiceGetTestArgs) GetReq() (v *GetTestRequest) { +func (p *VersionServiceSetCloudArgs) GetReq() (v *SetCloudRequest) { if !p.IsSetReq() { - return VersionServiceGetTestArgs_Req_DEFAULT + return VersionServiceSetCloudArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_VersionServiceGetTestArgs = map[int16]string{ +var fieldIDToName_VersionServiceSetCloudArgs = map[int16]string{ 1: "req", } -func (p *VersionServiceGetTestArgs) IsSetReq() bool { +func (p *VersionServiceSetCloudArgs) IsSetReq() bool { return p.Req != nil } -func (p *VersionServiceGetTestArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceSetCloudArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -26603,7 +27730,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_VersionServiceGetTestArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceSetCloudArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -26613,8 +27740,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *VersionServiceGetTestArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetTestRequest() +func (p *VersionServiceSetCloudArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewSetCloudRequest() if err := _field.Read(iprot); err != nil { return err } @@ -26622,10 +27749,9 @@ func (p *VersionServiceGetTestArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *VersionServiceGetTestArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *VersionServiceSetCloudArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetTest_args"); err != nil { + if err = oprot.WriteStructBegin("SetCloud_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -26651,7 +27777,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *VersionServiceGetTestArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceSetCloudArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -26668,43 +27794,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *VersionServiceGetTestArgs) String() string { +func (p *VersionServiceSetCloudArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("VersionServiceGetTestArgs(%+v)", *p) + return fmt.Sprintf("VersionServiceSetCloudArgs(%+v)", *p) } -type VersionServiceGetTestResult struct { - Success *GetTestResponse `thrift:"success,0,optional"` +type VersionServiceSetCloudResult struct { + Success *SetCloudResponse `thrift:"success,0,optional"` } -func NewVersionServiceGetTestResult() *VersionServiceGetTestResult { - return &VersionServiceGetTestResult{} +func NewVersionServiceSetCloudResult() *VersionServiceSetCloudResult { + return &VersionServiceSetCloudResult{} } -func (p *VersionServiceGetTestResult) InitDefault() { +func (p *VersionServiceSetCloudResult) InitDefault() { } -var VersionServiceGetTestResult_Success_DEFAULT *GetTestResponse +var VersionServiceSetCloudResult_Success_DEFAULT *SetCloudResponse -func (p *VersionServiceGetTestResult) GetSuccess() (v *GetTestResponse) { +func (p *VersionServiceSetCloudResult) GetSuccess() (v *SetCloudResponse) { if !p.IsSetSuccess() { - return VersionServiceGetTestResult_Success_DEFAULT + return VersionServiceSetCloudResult_Success_DEFAULT } return p.Success } -var fieldIDToName_VersionServiceGetTestResult = map[int16]string{ +var fieldIDToName_VersionServiceSetCloudResult = map[int16]string{ 0: "success", } -func (p *VersionServiceGetTestResult) IsSetSuccess() bool { +func (p *VersionServiceSetCloudResult) IsSetSuccess() bool { return p.Success != nil } -func (p *VersionServiceGetTestResult) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceSetCloudResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -26750,7 +27876,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_VersionServiceGetTestResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceSetCloudResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -26760,8 +27886,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *VersionServiceGetTestResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetTestResponse() +func (p *VersionServiceSetCloudResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewSetCloudResponse() if err := _field.Read(iprot); err != nil { return err } @@ -26769,10 +27895,9 @@ func (p *VersionServiceGetTestResult) ReadField0(iprot thrift.TProtocol) error { return nil } -func (p *VersionServiceGetTestResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *VersionServiceSetCloudResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetTest_result"); err != nil { + if err = oprot.WriteStructBegin("SetCloud_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -26798,7 +27923,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *VersionServiceGetTestResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceSetCloudResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -26817,43 +27942,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *VersionServiceGetTestResult) String() string { +func (p *VersionServiceSetCloudResult) String() string { if p == nil { return "" } - return fmt.Sprintf("VersionServiceGetTestResult(%+v)", *p) + return fmt.Sprintf("VersionServiceSetCloudResult(%+v)", *p) } -type VersionServiceGetCloudArgs struct { - Req *GetCloudRequest `thrift:"req,1"` +type VersionServiceGetDumpArgs struct { + Req *GetDumpRequest `thrift:"req,1"` } -func NewVersionServiceGetCloudArgs() *VersionServiceGetCloudArgs { - return &VersionServiceGetCloudArgs{} +func NewVersionServiceGetDumpArgs() *VersionServiceGetDumpArgs { + return &VersionServiceGetDumpArgs{} } -func (p *VersionServiceGetCloudArgs) InitDefault() { +func (p *VersionServiceGetDumpArgs) InitDefault() { } -var VersionServiceGetCloudArgs_Req_DEFAULT *GetCloudRequest +var VersionServiceGetDumpArgs_Req_DEFAULT *GetDumpRequest -func (p *VersionServiceGetCloudArgs) GetReq() (v *GetCloudRequest) { +func (p *VersionServiceGetDumpArgs) GetReq() (v *GetDumpRequest) { if !p.IsSetReq() { - return VersionServiceGetCloudArgs_Req_DEFAULT + return VersionServiceGetDumpArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_VersionServiceGetCloudArgs = map[int16]string{ +var fieldIDToName_VersionServiceGetDumpArgs = map[int16]string{ 1: "req", } -func (p *VersionServiceGetCloudArgs) IsSetReq() bool { +func (p *VersionServiceGetDumpArgs) IsSetReq() bool { return p.Req != nil } -func (p *VersionServiceGetCloudArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetDumpArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -26899,7 +28024,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_VersionServiceGetCloudArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetDumpArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -26909,8 +28034,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *VersionServiceGetCloudArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetCloudRequest() +func (p *VersionServiceGetDumpArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetDumpRequest() if err := _field.Read(iprot); err != nil { return err } @@ -26918,10 +28043,9 @@ func (p *VersionServiceGetCloudArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *VersionServiceGetCloudArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *VersionServiceGetDumpArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetCloud_args"); err != nil { + if err = oprot.WriteStructBegin("GetDump_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -26947,7 +28071,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *VersionServiceGetCloudArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetDumpArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -26964,43 +28088,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *VersionServiceGetCloudArgs) String() string { +func (p *VersionServiceGetDumpArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("VersionServiceGetCloudArgs(%+v)", *p) + return fmt.Sprintf("VersionServiceGetDumpArgs(%+v)", *p) } -type VersionServiceGetCloudResult struct { - Success *GetCloudResponse `thrift:"success,0,optional"` +type VersionServiceGetDumpResult struct { + Success *GetDumpResponse `thrift:"success,0,optional"` } -func NewVersionServiceGetCloudResult() *VersionServiceGetCloudResult { - return &VersionServiceGetCloudResult{} +func NewVersionServiceGetDumpResult() *VersionServiceGetDumpResult { + return &VersionServiceGetDumpResult{} } -func (p *VersionServiceGetCloudResult) InitDefault() { +func (p *VersionServiceGetDumpResult) InitDefault() { } -var VersionServiceGetCloudResult_Success_DEFAULT *GetCloudResponse +var VersionServiceGetDumpResult_Success_DEFAULT *GetDumpResponse -func (p *VersionServiceGetCloudResult) GetSuccess() (v *GetCloudResponse) { +func (p *VersionServiceGetDumpResult) GetSuccess() (v *GetDumpResponse) { if !p.IsSetSuccess() { - return VersionServiceGetCloudResult_Success_DEFAULT + return VersionServiceGetDumpResult_Success_DEFAULT } return p.Success } -var fieldIDToName_VersionServiceGetCloudResult = map[int16]string{ +var fieldIDToName_VersionServiceGetDumpResult = map[int16]string{ 0: "success", } -func (p *VersionServiceGetCloudResult) IsSetSuccess() bool { +func (p *VersionServiceGetDumpResult) IsSetSuccess() bool { return p.Success != nil } -func (p *VersionServiceGetCloudResult) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetDumpResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -27046,110 +28170,394 @@ 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_VersionServiceGetCloudResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetDumpResult[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) +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 *VersionServiceGetDumpResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetDumpResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *VersionServiceGetDumpResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetDump_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 *VersionServiceGetDumpResult) 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 *VersionServiceGetDumpResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VersionServiceGetDumpResult(%+v)", *p) + +} + +type CommonServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler CommonService +} + +func (p *CommonServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *CommonServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *CommonServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewCommonServiceProcessor(handler CommonService) *CommonServiceProcessor { + self := &CommonServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self.AddToProcessorMap("GetCSS", &commonServiceProcessorGetCSS{handler: handler}) + self.AddToProcessorMap("GetHtml", &commonServiceProcessorGetHtml{handler: handler}) + self.AddToProcessorMap("GetUserAgreement", &commonServiceProcessorGetUserAgreement{handler: handler}) + self.AddToProcessorMap("GetTermsList", &commonServiceProcessorGetTermsList{handler: handler}) + self.AddToProcessorMap("GetTerm", &commonServiceProcessorGetTerm{handler: handler}) + return self +} +func (p *CommonServiceProcessor) 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 commonServiceProcessorGetCSS struct { + handler CommonService +} + +func (p *commonServiceProcessorGetCSS) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := CommonServiceGetCSSArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetCSS", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := CommonServiceGetCSSResult{} + var retval *GetCSSResponse + if retval, err2 = p.handler.GetCSS(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCSS: "+err2.Error()) + oprot.WriteMessageBegin("GetCSS", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetCSS", 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 commonServiceProcessorGetHtml struct { + handler CommonService +} + +func (p *commonServiceProcessorGetHtml) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := CommonServiceGetHtmlArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetHtml", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := CommonServiceGetHtmlResult{} + var retval *GetHtmlResponse + if retval, err2 = p.handler.GetHtml(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetHtml: "+err2.Error()) + oprot.WriteMessageBegin("GetHtml", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetHtml", 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 commonServiceProcessorGetUserAgreement struct { + handler CommonService } -func (p *VersionServiceGetCloudResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetCloudResponse() - if err := _field.Read(iprot); err != nil { - return err +func (p *commonServiceProcessorGetUserAgreement) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := CommonServiceGetUserAgreementArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetUserAgreement", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err } - p.Success = _field - return nil + + iprot.ReadMessageEnd() + var err2 error + result := CommonServiceGetUserAgreementResult{} + var retval *GetUserAgreementResponse + if retval, err2 = p.handler.GetUserAgreement(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetUserAgreement: "+err2.Error()) + oprot.WriteMessageBegin("GetUserAgreement", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetUserAgreement", 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 } -func (p *VersionServiceGetCloudResult) Write(oprot thrift.TProtocol) (err error) { +type commonServiceProcessorGetTermsList struct { + handler CommonService +} - var fieldId int16 - if err = oprot.WriteStructBegin("GetCloud_result"); err != nil { - goto WriteStructBeginError +func (p *commonServiceProcessorGetTermsList) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := CommonServiceGetTermsListArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetTermsList", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err } - if p != nil { - if err = p.writeField0(oprot); err != nil { - fieldId = 0 - goto WriteFieldError - } + + iprot.ReadMessageEnd() + var err2 error + result := CommonServiceGetTermsListResult{} + var retval *TermListResponse + if retval, err2 = p.handler.GetTermsList(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTermsList: "+err2.Error()) + oprot.WriteMessageBegin("GetTermsList", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError + if err2 = oprot.WriteMessageBegin("GetTermsList", thrift.REPLY, seqId); err2 != nil { + err = err2 } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 } - 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) + 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 } -func (p *VersionServiceGetCloudResult) 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) +type commonServiceProcessorGetTerm struct { + handler CommonService } -func (p *VersionServiceGetCloudResult) String() string { - if p == nil { - return "" +func (p *commonServiceProcessorGetTerm) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := CommonServiceGetTermArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetTerm", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err } - return fmt.Sprintf("VersionServiceGetCloudResult(%+v)", *p) + iprot.ReadMessageEnd() + var err2 error + result := CommonServiceGetTermResult{} + var retval *TermResponse + if retval, err2 = p.handler.GetTerm(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTerm: "+err2.Error()) + oprot.WriteMessageBegin("GetTerm", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetTerm", 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 VersionServiceSetCloudArgs struct { - Req *SetCloudRequest `thrift:"req,1"` +type CommonServiceGetCSSArgs struct { + Req *GetCSSRequest `thrift:"req,1"` } -func NewVersionServiceSetCloudArgs() *VersionServiceSetCloudArgs { - return &VersionServiceSetCloudArgs{} +func NewCommonServiceGetCSSArgs() *CommonServiceGetCSSArgs { + return &CommonServiceGetCSSArgs{} } -func (p *VersionServiceSetCloudArgs) InitDefault() { +func (p *CommonServiceGetCSSArgs) InitDefault() { } -var VersionServiceSetCloudArgs_Req_DEFAULT *SetCloudRequest +var CommonServiceGetCSSArgs_Req_DEFAULT *GetCSSRequest -func (p *VersionServiceSetCloudArgs) GetReq() (v *SetCloudRequest) { +func (p *CommonServiceGetCSSArgs) GetReq() (v *GetCSSRequest) { if !p.IsSetReq() { - return VersionServiceSetCloudArgs_Req_DEFAULT + return CommonServiceGetCSSArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_VersionServiceSetCloudArgs = map[int16]string{ +var fieldIDToName_CommonServiceGetCSSArgs = map[int16]string{ 1: "req", } -func (p *VersionServiceSetCloudArgs) IsSetReq() bool { +func (p *CommonServiceGetCSSArgs) IsSetReq() bool { return p.Req != nil } -func (p *VersionServiceSetCloudArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetCSSArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -27195,7 +28603,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_VersionServiceSetCloudArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetCSSArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -27205,8 +28613,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *VersionServiceSetCloudArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewSetCloudRequest() +func (p *CommonServiceGetCSSArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetCSSRequest() if err := _field.Read(iprot); err != nil { return err } @@ -27214,10 +28622,9 @@ func (p *VersionServiceSetCloudArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *VersionServiceSetCloudArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *CommonServiceGetCSSArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("SetCloud_args"); err != nil { + if err = oprot.WriteStructBegin("GetCSS_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -27243,7 +28650,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *VersionServiceSetCloudArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetCSSArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -27260,43 +28667,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *VersionServiceSetCloudArgs) String() string { +func (p *CommonServiceGetCSSArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("VersionServiceSetCloudArgs(%+v)", *p) + return fmt.Sprintf("CommonServiceGetCSSArgs(%+v)", *p) } -type VersionServiceSetCloudResult struct { - Success *SetCloudResponse `thrift:"success,0,optional"` +type CommonServiceGetCSSResult struct { + Success *GetCSSResponse `thrift:"success,0,optional"` } -func NewVersionServiceSetCloudResult() *VersionServiceSetCloudResult { - return &VersionServiceSetCloudResult{} +func NewCommonServiceGetCSSResult() *CommonServiceGetCSSResult { + return &CommonServiceGetCSSResult{} } -func (p *VersionServiceSetCloudResult) InitDefault() { +func (p *CommonServiceGetCSSResult) InitDefault() { } -var VersionServiceSetCloudResult_Success_DEFAULT *SetCloudResponse +var CommonServiceGetCSSResult_Success_DEFAULT *GetCSSResponse -func (p *VersionServiceSetCloudResult) GetSuccess() (v *SetCloudResponse) { +func (p *CommonServiceGetCSSResult) GetSuccess() (v *GetCSSResponse) { if !p.IsSetSuccess() { - return VersionServiceSetCloudResult_Success_DEFAULT + return CommonServiceGetCSSResult_Success_DEFAULT } return p.Success } -var fieldIDToName_VersionServiceSetCloudResult = map[int16]string{ +var fieldIDToName_CommonServiceGetCSSResult = map[int16]string{ 0: "success", } -func (p *VersionServiceSetCloudResult) IsSetSuccess() bool { +func (p *CommonServiceGetCSSResult) IsSetSuccess() bool { return p.Success != nil } -func (p *VersionServiceSetCloudResult) Read(iprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetCSSResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -27342,7 +28749,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_VersionServiceSetCloudResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetCSSResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -27352,8 +28759,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *VersionServiceSetCloudResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewSetCloudResponse() +func (p *CommonServiceGetCSSResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetCSSResponse() if err := _field.Read(iprot); err != nil { return err } @@ -27361,10 +28768,9 @@ func (p *VersionServiceSetCloudResult) ReadField0(iprot thrift.TProtocol) error return nil } -func (p *VersionServiceSetCloudResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *CommonServiceGetCSSResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("SetCloud_result"); err != nil { + if err = oprot.WriteStructBegin("GetCSS_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -27390,7 +28796,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *VersionServiceSetCloudResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetCSSResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -27409,43 +28815,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *VersionServiceSetCloudResult) String() string { +func (p *CommonServiceGetCSSResult) String() string { if p == nil { return "" } - return fmt.Sprintf("VersionServiceSetCloudResult(%+v)", *p) + return fmt.Sprintf("CommonServiceGetCSSResult(%+v)", *p) } -type VersionServiceGetDumpArgs struct { - Req *GetDumpRequest `thrift:"req,1"` +type CommonServiceGetHtmlArgs struct { + Req *GetHtmlRequest `thrift:"req,1"` } -func NewVersionServiceGetDumpArgs() *VersionServiceGetDumpArgs { - return &VersionServiceGetDumpArgs{} +func NewCommonServiceGetHtmlArgs() *CommonServiceGetHtmlArgs { + return &CommonServiceGetHtmlArgs{} } -func (p *VersionServiceGetDumpArgs) InitDefault() { +func (p *CommonServiceGetHtmlArgs) InitDefault() { } -var VersionServiceGetDumpArgs_Req_DEFAULT *GetDumpRequest +var CommonServiceGetHtmlArgs_Req_DEFAULT *GetHtmlRequest -func (p *VersionServiceGetDumpArgs) GetReq() (v *GetDumpRequest) { +func (p *CommonServiceGetHtmlArgs) GetReq() (v *GetHtmlRequest) { if !p.IsSetReq() { - return VersionServiceGetDumpArgs_Req_DEFAULT + return CommonServiceGetHtmlArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_VersionServiceGetDumpArgs = map[int16]string{ +var fieldIDToName_CommonServiceGetHtmlArgs = map[int16]string{ 1: "req", } -func (p *VersionServiceGetDumpArgs) IsSetReq() bool { +func (p *CommonServiceGetHtmlArgs) IsSetReq() bool { return p.Req != nil } -func (p *VersionServiceGetDumpArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetHtmlArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -27491,7 +28897,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_VersionServiceGetDumpArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetHtmlArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -27501,8 +28907,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *VersionServiceGetDumpArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetDumpRequest() +func (p *CommonServiceGetHtmlArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetHtmlRequest() if err := _field.Read(iprot); err != nil { return err } @@ -27510,10 +28916,9 @@ func (p *VersionServiceGetDumpArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *VersionServiceGetDumpArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *CommonServiceGetHtmlArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetDump_args"); err != nil { + if err = oprot.WriteStructBegin("GetHtml_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -27539,7 +28944,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *VersionServiceGetDumpArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetHtmlArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -27556,43 +28961,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *VersionServiceGetDumpArgs) String() string { +func (p *CommonServiceGetHtmlArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("VersionServiceGetDumpArgs(%+v)", *p) + return fmt.Sprintf("CommonServiceGetHtmlArgs(%+v)", *p) } -type VersionServiceGetDumpResult struct { - Success *GetDumpResponse `thrift:"success,0,optional"` +type CommonServiceGetHtmlResult struct { + Success *GetHtmlResponse `thrift:"success,0,optional"` } -func NewVersionServiceGetDumpResult() *VersionServiceGetDumpResult { - return &VersionServiceGetDumpResult{} +func NewCommonServiceGetHtmlResult() *CommonServiceGetHtmlResult { + return &CommonServiceGetHtmlResult{} } -func (p *VersionServiceGetDumpResult) InitDefault() { +func (p *CommonServiceGetHtmlResult) InitDefault() { } -var VersionServiceGetDumpResult_Success_DEFAULT *GetDumpResponse +var CommonServiceGetHtmlResult_Success_DEFAULT *GetHtmlResponse -func (p *VersionServiceGetDumpResult) GetSuccess() (v *GetDumpResponse) { +func (p *CommonServiceGetHtmlResult) GetSuccess() (v *GetHtmlResponse) { if !p.IsSetSuccess() { - return VersionServiceGetDumpResult_Success_DEFAULT + return CommonServiceGetHtmlResult_Success_DEFAULT } return p.Success } -var fieldIDToName_VersionServiceGetDumpResult = map[int16]string{ +var fieldIDToName_CommonServiceGetHtmlResult = map[int16]string{ 0: "success", } -func (p *VersionServiceGetDumpResult) IsSetSuccess() bool { +func (p *CommonServiceGetHtmlResult) IsSetSuccess() bool { return p.Success != nil } -func (p *VersionServiceGetDumpResult) Read(iprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetHtmlResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -27637,298 +29042,110 @@ 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_VersionServiceGetDumpResult[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 *VersionServiceGetDumpResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetDumpResponse() - if err := _field.Read(iprot); err != nil { - return err - } - p.Success = _field - return nil -} - -func (p *VersionServiceGetDumpResult) Write(oprot thrift.TProtocol) (err error) { - - var fieldId int16 - if err = oprot.WriteStructBegin("GetDump_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 *VersionServiceGetDumpResult) 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 *VersionServiceGetDumpResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("VersionServiceGetDumpResult(%+v)", *p) - -} - -type CommonServiceProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler CommonService -} - -func (p *CommonServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor -} - -func (p *CommonServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok -} - -func (p *CommonServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap -} - -func NewCommonServiceProcessor(handler CommonService) *CommonServiceProcessor { - self := &CommonServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} - self.AddToProcessorMap("GetCSS", &commonServiceProcessorGetCSS{handler: handler}) - self.AddToProcessorMap("GetHtml", &commonServiceProcessorGetHtml{handler: handler}) - self.AddToProcessorMap("GetUserAgreement", &commonServiceProcessorGetUserAgreement{handler: handler}) - return self -} -func (p *CommonServiceProcessor) 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 commonServiceProcessorGetCSS struct { - handler CommonService -} - -func (p *commonServiceProcessorGetCSS) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := CommonServiceGetCSSArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetCSS", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := CommonServiceGetCSSResult{} - var retval *GetCSSResponse - if retval, err2 = p.handler.GetCSS(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCSS: "+err2.Error()) - oprot.WriteMessageBegin("GetCSS", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("GetCSS", 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 commonServiceProcessorGetHtml struct { - handler CommonService -} - -func (p *commonServiceProcessorGetHtml) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := CommonServiceGetHtmlArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetHtml", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := CommonServiceGetHtmlResult{} - var retval *GetHtmlResponse - if retval, err2 = p.handler.GetHtml(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetHtml: "+err2.Error()) - oprot.WriteMessageBegin("GetHtml", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("GetHtml", 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 -} +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetHtmlResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -type commonServiceProcessorGetUserAgreement struct { - handler CommonService +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 *commonServiceProcessorGetUserAgreement) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := CommonServiceGetUserAgreementArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetUserAgreement", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *CommonServiceGetHtmlResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetHtmlResponse() + if err := _field.Read(iprot); err != nil { + return err } + p.Success = _field + return nil +} - iprot.ReadMessageEnd() - var err2 error - result := CommonServiceGetUserAgreementResult{} - var retval *GetUserAgreementResponse - if retval, err2 = p.handler.GetUserAgreement(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetUserAgreement: "+err2.Error()) - oprot.WriteMessageBegin("GetUserAgreement", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval +func (p *CommonServiceGetHtmlResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetHtml_result"); err != nil { + goto WriteStructBeginError } - if err2 = oprot.WriteMessageBegin("GetUserAgreement", thrift.REPLY, seqId); err2 != nil { - err = err2 + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + 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 *CommonServiceGetHtmlResult) 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 + } } - if err != nil { - return + 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 *CommonServiceGetHtmlResult) String() string { + if p == nil { + return "" } - return true, err + return fmt.Sprintf("CommonServiceGetHtmlResult(%+v)", *p) + } -type CommonServiceGetCSSArgs struct { - Req *GetCSSRequest `thrift:"req,1"` +type CommonServiceGetUserAgreementArgs struct { + Req *GetUserAgreementRequest `thrift:"req,1"` } -func NewCommonServiceGetCSSArgs() *CommonServiceGetCSSArgs { - return &CommonServiceGetCSSArgs{} +func NewCommonServiceGetUserAgreementArgs() *CommonServiceGetUserAgreementArgs { + return &CommonServiceGetUserAgreementArgs{} } -func (p *CommonServiceGetCSSArgs) InitDefault() { +func (p *CommonServiceGetUserAgreementArgs) InitDefault() { } -var CommonServiceGetCSSArgs_Req_DEFAULT *GetCSSRequest +var CommonServiceGetUserAgreementArgs_Req_DEFAULT *GetUserAgreementRequest -func (p *CommonServiceGetCSSArgs) GetReq() (v *GetCSSRequest) { +func (p *CommonServiceGetUserAgreementArgs) GetReq() (v *GetUserAgreementRequest) { if !p.IsSetReq() { - return CommonServiceGetCSSArgs_Req_DEFAULT + return CommonServiceGetUserAgreementArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_CommonServiceGetCSSArgs = map[int16]string{ +var fieldIDToName_CommonServiceGetUserAgreementArgs = map[int16]string{ 1: "req", } -func (p *CommonServiceGetCSSArgs) IsSetReq() bool { +func (p *CommonServiceGetUserAgreementArgs) IsSetReq() bool { return p.Req != nil } -func (p *CommonServiceGetCSSArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetUserAgreementArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -27974,7 +29191,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_CommonServiceGetCSSArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetUserAgreementArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -27984,8 +29201,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *CommonServiceGetCSSArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetCSSRequest() +func (p *CommonServiceGetUserAgreementArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetUserAgreementRequest() if err := _field.Read(iprot); err != nil { return err } @@ -27993,10 +29210,9 @@ func (p *CommonServiceGetCSSArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *CommonServiceGetCSSArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *CommonServiceGetUserAgreementArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetCSS_args"); err != nil { + if err = oprot.WriteStructBegin("GetUserAgreement_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -28022,7 +29238,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *CommonServiceGetCSSArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetUserAgreementArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -28039,43 +29255,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *CommonServiceGetCSSArgs) String() string { +func (p *CommonServiceGetUserAgreementArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("CommonServiceGetCSSArgs(%+v)", *p) + return fmt.Sprintf("CommonServiceGetUserAgreementArgs(%+v)", *p) } -type CommonServiceGetCSSResult struct { - Success *GetCSSResponse `thrift:"success,0,optional"` +type CommonServiceGetUserAgreementResult struct { + Success *GetUserAgreementResponse `thrift:"success,0,optional"` } -func NewCommonServiceGetCSSResult() *CommonServiceGetCSSResult { - return &CommonServiceGetCSSResult{} +func NewCommonServiceGetUserAgreementResult() *CommonServiceGetUserAgreementResult { + return &CommonServiceGetUserAgreementResult{} } -func (p *CommonServiceGetCSSResult) InitDefault() { +func (p *CommonServiceGetUserAgreementResult) InitDefault() { } -var CommonServiceGetCSSResult_Success_DEFAULT *GetCSSResponse +var CommonServiceGetUserAgreementResult_Success_DEFAULT *GetUserAgreementResponse -func (p *CommonServiceGetCSSResult) GetSuccess() (v *GetCSSResponse) { +func (p *CommonServiceGetUserAgreementResult) GetSuccess() (v *GetUserAgreementResponse) { if !p.IsSetSuccess() { - return CommonServiceGetCSSResult_Success_DEFAULT + return CommonServiceGetUserAgreementResult_Success_DEFAULT } return p.Success } -var fieldIDToName_CommonServiceGetCSSResult = map[int16]string{ +var fieldIDToName_CommonServiceGetUserAgreementResult = map[int16]string{ 0: "success", } -func (p *CommonServiceGetCSSResult) IsSetSuccess() bool { +func (p *CommonServiceGetUserAgreementResult) IsSetSuccess() bool { return p.Success != nil } -func (p *CommonServiceGetCSSResult) Read(iprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetUserAgreementResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -28121,7 +29337,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_CommonServiceGetCSSResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetUserAgreementResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -28131,8 +29347,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *CommonServiceGetCSSResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetCSSResponse() +func (p *CommonServiceGetUserAgreementResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetUserAgreementResponse() if err := _field.Read(iprot); err != nil { return err } @@ -28140,10 +29356,9 @@ func (p *CommonServiceGetCSSResult) ReadField0(iprot thrift.TProtocol) error { return nil } -func (p *CommonServiceGetCSSResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *CommonServiceGetUserAgreementResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetCSS_result"); err != nil { + if err = oprot.WriteStructBegin("GetUserAgreement_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -28169,7 +29384,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *CommonServiceGetCSSResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetUserAgreementResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -28188,43 +29403,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *CommonServiceGetCSSResult) String() string { +func (p *CommonServiceGetUserAgreementResult) String() string { if p == nil { return "" } - return fmt.Sprintf("CommonServiceGetCSSResult(%+v)", *p) + return fmt.Sprintf("CommonServiceGetUserAgreementResult(%+v)", *p) } -type CommonServiceGetHtmlArgs struct { - Req *GetHtmlRequest `thrift:"req,1"` +type CommonServiceGetTermsListArgs struct { + Req *TermListRequest `thrift:"req,1"` } -func NewCommonServiceGetHtmlArgs() *CommonServiceGetHtmlArgs { - return &CommonServiceGetHtmlArgs{} +func NewCommonServiceGetTermsListArgs() *CommonServiceGetTermsListArgs { + return &CommonServiceGetTermsListArgs{} } -func (p *CommonServiceGetHtmlArgs) InitDefault() { +func (p *CommonServiceGetTermsListArgs) InitDefault() { } -var CommonServiceGetHtmlArgs_Req_DEFAULT *GetHtmlRequest +var CommonServiceGetTermsListArgs_Req_DEFAULT *TermListRequest -func (p *CommonServiceGetHtmlArgs) GetReq() (v *GetHtmlRequest) { +func (p *CommonServiceGetTermsListArgs) GetReq() (v *TermListRequest) { if !p.IsSetReq() { - return CommonServiceGetHtmlArgs_Req_DEFAULT + return CommonServiceGetTermsListArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_CommonServiceGetHtmlArgs = map[int16]string{ +var fieldIDToName_CommonServiceGetTermsListArgs = map[int16]string{ 1: "req", } -func (p *CommonServiceGetHtmlArgs) IsSetReq() bool { +func (p *CommonServiceGetTermsListArgs) IsSetReq() bool { return p.Req != nil } -func (p *CommonServiceGetHtmlArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetTermsListArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -28270,7 +29485,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_CommonServiceGetHtmlArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetTermsListArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -28280,8 +29495,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *CommonServiceGetHtmlArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetHtmlRequest() +func (p *CommonServiceGetTermsListArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewTermListRequest() if err := _field.Read(iprot); err != nil { return err } @@ -28289,10 +29504,9 @@ func (p *CommonServiceGetHtmlArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *CommonServiceGetHtmlArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *CommonServiceGetTermsListArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetHtml_args"); err != nil { + if err = oprot.WriteStructBegin("GetTermsList_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -28318,7 +29532,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *CommonServiceGetHtmlArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetTermsListArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -28335,43 +29549,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *CommonServiceGetHtmlArgs) String() string { +func (p *CommonServiceGetTermsListArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("CommonServiceGetHtmlArgs(%+v)", *p) + return fmt.Sprintf("CommonServiceGetTermsListArgs(%+v)", *p) } -type CommonServiceGetHtmlResult struct { - Success *GetHtmlResponse `thrift:"success,0,optional"` +type CommonServiceGetTermsListResult struct { + Success *TermListResponse `thrift:"success,0,optional"` } -func NewCommonServiceGetHtmlResult() *CommonServiceGetHtmlResult { - return &CommonServiceGetHtmlResult{} +func NewCommonServiceGetTermsListResult() *CommonServiceGetTermsListResult { + return &CommonServiceGetTermsListResult{} } -func (p *CommonServiceGetHtmlResult) InitDefault() { +func (p *CommonServiceGetTermsListResult) InitDefault() { } -var CommonServiceGetHtmlResult_Success_DEFAULT *GetHtmlResponse +var CommonServiceGetTermsListResult_Success_DEFAULT *TermListResponse -func (p *CommonServiceGetHtmlResult) GetSuccess() (v *GetHtmlResponse) { +func (p *CommonServiceGetTermsListResult) GetSuccess() (v *TermListResponse) { if !p.IsSetSuccess() { - return CommonServiceGetHtmlResult_Success_DEFAULT + return CommonServiceGetTermsListResult_Success_DEFAULT } return p.Success } -var fieldIDToName_CommonServiceGetHtmlResult = map[int16]string{ +var fieldIDToName_CommonServiceGetTermsListResult = map[int16]string{ 0: "success", } -func (p *CommonServiceGetHtmlResult) IsSetSuccess() bool { +func (p *CommonServiceGetTermsListResult) IsSetSuccess() bool { return p.Success != nil } -func (p *CommonServiceGetHtmlResult) Read(iprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetTermsListResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -28417,7 +29631,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_CommonServiceGetHtmlResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetTermsListResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -28427,8 +29641,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *CommonServiceGetHtmlResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetHtmlResponse() +func (p *CommonServiceGetTermsListResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewTermListResponse() if err := _field.Read(iprot); err != nil { return err } @@ -28436,10 +29650,9 @@ func (p *CommonServiceGetHtmlResult) ReadField0(iprot thrift.TProtocol) error { return nil } -func (p *CommonServiceGetHtmlResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *CommonServiceGetTermsListResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetHtml_result"); err != nil { + if err = oprot.WriteStructBegin("GetTermsList_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -28465,7 +29678,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *CommonServiceGetHtmlResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetTermsListResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -28484,43 +29697,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *CommonServiceGetHtmlResult) String() string { +func (p *CommonServiceGetTermsListResult) String() string { if p == nil { return "" } - return fmt.Sprintf("CommonServiceGetHtmlResult(%+v)", *p) + return fmt.Sprintf("CommonServiceGetTermsListResult(%+v)", *p) } -type CommonServiceGetUserAgreementArgs struct { - Req *GetUserAgreementRequest `thrift:"req,1"` +type CommonServiceGetTermArgs struct { + Req *TermRequest `thrift:"req,1"` } -func NewCommonServiceGetUserAgreementArgs() *CommonServiceGetUserAgreementArgs { - return &CommonServiceGetUserAgreementArgs{} +func NewCommonServiceGetTermArgs() *CommonServiceGetTermArgs { + return &CommonServiceGetTermArgs{} } -func (p *CommonServiceGetUserAgreementArgs) InitDefault() { +func (p *CommonServiceGetTermArgs) InitDefault() { } -var CommonServiceGetUserAgreementArgs_Req_DEFAULT *GetUserAgreementRequest +var CommonServiceGetTermArgs_Req_DEFAULT *TermRequest -func (p *CommonServiceGetUserAgreementArgs) GetReq() (v *GetUserAgreementRequest) { +func (p *CommonServiceGetTermArgs) GetReq() (v *TermRequest) { if !p.IsSetReq() { - return CommonServiceGetUserAgreementArgs_Req_DEFAULT + return CommonServiceGetTermArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_CommonServiceGetUserAgreementArgs = map[int16]string{ +var fieldIDToName_CommonServiceGetTermArgs = map[int16]string{ 1: "req", } -func (p *CommonServiceGetUserAgreementArgs) IsSetReq() bool { +func (p *CommonServiceGetTermArgs) IsSetReq() bool { return p.Req != nil } -func (p *CommonServiceGetUserAgreementArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetTermArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -28566,7 +29779,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_CommonServiceGetUserAgreementArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetTermArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -28576,8 +29789,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *CommonServiceGetUserAgreementArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetUserAgreementRequest() +func (p *CommonServiceGetTermArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewTermRequest() if err := _field.Read(iprot); err != nil { return err } @@ -28585,10 +29798,9 @@ func (p *CommonServiceGetUserAgreementArgs) ReadField1(iprot thrift.TProtocol) e return nil } -func (p *CommonServiceGetUserAgreementArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *CommonServiceGetTermArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetUserAgreement_args"); err != nil { + if err = oprot.WriteStructBegin("GetTerm_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -28614,7 +29826,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *CommonServiceGetUserAgreementArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetTermArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -28631,43 +29843,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *CommonServiceGetUserAgreementArgs) String() string { +func (p *CommonServiceGetTermArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("CommonServiceGetUserAgreementArgs(%+v)", *p) + return fmt.Sprintf("CommonServiceGetTermArgs(%+v)", *p) } -type CommonServiceGetUserAgreementResult struct { - Success *GetUserAgreementResponse `thrift:"success,0,optional"` +type CommonServiceGetTermResult struct { + Success *TermResponse `thrift:"success,0,optional"` } -func NewCommonServiceGetUserAgreementResult() *CommonServiceGetUserAgreementResult { - return &CommonServiceGetUserAgreementResult{} +func NewCommonServiceGetTermResult() *CommonServiceGetTermResult { + return &CommonServiceGetTermResult{} } -func (p *CommonServiceGetUserAgreementResult) InitDefault() { +func (p *CommonServiceGetTermResult) InitDefault() { } -var CommonServiceGetUserAgreementResult_Success_DEFAULT *GetUserAgreementResponse +var CommonServiceGetTermResult_Success_DEFAULT *TermResponse -func (p *CommonServiceGetUserAgreementResult) GetSuccess() (v *GetUserAgreementResponse) { +func (p *CommonServiceGetTermResult) GetSuccess() (v *TermResponse) { if !p.IsSetSuccess() { - return CommonServiceGetUserAgreementResult_Success_DEFAULT + return CommonServiceGetTermResult_Success_DEFAULT } return p.Success } -var fieldIDToName_CommonServiceGetUserAgreementResult = map[int16]string{ +var fieldIDToName_CommonServiceGetTermResult = map[int16]string{ 0: "success", } -func (p *CommonServiceGetUserAgreementResult) IsSetSuccess() bool { +func (p *CommonServiceGetTermResult) IsSetSuccess() bool { return p.Success != nil } -func (p *CommonServiceGetUserAgreementResult) Read(iprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetTermResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -28713,7 +29925,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_CommonServiceGetUserAgreementResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetTermResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -28723,8 +29935,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *CommonServiceGetUserAgreementResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetUserAgreementResponse() +func (p *CommonServiceGetTermResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewTermResponse() if err := _field.Read(iprot); err != nil { return err } @@ -28732,10 +29944,9 @@ func (p *CommonServiceGetUserAgreementResult) ReadField0(iprot thrift.TProtocol) return nil } -func (p *CommonServiceGetUserAgreementResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *CommonServiceGetTermResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetUserAgreement_result"); err != nil { + if err = oprot.WriteStructBegin("GetTerm_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -28761,7 +29972,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *CommonServiceGetUserAgreementResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetTermResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -28780,10 +29991,10 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *CommonServiceGetUserAgreementResult) String() string { +func (p *CommonServiceGetTermResult) String() string { if p == nil { return "" } - return fmt.Sprintf("CommonServiceGetUserAgreementResult(%+v)", *p) + return fmt.Sprintf("CommonServiceGetTermResult(%+v)", *p) } diff --git a/api/model/model/model.go b/api/model/model/model.go index 4fef7643..e8bb8541 100644 --- a/api/model/model/model.go +++ b/api/model/model/model.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by thriftgo (0.3.18). DO NOT EDIT. +// Code generated by thriftgo (0.3.17). DO NOT EDIT. package model @@ -137,7 +137,6 @@ func (p *BaseResp) ReadField2(iprot thrift.TProtocol) error { } func (p *BaseResp) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("BaseResp"); err != nil { goto WriteStructBeginError @@ -354,7 +353,6 @@ func (p *LoginData) ReadField2(iprot thrift.TProtocol) error { } func (p *LoginData) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("LoginData"); err != nil { goto WriteStructBeginError @@ -633,7 +631,6 @@ func (p *Classroom) ReadField4(iprot thrift.TProtocol) error { } func (p *Classroom) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("Classroom"); err != nil { goto WriteStructBeginError @@ -1012,7 +1009,6 @@ func (p *ExamRoomInfo) ReadField6(iprot thrift.TProtocol) error { } func (p *ExamRoomInfo) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("ExamRoomInfo"); err != nil { goto WriteStructBeginError @@ -1523,7 +1519,6 @@ func (p *CourseScheduleRule) ReadField9(iprot thrift.TProtocol) error { } func (p *CourseScheduleRule) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("CourseScheduleRule"); err != nil { goto WriteStructBeginError @@ -2077,7 +2072,6 @@ func (p *Course) ReadField8(iprot thrift.TProtocol) error { } func (p *Course) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("Course"); err != nil { goto WriteStructBeginError @@ -2766,7 +2760,6 @@ func (p *Picture) ReadField16(iprot thrift.TProtocol) error { } func (p *Picture) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("Picture"); err != nil { goto WriteStructBeginError @@ -3126,9 +3119,9 @@ func (p *Picture) String() string { * @Param folders 当前所在目录下的文件夹 */ type UpYunFileDir struct { - BasePath string `thrift:"basePath,1,required" form:"basePath,required" json:"basePath,required" query:"basePath,required"` - Files []string `thrift:"files,2,required" form:"files,required" json:"files,required" query:"files,required"` - Folders []string `thrift:"folders,3,required" form:"folders,required" json:"folders,required" query:"folders,required"` + BasePath *string `thrift:"basePath,1,optional" form:"basePath" json:"basePath,omitempty" query:"basePath"` + Files []string `thrift:"files,2,optional" form:"files" json:"files,omitempty" query:"files"` + Folders []string `thrift:"folders,3,optional" form:"folders" json:"folders,omitempty" query:"folders"` } func NewUpYunFileDir() *UpYunFileDir { @@ -3138,15 +3131,30 @@ func NewUpYunFileDir() *UpYunFileDir { func (p *UpYunFileDir) InitDefault() { } +var UpYunFileDir_BasePath_DEFAULT string + func (p *UpYunFileDir) GetBasePath() (v string) { - return p.BasePath + if !p.IsSetBasePath() { + return UpYunFileDir_BasePath_DEFAULT + } + return *p.BasePath } +var UpYunFileDir_Files_DEFAULT []string + func (p *UpYunFileDir) GetFiles() (v []string) { + if !p.IsSetFiles() { + return UpYunFileDir_Files_DEFAULT + } return p.Files } +var UpYunFileDir_Folders_DEFAULT []string + func (p *UpYunFileDir) GetFolders() (v []string) { + if !p.IsSetFolders() { + return UpYunFileDir_Folders_DEFAULT + } return p.Folders } @@ -3156,13 +3164,22 @@ var fieldIDToName_UpYunFileDir = map[int16]string{ 3: "folders", } +func (p *UpYunFileDir) IsSetBasePath() bool { + return p.BasePath != nil +} + +func (p *UpYunFileDir) IsSetFiles() bool { + return p.Files != nil +} + +func (p *UpYunFileDir) IsSetFolders() bool { + return p.Folders != nil +} + func (p *UpYunFileDir) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetBasePath bool = false - var issetFiles bool = false - var issetFolders bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -3183,7 +3200,6 @@ func (p *UpYunFileDir) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetBasePath = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -3192,7 +3208,6 @@ func (p *UpYunFileDir) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField2(iprot); err != nil { goto ReadFieldError } - issetFiles = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -3201,7 +3216,6 @@ func (p *UpYunFileDir) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField3(iprot); err != nil { goto ReadFieldError } - issetFolders = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -3218,20 +3232,6 @@ func (p *UpYunFileDir) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetBasePath { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetFiles { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetFolders { - fieldId = 3 - goto RequiredFieldNotSetError - } return nil ReadStructBeginError: return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) @@ -3246,17 +3246,15 @@ 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) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_UpYunFileDir[fieldId])) } func (p *UpYunFileDir) ReadField1(iprot thrift.TProtocol) error { - var _field string + var _field *string if v, err := iprot.ReadString(); err != nil { return err } else { - _field = v + _field = &v } p.BasePath = _field return nil @@ -3309,7 +3307,6 @@ func (p *UpYunFileDir) ReadField3(iprot thrift.TProtocol) error { } func (p *UpYunFileDir) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("UpYunFileDir"); err != nil { goto WriteStructBeginError @@ -3346,14 +3343,16 @@ WriteStructEndError: } func (p *UpYunFileDir) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("basePath", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.BasePath); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError + if p.IsSetBasePath() { + if err = oprot.WriteFieldBegin("basePath", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.BasePath); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } return nil WriteFieldBeginError: @@ -3363,22 +3362,24 @@ WriteFieldEndError: } func (p *UpYunFileDir) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("files", thrift.LIST, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.STRING, len(p.Files)); err != nil { - return err - } - for _, v := range p.Files { - if err := oprot.WriteString(v); err != nil { + if p.IsSetFiles() { + if err = oprot.WriteFieldBegin("files", thrift.LIST, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Files)); err != nil { return err } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError + for _, v := range p.Files { + if err := oprot.WriteString(v); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } return nil WriteFieldBeginError: @@ -3388,22 +3389,24 @@ WriteFieldEndError: } func (p *UpYunFileDir) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("folders", thrift.LIST, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.STRING, len(p.Folders)); err != nil { - return err - } - for _, v := range p.Folders { - if err := oprot.WriteString(v); err != nil { + if p.IsSetFolders() { + if err = oprot.WriteFieldBegin("folders", thrift.LIST, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Folders)); err != nil { return err } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError + for _, v := range p.Folders { + if err := oprot.WriteString(v); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } return nil WriteFieldBeginError: @@ -3709,7 +3712,6 @@ func (p *Score) ReadField7(iprot thrift.TProtocol) error { } func (p *Score) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("Score"); err != nil { goto WriteStructBeginError @@ -4029,7 +4031,6 @@ func (p *GPABean) ReadField2(iprot thrift.TProtocol) error { } func (p *GPABean) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GPABean"); err != nil { goto WriteStructBeginError @@ -4240,7 +4241,6 @@ func (p *GPAData) ReadField2(iprot thrift.TProtocol) error { } func (p *GPAData) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GPAData"); err != nil { goto WriteStructBeginError @@ -4475,7 +4475,6 @@ func (p *Credit) ReadField3(iprot thrift.TProtocol) error { } func (p *Credit) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("Credit"); err != nil { goto WriteStructBeginError @@ -4731,7 +4730,6 @@ func (p *UnifiedExam) ReadField3(iprot thrift.TProtocol) error { } func (p *UnifiedExam) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("UnifiedExam"); err != nil { goto WriteStructBeginError @@ -4826,60 +4824,68 @@ func (p *UnifiedExam) String() string { } -// ====== Common ====== -// 校历 -type Term struct { - TermID string `thrift:"term_id,1,required" form:"term_id,required" json:"term_id,required" query:"term_id,required"` - SchoolYear string `thrift:"school_year,2,required" form:"school_year,required" json:"school_year,required" query:"school_year,required"` - Term string `thrift:"term,3,required" form:"term,required" json:"term,required" query:"term,required"` - StartDate string `thrift:"start_date,4,required" form:"start_date,required" json:"start_date,required" query:"start_date,required"` - EndDate string `thrift:"end_date,5,required" form:"end_date,required" json:"end_date,required" query:"end_date,required"` +type PaperData struct { + BasePath *string `thrift:"base_path,1,optional" form:"base_path" json:"base_path,omitempty" query:"base_path"` + Files []string `thrift:"files,2,optional" form:"files" json:"files,omitempty" query:"files"` + Folders []string `thrift:"folders,3,optional" form:"folders" json:"folders,omitempty" query:"folders"` } -func NewTerm() *Term { - return &Term{} +func NewPaperData() *PaperData { + return &PaperData{} } -func (p *Term) InitDefault() { +func (p *PaperData) InitDefault() { } -func (p *Term) GetTermID() (v string) { - return p.TermID +var PaperData_BasePath_DEFAULT string + +func (p *PaperData) GetBasePath() (v string) { + if !p.IsSetBasePath() { + return PaperData_BasePath_DEFAULT + } + return *p.BasePath } -func (p *Term) GetSchoolYear() (v string) { - return p.SchoolYear +var PaperData_Files_DEFAULT []string + +func (p *PaperData) GetFiles() (v []string) { + if !p.IsSetFiles() { + return PaperData_Files_DEFAULT + } + return p.Files } -func (p *Term) GetTerm() (v string) { - return p.Term +var PaperData_Folders_DEFAULT []string + +func (p *PaperData) GetFolders() (v []string) { + if !p.IsSetFolders() { + return PaperData_Folders_DEFAULT + } + return p.Folders } -func (p *Term) GetStartDate() (v string) { - return p.StartDate +var fieldIDToName_PaperData = map[int16]string{ + 1: "base_path", + 2: "files", + 3: "folders", } -func (p *Term) GetEndDate() (v string) { - return p.EndDate +func (p *PaperData) IsSetBasePath() bool { + return p.BasePath != nil } -var fieldIDToName_Term = map[int16]string{ - 1: "term_id", - 2: "school_year", - 3: "term", - 4: "start_date", - 5: "end_date", +func (p *PaperData) IsSetFiles() bool { + return p.Files != nil } -func (p *Term) Read(iprot thrift.TProtocol) (err error) { +func (p *PaperData) IsSetFolders() bool { + return p.Folders != nil +} + +func (p *PaperData) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetTermID bool = false - var issetSchoolYear bool = false - var issetTerm bool = false - var issetStartDate bool = false - var issetEndDate bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -4900,43 +4906,22 @@ func (p *Term) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetTermID = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } case 2: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.LIST { if err = p.ReadField2(iprot); err != nil { goto ReadFieldError } - issetSchoolYear = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } case 3: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.LIST { if err = p.ReadField3(iprot); err != nil { goto ReadFieldError } - issetTerm = true - } 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 - } - issetStartDate = true - } 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 - } - issetEndDate = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -4953,37 +4938,13 @@ func (p *Term) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetTermID { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetSchoolYear { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetTerm { - fieldId = 3 - goto RequiredFieldNotSetError - } - - if !issetStartDate { - fieldId = 4 - goto RequiredFieldNotSetError - } - - if !issetEndDate { - fieldId = 5 - goto RequiredFieldNotSetError - } 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_Term[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaperData[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -4991,70 +4952,69 @@ 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) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_Term[fieldId])) } -func (p *Term) ReadField1(iprot thrift.TProtocol) error { +func (p *PaperData) ReadField1(iprot thrift.TProtocol) error { - var _field string + var _field *string if v, err := iprot.ReadString(); err != nil { return err } else { - _field = v + _field = &v } - p.TermID = _field + p.BasePath = _field return nil } -func (p *Term) ReadField2(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { +func (p *PaperData) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { return err - } else { - _field = v } - p.SchoolYear = _field - return nil -} -func (p *Term) ReadField3(iprot thrift.TProtocol) error { + _field := make([]string, 0, size) + for i := 0; i < size; i++ { - var _field string - if v, err := iprot.ReadString(); err != nil { + var _elem string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _elem = v + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { return err - } else { - _field = v } - p.Term = _field + p.Files = _field return nil } -func (p *Term) ReadField4(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { +func (p *PaperData) ReadField3(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { return err - } else { - _field = v } - p.StartDate = _field - return nil -} -func (p *Term) ReadField5(iprot thrift.TProtocol) error { + _field := make([]string, 0, size) + for i := 0; i < size; i++ { - var _field string - if v, err := iprot.ReadString(); err != nil { + var _elem string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _elem = v + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { return err - } else { - _field = v } - p.EndDate = _field + p.Folders = _field return nil } -func (p *Term) Write(oprot thrift.TProtocol) (err error) { - +func (p *PaperData) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("Term"); err != nil { + if err = oprot.WriteStructBegin("PaperData"); err != nil { goto WriteStructBeginError } if p != nil { @@ -5070,14 +5030,6 @@ func (p *Term) Write(oprot thrift.TProtocol) (err error) { 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 @@ -5096,15 +5048,17 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *Term) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("term_id", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.TermID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError +func (p *PaperData) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetBasePath() { + if err = oprot.WriteFieldBegin("base_path", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.BasePath); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } return nil WriteFieldBeginError: @@ -5113,15 +5067,25 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *Term) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("school_year", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.SchoolYear); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError +func (p *PaperData) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetFiles() { + if err = oprot.WriteFieldBegin("files", thrift.LIST, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Files)); err != nil { + return err + } + for _, v := range p.Files { + if err := oprot.WriteString(v); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } return nil WriteFieldBeginError: @@ -5130,15 +5094,25 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *Term) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("term", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Term); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError +func (p *PaperData) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetFolders() { + if err = oprot.WriteFieldBegin("folders", thrift.LIST, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Folders)); err != nil { + return err + } + for _, v := range p.Folders { + if err := oprot.WriteString(v); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } return nil WriteFieldBeginError: @@ -5147,86 +5121,38 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) } -func (p *Term) writeField4(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("start_date", thrift.STRING, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.StartDate); 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 *Term) writeField5(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("end_date", thrift.STRING, 5); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.EndDate); 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 *Term) String() string { +func (p *PaperData) String() string { if p == nil { return "" } - return fmt.Sprintf("Term(%+v)", *p) - -} - -type TermEvent struct { - Name string `thrift:"name,1,required" form:"name,required" json:"name,required" query:"name,required"` - StartDate string `thrift:"start_date,2,required" form:"start_date,required" json:"start_date,required" query:"start_date,required"` - EndDate string `thrift:"end_date,3,required" form:"end_date,required" json:"end_date,required" query:"end_date,required"` -} + return fmt.Sprintf("PaperData(%+v)", *p) -func NewTermEvent() *TermEvent { - return &TermEvent{} } -func (p *TermEvent) InitDefault() { +type PaperUrlData struct { + URL string `thrift:"url,1,required" form:"url,required" json:"url,required" query:"url,required"` } -func (p *TermEvent) GetName() (v string) { - return p.Name +func NewPaperUrlData() *PaperUrlData { + return &PaperUrlData{} } -func (p *TermEvent) GetStartDate() (v string) { - return p.StartDate +func (p *PaperUrlData) InitDefault() { } -func (p *TermEvent) GetEndDate() (v string) { - return p.EndDate +func (p *PaperUrlData) GetURL() (v string) { + return p.URL } -var fieldIDToName_TermEvent = map[int16]string{ - 1: "name", - 2: "start_date", - 3: "end_date", +var fieldIDToName_PaperUrlData = map[int16]string{ + 1: "url", } -func (p *TermEvent) Read(iprot thrift.TProtocol) (err error) { +func (p *PaperUrlData) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetName bool = false - var issetStartDate bool = false - var issetEndDate bool = false + var issetURL bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -5247,25 +5173,7 @@ func (p *TermEvent) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetName = true - } 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 - } - issetStartDate = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRING { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - issetEndDate = true + issetURL = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -5282,27 +5190,17 @@ func (p *TermEvent) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetName { + if !issetURL { fieldId = 1 goto RequiredFieldNotSetError } - - if !issetStartDate { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetEndDate { - fieldId = 3 - goto RequiredFieldNotSetError - } 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_TermEvent[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaperUrlData[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -5311,32 +5209,10 @@ ReadFieldEndError: ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TermEvent[fieldId])) -} - -func (p *TermEvent) ReadField1(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Name = _field - return nil + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_PaperUrlData[fieldId])) } -func (p *TermEvent) ReadField2(iprot thrift.TProtocol) error { - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.StartDate = _field - return nil -} -func (p *TermEvent) ReadField3(iprot thrift.TProtocol) error { +func (p *PaperUrlData) ReadField1(iprot thrift.TProtocol) error { var _field string if v, err := iprot.ReadString(); err != nil { @@ -5344,14 +5220,13 @@ func (p *TermEvent) ReadField3(iprot thrift.TProtocol) error { } else { _field = v } - p.EndDate = _field + p.URL = _field return nil } -func (p *TermEvent) Write(oprot thrift.TProtocol) (err error) { - +func (p *PaperUrlData) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("TermEvent"); err != nil { + if err = oprot.WriteStructBegin("PaperUrlData"); err != nil { goto WriteStructBeginError } if p != nil { @@ -5359,14 +5234,6 @@ func (p *TermEvent) Write(oprot thrift.TProtocol) (err error) { fieldId = 1 goto WriteFieldError } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -5385,11 +5252,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *TermEvent) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { +func (p *PaperUrlData) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("url", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(p.Name); err != nil { + if err := oprot.WriteString(p.URL); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -5402,87 +5269,457 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *TermEvent) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("start_date", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.StartDate); 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 *TermEvent) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("end_date", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.EndDate); 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 *TermEvent) String() string { +func (p *PaperUrlData) String() string { if p == nil { return "" } - return fmt.Sprintf("TermEvent(%+v)", *p) + return fmt.Sprintf("PaperUrlData(%+v)", *p) } -// ====== END Common ====== -type PaperData struct { - BasePath string `thrift:"base_path,1,required" form:"base_path,required" json:"base_path,required" query:"base_path,required"` - Files []string `thrift:"files,2,required" form:"files,required" json:"files,required" query:"files,required"` - Folders []string `thrift:"folders,3,required" form:"folders,required" json:"folders,required" query:"folders,required"` +// ====== Common ====== +// 校历 +type Term struct { + TermID *string `thrift:"term_id,1,optional" form:"term_id" json:"term_id,omitempty" query:"term_id"` + SchoolYear *string `thrift:"school_year,2,optional" form:"school_year" json:"school_year,omitempty" query:"school_year"` + Term *string `thrift:"term,3,optional" form:"term" json:"term,omitempty" query:"term"` + StartDate *string `thrift:"start_date,4,optional" form:"start_date" json:"start_date,omitempty" query:"start_date"` + EndDate *string `thrift:"end_date,5,optional" form:"end_date" json:"end_date,omitempty" query:"end_date"` } -func NewPaperData() *PaperData { - return &PaperData{} +func NewTerm() *Term { + return &Term{} } -func (p *PaperData) InitDefault() { +func (p *Term) InitDefault() { } -func (p *PaperData) GetBasePath() (v string) { - return p.BasePath -} +var Term_TermID_DEFAULT string -func (p *PaperData) GetFiles() (v []string) { - return p.Files +func (p *Term) GetTermID() (v string) { + if !p.IsSetTermID() { + return Term_TermID_DEFAULT + } + return *p.TermID } -func (p *PaperData) GetFolders() (v []string) { - return p.Folders +var Term_SchoolYear_DEFAULT string + +func (p *Term) GetSchoolYear() (v string) { + if !p.IsSetSchoolYear() { + return Term_SchoolYear_DEFAULT + } + return *p.SchoolYear } -var fieldIDToName_PaperData = map[int16]string{ - 1: "base_path", - 2: "files", - 3: "folders", +var Term_Term_DEFAULT string + +func (p *Term) GetTerm() (v string) { + if !p.IsSetTerm() { + return Term_Term_DEFAULT + } + return *p.Term +} + +var Term_StartDate_DEFAULT string + +func (p *Term) GetStartDate() (v string) { + if !p.IsSetStartDate() { + return Term_StartDate_DEFAULT + } + return *p.StartDate +} + +var Term_EndDate_DEFAULT string + +func (p *Term) GetEndDate() (v string) { + if !p.IsSetEndDate() { + return Term_EndDate_DEFAULT + } + return *p.EndDate +} + +var fieldIDToName_Term = map[int16]string{ + 1: "term_id", + 2: "school_year", + 3: "term", + 4: "start_date", + 5: "end_date", +} + +func (p *Term) IsSetTermID() bool { + return p.TermID != nil +} + +func (p *Term) IsSetSchoolYear() bool { + return p.SchoolYear != nil +} + +func (p *Term) IsSetTerm() bool { + return p.Term != nil +} + +func (p *Term) IsSetStartDate() bool { + return p.StartDate != nil +} + +func (p *Term) IsSetEndDate() bool { + return p.EndDate != nil +} + +func (p *Term) 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.STRING { + 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_Term[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 *Term) ReadField1(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.TermID = _field + return nil +} +func (p *Term) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.SchoolYear = _field + return nil +} +func (p *Term) ReadField3(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Term = _field + return nil +} +func (p *Term) ReadField4(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.StartDate = _field + return nil +} +func (p *Term) ReadField5(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.EndDate = _field + return nil +} + +func (p *Term) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Term"); 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 *Term) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetTermID() { + if err = oprot.WriteFieldBegin("term_id", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.TermID); 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 *Term) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetSchoolYear() { + if err = oprot.WriteFieldBegin("school_year", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.SchoolYear); 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 *Term) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetTerm() { + if err = oprot.WriteFieldBegin("term", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Term); 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 *Term) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetStartDate() { + if err = oprot.WriteFieldBegin("start_date", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.StartDate); 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 *Term) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetEndDate() { + if err = oprot.WriteFieldBegin("end_date", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.EndDate); 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 *Term) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Term(%+v)", *p) + +} + +type TermEvent struct { + Name *string `thrift:"name,1,optional" form:"name" json:"name,omitempty" query:"name"` + StartDate *string `thrift:"start_date,2,optional" form:"start_date" json:"start_date,omitempty" query:"start_date"` + EndDate *string `thrift:"end_date,3,optional" form:"end_date" json:"end_date,omitempty" query:"end_date"` +} + +func NewTermEvent() *TermEvent { + return &TermEvent{} +} + +func (p *TermEvent) InitDefault() { +} + +var TermEvent_Name_DEFAULT string + +func (p *TermEvent) GetName() (v string) { + if !p.IsSetName() { + return TermEvent_Name_DEFAULT + } + return *p.Name } -func (p *PaperData) Read(iprot thrift.TProtocol) (err error) { +var TermEvent_StartDate_DEFAULT string + +func (p *TermEvent) GetStartDate() (v string) { + if !p.IsSetStartDate() { + return TermEvent_StartDate_DEFAULT + } + return *p.StartDate +} + +var TermEvent_EndDate_DEFAULT string + +func (p *TermEvent) GetEndDate() (v string) { + if !p.IsSetEndDate() { + return TermEvent_EndDate_DEFAULT + } + return *p.EndDate +} + +var fieldIDToName_TermEvent = map[int16]string{ + 1: "name", + 2: "start_date", + 3: "end_date", +} + +func (p *TermEvent) IsSetName() bool { + return p.Name != nil +} + +func (p *TermEvent) IsSetStartDate() bool { + return p.StartDate != nil +} + +func (p *TermEvent) IsSetEndDate() bool { + return p.EndDate != nil +} + +func (p *TermEvent) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetBasePath bool = false - var issetFiles bool = false - var issetFolders bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -5503,25 +5740,22 @@ func (p *PaperData) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetBasePath = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } case 2: - if fieldTypeId == thrift.LIST { + if fieldTypeId == thrift.STRING { if err = p.ReadField2(iprot); err != nil { goto ReadFieldError } - issetFiles = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } case 3: - if fieldTypeId == thrift.LIST { + if fieldTypeId == thrift.STRING { if err = p.ReadField3(iprot); err != nil { goto ReadFieldError } - issetFolders = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -5538,27 +5772,13 @@ func (p *PaperData) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetBasePath { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetFiles { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetFolders { - fieldId = 3 - goto RequiredFieldNotSetError - } 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_PaperData[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TermEvent[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -5566,57 +5786,274 @@ 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) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_PaperData[fieldId])) } -func (p *PaperData) ReadField1(iprot thrift.TProtocol) error { +func (p *TermEvent) ReadField1(iprot thrift.TProtocol) error { - var _field string + var _field *string if v, err := iprot.ReadString(); err != nil { return err } else { - _field = v + _field = &v } - p.BasePath = _field + p.Name = _field return nil } -func (p *PaperData) ReadField2(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { +func (p *TermEvent) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { return err + } else { + _field = &v } - _field := make([]string, 0, size) - for i := 0; i < size; i++ { + p.StartDate = _field + return nil +} +func (p *TermEvent) ReadField3(iprot thrift.TProtocol) error { - var _elem string - if v, err := iprot.ReadString(); err != nil { + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.EndDate = _field + return nil +} + +func (p *TermEvent) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("TermEvent"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *TermEvent) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetName() { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Name); err != nil { return err - } else { - _elem = v } + 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) +} - _field = append(_field, _elem) +func (p *TermEvent) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetStartDate() { + if err = oprot.WriteFieldBegin("start_date", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.StartDate); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } - if err := iprot.ReadListEnd(); err != nil { + 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 *TermEvent) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetEndDate() { + if err = oprot.WriteFieldBegin("end_date", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.EndDate); 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 *TermEvent) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TermEvent(%+v)", *p) + +} + +type TermList struct { + CurrentTerm *string `thrift:"current_term,1,optional" form:"current_term" json:"current_term,omitempty" query:"current_term"` + Terms []*Term `thrift:"terms,2,optional" form:"terms" json:"terms,omitempty" query:"terms"` +} + +func NewTermList() *TermList { + return &TermList{} +} + +func (p *TermList) InitDefault() { +} + +var TermList_CurrentTerm_DEFAULT string + +func (p *TermList) GetCurrentTerm() (v string) { + if !p.IsSetCurrentTerm() { + return TermList_CurrentTerm_DEFAULT + } + return *p.CurrentTerm +} + +var TermList_Terms_DEFAULT []*Term + +func (p *TermList) GetTerms() (v []*Term) { + if !p.IsSetTerms() { + return TermList_Terms_DEFAULT + } + return p.Terms +} + +var fieldIDToName_TermList = map[int16]string{ + 1: "current_term", + 2: "terms", +} + +func (p *TermList) IsSetCurrentTerm() bool { + return p.CurrentTerm != nil +} + +func (p *TermList) IsSetTerms() bool { + return p.Terms != nil +} + +func (p *TermList) 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.LIST { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TermList[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 *TermList) ReadField1(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { return err + } else { + _field = &v } - p.Files = _field + p.CurrentTerm = _field return nil } -func (p *PaperData) ReadField3(iprot thrift.TProtocol) error { +func (p *TermList) ReadField2(iprot thrift.TProtocol) error { _, size, err := iprot.ReadListBegin() if err != nil { return err } - _field := make([]string, 0, size) + _field := make([]*Term, 0, size) + values := make([]Term, size) for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() - var _elem string - if v, err := iprot.ReadString(); err != nil { + if err := _elem.Read(iprot); err != nil { return err - } else { - _elem = v } _field = append(_field, _elem) @@ -5624,14 +6061,13 @@ func (p *PaperData) ReadField3(iprot thrift.TProtocol) error { if err := iprot.ReadListEnd(); err != nil { return err } - p.Folders = _field + p.Terms = _field return nil } -func (p *PaperData) Write(oprot thrift.TProtocol) (err error) { - +func (p *TermList) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("PaperData"); err != nil { + if err = oprot.WriteStructBegin("TermList"); err != nil { goto WriteStructBeginError } if p != nil { @@ -5643,10 +6079,6 @@ func (p *PaperData) Write(oprot thrift.TProtocol) (err error) { fieldId = 2 goto WriteFieldError } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -5665,15 +6097,17 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *PaperData) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("base_path", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.BasePath); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError +func (p *TermList) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetCurrentTerm() { + if err = oprot.WriteFieldBegin("current_term", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.CurrentTerm); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } return nil WriteFieldBeginError: @@ -5682,23 +6116,25 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *PaperData) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("files", thrift.LIST, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.STRING, len(p.Files)); err != nil { - return err - } - for _, v := range p.Files { - if err := oprot.WriteString(v); err != nil { +func (p *TermList) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetTerms() { + if err = oprot.WriteFieldBegin("terms", thrift.LIST, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Terms)); err != nil { return err } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError + for _, v := range p.Terms { + 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: @@ -5707,63 +6143,91 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *PaperData) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("folders", thrift.LIST, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.STRING, len(p.Folders)); err != nil { - return err - } - for _, v := range p.Folders { - if err := oprot.WriteString(v); err != nil { - return err - } +func (p *TermList) String() string { + if p == nil { + return "" } - if err := oprot.WriteListEnd(); err != nil { - return err + return fmt.Sprintf("TermList(%+v)", *p) + +} + +type TermInfo struct { + TermID *string `thrift:"term_id,1,optional" form:"term_id" json:"term_id,omitempty" query:"term_id"` + Term *string `thrift:"term,2,optional" form:"term" json:"term,omitempty" query:"term"` + SchoolYear *string `thrift:"school_year,3,optional" form:"school_year" json:"school_year,omitempty" query:"school_year"` + Events []*TermEvent `thrift:"events,4,optional" form:"events" json:"events,omitempty" query:"events"` +} + +func NewTermInfo() *TermInfo { + return &TermInfo{} +} + +func (p *TermInfo) InitDefault() { +} + +var TermInfo_TermID_DEFAULT string + +func (p *TermInfo) GetTermID() (v string) { + if !p.IsSetTermID() { + return TermInfo_TermID_DEFAULT } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError + return *p.TermID +} + +var TermInfo_Term_DEFAULT string + +func (p *TermInfo) GetTerm() (v string) { + if !p.IsSetTerm() { + return TermInfo_Term_DEFAULT } - 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) + return *p.Term } -func (p *PaperData) String() string { - if p == nil { - return "" +var TermInfo_SchoolYear_DEFAULT string + +func (p *TermInfo) GetSchoolYear() (v string) { + if !p.IsSetSchoolYear() { + return TermInfo_SchoolYear_DEFAULT } - return fmt.Sprintf("PaperData(%+v)", *p) + return *p.SchoolYear +} + +var TermInfo_Events_DEFAULT []*TermEvent +func (p *TermInfo) GetEvents() (v []*TermEvent) { + if !p.IsSetEvents() { + return TermInfo_Events_DEFAULT + } + return p.Events } -type PaperUrlData struct { - URL string `thrift:"url,1,required" form:"url,required" json:"url,required" query:"url,required"` +var fieldIDToName_TermInfo = map[int16]string{ + 1: "term_id", + 2: "term", + 3: "school_year", + 4: "events", } -func NewPaperUrlData() *PaperUrlData { - return &PaperUrlData{} +func (p *TermInfo) IsSetTermID() bool { + return p.TermID != nil } -func (p *PaperUrlData) InitDefault() { +func (p *TermInfo) IsSetTerm() bool { + return p.Term != nil } -func (p *PaperUrlData) GetURL() (v string) { - return p.URL +func (p *TermInfo) IsSetSchoolYear() bool { + return p.SchoolYear != nil } -var fieldIDToName_PaperUrlData = map[int16]string{ - 1: "url", +func (p *TermInfo) IsSetEvents() bool { + return p.Events != nil } -func (p *PaperUrlData) Read(iprot thrift.TProtocol) (err error) { +func (p *TermInfo) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetURL bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -5784,7 +6248,30 @@ func (p *PaperUrlData) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetURL = true + } 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.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.LIST { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -5801,17 +6288,13 @@ func (p *PaperUrlData) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetURL { - fieldId = 1 - goto RequiredFieldNotSetError - } 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_PaperUrlData[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TermInfo[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -5819,26 +6302,68 @@ 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) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_PaperUrlData[fieldId])) } -func (p *PaperUrlData) ReadField1(iprot thrift.TProtocol) error { +func (p *TermInfo) ReadField1(iprot thrift.TProtocol) error { - var _field string + var _field *string if v, err := iprot.ReadString(); err != nil { return err } else { - _field = v + _field = &v } - p.URL = _field + p.TermID = _field return nil } +func (p *TermInfo) ReadField2(iprot thrift.TProtocol) error { -func (p *PaperUrlData) Write(oprot thrift.TProtocol) (err error) { + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Term = _field + return nil +} +func (p *TermInfo) ReadField3(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.SchoolYear = _field + return nil +} +func (p *TermInfo) ReadField4(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*TermEvent, 0, size) + values := make([]TermEvent, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.Events = _field + return nil +} +func (p *TermInfo) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("PaperUrlData"); err != nil { + if err = oprot.WriteStructBegin("TermInfo"); err != nil { goto WriteStructBeginError } if p != nil { @@ -5846,6 +6371,18 @@ func (p *PaperUrlData) Write(oprot thrift.TProtocol) (err error) { 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 @@ -5864,15 +6401,17 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *PaperUrlData) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("url", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.URL); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError +func (p *TermInfo) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetTermID() { + if err = oprot.WriteFieldBegin("term_id", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.TermID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } return nil WriteFieldBeginError: @@ -5881,10 +6420,75 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *PaperUrlData) String() string { +func (p *TermInfo) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetTerm() { + if err = oprot.WriteFieldBegin("term", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Term); 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 *TermInfo) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetSchoolYear() { + if err = oprot.WriteFieldBegin("school_year", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.SchoolYear); 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 *TermInfo) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetEvents() { + if err = oprot.WriteFieldBegin("events", thrift.LIST, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Events)); err != nil { + return err + } + for _, v := range p.Events { + 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 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *TermInfo) String() string { if p == nil { return "" } - return fmt.Sprintf("PaperUrlData(%+v)", *p) + return fmt.Sprintf("TermInfo(%+v)", *p) } diff --git a/api/pack/common.go b/api/pack/common.go new file mode 100644 index 00000000..4be24324 --- /dev/null +++ b/api/pack/common.go @@ -0,0 +1,65 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package pack + +import ( + api "github.com/west2-online/fzuhelper-server/api/model/model" + "github.com/west2-online/fzuhelper-server/kitex_gen/model" + "github.com/west2-online/fzuhelper-server/pkg/base" +) + +func BuildTermList(termList *model.TermList) *api.TermList { + return &api.TermList{ + CurrentTerm: termList.CurrentTerm, + Terms: BuildTerms(termList.Terms), + } +} + +func BuildTerms(termList []*model.Term) []*api.Term { + return base.BuildTypeList(termList, BuildTerm) +} + +func BuildTerm(term *model.Term) *api.Term { + return &api.Term{ + TermID: term.TermId, + SchoolYear: term.SchoolYear, + Term: term.Term, + StartDate: term.StartDate, + EndDate: term.EndDate, + } +} + +func BuildTermInfo(termInfo *model.TermInfo) *api.TermInfo { + return &api.TermInfo{ + TermID: termInfo.TermId, + SchoolYear: termInfo.SchoolYear, + Term: termInfo.Term, + Events: BuildTermEvents(termInfo.Events), + } +} + +func BuildTermEvent(termEvent *model.TermEvent) *api.TermEvent { + return &api.TermEvent{ + Name: termEvent.Name, + StartDate: termEvent.StartDate, + EndDate: termEvent.EndDate, + } +} + +func BuildTermEvents(termEvents []*model.TermEvent) []*api.TermEvent { + return base.BuildTypeList(termEvents, BuildTermEvent) +} diff --git a/api/router/api/api.go b/api/router/api/api.go index 1a36c101..cd8901ad 100644 --- a/api/router/api/api.go +++ b/api/router/api/api.go @@ -99,6 +99,11 @@ func Register(r *server.Hertz) { _paper.GET("/download", append(_getdownloadurlMw(), api.GetDownloadUrl)...) _paper.GET("/list", append(_listdirfilesMw(), api.ListDirFiles)...) } + { + _terms := _v1.Group("/terms", _termsMw()...) + _terms.GET("/info", append(_gettermMw(), api.GetTerm)...) + _terms.GET("/list", append(_gettermslistMw(), api.GetTermsList)...) + } { _user0 := _v1.Group("/user", _user0Mw()...) _user0.POST("/validate-code", append(_validatecodeMw(), api.ValidateCode)...) diff --git a/api/router/api/middleware.go b/api/router/api/middleware.go index aac11106..2facd904 100644 --- a/api/router/api/middleware.go +++ b/api/router/api/middleware.go @@ -403,3 +403,18 @@ func _uploadparamsMw() []app.HandlerFunc { // your code... return nil } + +func _termsMw() []app.HandlerFunc { + // your code... + return nil +} + +func _gettermMw() []app.HandlerFunc { + // your code... + return nil +} + +func _gettermslistMw() []app.HandlerFunc { + // your code... + return nil +} diff --git a/api/rpc/common.go b/api/rpc/common.go index 67978348..ef65f97b 100644 --- a/api/rpc/common.go +++ b/api/rpc/common.go @@ -20,9 +20,11 @@ import ( "context" "github.com/west2-online/fzuhelper-server/kitex_gen/common" + "github.com/west2-online/fzuhelper-server/kitex_gen/model" "github.com/west2-online/fzuhelper-server/pkg/base/client" "github.com/west2-online/fzuhelper-server/pkg/errno" "github.com/west2-online/fzuhelper-server/pkg/logger" + "github.com/west2-online/fzuhelper-server/pkg/utils" ) func InitCommonRPC() { @@ -59,3 +61,30 @@ func GetUserAgreementRPC(ctx context.Context, req *common.GetUserAgreementReques } return &resp.UserAgreement, nil } + +func GetTermsListRPC(ctx context.Context, req *common.TermListRequest) (*model.TermList, error) { + resp, err := commonClient.GetTermsList(ctx, req) + if err != nil { + logger.Errorf("GetTermsListRPC: RPC called failed: %v", err.Error()) + return nil, errno.InternalServiceError.WithMessage(err.Error()) + } + + if err = utils.HandleBaseRespWithCookie(resp.Base); err != nil { + return nil, err + } + + return resp.TermLists, nil +} + +func GetTermRPC(ctx context.Context, req *common.TermRequest) (*model.TermInfo, error) { + resp, err := commonClient.GetTerm(ctx, req) + if err != nil { + logger.Errorf("GetTermRPC: RPC called failed: %v", err.Error()) + return nil, errno.InternalServiceError.WithMessage(err.Error()) + } + if err = utils.HandleBaseRespWithCookie(resp.Base); err != nil { + return nil, err + } + + return resp.TermInfo, nil +} diff --git a/api/rpc/common_test.go b/api/rpc/common_test.go new file mode 100644 index 00000000..8251191a --- /dev/null +++ b/api/rpc/common_test.go @@ -0,0 +1,196 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package rpc + +import ( + "context" + "errors" + "testing" + + "github.com/bytedance/mockey" + "github.com/stretchr/testify/assert" + + "github.com/west2-online/fzuhelper-server/kitex_gen/common" + "github.com/west2-online/fzuhelper-server/kitex_gen/model" +) + +func TestGetTermsListRPC(t *testing.T) { + f := func(str string) *string { + return &str + } + type TestCase struct { + Name string + expectedError bool + expectedErrorInfo error + expectedResult *model.TermList + mockResult *model.TermList + } + + expectedResult := &model.TermList{ + CurrentTerm: f("202401"), + Terms: []*model.Term{ + { + TermId: f("2024012024082620250117"), + SchoolYear: f("2024"), + Term: f("202401"), + StartDate: f("2024-08-26"), + EndDate: f("2025-01-17"), + }, + { + TermId: f("2024022025022420250704"), + SchoolYear: f("2024"), + Term: f("202402"), + StartDate: f("2025-02-24"), + EndDate: f("2025-07-04"), + }, + }, + } + + testCases := []TestCase{ + { + Name: "GetTermsListRPCSuccessfully", + expectedError: false, + expectedErrorInfo: nil, + expectedResult: expectedResult, + mockResult: expectedResult, + }, + { + Name: "GetTermsListRPCError", + expectedError: true, + expectedErrorInfo: errors.New("RPC call failed"), + expectedResult: nil, + mockResult: nil, + }, + } + + req := &common.TermListRequest{} + + defer mockey.UnPatchAll() + + for _, tc := range testCases { + mockey.PatchConvey(tc.Name, t, func() { + mockey.Mock(GetTermsListRPC).To(func(ctx context.Context, req *common.TermListRequest) (*model.TermList, error) { + return tc.mockResult, tc.expectedErrorInfo + }).Build() + + result, err := GetTermsListRPC(context.Background(), req) + if tc.expectedError { + assert.EqualError(t, tc.expectedErrorInfo, err.Error()) + assert.Equal(t, tc.expectedResult, result) + } else { + assert.Nil(t, err) + assert.Equal(t, tc.expectedResult, result) + } + }) + } +} + +func TestGetTermRPC(t *testing.T) { + f := func(str string) *string { + return &str + } + type TestCase struct { + Name string + expectedError bool + expectedErrorInfo error + expectedResult *model.TermInfo + mockResult *model.TermInfo + } + + expectedResult := &model.TermInfo{ + TermId: f("201501"), + Term: f("201501"), + SchoolYear: f("2015"), + Events: []*model.TermEvent{ + { + Name: f("学生注册"), + StartDate: f("2015-08-29"), + EndDate: f("2015-08-30"), + }, + { + Name: f("学生补考"), + StartDate: f("2015-08-29"), + EndDate: f("2015-09-06"), + }, + { + Name: f("正式上课"), + StartDate: f("2015-08-31"), + EndDate: f("2015-08-31"), + }, + { + Name: f("新生报到"), + StartDate: f("2015-09-07"), + EndDate: f("2015-09-07"), + }, + { + Name: f("校运会"), + StartDate: f("2015-11-12"), + EndDate: f("2015-11-14"), + }, + { + Name: f("期末考试"), + StartDate: f("2016-01-16"), + EndDate: f("2016-01-22"), + }, + { + Name: f("寒假"), + StartDate: f("2016-01-23"), + EndDate: f("2016-02-28"), + }, + }, + } + + testCases := []TestCase{ + { + Name: "GetTermsListRPCSuccessfully", + expectedError: false, + expectedErrorInfo: nil, + expectedResult: expectedResult, + mockResult: expectedResult, + }, + { + Name: "GetTermsListRPCError", + expectedError: true, + expectedErrorInfo: errors.New("RPC call failed"), + expectedResult: nil, + mockResult: nil, + }, + } + + req := &common.TermRequest{ + Term: "201501", + } + + defer mockey.UnPatchAll() + + for _, tc := range testCases { + mockey.PatchConvey(tc.Name, t, func() { + mockey.Mock(GetTermRPC).To(func(ctx context.Context, req *common.TermRequest) (*model.TermInfo, error) { + return tc.mockResult, tc.expectedErrorInfo + }).Build() + + result, err := GetTermRPC(context.Background(), req) + if tc.expectedError { + assert.EqualError(t, tc.expectedErrorInfo, err.Error()) + assert.Equal(t, tc.expectedResult, result) + } else { + assert.Nil(t, err) + assert.Equal(t, tc.expectedResult, result) + } + }) + } +} diff --git a/api/rpc/paper_test.go b/api/rpc/paper_test.go new file mode 100644 index 00000000..9c286680 --- /dev/null +++ b/api/rpc/paper_test.go @@ -0,0 +1,184 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package rpc + +import ( + "context" + "errors" + "testing" + + "github.com/bytedance/mockey" + "github.com/stretchr/testify/assert" + + "github.com/west2-online/fzuhelper-server/kitex_gen/model" + "github.com/west2-online/fzuhelper-server/kitex_gen/paper" +) + +func TestGetDownloadUrlRPC(t *testing.T) { + type TestCase struct { + Name string + expectedError bool + expectedErrorInfo error + expectedResult string + mockResult string + } + + testCases := []TestCase{ + { + Name: "GetDownloadUrlRPCSuccessfully", + expectedError: false, + expectedErrorInfo: nil, + expectedResult: "url", + mockResult: "url", + }, + { + Name: "GetDownloadUrlRPCError", + expectedError: true, + expectedErrorInfo: errors.New("RPC call failed"), + expectedResult: "", + mockResult: "", + }, + } + + req := &paper.GetDownloadUrlRequest{ + Filepath: "test_filepath", + } + + defer mockey.UnPatchAll() + + for _, tc := range testCases { + mockey.PatchConvey(tc.Name, t, func() { + mockey.Mock(GetDownloadUrlRPC).To(func(ctx context.Context, req *paper.GetDownloadUrlRequest) (url string, err error) { + return tc.mockResult, tc.expectedErrorInfo + }).Build() + + result, err := GetDownloadUrlRPC(context.Background(), req) + if tc.expectedError { + assert.EqualError(t, tc.expectedErrorInfo, err.Error()) + assert.Equal(t, tc.expectedResult, result) + } else { + assert.Nil(t, err) + assert.Equal(t, tc.expectedResult, result) + } + }) + } +} + +func TestGetDirFilesRPC(t *testing.T) { + type TestCase struct { + Name string + expectedError bool + expectedErrorInfo error + expectedResult *model.UpYunFileDir + mockResult *model.UpYunFileDir + } + basePath := "/C语言" + expectedResult := &model.UpYunFileDir{ + BasePath: &basePath, + Files: []string{ + "10份练习.zip", + "200912填空题(含答案).doc", + "200912改错题(含答案).doc", + "200912程序题(含答案).doc", + "201012真题C语言(含答案).doc", + "2010年4月试题.doc", + "2010年4月试题答案.doc", + "2011-06改错填空编程(含答案).doc", + "2011-06真题C语言(含答案).doc", + "2012年福建省C语言二级考试大题及答案.doc", + "2015C语言课件.zip", + "2015上机题.zip", + "2015选择题.zip", + "C语言-张莹.zip", + "C语言模拟卷含答案 (1).doc", + "C语言模拟卷含答案 (2).doc", + "C语言模拟卷含答案 (3).doc", + "C语言模拟卷含答案 (4).doc", + "C语言模拟卷含答案 (5).doc", + "C语言模拟卷含答案 (6).doc", + "C语言模拟卷含答案 (7).doc", + "C语言要点综合.zip", + "C语言试题汇编.doc", + "c语言真题.zip", + "c语言选择题.doc", + "ugee.tablet.driver.zip", + "全国计算机二级考试复习资料.doc", + "全国计算机等级考试二级笔试复习资料.doc", + "实验.zip", + "林秋月课件.zip", + "王林课件.zip", + "王鸿课件.zip", + "省考.zip", + "省考2级.zip", + "福建省c语言考试试题c题库选择题答案06-08(最新).doc", + "福建省计算机二级c语言模拟卷汇总.doc", + "福建省计算机二级c语言选择题题库.doc", + "福建省高等学校2013年计算机二级C语言试题库.doc", + "福建省高等学校计算机二级C语言试题库大题部分.doc", + "计算机2级.doc", + "计算机等级考试二级C语言超级经典400道题目[1].doc.doc", + "谢丽聪课件.zip", + "选择50题-第二次完善.zip", + }, + Folders: []string{ + "c语试题", + "王鸿", + "省考(期末考)真题", + "谢丽聪", + }, + } + + testCases := []TestCase{ + { + Name: "GetDownloadUrlRPCSuccessfully", + expectedError: false, + expectedErrorInfo: nil, + expectedResult: expectedResult, + mockResult: expectedResult, + }, + { + Name: "GetDownloadUrlRPCError", + expectedError: true, + expectedErrorInfo: errors.New("RPC call failed"), + expectedResult: nil, + mockResult: nil, + }, + } + + req := &paper.ListDirFilesRequest{ + Path: "test_path", + } + + defer mockey.UnPatchAll() + + for _, tc := range testCases { + mockey.PatchConvey(tc.Name, t, func() { + mockey.Mock(GetDirFilesRPC).To(func(ctx context.Context, req *paper.ListDirFilesRequest) (files *model.UpYunFileDir, err error) { + return tc.mockResult, tc.expectedErrorInfo + }).Build() + + result, err := GetDirFilesRPC(context.Background(), req) + if tc.expectedError { + assert.EqualError(t, tc.expectedErrorInfo, err.Error()) + assert.Equal(t, tc.expectedResult, result) + } else { + assert.Nil(t, err) + assert.Equal(t, tc.expectedResult, result) + } + }) + } +} diff --git a/config/config.example.yaml b/config/config.example.yaml index 99438427..850d2f6e 100644 --- a/config/config.example.yaml +++ b/config/config.example.yaml @@ -146,4 +146,3 @@ services: load-balance: false addr: - 0.0.0.0:20009 - diff --git a/idl/api.thrift b/idl/api.thrift index 95197bd7..5fd34c3f 100644 --- a/idl/api.thrift +++ b/idl/api.thrift @@ -441,8 +441,33 @@ struct GetUserAgreementResponse{ 1: binary user_agreement, } +// 学期列表 +struct TermListRequest { +} + +struct TermListResponse { + 1: required model.BaseResp base + 2: required model.TermList term_lists +} + +// 学期信息 +struct TermRequest { + 1: required string term +} + +struct TermResponse { + 1: required model.BaseResp base + 2: required model.TermInfo term_info +} + service CommonService { GetCSSResponse GetCSS(1:GetCSSRequest req)(api.get="/api/v2/common/fzu-helper.css"), GetHtmlResponse GetHtml(1:GetHtmlRequest req)(api.get="/api/v2/common/fzu-helper.html"), GetUserAgreementResponse GetUserAgreement(1: GetUserAgreementRequest req) (api.get="/api/v2/common/user-agreement.html") + // 学期信息:学期列表 + TermListResponse GetTermsList(1: TermListRequest req) (api.get="/api/v1/terms/list") + // 学期信息:学期详情 + TermResponse GetTerm(1: TermRequest req) (api.get="/api/v1/terms/info") } + + diff --git a/idl/common.thrift b/idl/common.thrift index eeb6a283..77ae2ee3 100644 --- a/idl/common.thrift +++ b/idl/common.thrift @@ -11,8 +11,10 @@ struct GetCSSResponse{ struct GetHtmlRequest{ } + struct GetHtmlResponse{ 1: binary html, + } struct GetUserAgreementRequest{ @@ -22,8 +24,31 @@ struct GetUserAgreementResponse{ 1: binary user_agreement, } +// 学期信息 +struct TermRequest { + 1: required string term +} + +struct TermResponse { + 1: required model.BaseResp base + 2: required model.TermInfo term_info +} + +// 学期列表 +struct TermListRequest { +} + +struct TermListResponse { + 1: required model.BaseResp base + 2: required model.TermList term_lists +} + service CommonService { GetCSSResponse GetCSS(1:GetCSSRequest req)(api.get="/api/v1/url/onekey/FZUHelper.css"), GetHtmlResponse GetHtml(1:GetHtmlRequest req)(api.get="/api/v1/url/onekey/FZUHelper.html"), GetUserAgreementResponse GetUserAgreement(1: GetUserAgreementRequest req) (api.get="/api/v1/url/onekey/UserAgreement.html") + // 学期信息:学期列表 + TermListResponse GetTermsList(1: TermListRequest req) + // 学期信息:学期详情 + TermResponse GetTerm(1: TermRequest req) } diff --git a/idl/model.thrift b/idl/model.thrift index 81ddd223..069f7e3f 100644 --- a/idl/model.thrift +++ b/idl/model.thrift @@ -81,9 +81,9 @@ struct Picture{ * @Param folders 当前所在目录下的文件夹 */ struct UpYunFileDir { - 1: required string basePath, - 2: required list files, - 3: required list folders, + 1: optional string basePath, + 2: optional list files, + 3: optional list folders, } // 课程成绩 @@ -121,29 +121,41 @@ struct UnifiedExam { 3: required string term } +struct PaperData { + 1: optional string base_path, + 2: optional list files, + 3: optional list folders, +} + +struct PaperUrlData { + 1: required string url, +} + // ====== Common ====== // 校历 struct Term { - 1: required string term_id - 2: required string school_year - 3: required string term - 4: required string start_date - 5: required string end_date + 1: optional string term_id + 2: optional string school_year + 3: optional string term + 4: optional string start_date + 5: optional string end_date } struct TermEvent { - 1: required string name - 2: required string start_date - 3: required string end_date + 1: optional string name + 2: optional string start_date + 3: optional string end_date } -// ====== END Common ====== -struct PaperData { - 1: required string base_path, - 2: required list files, - 3: required list folders, +struct TermList { + 1: optional string current_term + 2: optional list terms } -struct PaperUrlData { - 1: required string url, +struct TermInfo { + 1: optional string term_id + 2: optional string term + 3: optional string school_year + 4: optional list events } +// ====== END Common ====== diff --git a/internal/common/handler.go b/internal/common/handler.go index 2970c3c3..f7293614 100644 --- a/internal/common/handler.go +++ b/internal/common/handler.go @@ -18,7 +18,9 @@ package common import ( "context" + "fmt" + "github.com/west2-online/fzuhelper-server/internal/common/pack" "github.com/west2-online/fzuhelper-server/internal/common/service" "github.com/west2-online/fzuhelper-server/kitex_gen/common" "github.com/west2-online/fzuhelper-server/pkg/base" @@ -71,3 +73,33 @@ func (s *CommonServiceImpl) GetUserAgreement(ctx context.Context, req *common.Ge resp.UserAgreement = *agreement return resp, nil } + +// GetTermsList implements the CommonServiceImpl interface. +func (s *CommonServiceImpl) GetTermsList(ctx context.Context, req *common.TermListRequest) (resp *common.TermListResponse, err error) { + resp = common.NewTermListResponse() + + res, err := service.NewCommonService(ctx, s.ClientSet).GetTermList() + if err != nil { + resp.Base = base.BuildBaseResp(fmt.Errorf("Common.GetTermsList: get terms list failed: %w", err)) + return resp, nil + } + + resp.Base = base.BuildBaseResp(nil) + resp.TermLists = pack.BuildTermsList(res) + return +} + +// GetTerm implements the CommonServiceImpl interface. +func (s *CommonServiceImpl) GetTerm(ctx context.Context, req *common.TermRequest) (resp *common.TermResponse, err error) { + resp = common.NewTermResponse() + + res, err := service.NewCommonService(ctx, s.ClientSet).GetTerm(req) + if err != nil { + resp.Base = base.BuildBaseResp(fmt.Errorf("Common.GetTerm: get term failed: %w", err)) + return resp, nil + } + + resp.Base = base.BuildBaseResp(nil) + resp.TermInfo = pack.BuildTermInfo(res) + return +} diff --git a/internal/common/pack/term.go b/internal/common/pack/term.go new file mode 100644 index 00000000..785d3fc7 --- /dev/null +++ b/internal/common/pack/term.go @@ -0,0 +1,65 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package pack + +import ( + "github.com/west2-online/fzuhelper-server/kitex_gen/model" + "github.com/west2-online/fzuhelper-server/pkg/base" + "github.com/west2-online/jwch" +) + +func BuildTermsList(calendar *jwch.SchoolCalendar) *model.TermList { + return &model.TermList{ + CurrentTerm: &calendar.CurrentTerm, + Terms: BuildTerms(calendar.Terms), + } +} + +func BuildTermInfo(term *jwch.CalTermEvents) *model.TermInfo { + return &model.TermInfo{ + TermId: &term.TermId, + Term: &term.Term, + SchoolYear: &term.SchoolYear, + Events: BuildTermEvents(term.Events), + } +} + +func BuildTerm(term jwch.CalTerm) *model.Term { + return &model.Term{ + TermId: &term.TermId, + SchoolYear: &term.SchoolYear, + Term: &term.Term, + StartDate: &term.StartDate, + EndDate: &term.EndDate, + } +} + +func BuildTerms(terms []jwch.CalTerm) []*model.Term { + return base.BuildTypeList(terms, BuildTerm) +} + +func BuildTermEvent(term jwch.CalTermEvent) *model.TermEvent { + return &model.TermEvent{ + Name: &term.Name, + StartDate: &term.StartDate, + EndDate: &term.EndDate, + } +} + +func BuildTermEvents(events []jwch.CalTermEvent) []*model.TermEvent { + return base.BuildTypeList(events, BuildTermEvent) +} diff --git a/internal/common/service/term.go b/internal/common/service/term.go new file mode 100644 index 00000000..b35396f4 --- /dev/null +++ b/internal/common/service/term.go @@ -0,0 +1,41 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package service + +import ( + "fmt" + + "github.com/west2-online/fzuhelper-server/kitex_gen/common" + "github.com/west2-online/fzuhelper-server/pkg/base" + "github.com/west2-online/jwch" +) + +func (s *CommonService) GetTermList() (*jwch.SchoolCalendar, error) { + calendar, err := jwch.NewStudent().GetSchoolCalendar() + if err = base.HandleJwchError(err); err != nil { + return nil, fmt.Errorf("service.GetTermList: Get term list failed %w", err) + } + return calendar, nil +} + +func (s *CommonService) GetTerm(req *common.TermRequest) (*jwch.CalTermEvents, error) { + events, err := jwch.NewStudent().GetTermEvents(req.Term) + if err = base.HandleJwchError(err); err != nil { + return nil, fmt.Errorf("service.GetTerm: Get term failed %w", err) + } + return events, nil +} diff --git a/internal/common/service/term_test.go b/internal/common/service/term_test.go new file mode 100644 index 00000000..8ea36647 --- /dev/null +++ b/internal/common/service/term_test.go @@ -0,0 +1,179 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package service + +import ( + "context" + "errors" + "testing" + + "github.com/bytedance/mockey" + "github.com/stretchr/testify/assert" + + "github.com/west2-online/fzuhelper-server/kitex_gen/common" + "github.com/west2-online/fzuhelper-server/pkg/base" + "github.com/west2-online/jwch" +) + +func TestGetTermList(t *testing.T) { + type TestCase struct { + Name string + expectedError bool + expectedErrorInfo error + expectedResult *jwch.SchoolCalendar + } + + expectedResult := &jwch.SchoolCalendar{ + CurrentTerm: "202401", + Terms: []jwch.CalTerm{ + { + TermId: "2024012024082620250117", + SchoolYear: "2024", + Term: "202401", + StartDate: "2024-08-26", + EndDate: "2025-01-17", + }, + { + TermId: "2024022025022420250704", + SchoolYear: "2024", + Term: "202402", + StartDate: "2025-02-24", + EndDate: "2025-07-04", + }, + }, + } + defer mockey.UnPatchAll() + testCases := []TestCase{ + { + Name: "GetTermListSuccessfully", + expectedError: false, + expectedErrorInfo: nil, + expectedResult: expectedResult, + }, + { + Name: "GetTermListError", + expectedError: true, + expectedErrorInfo: errors.New("get term list failed"), + expectedResult: nil, + }, + } + + for _, tc := range testCases { + mockey.PatchConvey(tc.Name, t, func() { + mockey.Mock((*jwch.Student).GetSchoolCalendar).To(func() (*jwch.SchoolCalendar, error) { + return tc.expectedResult, tc.expectedErrorInfo + }).Build() + clientSet := new(base.ClientSet) + commonService := NewCommonService(context.Background(), clientSet) + result, err := commonService.GetTermList() + if tc.expectedError { + assert.EqualError(t, err, "service.GetTermList: Get term list failed "+tc.expectedErrorInfo.Error()) + assert.Nil(t, result) + } else { + assert.Nil(t, tc.expectedErrorInfo, err) + assert.Equal(t, tc.expectedResult, result) + } + }) + } +} + +func TestGetTerm(t *testing.T) { + type TestCase struct { + Name string + expectedError bool + expectedErrorInfo error + expectedResult *jwch.CalTermEvents + } + + expectedResult := &jwch.CalTermEvents{ + TermId: "201501", + Term: "201501", + SchoolYear: "2015", + Events: []jwch.CalTermEvent{ + { + Name: "学生注册", + StartDate: "2015-08-29", + EndDate: "2015-08-30", + }, + { + Name: "学生补考", + StartDate: "2015-08-29", + EndDate: "2015-09-06", + }, + { + Name: "正式上课", + StartDate: "2015-08-31", + EndDate: "2015-08-31", + }, + { + Name: "新生报到", + StartDate: "2015-09-07", + EndDate: "2015-09-07", + }, + { + Name: "校运会", + StartDate: "2015-11-12", + EndDate: "2015-11-14", + }, + { + Name: "期末考试", + StartDate: "2016-01-16", + EndDate: "2016-01-22", + }, + { + Name: "寒假", + StartDate: "2016-01-23", + EndDate: "2016-02-28", + }, + }, + } + + testCases := []TestCase{ + { + Name: "GetTermSuccessfully", + expectedError: false, + expectedErrorInfo: nil, + expectedResult: expectedResult, + }, + { + Name: "GetTermError", + expectedError: true, + expectedErrorInfo: errors.New("get term events failed"), + expectedResult: nil, + }, + } + + defer mockey.UnPatchAll() + req := &common.TermRequest{Term: "201501"} + for _, tc := range testCases { + mockey.PatchConvey(tc.Name, t, func() { + mockey.Mock((*jwch.Student).GetTermEvents).To(func(termId string) (*jwch.CalTermEvents, error) { + return tc.expectedResult, tc.expectedErrorInfo + }).Build() + ClientSet := new(base.ClientSet) + commonService := NewCommonService(context.Background(), ClientSet) + result, err := commonService.GetTerm(req) + if tc.expectedError { + assert.EqualError(t, err, "service.GetTerm: Get term failed "+tc.expectedErrorInfo.Error()) + assert.Nil(t, result) + } else { + assert.Nil(t, err, tc.expectedErrorInfo) + assert.Equal(t, tc.expectedResult, result) + } + }) + } +} diff --git a/internal/paper/handler.go b/internal/paper/handler.go index d1a8c019..3eadd821 100644 --- a/internal/paper/handler.go +++ b/internal/paper/handler.go @@ -50,7 +50,7 @@ func (s *PaperServiceImpl) ListDirFiles(ctx context.Context, req *paper.ListDirF base.LogError(fmt.Errorf("Paper.ListDirFiles: get dir info failed: %w", err)) } if !success { - resp.Base = base.BuildBaseResp(errors.New("failed to get files info")) + resp.Base = base.BuildBaseResp(errors.New("Paper.ListDirFiles: failed to get files info")) return resp, nil } diff --git a/internal/paper/service/get_dir_test.go b/internal/paper/service/get_dir_test.go index cfe40e5c..a3921fbd 100644 --- a/internal/paper/service/get_dir_test.go +++ b/internal/paper/service/get_dir_test.go @@ -50,9 +50,9 @@ func TestGetDir(t *testing.T) { // 成功获取数据 mockIsGetInfo bool } - + basePath := "/C语言" expectedResult := &model.UpYunFileDir{ - BasePath: "/C语言", + BasePath: &basePath, Files: []string{ "10份练习.zip", "200912填空题(含答案).doc", diff --git a/kitex_gen/common/common.go b/kitex_gen/common/common.go index c9d404ae..21ed11cc 100644 --- a/kitex_gen/common/common.go +++ b/kitex_gen/common/common.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by thriftgo (0.3.18). DO NOT EDIT. +// Code generated by thriftgo (0.3.17). DO NOT EDIT. package common @@ -22,8 +22,11 @@ import ( "bytes" "context" "fmt" + "strings" thrift "github.com/cloudwego/kitex/pkg/protocol/bthrift/apache" + + "github.com/west2-online/fzuhelper-server/kitex_gen/model" ) type GetCSSRequest struct { @@ -81,7 +84,6 @@ ReadStructEndError: } func (p *GetCSSRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetCSSRequest"); err != nil { goto WriteStructBeginError } @@ -210,7 +212,6 @@ func (p *GetCSSResponse) ReadField1(iprot thrift.TProtocol) error { } func (p *GetCSSResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GetCSSResponse"); err != nil { goto WriteStructBeginError @@ -338,7 +339,6 @@ ReadStructEndError: } func (p *GetHtmlRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetHtmlRequest"); err != nil { goto WriteStructBeginError } @@ -467,7 +467,6 @@ func (p *GetHtmlResponse) ReadField1(iprot thrift.TProtocol) error { } func (p *GetHtmlResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GetHtmlResponse"); err != nil { goto WriteStructBeginError @@ -595,7 +594,6 @@ ReadStructEndError: } func (p *GetUserAgreementRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetUserAgreementRequest"); err != nil { goto WriteStructBeginError } @@ -724,7 +722,6 @@ func (p *GetUserAgreementResponse) ReadField1(iprot thrift.TProtocol) error { } func (p *GetUserAgreementResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GetUserAgreementResponse"); err != nil { goto WriteStructBeginError @@ -797,49 +794,33 @@ func (p *GetUserAgreementResponse) Field1DeepEqual(src []byte) bool { return true } -type CommonService interface { - GetCSS(ctx context.Context, req *GetCSSRequest) (r *GetCSSResponse, err error) - - GetHtml(ctx context.Context, req *GetHtmlRequest) (r *GetHtmlResponse, err error) - - GetUserAgreement(ctx context.Context, req *GetUserAgreementRequest) (r *GetUserAgreementResponse, err error) -} - -type CommonServiceGetCSSArgs struct { - Req *GetCSSRequest `thrift:"req,1" frugal:"1,default,GetCSSRequest" json:"req"` +type TermRequest struct { + Term string `thrift:"term,1,required" frugal:"1,required,string" json:"term"` } -func NewCommonServiceGetCSSArgs() *CommonServiceGetCSSArgs { - return &CommonServiceGetCSSArgs{} +func NewTermRequest() *TermRequest { + return &TermRequest{} } -func (p *CommonServiceGetCSSArgs) InitDefault() { +func (p *TermRequest) InitDefault() { } -var CommonServiceGetCSSArgs_Req_DEFAULT *GetCSSRequest - -func (p *CommonServiceGetCSSArgs) GetReq() (v *GetCSSRequest) { - if !p.IsSetReq() { - return CommonServiceGetCSSArgs_Req_DEFAULT - } - return p.Req -} -func (p *CommonServiceGetCSSArgs) SetReq(val *GetCSSRequest) { - p.Req = val +func (p *TermRequest) GetTerm() (v string) { + return p.Term } - -var fieldIDToName_CommonServiceGetCSSArgs = map[int16]string{ - 1: "req", +func (p *TermRequest) SetTerm(val string) { + p.Term = val } -func (p *CommonServiceGetCSSArgs) IsSetReq() bool { - return p.Req != nil +var fieldIDToName_TermRequest = map[int16]string{ + 1: "term", } -func (p *CommonServiceGetCSSArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *TermRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 + var issetTerm bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -856,10 +837,11 @@ func (p *CommonServiceGetCSSArgs) Read(iprot thrift.TProtocol) (err error) { switch fieldId { case 1: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.STRING { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } + issetTerm = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -876,13 +858,17 @@ func (p *CommonServiceGetCSSArgs) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } + if !issetTerm { + fieldId = 1 + goto RequiredFieldNotSetError + } 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_CommonServiceGetCSSArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TermRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -890,21 +876,25 @@ 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) +RequiredFieldNotSetError: + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TermRequest[fieldId])) } -func (p *CommonServiceGetCSSArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetCSSRequest() - if err := _field.Read(iprot); err != nil { +func (p *TermRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { return err + } else { + _field = v } - p.Req = _field + p.Term = _field return nil } -func (p *CommonServiceGetCSSArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *TermRequest) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetCSS_args"); err != nil { + if err = oprot.WriteStructBegin("TermRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -930,11 +920,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *CommonServiceGetCSSArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { +func (p *TermRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("term", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } - if err := p.Req.Write(oprot); err != nil { + if err := oprot.WriteString(p.Term); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -947,69 +937,89 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *CommonServiceGetCSSArgs) String() string { +func (p *TermRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("CommonServiceGetCSSArgs(%+v)", *p) + return fmt.Sprintf("TermRequest(%+v)", *p) } -func (p *CommonServiceGetCSSArgs) DeepEqual(ano *CommonServiceGetCSSArgs) bool { +func (p *TermRequest) DeepEqual(ano *TermRequest) bool { if p == ano { return true } else if p == nil || ano == nil { return false } - if !p.Field1DeepEqual(ano.Req) { + if !p.Field1DeepEqual(ano.Term) { return false } return true } -func (p *CommonServiceGetCSSArgs) Field1DeepEqual(src *GetCSSRequest) bool { +func (p *TermRequest) Field1DeepEqual(src string) bool { - if !p.Req.DeepEqual(src) { + if strings.Compare(p.Term, src) != 0 { return false } return true } -type CommonServiceGetCSSResult struct { - Success *GetCSSResponse `thrift:"success,0,optional" frugal:"0,optional,GetCSSResponse" json:"success,omitempty"` +type TermResponse struct { + Base *model.BaseResp `thrift:"base,1,required" frugal:"1,required,model.BaseResp" json:"base"` + TermInfo *model.TermInfo `thrift:"term_info,2,required" frugal:"2,required,model.TermInfo" json:"term_info"` } -func NewCommonServiceGetCSSResult() *CommonServiceGetCSSResult { - return &CommonServiceGetCSSResult{} +func NewTermResponse() *TermResponse { + return &TermResponse{} } -func (p *CommonServiceGetCSSResult) InitDefault() { +func (p *TermResponse) InitDefault() { } -var CommonServiceGetCSSResult_Success_DEFAULT *GetCSSResponse +var TermResponse_Base_DEFAULT *model.BaseResp -func (p *CommonServiceGetCSSResult) GetSuccess() (v *GetCSSResponse) { - if !p.IsSetSuccess() { - return CommonServiceGetCSSResult_Success_DEFAULT +func (p *TermResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return TermResponse_Base_DEFAULT } - return p.Success + return p.Base } -func (p *CommonServiceGetCSSResult) SetSuccess(x interface{}) { - p.Success = x.(*GetCSSResponse) + +var TermResponse_TermInfo_DEFAULT *model.TermInfo + +func (p *TermResponse) GetTermInfo() (v *model.TermInfo) { + if !p.IsSetTermInfo() { + return TermResponse_TermInfo_DEFAULT + } + return p.TermInfo +} +func (p *TermResponse) SetBase(val *model.BaseResp) { + p.Base = val +} +func (p *TermResponse) SetTermInfo(val *model.TermInfo) { + p.TermInfo = val } -var fieldIDToName_CommonServiceGetCSSResult = map[int16]string{ - 0: "success", +var fieldIDToName_TermResponse = map[int16]string{ + 1: "base", + 2: "term_info", } -func (p *CommonServiceGetCSSResult) IsSetSuccess() bool { - return p.Success != nil +func (p *TermResponse) IsSetBase() bool { + return p.Base != nil } -func (p *CommonServiceGetCSSResult) Read(iprot thrift.TProtocol) (err error) { +func (p *TermResponse) IsSetTermInfo() bool { + return p.TermInfo != nil +} + +func (p *TermResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 + var issetBase bool = false + var issetTermInfo bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -1025,11 +1035,21 @@ func (p *CommonServiceGetCSSResult) Read(iprot thrift.TProtocol) (err error) { } switch fieldId { - case 0: + case 1: if fieldTypeId == thrift.STRUCT { - if err = p.ReadField0(iprot); err != nil { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetBase = true + } 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 } + issetTermInfo = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -1046,13 +1066,22 @@ func (p *CommonServiceGetCSSResult) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } + if !issetBase { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetTermInfo { + fieldId = 2 + goto RequiredFieldNotSetError + } 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_CommonServiceGetCSSResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TermResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -1060,26 +1089,39 @@ 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) +RequiredFieldNotSetError: + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TermResponse[fieldId])) } -func (p *CommonServiceGetCSSResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetCSSResponse() +func (p *TermResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() if err := _field.Read(iprot); err != nil { return err } - p.Success = _field + p.Base = _field + return nil +} +func (p *TermResponse) ReadField2(iprot thrift.TProtocol) error { + _field := model.NewTermInfo() + if err := _field.Read(iprot); err != nil { + return err + } + p.TermInfo = _field return nil } -func (p *CommonServiceGetCSSResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *TermResponse) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetCSS_result"); err != nil { + if err = oprot.WriteStructBegin("TermResponse"); err != nil { goto WriteStructBeginError } if p != nil { - if err = p.writeField0(oprot); err != nil { - fieldId = 0 + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 goto WriteFieldError } } @@ -1100,85 +1142,91 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *CommonServiceGetCSSResult) 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 - } +func (p *TermResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); 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 0 begin error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *CommonServiceGetCSSResult) String() string { +func (p *TermResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("term_info", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.TermInfo.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 *TermResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("CommonServiceGetCSSResult(%+v)", *p) + return fmt.Sprintf("TermResponse(%+v)", *p) } -func (p *CommonServiceGetCSSResult) DeepEqual(ano *CommonServiceGetCSSResult) bool { +func (p *TermResponse) DeepEqual(ano *TermResponse) bool { if p == ano { return true } else if p == nil || ano == nil { return false } - if !p.Field0DeepEqual(ano.Success) { + if !p.Field1DeepEqual(ano.Base) { + return false + } + if !p.Field2DeepEqual(ano.TermInfo) { return false } return true } -func (p *CommonServiceGetCSSResult) Field0DeepEqual(src *GetCSSResponse) bool { +func (p *TermResponse) Field1DeepEqual(src *model.BaseResp) bool { - if !p.Success.DeepEqual(src) { + if !p.Base.DeepEqual(src) { return false } return true } +func (p *TermResponse) Field2DeepEqual(src *model.TermInfo) bool { -type CommonServiceGetHtmlArgs struct { - Req *GetHtmlRequest `thrift:"req,1" frugal:"1,default,GetHtmlRequest" json:"req"` -} - -func NewCommonServiceGetHtmlArgs() *CommonServiceGetHtmlArgs { - return &CommonServiceGetHtmlArgs{} + if !p.TermInfo.DeepEqual(src) { + return false + } + return true } -func (p *CommonServiceGetHtmlArgs) InitDefault() { +type TermListRequest struct { } -var CommonServiceGetHtmlArgs_Req_DEFAULT *GetHtmlRequest - -func (p *CommonServiceGetHtmlArgs) GetReq() (v *GetHtmlRequest) { - if !p.IsSetReq() { - return CommonServiceGetHtmlArgs_Req_DEFAULT - } - return p.Req -} -func (p *CommonServiceGetHtmlArgs) SetReq(val *GetHtmlRequest) { - p.Req = val +func NewTermListRequest() *TermListRequest { + return &TermListRequest{} } -var fieldIDToName_CommonServiceGetHtmlArgs = map[int16]string{ - 1: "req", +func (p *TermListRequest) InitDefault() { } -func (p *CommonServiceGetHtmlArgs) IsSetReq() bool { - return p.Req != nil -} +var fieldIDToName_TermListRequest = map[int16]string{} -func (p *CommonServiceGetHtmlArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *TermListRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -1195,20 +1243,8 @@ func (p *CommonServiceGetHtmlArgs) Read(iprot thrift.TProtocol) (err error) { 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.Skip(fieldTypeId); err != nil { + goto SkipFieldTypeError } if err = iprot.ReadFieldEnd(); err != nil { goto ReadFieldEndError @@ -1223,10 +1259,8 @@ 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_CommonServiceGetHtmlArgs[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +SkipFieldTypeError: + return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, fieldTypeId), err) ReadFieldEndError: return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) @@ -1234,26 +1268,11 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *CommonServiceGetHtmlArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetHtmlRequest() - if err := _field.Read(iprot); err != nil { - return err - } - p.Req = _field - return nil -} - -func (p *CommonServiceGetHtmlArgs) Write(oprot thrift.TProtocol) (err error) { - - var fieldId int16 - if err = oprot.WriteStructBegin("GetHtml_args"); err != nil { +func (p *TermListRequest) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("TermListRequest"); 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 @@ -1264,91 +1283,1511 @@ func (p *CommonServiceGetHtmlArgs) Write(oprot thrift.TProtocol) (err error) { 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 *CommonServiceGetHtmlArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.Req.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *CommonServiceGetHtmlArgs) String() string { +func (p *TermListRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("CommonServiceGetHtmlArgs(%+v)", *p) + return fmt.Sprintf("TermListRequest(%+v)", *p) } -func (p *CommonServiceGetHtmlArgs) DeepEqual(ano *CommonServiceGetHtmlArgs) bool { +func (p *TermListRequest) DeepEqual(ano *TermListRequest) bool { if p == ano { return true } else if p == nil || ano == nil { return false } - if !p.Field1DeepEqual(ano.Req) { - return false - } return true } -func (p *CommonServiceGetHtmlArgs) Field1DeepEqual(src *GetHtmlRequest) bool { - - if !p.Req.DeepEqual(src) { - return false - } - return true +type TermListResponse struct { + Base *model.BaseResp `thrift:"base,1,required" frugal:"1,required,model.BaseResp" json:"base"` + TermLists *model.TermList `thrift:"term_lists,2,required" frugal:"2,required,model.TermList" json:"term_lists"` } -type CommonServiceGetHtmlResult struct { - Success *GetHtmlResponse `thrift:"success,0,optional" frugal:"0,optional,GetHtmlResponse" json:"success,omitempty"` +func NewTermListResponse() *TermListResponse { + return &TermListResponse{} } -func NewCommonServiceGetHtmlResult() *CommonServiceGetHtmlResult { - return &CommonServiceGetHtmlResult{} +func (p *TermListResponse) InitDefault() { } -func (p *CommonServiceGetHtmlResult) InitDefault() { -} +var TermListResponse_Base_DEFAULT *model.BaseResp + +func (p *TermListResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return TermListResponse_Base_DEFAULT + } + return p.Base +} + +var TermListResponse_TermLists_DEFAULT *model.TermList + +func (p *TermListResponse) GetTermLists() (v *model.TermList) { + if !p.IsSetTermLists() { + return TermListResponse_TermLists_DEFAULT + } + return p.TermLists +} +func (p *TermListResponse) SetBase(val *model.BaseResp) { + p.Base = val +} +func (p *TermListResponse) SetTermLists(val *model.TermList) { + p.TermLists = val +} + +var fieldIDToName_TermListResponse = map[int16]string{ + 1: "base", + 2: "term_lists", +} + +func (p *TermListResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *TermListResponse) IsSetTermLists() bool { + return p.TermLists != nil +} + +func (p *TermListResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetBase bool = false + var issetTermLists bool = false + + 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 + } + issetBase = true + } 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 + } + issetTermLists = true + } 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 + } + + if !issetBase { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetTermLists { + fieldId = 2 + goto RequiredFieldNotSetError + } + 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_TermListResponse[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) +RequiredFieldNotSetError: + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TermListResponse[fieldId])) +} + +func (p *TermListResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *TermListResponse) ReadField2(iprot thrift.TProtocol) error { + _field := model.NewTermList() + if err := _field.Read(iprot); err != nil { + return err + } + p.TermLists = _field + return nil +} + +func (p *TermListResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("TermListResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *TermListResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); 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 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *TermListResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("term_lists", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.TermLists.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 *TermListResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TermListResponse(%+v)", *p) + +} + +func (p *TermListResponse) DeepEqual(ano *TermListResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Base) { + return false + } + if !p.Field2DeepEqual(ano.TermLists) { + return false + } + return true +} + +func (p *TermListResponse) Field1DeepEqual(src *model.BaseResp) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} +func (p *TermListResponse) Field2DeepEqual(src *model.TermList) bool { + + if !p.TermLists.DeepEqual(src) { + return false + } + return true +} + +type CommonService interface { + GetCSS(ctx context.Context, req *GetCSSRequest) (r *GetCSSResponse, err error) + + GetHtml(ctx context.Context, req *GetHtmlRequest) (r *GetHtmlResponse, err error) + + GetUserAgreement(ctx context.Context, req *GetUserAgreementRequest) (r *GetUserAgreementResponse, err error) + + GetTermsList(ctx context.Context, req *TermListRequest) (r *TermListResponse, err error) + + GetTerm(ctx context.Context, req *TermRequest) (r *TermResponse, err error) +} + +type CommonServiceGetCSSArgs struct { + Req *GetCSSRequest `thrift:"req,1" frugal:"1,default,GetCSSRequest" json:"req"` +} + +func NewCommonServiceGetCSSArgs() *CommonServiceGetCSSArgs { + return &CommonServiceGetCSSArgs{} +} + +func (p *CommonServiceGetCSSArgs) InitDefault() { +} + +var CommonServiceGetCSSArgs_Req_DEFAULT *GetCSSRequest + +func (p *CommonServiceGetCSSArgs) GetReq() (v *GetCSSRequest) { + if !p.IsSetReq() { + return CommonServiceGetCSSArgs_Req_DEFAULT + } + return p.Req +} +func (p *CommonServiceGetCSSArgs) SetReq(val *GetCSSRequest) { + p.Req = val +} + +var fieldIDToName_CommonServiceGetCSSArgs = map[int16]string{ + 1: "req", +} + +func (p *CommonServiceGetCSSArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *CommonServiceGetCSSArgs) 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_CommonServiceGetCSSArgs[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 *CommonServiceGetCSSArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetCSSRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *CommonServiceGetCSSArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetCSS_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 *CommonServiceGetCSSArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *CommonServiceGetCSSArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CommonServiceGetCSSArgs(%+v)", *p) + +} + +func (p *CommonServiceGetCSSArgs) DeepEqual(ano *CommonServiceGetCSSArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Req) { + return false + } + return true +} + +func (p *CommonServiceGetCSSArgs) Field1DeepEqual(src *GetCSSRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type CommonServiceGetCSSResult struct { + Success *GetCSSResponse `thrift:"success,0,optional" frugal:"0,optional,GetCSSResponse" json:"success,omitempty"` +} + +func NewCommonServiceGetCSSResult() *CommonServiceGetCSSResult { + return &CommonServiceGetCSSResult{} +} + +func (p *CommonServiceGetCSSResult) InitDefault() { +} + +var CommonServiceGetCSSResult_Success_DEFAULT *GetCSSResponse + +func (p *CommonServiceGetCSSResult) GetSuccess() (v *GetCSSResponse) { + if !p.IsSetSuccess() { + return CommonServiceGetCSSResult_Success_DEFAULT + } + return p.Success +} +func (p *CommonServiceGetCSSResult) SetSuccess(x interface{}) { + p.Success = x.(*GetCSSResponse) +} + +var fieldIDToName_CommonServiceGetCSSResult = map[int16]string{ + 0: "success", +} + +func (p *CommonServiceGetCSSResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *CommonServiceGetCSSResult) 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_CommonServiceGetCSSResult[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 *CommonServiceGetCSSResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetCSSResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *CommonServiceGetCSSResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetCSS_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 *CommonServiceGetCSSResult) 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 *CommonServiceGetCSSResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CommonServiceGetCSSResult(%+v)", *p) + +} + +func (p *CommonServiceGetCSSResult) DeepEqual(ano *CommonServiceGetCSSResult) 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 *CommonServiceGetCSSResult) Field0DeepEqual(src *GetCSSResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type CommonServiceGetHtmlArgs struct { + Req *GetHtmlRequest `thrift:"req,1" frugal:"1,default,GetHtmlRequest" json:"req"` +} + +func NewCommonServiceGetHtmlArgs() *CommonServiceGetHtmlArgs { + return &CommonServiceGetHtmlArgs{} +} + +func (p *CommonServiceGetHtmlArgs) InitDefault() { +} + +var CommonServiceGetHtmlArgs_Req_DEFAULT *GetHtmlRequest + +func (p *CommonServiceGetHtmlArgs) GetReq() (v *GetHtmlRequest) { + if !p.IsSetReq() { + return CommonServiceGetHtmlArgs_Req_DEFAULT + } + return p.Req +} +func (p *CommonServiceGetHtmlArgs) SetReq(val *GetHtmlRequest) { + p.Req = val +} + +var fieldIDToName_CommonServiceGetHtmlArgs = map[int16]string{ + 1: "req", +} + +func (p *CommonServiceGetHtmlArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *CommonServiceGetHtmlArgs) 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_CommonServiceGetHtmlArgs[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 *CommonServiceGetHtmlArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetHtmlRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *CommonServiceGetHtmlArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetHtml_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 *CommonServiceGetHtmlArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *CommonServiceGetHtmlArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CommonServiceGetHtmlArgs(%+v)", *p) + +} + +func (p *CommonServiceGetHtmlArgs) DeepEqual(ano *CommonServiceGetHtmlArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Req) { + return false + } + return true +} + +func (p *CommonServiceGetHtmlArgs) Field1DeepEqual(src *GetHtmlRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type CommonServiceGetHtmlResult struct { + Success *GetHtmlResponse `thrift:"success,0,optional" frugal:"0,optional,GetHtmlResponse" json:"success,omitempty"` +} + +func NewCommonServiceGetHtmlResult() *CommonServiceGetHtmlResult { + return &CommonServiceGetHtmlResult{} +} + +func (p *CommonServiceGetHtmlResult) InitDefault() { +} var CommonServiceGetHtmlResult_Success_DEFAULT *GetHtmlResponse -func (p *CommonServiceGetHtmlResult) GetSuccess() (v *GetHtmlResponse) { +func (p *CommonServiceGetHtmlResult) GetSuccess() (v *GetHtmlResponse) { + if !p.IsSetSuccess() { + return CommonServiceGetHtmlResult_Success_DEFAULT + } + return p.Success +} +func (p *CommonServiceGetHtmlResult) SetSuccess(x interface{}) { + p.Success = x.(*GetHtmlResponse) +} + +var fieldIDToName_CommonServiceGetHtmlResult = map[int16]string{ + 0: "success", +} + +func (p *CommonServiceGetHtmlResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *CommonServiceGetHtmlResult) 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_CommonServiceGetHtmlResult[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 *CommonServiceGetHtmlResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetHtmlResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *CommonServiceGetHtmlResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetHtml_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 *CommonServiceGetHtmlResult) 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 *CommonServiceGetHtmlResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CommonServiceGetHtmlResult(%+v)", *p) + +} + +func (p *CommonServiceGetHtmlResult) DeepEqual(ano *CommonServiceGetHtmlResult) 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 *CommonServiceGetHtmlResult) Field0DeepEqual(src *GetHtmlResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type CommonServiceGetUserAgreementArgs struct { + Req *GetUserAgreementRequest `thrift:"req,1" frugal:"1,default,GetUserAgreementRequest" json:"req"` +} + +func NewCommonServiceGetUserAgreementArgs() *CommonServiceGetUserAgreementArgs { + return &CommonServiceGetUserAgreementArgs{} +} + +func (p *CommonServiceGetUserAgreementArgs) InitDefault() { +} + +var CommonServiceGetUserAgreementArgs_Req_DEFAULT *GetUserAgreementRequest + +func (p *CommonServiceGetUserAgreementArgs) GetReq() (v *GetUserAgreementRequest) { + if !p.IsSetReq() { + return CommonServiceGetUserAgreementArgs_Req_DEFAULT + } + return p.Req +} +func (p *CommonServiceGetUserAgreementArgs) SetReq(val *GetUserAgreementRequest) { + p.Req = val +} + +var fieldIDToName_CommonServiceGetUserAgreementArgs = map[int16]string{ + 1: "req", +} + +func (p *CommonServiceGetUserAgreementArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *CommonServiceGetUserAgreementArgs) 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_CommonServiceGetUserAgreementArgs[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 *CommonServiceGetUserAgreementArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetUserAgreementRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *CommonServiceGetUserAgreementArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetUserAgreement_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 *CommonServiceGetUserAgreementArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *CommonServiceGetUserAgreementArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CommonServiceGetUserAgreementArgs(%+v)", *p) + +} + +func (p *CommonServiceGetUserAgreementArgs) DeepEqual(ano *CommonServiceGetUserAgreementArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Req) { + return false + } + return true +} + +func (p *CommonServiceGetUserAgreementArgs) Field1DeepEqual(src *GetUserAgreementRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type CommonServiceGetUserAgreementResult struct { + Success *GetUserAgreementResponse `thrift:"success,0,optional" frugal:"0,optional,GetUserAgreementResponse" json:"success,omitempty"` +} + +func NewCommonServiceGetUserAgreementResult() *CommonServiceGetUserAgreementResult { + return &CommonServiceGetUserAgreementResult{} +} + +func (p *CommonServiceGetUserAgreementResult) InitDefault() { +} + +var CommonServiceGetUserAgreementResult_Success_DEFAULT *GetUserAgreementResponse + +func (p *CommonServiceGetUserAgreementResult) GetSuccess() (v *GetUserAgreementResponse) { + if !p.IsSetSuccess() { + return CommonServiceGetUserAgreementResult_Success_DEFAULT + } + return p.Success +} +func (p *CommonServiceGetUserAgreementResult) SetSuccess(x interface{}) { + p.Success = x.(*GetUserAgreementResponse) +} + +var fieldIDToName_CommonServiceGetUserAgreementResult = map[int16]string{ + 0: "success", +} + +func (p *CommonServiceGetUserAgreementResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *CommonServiceGetUserAgreementResult) 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_CommonServiceGetUserAgreementResult[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 *CommonServiceGetUserAgreementResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetUserAgreementResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *CommonServiceGetUserAgreementResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetUserAgreement_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 *CommonServiceGetUserAgreementResult) 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 *CommonServiceGetUserAgreementResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CommonServiceGetUserAgreementResult(%+v)", *p) + +} + +func (p *CommonServiceGetUserAgreementResult) DeepEqual(ano *CommonServiceGetUserAgreementResult) 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 *CommonServiceGetUserAgreementResult) Field0DeepEqual(src *GetUserAgreementResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type CommonServiceGetTermsListArgs struct { + Req *TermListRequest `thrift:"req,1" frugal:"1,default,TermListRequest" json:"req"` +} + +func NewCommonServiceGetTermsListArgs() *CommonServiceGetTermsListArgs { + return &CommonServiceGetTermsListArgs{} +} + +func (p *CommonServiceGetTermsListArgs) InitDefault() { +} + +var CommonServiceGetTermsListArgs_Req_DEFAULT *TermListRequest + +func (p *CommonServiceGetTermsListArgs) GetReq() (v *TermListRequest) { + if !p.IsSetReq() { + return CommonServiceGetTermsListArgs_Req_DEFAULT + } + return p.Req +} +func (p *CommonServiceGetTermsListArgs) SetReq(val *TermListRequest) { + p.Req = val +} + +var fieldIDToName_CommonServiceGetTermsListArgs = map[int16]string{ + 1: "req", +} + +func (p *CommonServiceGetTermsListArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *CommonServiceGetTermsListArgs) 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_CommonServiceGetTermsListArgs[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 *CommonServiceGetTermsListArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewTermListRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *CommonServiceGetTermsListArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetTermsList_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 *CommonServiceGetTermsListArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *CommonServiceGetTermsListArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CommonServiceGetTermsListArgs(%+v)", *p) + +} + +func (p *CommonServiceGetTermsListArgs) DeepEqual(ano *CommonServiceGetTermsListArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Req) { + return false + } + return true +} + +func (p *CommonServiceGetTermsListArgs) Field1DeepEqual(src *TermListRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type CommonServiceGetTermsListResult struct { + Success *TermListResponse `thrift:"success,0,optional" frugal:"0,optional,TermListResponse" json:"success,omitempty"` +} + +func NewCommonServiceGetTermsListResult() *CommonServiceGetTermsListResult { + return &CommonServiceGetTermsListResult{} +} + +func (p *CommonServiceGetTermsListResult) InitDefault() { +} + +var CommonServiceGetTermsListResult_Success_DEFAULT *TermListResponse + +func (p *CommonServiceGetTermsListResult) GetSuccess() (v *TermListResponse) { if !p.IsSetSuccess() { - return CommonServiceGetHtmlResult_Success_DEFAULT + return CommonServiceGetTermsListResult_Success_DEFAULT } return p.Success } -func (p *CommonServiceGetHtmlResult) SetSuccess(x interface{}) { - p.Success = x.(*GetHtmlResponse) +func (p *CommonServiceGetTermsListResult) SetSuccess(x interface{}) { + p.Success = x.(*TermListResponse) } -var fieldIDToName_CommonServiceGetHtmlResult = map[int16]string{ +var fieldIDToName_CommonServiceGetTermsListResult = map[int16]string{ 0: "success", } -func (p *CommonServiceGetHtmlResult) IsSetSuccess() bool { +func (p *CommonServiceGetTermsListResult) IsSetSuccess() bool { return p.Success != nil } -func (p *CommonServiceGetHtmlResult) Read(iprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetTermsListResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -1394,7 +2833,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_CommonServiceGetHtmlResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetTermsListResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -1404,8 +2843,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *CommonServiceGetHtmlResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetHtmlResponse() +func (p *CommonServiceGetTermsListResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewTermListResponse() if err := _field.Read(iprot); err != nil { return err } @@ -1413,10 +2852,9 @@ func (p *CommonServiceGetHtmlResult) ReadField0(iprot thrift.TProtocol) error { return nil } -func (p *CommonServiceGetHtmlResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *CommonServiceGetTermsListResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetHtml_result"); err != nil { + if err = oprot.WriteStructBegin("GetTermsList_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -1442,7 +2880,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *CommonServiceGetHtmlResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetTermsListResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -1461,15 +2899,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *CommonServiceGetHtmlResult) String() string { +func (p *CommonServiceGetTermsListResult) String() string { if p == nil { return "" } - return fmt.Sprintf("CommonServiceGetHtmlResult(%+v)", *p) + return fmt.Sprintf("CommonServiceGetTermsListResult(%+v)", *p) } -func (p *CommonServiceGetHtmlResult) DeepEqual(ano *CommonServiceGetHtmlResult) bool { +func (p *CommonServiceGetTermsListResult) DeepEqual(ano *CommonServiceGetTermsListResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -1481,7 +2919,7 @@ func (p *CommonServiceGetHtmlResult) DeepEqual(ano *CommonServiceGetHtmlResult) return true } -func (p *CommonServiceGetHtmlResult) Field0DeepEqual(src *GetHtmlResponse) bool { +func (p *CommonServiceGetTermsListResult) Field0DeepEqual(src *TermListResponse) bool { if !p.Success.DeepEqual(src) { return false @@ -1489,38 +2927,38 @@ func (p *CommonServiceGetHtmlResult) Field0DeepEqual(src *GetHtmlResponse) bool return true } -type CommonServiceGetUserAgreementArgs struct { - Req *GetUserAgreementRequest `thrift:"req,1" frugal:"1,default,GetUserAgreementRequest" json:"req"` +type CommonServiceGetTermArgs struct { + Req *TermRequest `thrift:"req,1" frugal:"1,default,TermRequest" json:"req"` } -func NewCommonServiceGetUserAgreementArgs() *CommonServiceGetUserAgreementArgs { - return &CommonServiceGetUserAgreementArgs{} +func NewCommonServiceGetTermArgs() *CommonServiceGetTermArgs { + return &CommonServiceGetTermArgs{} } -func (p *CommonServiceGetUserAgreementArgs) InitDefault() { +func (p *CommonServiceGetTermArgs) InitDefault() { } -var CommonServiceGetUserAgreementArgs_Req_DEFAULT *GetUserAgreementRequest +var CommonServiceGetTermArgs_Req_DEFAULT *TermRequest -func (p *CommonServiceGetUserAgreementArgs) GetReq() (v *GetUserAgreementRequest) { +func (p *CommonServiceGetTermArgs) GetReq() (v *TermRequest) { if !p.IsSetReq() { - return CommonServiceGetUserAgreementArgs_Req_DEFAULT + return CommonServiceGetTermArgs_Req_DEFAULT } return p.Req } -func (p *CommonServiceGetUserAgreementArgs) SetReq(val *GetUserAgreementRequest) { +func (p *CommonServiceGetTermArgs) SetReq(val *TermRequest) { p.Req = val } -var fieldIDToName_CommonServiceGetUserAgreementArgs = map[int16]string{ +var fieldIDToName_CommonServiceGetTermArgs = map[int16]string{ 1: "req", } -func (p *CommonServiceGetUserAgreementArgs) IsSetReq() bool { +func (p *CommonServiceGetTermArgs) IsSetReq() bool { return p.Req != nil } -func (p *CommonServiceGetUserAgreementArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetTermArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -1566,7 +3004,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_CommonServiceGetUserAgreementArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetTermArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -1576,8 +3014,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *CommonServiceGetUserAgreementArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetUserAgreementRequest() +func (p *CommonServiceGetTermArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewTermRequest() if err := _field.Read(iprot); err != nil { return err } @@ -1585,10 +3023,9 @@ func (p *CommonServiceGetUserAgreementArgs) ReadField1(iprot thrift.TProtocol) e return nil } -func (p *CommonServiceGetUserAgreementArgs) Write(oprot thrift.TProtocol) (err error) { - +func (p *CommonServiceGetTermArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetUserAgreement_args"); err != nil { + if err = oprot.WriteStructBegin("GetTerm_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -1614,7 +3051,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *CommonServiceGetUserAgreementArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetTermArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -1631,15 +3068,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *CommonServiceGetUserAgreementArgs) String() string { +func (p *CommonServiceGetTermArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("CommonServiceGetUserAgreementArgs(%+v)", *p) + return fmt.Sprintf("CommonServiceGetTermArgs(%+v)", *p) } -func (p *CommonServiceGetUserAgreementArgs) DeepEqual(ano *CommonServiceGetUserAgreementArgs) bool { +func (p *CommonServiceGetTermArgs) DeepEqual(ano *CommonServiceGetTermArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -1651,7 +3088,7 @@ func (p *CommonServiceGetUserAgreementArgs) DeepEqual(ano *CommonServiceGetUserA return true } -func (p *CommonServiceGetUserAgreementArgs) Field1DeepEqual(src *GetUserAgreementRequest) bool { +func (p *CommonServiceGetTermArgs) Field1DeepEqual(src *TermRequest) bool { if !p.Req.DeepEqual(src) { return false @@ -1659,38 +3096,38 @@ func (p *CommonServiceGetUserAgreementArgs) Field1DeepEqual(src *GetUserAgreemen return true } -type CommonServiceGetUserAgreementResult struct { - Success *GetUserAgreementResponse `thrift:"success,0,optional" frugal:"0,optional,GetUserAgreementResponse" json:"success,omitempty"` +type CommonServiceGetTermResult struct { + Success *TermResponse `thrift:"success,0,optional" frugal:"0,optional,TermResponse" json:"success,omitempty"` } -func NewCommonServiceGetUserAgreementResult() *CommonServiceGetUserAgreementResult { - return &CommonServiceGetUserAgreementResult{} +func NewCommonServiceGetTermResult() *CommonServiceGetTermResult { + return &CommonServiceGetTermResult{} } -func (p *CommonServiceGetUserAgreementResult) InitDefault() { +func (p *CommonServiceGetTermResult) InitDefault() { } -var CommonServiceGetUserAgreementResult_Success_DEFAULT *GetUserAgreementResponse +var CommonServiceGetTermResult_Success_DEFAULT *TermResponse -func (p *CommonServiceGetUserAgreementResult) GetSuccess() (v *GetUserAgreementResponse) { +func (p *CommonServiceGetTermResult) GetSuccess() (v *TermResponse) { if !p.IsSetSuccess() { - return CommonServiceGetUserAgreementResult_Success_DEFAULT + return CommonServiceGetTermResult_Success_DEFAULT } return p.Success } -func (p *CommonServiceGetUserAgreementResult) SetSuccess(x interface{}) { - p.Success = x.(*GetUserAgreementResponse) +func (p *CommonServiceGetTermResult) SetSuccess(x interface{}) { + p.Success = x.(*TermResponse) } -var fieldIDToName_CommonServiceGetUserAgreementResult = map[int16]string{ +var fieldIDToName_CommonServiceGetTermResult = map[int16]string{ 0: "success", } -func (p *CommonServiceGetUserAgreementResult) IsSetSuccess() bool { +func (p *CommonServiceGetTermResult) IsSetSuccess() bool { return p.Success != nil } -func (p *CommonServiceGetUserAgreementResult) Read(iprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetTermResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -1736,7 +3173,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_CommonServiceGetUserAgreementResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetTermResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -1746,8 +3183,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *CommonServiceGetUserAgreementResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetUserAgreementResponse() +func (p *CommonServiceGetTermResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewTermResponse() if err := _field.Read(iprot); err != nil { return err } @@ -1755,10 +3192,9 @@ func (p *CommonServiceGetUserAgreementResult) ReadField0(iprot thrift.TProtocol) return nil } -func (p *CommonServiceGetUserAgreementResult) Write(oprot thrift.TProtocol) (err error) { - +func (p *CommonServiceGetTermResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetUserAgreement_result"); err != nil { + if err = oprot.WriteStructBegin("GetTerm_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -1784,7 +3220,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *CommonServiceGetUserAgreementResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetTermResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -1803,15 +3239,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *CommonServiceGetUserAgreementResult) String() string { +func (p *CommonServiceGetTermResult) String() string { if p == nil { return "" } - return fmt.Sprintf("CommonServiceGetUserAgreementResult(%+v)", *p) + return fmt.Sprintf("CommonServiceGetTermResult(%+v)", *p) } -func (p *CommonServiceGetUserAgreementResult) DeepEqual(ano *CommonServiceGetUserAgreementResult) bool { +func (p *CommonServiceGetTermResult) DeepEqual(ano *CommonServiceGetTermResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -1823,7 +3259,7 @@ func (p *CommonServiceGetUserAgreementResult) DeepEqual(ano *CommonServiceGetUse return true } -func (p *CommonServiceGetUserAgreementResult) Field0DeepEqual(src *GetUserAgreementResponse) bool { +func (p *CommonServiceGetTermResult) Field0DeepEqual(src *TermResponse) bool { if !p.Success.DeepEqual(src) { return false diff --git a/kitex_gen/common/commonservice/client.go b/kitex_gen/common/commonservice/client.go index 0287247a..7cbac5cb 100644 --- a/kitex_gen/common/commonservice/client.go +++ b/kitex_gen/common/commonservice/client.go @@ -32,6 +32,8 @@ type Client interface { GetCSS(ctx context.Context, req *common.GetCSSRequest, callOptions ...callopt.Option) (r *common.GetCSSResponse, err error) GetHtml(ctx context.Context, req *common.GetHtmlRequest, callOptions ...callopt.Option) (r *common.GetHtmlResponse, err error) GetUserAgreement(ctx context.Context, req *common.GetUserAgreementRequest, callOptions ...callopt.Option) (r *common.GetUserAgreementResponse, err error) + GetTermsList(ctx context.Context, req *common.TermListRequest, callOptions ...callopt.Option) (r *common.TermListResponse, err error) + GetTerm(ctx context.Context, req *common.TermRequest, callOptions ...callopt.Option) (r *common.TermResponse, err error) } // NewClient creates a client for the service defined in IDL. @@ -77,3 +79,13 @@ func (p *kCommonServiceClient) GetUserAgreement(ctx context.Context, req *common ctx = client.NewCtxWithCallOptions(ctx, callOptions) return p.kClient.GetUserAgreement(ctx, req) } + +func (p *kCommonServiceClient) GetTermsList(ctx context.Context, req *common.TermListRequest, callOptions ...callopt.Option) (r *common.TermListResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.GetTermsList(ctx, req) +} + +func (p *kCommonServiceClient) GetTerm(ctx context.Context, req *common.TermRequest, callOptions ...callopt.Option) (r *common.TermResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.GetTerm(ctx, req) +} diff --git a/kitex_gen/common/commonservice/commonservice.go b/kitex_gen/common/commonservice/commonservice.go index 811dd31c..1bcbf189 100644 --- a/kitex_gen/common/commonservice/commonservice.go +++ b/kitex_gen/common/commonservice/commonservice.go @@ -52,6 +52,20 @@ var serviceMethods = map[string]kitex.MethodInfo{ false, kitex.WithStreamingMode(kitex.StreamingNone), ), + "GetTermsList": kitex.NewMethodInfo( + getTermsListHandler, + newCommonServiceGetTermsListArgs, + newCommonServiceGetTermsListResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "GetTerm": kitex.NewMethodInfo( + getTermHandler, + newCommonServiceGetTermArgs, + newCommonServiceGetTermResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), } var ( @@ -172,6 +186,42 @@ func newCommonServiceGetUserAgreementResult() interface{} { return common.NewCommonServiceGetUserAgreementResult() } +func getTermsListHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*common.CommonServiceGetTermsListArgs) + realResult := result.(*common.CommonServiceGetTermsListResult) + success, err := handler.(common.CommonService).GetTermsList(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newCommonServiceGetTermsListArgs() interface{} { + return common.NewCommonServiceGetTermsListArgs() +} + +func newCommonServiceGetTermsListResult() interface{} { + return common.NewCommonServiceGetTermsListResult() +} + +func getTermHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*common.CommonServiceGetTermArgs) + realResult := result.(*common.CommonServiceGetTermResult) + success, err := handler.(common.CommonService).GetTerm(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newCommonServiceGetTermArgs() interface{} { + return common.NewCommonServiceGetTermArgs() +} + +func newCommonServiceGetTermResult() interface{} { + return common.NewCommonServiceGetTermResult() +} + type kClient struct { c client.Client } @@ -211,3 +261,23 @@ func (p *kClient) GetUserAgreement(ctx context.Context, req *common.GetUserAgree } return _result.GetSuccess(), nil } + +func (p *kClient) GetTermsList(ctx context.Context, req *common.TermListRequest) (r *common.TermListResponse, err error) { + var _args common.CommonServiceGetTermsListArgs + _args.Req = req + var _result common.CommonServiceGetTermsListResult + if err = p.c.Call(ctx, "GetTermsList", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) GetTerm(ctx context.Context, req *common.TermRequest) (r *common.TermResponse, err error) { + var _args common.CommonServiceGetTermArgs + _args.Req = req + var _result common.CommonServiceGetTermResult + if err = p.c.Call(ctx, "GetTerm", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} diff --git a/kitex_gen/common/k-common.go b/kitex_gen/common/k-common.go index b129a180..8abd2bbd 100644 --- a/kitex_gen/common/k-common.go +++ b/kitex_gen/common/k-common.go @@ -492,6 +492,471 @@ func (p *GetUserAgreementResponse) field1Length() int { return l } +func (p *TermRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + var issetTerm bool = false + for { + fieldTypeId, fieldId, l, err = thrift.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 + } + issetTerm = true + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + if !issetTerm { + fieldId = 1 + goto RequiredFieldNotSetError + } + return offset, nil +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_TermRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +RequiredFieldNotSetError: + return offset, thrift.NewProtocolException(thrift.INVALID_DATA, fmt.Sprintf("required field %s is not set", fieldIDToName_TermRequest[fieldId])) +} + +func (p *TermRequest) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = v + } + p.Term = _field + return offset, nil +} + +// for compatibility +func (p *TermRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *TermRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *TermRequest) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *TermRequest) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.Term) + return offset +} + +func (p *TermRequest) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.Term) + return l +} + +func (p *TermResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + var issetBase bool = false + var issetTermInfo bool = false + for { + fieldTypeId, fieldId, l, err = thrift.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 + } + issetBase = true + } else { + l, err = thrift.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 + } + issetTermInfo = true + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + if !issetBase { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetTermInfo { + fieldId = 2 + goto RequiredFieldNotSetError + } + return offset, nil +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_TermResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +RequiredFieldNotSetError: + return offset, thrift.NewProtocolException(thrift.INVALID_DATA, fmt.Sprintf("required field %s is not set", fieldIDToName_TermResponse[fieldId])) +} + +func (p *TermResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := model.NewBaseResp() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = _field + return offset, nil +} + +func (p *TermResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 + _field := model.NewTermInfo() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.TermInfo = _field + return offset, nil +} + +// for compatibility +func (p *TermResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *TermResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *TermResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *TermResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Base.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *TermResponse) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 2) + offset += p.TermInfo.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *TermResponse) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Base.BLength() + return l +} + +func (p *TermResponse) field2Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.TermInfo.BLength() + return l +} + +func (p *TermListRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +// for compatibility +func (p *TermListRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *TermListRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *TermListRequest) BLength() int { + l := 0 + if p != nil { + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *TermListResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + var issetBase bool = false + var issetTermLists bool = false + for { + fieldTypeId, fieldId, l, err = thrift.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 + } + issetBase = true + } else { + l, err = thrift.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 + } + issetTermLists = true + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + if !issetBase { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetTermLists { + fieldId = 2 + goto RequiredFieldNotSetError + } + return offset, nil +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_TermListResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +RequiredFieldNotSetError: + return offset, thrift.NewProtocolException(thrift.INVALID_DATA, fmt.Sprintf("required field %s is not set", fieldIDToName_TermListResponse[fieldId])) +} + +func (p *TermListResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := model.NewBaseResp() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = _field + return offset, nil +} + +func (p *TermListResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 + _field := model.NewTermList() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.TermLists = _field + return offset, nil +} + +// for compatibility +func (p *TermListResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *TermListResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *TermListResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *TermListResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Base.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *TermListResponse) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 2) + offset += p.TermLists.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *TermListResponse) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Base.BLength() + return l +} + +func (p *TermListResponse) field2Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.TermLists.BLength() + return l +} + func (p *CommonServiceGetCSSArgs) FastRead(buf []byte) (int, error) { var err error var offset int @@ -535,14 +1000,410 @@ func (p *CommonServiceGetCSSArgs) FastRead(buf []byte) (int, error) { 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_CommonServiceGetCSSArgs[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetCSSArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *CommonServiceGetCSSArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewGetCSSRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = _field + return offset, nil +} + +// for compatibility +func (p *CommonServiceGetCSSArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *CommonServiceGetCSSArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *CommonServiceGetCSSArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *CommonServiceGetCSSArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *CommonServiceGetCSSArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Req.BLength() + return l +} + +func (p *CommonServiceGetCSSResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.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 = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +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_CommonServiceGetCSSResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *CommonServiceGetCSSResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewGetCSSResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +// for compatibility +func (p *CommonServiceGetCSSResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *CommonServiceGetCSSResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *CommonServiceGetCSSResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *CommonServiceGetCSSResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *CommonServiceGetCSSResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *CommonServiceGetHtmlArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.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 = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +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_CommonServiceGetHtmlArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *CommonServiceGetHtmlArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewGetHtmlRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = _field + return offset, nil +} + +// for compatibility +func (p *CommonServiceGetHtmlArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *CommonServiceGetHtmlArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *CommonServiceGetHtmlArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *CommonServiceGetHtmlArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *CommonServiceGetHtmlArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Req.BLength() + return l +} + +func (p *CommonServiceGetHtmlResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.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 = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +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_CommonServiceGetHtmlResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *CommonServiceGetHtmlResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewGetHtmlResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +// for compatibility +func (p *CommonServiceGetHtmlResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *CommonServiceGetHtmlResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *CommonServiceGetHtmlResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *CommonServiceGetHtmlResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *CommonServiceGetHtmlResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *CommonServiceGetUserAgreementArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.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 = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +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_CommonServiceGetUserAgreementArgs[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) } -func (p *CommonServiceGetCSSArgs) FastReadField1(buf []byte) (int, error) { +func (p *CommonServiceGetUserAgreementArgs) FastReadField1(buf []byte) (int, error) { offset := 0 - _field := NewGetCSSRequest() + _field := NewGetUserAgreementRequest() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { @@ -553,11 +1414,11 @@ func (p *CommonServiceGetCSSArgs) FastReadField1(buf []byte) (int, error) { } // for compatibility -func (p *CommonServiceGetCSSArgs) FastWrite(buf []byte) int { +func (p *CommonServiceGetUserAgreementArgs) FastWrite(buf []byte) int { return 0 } -func (p *CommonServiceGetCSSArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *CommonServiceGetUserAgreementArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField1(buf[offset:], w) @@ -566,7 +1427,7 @@ func (p *CommonServiceGetCSSArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWri return offset } -func (p *CommonServiceGetCSSArgs) BLength() int { +func (p *CommonServiceGetUserAgreementArgs) BLength() int { l := 0 if p != nil { l += p.field1Length() @@ -575,21 +1436,21 @@ func (p *CommonServiceGetCSSArgs) BLength() int { return l } -func (p *CommonServiceGetCSSArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { +func (p *CommonServiceGetUserAgreementArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { offset := 0 offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) offset += p.Req.FastWriteNocopy(buf[offset:], w) return offset } -func (p *CommonServiceGetCSSArgs) field1Length() int { +func (p *CommonServiceGetUserAgreementArgs) field1Length() int { l := 0 l += thrift.Binary.FieldBeginLength() l += p.Req.BLength() return l } -func (p *CommonServiceGetCSSResult) FastRead(buf []byte) (int, error) { +func (p *CommonServiceGetUserAgreementResult) FastRead(buf []byte) (int, error) { var err error var offset int var l int @@ -632,14 +1493,14 @@ func (p *CommonServiceGetCSSResult) FastRead(buf []byte) (int, error) { 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_CommonServiceGetCSSResult[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetUserAgreementResult[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) } -func (p *CommonServiceGetCSSResult) FastReadField0(buf []byte) (int, error) { +func (p *CommonServiceGetUserAgreementResult) FastReadField0(buf []byte) (int, error) { offset := 0 - _field := NewGetCSSResponse() + _field := NewGetUserAgreementResponse() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { @@ -650,11 +1511,11 @@ func (p *CommonServiceGetCSSResult) FastReadField0(buf []byte) (int, error) { } // for compatibility -func (p *CommonServiceGetCSSResult) FastWrite(buf []byte) int { +func (p *CommonServiceGetUserAgreementResult) FastWrite(buf []byte) int { return 0 } -func (p *CommonServiceGetCSSResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *CommonServiceGetUserAgreementResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField0(buf[offset:], w) @@ -663,7 +1524,7 @@ func (p *CommonServiceGetCSSResult) FastWriteNocopy(buf []byte, w thrift.NocopyW return offset } -func (p *CommonServiceGetCSSResult) BLength() int { +func (p *CommonServiceGetUserAgreementResult) BLength() int { l := 0 if p != nil { l += p.field0Length() @@ -672,7 +1533,7 @@ func (p *CommonServiceGetCSSResult) BLength() int { return l } -func (p *CommonServiceGetCSSResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { +func (p *CommonServiceGetUserAgreementResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetSuccess() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) @@ -681,7 +1542,7 @@ func (p *CommonServiceGetCSSResult) fastWriteField0(buf []byte, w thrift.NocopyW return offset } -func (p *CommonServiceGetCSSResult) field0Length() int { +func (p *CommonServiceGetUserAgreementResult) field0Length() int { l := 0 if p.IsSetSuccess() { l += thrift.Binary.FieldBeginLength() @@ -690,7 +1551,7 @@ func (p *CommonServiceGetCSSResult) field0Length() int { return l } -func (p *CommonServiceGetHtmlArgs) FastRead(buf []byte) (int, error) { +func (p *CommonServiceGetTermsListArgs) FastRead(buf []byte) (int, error) { var err error var offset int var l int @@ -733,14 +1594,14 @@ func (p *CommonServiceGetHtmlArgs) FastRead(buf []byte) (int, error) { 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_CommonServiceGetHtmlArgs[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetTermsListArgs[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) } -func (p *CommonServiceGetHtmlArgs) FastReadField1(buf []byte) (int, error) { +func (p *CommonServiceGetTermsListArgs) FastReadField1(buf []byte) (int, error) { offset := 0 - _field := NewGetHtmlRequest() + _field := NewTermListRequest() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { @@ -751,11 +1612,11 @@ func (p *CommonServiceGetHtmlArgs) FastReadField1(buf []byte) (int, error) { } // for compatibility -func (p *CommonServiceGetHtmlArgs) FastWrite(buf []byte) int { +func (p *CommonServiceGetTermsListArgs) FastWrite(buf []byte) int { return 0 } -func (p *CommonServiceGetHtmlArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *CommonServiceGetTermsListArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField1(buf[offset:], w) @@ -764,7 +1625,7 @@ func (p *CommonServiceGetHtmlArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWr return offset } -func (p *CommonServiceGetHtmlArgs) BLength() int { +func (p *CommonServiceGetTermsListArgs) BLength() int { l := 0 if p != nil { l += p.field1Length() @@ -773,21 +1634,21 @@ func (p *CommonServiceGetHtmlArgs) BLength() int { return l } -func (p *CommonServiceGetHtmlArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { +func (p *CommonServiceGetTermsListArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { offset := 0 offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) offset += p.Req.FastWriteNocopy(buf[offset:], w) return offset } -func (p *CommonServiceGetHtmlArgs) field1Length() int { +func (p *CommonServiceGetTermsListArgs) field1Length() int { l := 0 l += thrift.Binary.FieldBeginLength() l += p.Req.BLength() return l } -func (p *CommonServiceGetHtmlResult) FastRead(buf []byte) (int, error) { +func (p *CommonServiceGetTermsListResult) FastRead(buf []byte) (int, error) { var err error var offset int var l int @@ -830,14 +1691,14 @@ func (p *CommonServiceGetHtmlResult) FastRead(buf []byte) (int, error) { 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_CommonServiceGetHtmlResult[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetTermsListResult[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) } -func (p *CommonServiceGetHtmlResult) FastReadField0(buf []byte) (int, error) { +func (p *CommonServiceGetTermsListResult) FastReadField0(buf []byte) (int, error) { offset := 0 - _field := NewGetHtmlResponse() + _field := NewTermListResponse() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { @@ -848,11 +1709,11 @@ func (p *CommonServiceGetHtmlResult) FastReadField0(buf []byte) (int, error) { } // for compatibility -func (p *CommonServiceGetHtmlResult) FastWrite(buf []byte) int { +func (p *CommonServiceGetTermsListResult) FastWrite(buf []byte) int { return 0 } -func (p *CommonServiceGetHtmlResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *CommonServiceGetTermsListResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField0(buf[offset:], w) @@ -861,7 +1722,7 @@ func (p *CommonServiceGetHtmlResult) FastWriteNocopy(buf []byte, w thrift.Nocopy return offset } -func (p *CommonServiceGetHtmlResult) BLength() int { +func (p *CommonServiceGetTermsListResult) BLength() int { l := 0 if p != nil { l += p.field0Length() @@ -870,7 +1731,7 @@ func (p *CommonServiceGetHtmlResult) BLength() int { return l } -func (p *CommonServiceGetHtmlResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { +func (p *CommonServiceGetTermsListResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetSuccess() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) @@ -879,7 +1740,7 @@ func (p *CommonServiceGetHtmlResult) fastWriteField0(buf []byte, w thrift.Nocopy return offset } -func (p *CommonServiceGetHtmlResult) field0Length() int { +func (p *CommonServiceGetTermsListResult) field0Length() int { l := 0 if p.IsSetSuccess() { l += thrift.Binary.FieldBeginLength() @@ -888,7 +1749,7 @@ func (p *CommonServiceGetHtmlResult) field0Length() int { return l } -func (p *CommonServiceGetUserAgreementArgs) FastRead(buf []byte) (int, error) { +func (p *CommonServiceGetTermArgs) FastRead(buf []byte) (int, error) { var err error var offset int var l int @@ -931,14 +1792,14 @@ func (p *CommonServiceGetUserAgreementArgs) FastRead(buf []byte) (int, error) { 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_CommonServiceGetUserAgreementArgs[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetTermArgs[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) } -func (p *CommonServiceGetUserAgreementArgs) FastReadField1(buf []byte) (int, error) { +func (p *CommonServiceGetTermArgs) FastReadField1(buf []byte) (int, error) { offset := 0 - _field := NewGetUserAgreementRequest() + _field := NewTermRequest() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { @@ -949,11 +1810,11 @@ func (p *CommonServiceGetUserAgreementArgs) FastReadField1(buf []byte) (int, err } // for compatibility -func (p *CommonServiceGetUserAgreementArgs) FastWrite(buf []byte) int { +func (p *CommonServiceGetTermArgs) FastWrite(buf []byte) int { return 0 } -func (p *CommonServiceGetUserAgreementArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *CommonServiceGetTermArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField1(buf[offset:], w) @@ -962,7 +1823,7 @@ func (p *CommonServiceGetUserAgreementArgs) FastWriteNocopy(buf []byte, w thrift return offset } -func (p *CommonServiceGetUserAgreementArgs) BLength() int { +func (p *CommonServiceGetTermArgs) BLength() int { l := 0 if p != nil { l += p.field1Length() @@ -971,21 +1832,21 @@ func (p *CommonServiceGetUserAgreementArgs) BLength() int { return l } -func (p *CommonServiceGetUserAgreementArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { +func (p *CommonServiceGetTermArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { offset := 0 offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) offset += p.Req.FastWriteNocopy(buf[offset:], w) return offset } -func (p *CommonServiceGetUserAgreementArgs) field1Length() int { +func (p *CommonServiceGetTermArgs) field1Length() int { l := 0 l += thrift.Binary.FieldBeginLength() l += p.Req.BLength() return l } -func (p *CommonServiceGetUserAgreementResult) FastRead(buf []byte) (int, error) { +func (p *CommonServiceGetTermResult) FastRead(buf []byte) (int, error) { var err error var offset int var l int @@ -1028,14 +1889,14 @@ func (p *CommonServiceGetUserAgreementResult) FastRead(buf []byte) (int, error) 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_CommonServiceGetUserAgreementResult[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetTermResult[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) } -func (p *CommonServiceGetUserAgreementResult) FastReadField0(buf []byte) (int, error) { +func (p *CommonServiceGetTermResult) FastReadField0(buf []byte) (int, error) { offset := 0 - _field := NewGetUserAgreementResponse() + _field := NewTermResponse() if l, err := _field.FastRead(buf[offset:]); err != nil { return offset, err } else { @@ -1046,11 +1907,11 @@ func (p *CommonServiceGetUserAgreementResult) FastReadField0(buf []byte) (int, e } // for compatibility -func (p *CommonServiceGetUserAgreementResult) FastWrite(buf []byte) int { +func (p *CommonServiceGetTermResult) FastWrite(buf []byte) int { return 0 } -func (p *CommonServiceGetUserAgreementResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *CommonServiceGetTermResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField0(buf[offset:], w) @@ -1059,7 +1920,7 @@ func (p *CommonServiceGetUserAgreementResult) FastWriteNocopy(buf []byte, w thri return offset } -func (p *CommonServiceGetUserAgreementResult) BLength() int { +func (p *CommonServiceGetTermResult) BLength() int { l := 0 if p != nil { l += p.field0Length() @@ -1068,7 +1929,7 @@ func (p *CommonServiceGetUserAgreementResult) BLength() int { return l } -func (p *CommonServiceGetUserAgreementResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { +func (p *CommonServiceGetTermResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p.IsSetSuccess() { offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) @@ -1077,7 +1938,7 @@ func (p *CommonServiceGetUserAgreementResult) fastWriteField0(buf []byte, w thri return offset } -func (p *CommonServiceGetUserAgreementResult) field0Length() int { +func (p *CommonServiceGetTermResult) field0Length() int { l := 0 if p.IsSetSuccess() { l += thrift.Binary.FieldBeginLength() @@ -1109,3 +1970,19 @@ func (p *CommonServiceGetUserAgreementArgs) GetFirstArgument() interface{} { func (p *CommonServiceGetUserAgreementResult) GetResult() interface{} { return p.Success } + +func (p *CommonServiceGetTermsListArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *CommonServiceGetTermsListResult) GetResult() interface{} { + return p.Success +} + +func (p *CommonServiceGetTermArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *CommonServiceGetTermResult) GetResult() interface{} { + return p.Success +} diff --git a/kitex_gen/model/k-model.go b/kitex_gen/model/k-model.go index 0cbb8012..d235b6d6 100644 --- a/kitex_gen/model/k-model.go +++ b/kitex_gen/model/k-model.go @@ -2714,9 +2714,6 @@ func (p *UpYunFileDir) FastRead(buf []byte) (int, error) { var l int var fieldTypeId thrift.TType var fieldId int16 - var issetBasePath bool = false - var issetFiles bool = false - var issetFolders bool = false for { fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) offset += l @@ -2734,7 +2731,6 @@ func (p *UpYunFileDir) FastRead(buf []byte) (int, error) { if err != nil { goto ReadFieldError } - issetBasePath = true } else { l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -2749,7 +2745,6 @@ func (p *UpYunFileDir) FastRead(buf []byte) (int, error) { if err != nil { goto ReadFieldError } - issetFiles = true } else { l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -2764,7 +2759,6 @@ func (p *UpYunFileDir) FastRead(buf []byte) (int, error) { if err != nil { goto ReadFieldError } - issetFolders = true } else { l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -2781,20 +2775,6 @@ func (p *UpYunFileDir) FastRead(buf []byte) (int, error) { } } - if !issetBasePath { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetFiles { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetFolders { - fieldId = 3 - goto RequiredFieldNotSetError - } return offset, nil ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) @@ -2802,19 +2782,17 @@ ReadFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UpYunFileDir[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -RequiredFieldNotSetError: - return offset, thrift.NewProtocolException(thrift.INVALID_DATA, fmt.Sprintf("required field %s is not set", fieldIDToName_UpYunFileDir[fieldId])) } func (p *UpYunFileDir) FastReadField1(buf []byte) (int, error) { offset := 0 - var _field string + var _field *string if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l - _field = v + _field = &v } p.BasePath = _field return offset, nil @@ -2897,64 +2875,76 @@ func (p *UpYunFileDir) BLength() int { func (p *UpYunFileDir) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { offset := 0 - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.BasePath) + if p.IsSetBasePath() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.BasePath) + } return offset } func (p *UpYunFileDir) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { offset := 0 - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 2) - listBeginOffset := offset - offset += thrift.Binary.ListBeginLength() - var length int - for _, v := range p.Files { - length++ - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, v) + if p.IsSetFiles() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 2) + listBeginOffset := offset + offset += thrift.Binary.ListBeginLength() + var length int + for _, v := range p.Files { + length++ + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, v) + } + thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) } - thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) return offset } func (p *UpYunFileDir) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { offset := 0 - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 3) - listBeginOffset := offset - offset += thrift.Binary.ListBeginLength() - var length int - for _, v := range p.Folders { - length++ - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, v) + if p.IsSetFolders() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 3) + listBeginOffset := offset + offset += thrift.Binary.ListBeginLength() + var length int + for _, v := range p.Folders { + length++ + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, v) + } + thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) } - thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) return offset } func (p *UpYunFileDir) field1Length() int { l := 0 - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(p.BasePath) + if p.IsSetBasePath() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.BasePath) + } return l } func (p *UpYunFileDir) field2Length() int { l := 0 - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.ListBeginLength() - for _, v := range p.Files { - _ = v - l += thrift.Binary.StringLengthNocopy(v) + if p.IsSetFiles() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.ListBeginLength() + for _, v := range p.Files { + _ = v + l += thrift.Binary.StringLengthNocopy(v) + } } return l } func (p *UpYunFileDir) field3Length() int { l := 0 - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.ListBeginLength() - for _, v := range p.Folders { - _ = v - l += thrift.Binary.StringLengthNocopy(v) + if p.IsSetFolders() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.ListBeginLength() + for _, v := range p.Folders { + _ = v + l += thrift.Binary.StringLengthNocopy(v) + } } return l } @@ -4128,17 +4118,12 @@ func (p *UnifiedExam) field3Length() int { return l } -func (p *Term) FastRead(buf []byte) (int, error) { +func (p *PaperData) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 - var issetTermId bool = false - var issetSchoolYear bool = false - var issetTerm bool = false - var issetStartDate bool = false - var issetEndDate bool = false for { fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) offset += l @@ -4156,7 +4141,6 @@ func (p *Term) FastRead(buf []byte) (int, error) { if err != nil { goto ReadFieldError } - issetTermId = true } else { l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -4165,13 +4149,12 @@ func (p *Term) FastRead(buf []byte) (int, error) { } } case 2: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.LIST { l, err = p.FastReadField2(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetSchoolYear = true } else { l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -4180,43 +4163,12 @@ func (p *Term) FastRead(buf []byte) (int, error) { } } case 3: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.LIST { l, err = p.FastReadField3(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetTerm = true - } else { - l, err = thrift.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 - } - issetStartDate = true - } else { - l, err = thrift.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 - } - issetEndDate = true } else { l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -4233,221 +4185,187 @@ func (p *Term) FastRead(buf []byte) (int, error) { } } - if !issetTermId { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetSchoolYear { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetTerm { - fieldId = 3 - goto RequiredFieldNotSetError - } - - if !issetStartDate { - fieldId = 4 - goto RequiredFieldNotSetError - } - - if !issetEndDate { - fieldId = 5 - goto RequiredFieldNotSetError - } return offset, nil 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_Term[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaperData[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -RequiredFieldNotSetError: - return offset, thrift.NewProtocolException(thrift.INVALID_DATA, fmt.Sprintf("required field %s is not set", fieldIDToName_Term[fieldId])) } -func (p *Term) FastReadField1(buf []byte) (int, error) { +func (p *PaperData) FastReadField1(buf []byte) (int, error) { offset := 0 - var _field string + var _field *string if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l - _field = v + _field = &v } - p.TermId = _field + p.BasePath = _field return offset, nil } -func (p *Term) FastReadField2(buf []byte) (int, error) { +func (p *PaperData) FastReadField2(buf []byte) (int, error) { offset := 0 - var _field string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + _, size, l, err := thrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { return offset, err - } else { - offset += l - _field = v } - p.SchoolYear = _field - return offset, nil -} - -func (p *Term) FastReadField3(buf []byte) (int, error) { - offset := 0 + _field := make([]string, 0, size) + for i := 0; i < size; i++ { + var _elem string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _elem = v + } - var _field string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _field = v + _field = append(_field, _elem) } - p.Term = _field + p.Files = _field return offset, nil } -func (p *Term) FastReadField4(buf []byte) (int, error) { +func (p *PaperData) FastReadField3(buf []byte) (int, error) { offset := 0 - var _field string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + _, size, l, err := thrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { return offset, err - } else { - offset += l - _field = v } - p.StartDate = _field - return offset, nil -} - -func (p *Term) FastReadField5(buf []byte) (int, error) { - offset := 0 + _field := make([]string, 0, size) + for i := 0; i < size; i++ { + var _elem string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _elem = v + } - var _field string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _field = v + _field = append(_field, _elem) } - p.EndDate = _field + p.Folders = _field return offset, nil } // for compatibility -func (p *Term) FastWrite(buf []byte) int { +func (p *PaperData) FastWrite(buf []byte) int { return 0 } -func (p *Term) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *PaperData) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField1(buf[offset:], w) offset += p.fastWriteField2(buf[offset:], w) offset += p.fastWriteField3(buf[offset:], w) - offset += p.fastWriteField4(buf[offset:], w) - offset += p.fastWriteField5(buf[offset:], w) } offset += thrift.Binary.WriteFieldStop(buf[offset:]) return offset } -func (p *Term) BLength() int { +func (p *PaperData) BLength() int { l := 0 if p != nil { l += p.field1Length() l += p.field2Length() l += p.field3Length() - l += p.field4Length() - l += p.field5Length() } l += thrift.Binary.FieldStopLength() return l } -func (p *Term) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.TermId) - return offset -} - -func (p *Term) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.SchoolYear) - return offset -} - -func (p *Term) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { +func (p *PaperData) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { offset := 0 - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 3) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.Term) + if p.IsSetBasePath() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.BasePath) + } return offset } -func (p *Term) fastWriteField4(buf []byte, w thrift.NocopyWriter) int { +func (p *PaperData) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { offset := 0 - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 4) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.StartDate) + if p.IsSetFiles() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 2) + listBeginOffset := offset + offset += thrift.Binary.ListBeginLength() + var length int + for _, v := range p.Files { + length++ + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, v) + } + thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) + } return offset } -func (p *Term) fastWriteField5(buf []byte, w thrift.NocopyWriter) int { +func (p *PaperData) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { offset := 0 - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 5) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.EndDate) + if p.IsSetFolders() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 3) + listBeginOffset := offset + offset += thrift.Binary.ListBeginLength() + var length int + for _, v := range p.Folders { + length++ + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, v) + } + thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) + } return offset } -func (p *Term) field1Length() int { - l := 0 - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(p.TermId) - return l -} - -func (p *Term) field2Length() int { - l := 0 - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(p.SchoolYear) - return l -} - -func (p *Term) field3Length() int { +func (p *PaperData) field1Length() int { l := 0 - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(p.Term) + if p.IsSetBasePath() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.BasePath) + } return l } -func (p *Term) field4Length() int { +func (p *PaperData) field2Length() int { l := 0 - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(p.StartDate) + if p.IsSetFiles() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.ListBeginLength() + for _, v := range p.Files { + _ = v + l += thrift.Binary.StringLengthNocopy(v) + } + } return l } -func (p *Term) field5Length() int { +func (p *PaperData) field3Length() int { l := 0 - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(p.EndDate) + if p.IsSetFolders() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.ListBeginLength() + for _, v := range p.Folders { + _ = v + l += thrift.Binary.StringLengthNocopy(v) + } + } return l } -func (p *TermEvent) FastRead(buf []byte) (int, error) { +func (p *PaperUrlData) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 - var issetName bool = false - var issetStartDate bool = false - var issetEndDate bool = false + var issetUrl bool = false for { fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) offset += l @@ -4465,7 +4383,7 @@ func (p *TermEvent) FastRead(buf []byte) (int, error) { if err != nil { goto ReadFieldError } - issetName = true + issetUrl = true } else { l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -4473,14 +4391,413 @@ func (p *TermEvent) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 2: + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + if !issetUrl { + fieldId = 1 + goto RequiredFieldNotSetError + } + return offset, nil +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_PaperUrlData[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +RequiredFieldNotSetError: + return offset, thrift.NewProtocolException(thrift.INVALID_DATA, fmt.Sprintf("required field %s is not set", fieldIDToName_PaperUrlData[fieldId])) +} + +func (p *PaperUrlData) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = v + } + p.Url = _field + return offset, nil +} + +// for compatibility +func (p *PaperUrlData) FastWrite(buf []byte) int { + return 0 +} + +func (p *PaperUrlData) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *PaperUrlData) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *PaperUrlData) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.Url) + return offset +} + +func (p *PaperUrlData) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.Url) + return l +} + +func (p *Term) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.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 = thrift.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 = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.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 = thrift.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 = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +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_Term[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *Term) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.TermId = _field + return offset, nil +} + +func (p *Term) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.SchoolYear = _field + return offset, nil +} + +func (p *Term) FastReadField3(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Term = _field + return offset, nil +} + +func (p *Term) FastReadField4(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.StartDate = _field + return offset, nil +} + +func (p *Term) FastReadField5(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.EndDate = _field + return offset, nil +} + +// for compatibility +func (p *Term) FastWrite(buf []byte) int { + return 0 +} + +func (p *Term) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField3(buf[offset:], w) + offset += p.fastWriteField4(buf[offset:], w) + offset += p.fastWriteField5(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *Term) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field4Length() + l += p.field5Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *Term) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetTermId() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.TermId) + } + return offset +} + +func (p *Term) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSchoolYear() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.SchoolYear) + } + return offset +} + +func (p *Term) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetTerm() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 3) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Term) + } + return offset +} + +func (p *Term) fastWriteField4(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetStartDate() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 4) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.StartDate) + } + return offset +} + +func (p *Term) fastWriteField5(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetEndDate() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 5) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.EndDate) + } + return offset +} + +func (p *Term) field1Length() int { + l := 0 + if p.IsSetTermId() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.TermId) + } + return l +} + +func (p *Term) field2Length() int { + l := 0 + if p.IsSetSchoolYear() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.SchoolYear) + } + return l +} + +func (p *Term) field3Length() int { + l := 0 + if p.IsSetTerm() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Term) + } + return l +} + +func (p *Term) field4Length() int { + l := 0 + if p.IsSetStartDate() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.StartDate) + } + return l +} + +func (p *Term) field5Length() int { + l := 0 + if p.IsSetEndDate() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.EndDate) + } + return l +} + +func (p *TermEvent) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.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 = thrift.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 } - issetStartDate = true } else { l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -4495,7 +4812,6 @@ func (p *TermEvent) FastRead(buf []byte) (int, error) { if err != nil { goto ReadFieldError } - issetEndDate = true } else { l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -4512,20 +4828,6 @@ func (p *TermEvent) FastRead(buf []byte) (int, error) { } } - if !issetName { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetStartDate { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetEndDate { - fieldId = 3 - goto RequiredFieldNotSetError - } return offset, nil ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) @@ -4533,19 +4835,17 @@ ReadFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TermEvent[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -RequiredFieldNotSetError: - return offset, thrift.NewProtocolException(thrift.INVALID_DATA, fmt.Sprintf("required field %s is not set", fieldIDToName_TermEvent[fieldId])) } func (p *TermEvent) FastReadField1(buf []byte) (int, error) { offset := 0 - var _field string + var _field *string if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l - _field = v + _field = &v } p.Name = _field return offset, nil @@ -4554,12 +4854,12 @@ func (p *TermEvent) FastReadField1(buf []byte) (int, error) { func (p *TermEvent) FastReadField2(buf []byte) (int, error) { offset := 0 - var _field string + var _field *string if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l - _field = v + _field = &v } p.StartDate = _field return offset, nil @@ -4568,12 +4868,12 @@ func (p *TermEvent) FastReadField2(buf []byte) (int, error) { func (p *TermEvent) FastReadField3(buf []byte) (int, error) { offset := 0 - var _field string + var _field *string if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l - _field = v + _field = &v } p.EndDate = _field return offset, nil @@ -4589,74 +4889,256 @@ func (p *TermEvent) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { if p != nil { offset += p.fastWriteField1(buf[offset:], w) offset += p.fastWriteField2(buf[offset:], w) - offset += p.fastWriteField3(buf[offset:], w) + offset += p.fastWriteField3(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *TermEvent) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *TermEvent) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetName() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Name) + } + return offset +} + +func (p *TermEvent) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetStartDate() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.StartDate) + } + return offset +} + +func (p *TermEvent) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetEndDate() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 3) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.EndDate) + } + return offset +} + +func (p *TermEvent) field1Length() int { + l := 0 + if p.IsSetName() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Name) + } + return l +} + +func (p *TermEvent) field2Length() int { + l := 0 + if p.IsSetStartDate() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.StartDate) + } + return l +} + +func (p *TermEvent) field3Length() int { + l := 0 + if p.IsSetEndDate() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.EndDate) + } + return l +} + +func (p *TermList) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.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 = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +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_TermList[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *TermList) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.CurrentTerm = _field + return offset, nil +} + +func (p *TermList) FastReadField2(buf []byte) (int, error) { + offset := 0 + + _, size, l, err := thrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make([]*Term, 0, size) + values := make([]Term, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + if l, err := _elem.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + + _field = append(_field, _elem) + } + p.Terms = _field + return offset, nil +} + +// for compatibility +func (p *TermList) FastWrite(buf []byte) int { + return 0 +} + +func (p *TermList) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) } offset += thrift.Binary.WriteFieldStop(buf[offset:]) return offset } -func (p *TermEvent) BLength() int { +func (p *TermList) BLength() int { l := 0 if p != nil { l += p.field1Length() l += p.field2Length() - l += p.field3Length() } l += thrift.Binary.FieldStopLength() return l } -func (p *TermEvent) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.Name) - return offset -} - -func (p *TermEvent) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { +func (p *TermList) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { offset := 0 - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.StartDate) + if p.IsSetCurrentTerm() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.CurrentTerm) + } return offset } -func (p *TermEvent) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { +func (p *TermList) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { offset := 0 - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 3) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.EndDate) + if p.IsSetTerms() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 2) + listBeginOffset := offset + offset += thrift.Binary.ListBeginLength() + var length int + for _, v := range p.Terms { + length++ + offset += v.FastWriteNocopy(buf[offset:], w) + } + thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) + } return offset } -func (p *TermEvent) field1Length() int { - l := 0 - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(p.Name) - return l -} - -func (p *TermEvent) field2Length() int { +func (p *TermList) field1Length() int { l := 0 - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(p.StartDate) + if p.IsSetCurrentTerm() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.CurrentTerm) + } return l } -func (p *TermEvent) field3Length() int { +func (p *TermList) field2Length() int { l := 0 - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(p.EndDate) + if p.IsSetTerms() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.ListBeginLength() + for _, v := range p.Terms { + _ = v + l += v.BLength() + } + } return l } -func (p *PaperData) FastRead(buf []byte) (int, error) { +func (p *TermInfo) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 - var issetBasePath bool = false - var issetFiles bool = false - var issetFolders bool = false for { fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) offset += l @@ -4674,7 +5156,6 @@ func (p *PaperData) FastRead(buf []byte) (int, error) { if err != nil { goto ReadFieldError } - issetBasePath = true } else { l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -4683,13 +5164,12 @@ func (p *PaperData) FastRead(buf []byte) (int, error) { } } case 2: - if fieldTypeId == thrift.LIST { + if fieldTypeId == thrift.STRING { l, err = p.FastReadField2(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetFiles = true } else { l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -4698,13 +5178,26 @@ func (p *PaperData) FastRead(buf []byte) (int, error) { } } case 3: - if fieldTypeId == thrift.LIST { + if fieldTypeId == thrift.STRING { l, err = p.FastReadField3(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetFolders = true + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } } else { l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -4721,70 +5214,58 @@ func (p *PaperData) FastRead(buf []byte) (int, error) { } } - if !issetBasePath { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetFiles { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetFolders { - fieldId = 3 - goto RequiredFieldNotSetError - } return offset, nil 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_PaperData[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TermInfo[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -RequiredFieldNotSetError: - return offset, thrift.NewProtocolException(thrift.INVALID_DATA, fmt.Sprintf("required field %s is not set", fieldIDToName_PaperData[fieldId])) } -func (p *PaperData) FastReadField1(buf []byte) (int, error) { +func (p *TermInfo) FastReadField1(buf []byte) (int, error) { offset := 0 - var _field string + var _field *string if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l - _field = v + _field = &v } - p.BasePath = _field + p.TermId = _field return offset, nil } -func (p *PaperData) FastReadField2(buf []byte) (int, error) { +func (p *TermInfo) FastReadField2(buf []byte) (int, error) { offset := 0 - _, size, l, err := thrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err + } else { + offset += l + _field = &v } - _field := make([]string, 0, size) - for i := 0; i < size; i++ { - var _elem string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _elem = v - } + p.Term = _field + return offset, nil +} - _field = append(_field, _elem) +func (p *TermInfo) FastReadField3(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v } - p.Files = _field + p.SchoolYear = _field return offset, nil } -func (p *PaperData) FastReadField3(buf []byte) (int, error) { +func (p *TermInfo) FastReadField4(buf []byte) (int, error) { offset := 0 _, size, l, err := thrift.Binary.ReadListBegin(buf[offset:]) @@ -4792,216 +5273,131 @@ func (p *PaperData) FastReadField3(buf []byte) (int, error) { if err != nil { return offset, err } - _field := make([]string, 0, size) + _field := make([]*TermEvent, 0, size) + values := make([]TermEvent, size) for i := 0; i < size; i++ { - var _elem string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + _elem := &values[i] + _elem.InitDefault() + if l, err := _elem.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l - _elem = v } _field = append(_field, _elem) } - p.Folders = _field + p.Events = _field return offset, nil } // for compatibility -func (p *PaperData) FastWrite(buf []byte) int { +func (p *TermInfo) FastWrite(buf []byte) int { return 0 } -func (p *PaperData) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { +func (p *TermInfo) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { offset := 0 if p != nil { offset += p.fastWriteField1(buf[offset:], w) offset += p.fastWriteField2(buf[offset:], w) offset += p.fastWriteField3(buf[offset:], w) + offset += p.fastWriteField4(buf[offset:], w) } offset += thrift.Binary.WriteFieldStop(buf[offset:]) return offset } -func (p *PaperData) BLength() int { +func (p *TermInfo) BLength() int { l := 0 if p != nil { l += p.field1Length() l += p.field2Length() l += p.field3Length() + l += p.field4Length() } l += thrift.Binary.FieldStopLength() return l } -func (p *PaperData) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { +func (p *TermInfo) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { offset := 0 - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.BasePath) + if p.IsSetTermId() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.TermId) + } return offset } -func (p *PaperData) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { +func (p *TermInfo) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { offset := 0 - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 2) - listBeginOffset := offset - offset += thrift.Binary.ListBeginLength() - var length int - for _, v := range p.Files { - length++ - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, v) + if p.IsSetTerm() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Term) } - thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) return offset } -func (p *PaperData) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { +func (p *TermInfo) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { offset := 0 - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 3) - listBeginOffset := offset - offset += thrift.Binary.ListBeginLength() - var length int - for _, v := range p.Folders { - length++ - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, v) + if p.IsSetSchoolYear() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 3) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.SchoolYear) } - thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) return offset } -func (p *PaperData) field1Length() int { - l := 0 - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(p.BasePath) - return l +func (p *TermInfo) fastWriteField4(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetEvents() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 4) + listBeginOffset := offset + offset += thrift.Binary.ListBeginLength() + var length int + for _, v := range p.Events { + length++ + offset += v.FastWriteNocopy(buf[offset:], w) + } + thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) + } + return offset } -func (p *PaperData) field2Length() int { +func (p *TermInfo) field1Length() int { l := 0 - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.ListBeginLength() - for _, v := range p.Files { - _ = v - l += thrift.Binary.StringLengthNocopy(v) + if p.IsSetTermId() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.TermId) } return l } -func (p *PaperData) field3Length() int { +func (p *TermInfo) field2Length() int { l := 0 - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.ListBeginLength() - for _, v := range p.Folders { - _ = v - l += thrift.Binary.StringLengthNocopy(v) + if p.IsSetTerm() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Term) } return l } -func (p *PaperUrlData) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - var issetUrl bool = false - for { - fieldTypeId, fieldId, l, err = thrift.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 - } - issetUrl = true - } else { - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - } - - if !issetUrl { - fieldId = 1 - goto RequiredFieldNotSetError - } - return offset, nil -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_PaperUrlData[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -RequiredFieldNotSetError: - return offset, thrift.NewProtocolException(thrift.INVALID_DATA, fmt.Sprintf("required field %s is not set", fieldIDToName_PaperUrlData[fieldId])) -} - -func (p *PaperUrlData) FastReadField1(buf []byte) (int, error) { - offset := 0 - - var _field string - if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - _field = v - } - p.Url = _field - return offset, nil -} - -// for compatibility -func (p *PaperUrlData) FastWrite(buf []byte) int { - return 0 -} - -func (p *PaperUrlData) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - if p != nil { - offset += p.fastWriteField1(buf[offset:], w) - } - offset += thrift.Binary.WriteFieldStop(buf[offset:]) - return offset -} - -func (p *PaperUrlData) BLength() int { +func (p *TermInfo) field3Length() int { l := 0 - if p != nil { - l += p.field1Length() + if p.IsSetSchoolYear() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.SchoolYear) } - l += thrift.Binary.FieldStopLength() return l } -func (p *PaperUrlData) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { - offset := 0 - offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.Url) - return offset -} - -func (p *PaperUrlData) field1Length() int { +func (p *TermInfo) field4Length() int { l := 0 - l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(p.Url) + if p.IsSetEvents() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.ListBeginLength() + for _, v := range p.Events { + _ = v + l += v.BLength() + } + } return l } diff --git a/kitex_gen/model/model.go b/kitex_gen/model/model.go index c716fef4..cc83a891 100644 --- a/kitex_gen/model/model.go +++ b/kitex_gen/model/model.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by thriftgo (0.3.18). DO NOT EDIT. +// Code generated by thriftgo (0.3.17). DO NOT EDIT. package model @@ -144,7 +144,6 @@ func (p *BaseResp) ReadField2(iprot thrift.TProtocol) error { } func (p *BaseResp) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("BaseResp"); err != nil { goto WriteStructBeginError @@ -394,7 +393,6 @@ func (p *LoginData) ReadField2(iprot thrift.TProtocol) error { } func (p *LoginData) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("LoginData"); err != nil { goto WriteStructBeginError @@ -716,7 +714,6 @@ func (p *Classroom) ReadField4(iprot thrift.TProtocol) error { } func (p *Classroom) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("Classroom"); err != nil { goto WriteStructBeginError @@ -1156,7 +1153,6 @@ func (p *ExamRoomInfo) ReadField6(iprot thrift.TProtocol) error { } func (p *ExamRoomInfo) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("ExamRoomInfo"); err != nil { goto WriteStructBeginError @@ -1763,7 +1759,6 @@ func (p *CourseScheduleRule) ReadField9(iprot thrift.TProtocol) error { } func (p *CourseScheduleRule) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("CourseScheduleRule"); err != nil { goto WriteStructBeginError @@ -2440,7 +2435,6 @@ func (p *Course) ReadField8(iprot thrift.TProtocol) error { } func (p *Course) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("Course"); err != nil { goto WriteStructBeginError @@ -3254,7 +3248,6 @@ func (p *Picture) ReadField16(iprot thrift.TProtocol) error { } func (p *Picture) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("Picture"); err != nil { goto WriteStructBeginError @@ -3783,9 +3776,9 @@ func (p *Picture) Field16DeepEqual(src string) bool { } type UpYunFileDir struct { - BasePath string `thrift:"basePath,1,required" frugal:"1,required,string" json:"basePath"` - Files []string `thrift:"files,2,required" frugal:"2,required,list" json:"files"` - Folders []string `thrift:"folders,3,required" frugal:"3,required,list" json:"folders"` + BasePath *string `thrift:"basePath,1,optional" frugal:"1,optional,string" json:"basePath,omitempty"` + Files []string `thrift:"files,2,optional" frugal:"2,optional,list" json:"files,omitempty"` + Folders []string `thrift:"folders,3,optional" frugal:"3,optional,list" json:"folders,omitempty"` } func NewUpYunFileDir() *UpYunFileDir { @@ -3795,18 +3788,33 @@ func NewUpYunFileDir() *UpYunFileDir { func (p *UpYunFileDir) InitDefault() { } +var UpYunFileDir_BasePath_DEFAULT string + func (p *UpYunFileDir) GetBasePath() (v string) { - return p.BasePath + if !p.IsSetBasePath() { + return UpYunFileDir_BasePath_DEFAULT + } + return *p.BasePath } +var UpYunFileDir_Files_DEFAULT []string + func (p *UpYunFileDir) GetFiles() (v []string) { + if !p.IsSetFiles() { + return UpYunFileDir_Files_DEFAULT + } return p.Files } +var UpYunFileDir_Folders_DEFAULT []string + func (p *UpYunFileDir) GetFolders() (v []string) { + if !p.IsSetFolders() { + return UpYunFileDir_Folders_DEFAULT + } return p.Folders } -func (p *UpYunFileDir) SetBasePath(val string) { +func (p *UpYunFileDir) SetBasePath(val *string) { p.BasePath = val } func (p *UpYunFileDir) SetFiles(val []string) { @@ -3822,13 +3830,22 @@ var fieldIDToName_UpYunFileDir = map[int16]string{ 3: "folders", } +func (p *UpYunFileDir) IsSetBasePath() bool { + return p.BasePath != nil +} + +func (p *UpYunFileDir) IsSetFiles() bool { + return p.Files != nil +} + +func (p *UpYunFileDir) IsSetFolders() bool { + return p.Folders != nil +} + func (p *UpYunFileDir) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetBasePath bool = false - var issetFiles bool = false - var issetFolders bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -3849,7 +3866,6 @@ func (p *UpYunFileDir) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetBasePath = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -3858,7 +3874,6 @@ func (p *UpYunFileDir) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField2(iprot); err != nil { goto ReadFieldError } - issetFiles = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -3867,7 +3882,6 @@ func (p *UpYunFileDir) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField3(iprot); err != nil { goto ReadFieldError } - issetFolders = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -3884,20 +3898,6 @@ func (p *UpYunFileDir) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetBasePath { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetFiles { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetFolders { - fieldId = 3 - goto RequiredFieldNotSetError - } return nil ReadStructBeginError: return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) @@ -3912,17 +3912,15 @@ 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) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_UpYunFileDir[fieldId])) } func (p *UpYunFileDir) ReadField1(iprot thrift.TProtocol) error { - var _field string + var _field *string if v, err := iprot.ReadString(); err != nil { return err } else { - _field = v + _field = &v } p.BasePath = _field return nil @@ -3975,7 +3973,6 @@ func (p *UpYunFileDir) ReadField3(iprot thrift.TProtocol) error { } func (p *UpYunFileDir) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("UpYunFileDir"); err != nil { goto WriteStructBeginError @@ -4012,14 +4009,16 @@ WriteStructEndError: } func (p *UpYunFileDir) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("basePath", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.BasePath); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError + if p.IsSetBasePath() { + if err = oprot.WriteFieldBegin("basePath", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.BasePath); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } return nil WriteFieldBeginError: @@ -4029,22 +4028,24 @@ WriteFieldEndError: } func (p *UpYunFileDir) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("files", thrift.LIST, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.STRING, len(p.Files)); err != nil { - return err - } - for _, v := range p.Files { - if err := oprot.WriteString(v); err != nil { + if p.IsSetFiles() { + if err = oprot.WriteFieldBegin("files", thrift.LIST, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Files)); err != nil { return err } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError + for _, v := range p.Files { + if err := oprot.WriteString(v); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } return nil WriteFieldBeginError: @@ -4054,22 +4055,24 @@ WriteFieldEndError: } func (p *UpYunFileDir) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("folders", thrift.LIST, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.STRING, len(p.Folders)); err != nil { - return err - } - for _, v := range p.Folders { - if err := oprot.WriteString(v); err != nil { + if p.IsSetFolders() { + if err = oprot.WriteFieldBegin("folders", thrift.LIST, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Folders)); err != nil { return err } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError + for _, v := range p.Folders { + if err := oprot.WriteString(v); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } return nil WriteFieldBeginError: @@ -4104,9 +4107,14 @@ func (p *UpYunFileDir) DeepEqual(ano *UpYunFileDir) bool { return true } -func (p *UpYunFileDir) Field1DeepEqual(src string) bool { +func (p *UpYunFileDir) Field1DeepEqual(src *string) bool { - if strings.Compare(p.BasePath, src) != 0 { + if p.BasePath == src { + return true + } else if p.BasePath == nil || src == nil { + return false + } + if strings.Compare(*p.BasePath, *src) != 0 { return false } return true @@ -4447,7 +4455,6 @@ func (p *Score) ReadField7(iprot thrift.TProtocol) error { } func (p *Score) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("Score"); err != nil { goto WriteStructBeginError @@ -4852,7 +4859,6 @@ func (p *GPABean) ReadField2(iprot thrift.TProtocol) error { } func (p *GPABean) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GPABean"); err != nil { goto WriteStructBeginError @@ -5104,7 +5110,6 @@ func (p *GPAData) ReadField2(iprot thrift.TProtocol) error { } func (p *GPAData) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("GPAData"); err != nil { goto WriteStructBeginError @@ -5377,7 +5382,6 @@ func (p *Credit) ReadField3(iprot thrift.TProtocol) error { } func (p *Credit) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("Credit"); err != nil { goto WriteStructBeginError @@ -5681,7 +5685,6 @@ func (p *UnifiedExam) ReadField3(iprot thrift.TProtocol) error { } func (p *UnifiedExam) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 if err = oprot.WriteStructBegin("UnifiedExam"); err != nil { goto WriteStructBeginError @@ -5816,73 +5819,77 @@ func (p *UnifiedExam) Field3DeepEqual(src string) bool { return true } -type Term struct { - TermId string `thrift:"term_id,1,required" frugal:"1,required,string" json:"term_id"` - SchoolYear string `thrift:"school_year,2,required" frugal:"2,required,string" json:"school_year"` - Term string `thrift:"term,3,required" frugal:"3,required,string" json:"term"` - StartDate string `thrift:"start_date,4,required" frugal:"4,required,string" json:"start_date"` - EndDate string `thrift:"end_date,5,required" frugal:"5,required,string" json:"end_date"` +type PaperData struct { + BasePath *string `thrift:"base_path,1,optional" frugal:"1,optional,string" json:"base_path,omitempty"` + Files []string `thrift:"files,2,optional" frugal:"2,optional,list" json:"files,omitempty"` + Folders []string `thrift:"folders,3,optional" frugal:"3,optional,list" json:"folders,omitempty"` } -func NewTerm() *Term { - return &Term{} +func NewPaperData() *PaperData { + return &PaperData{} } -func (p *Term) InitDefault() { +func (p *PaperData) InitDefault() { } -func (p *Term) GetTermId() (v string) { - return p.TermId -} +var PaperData_BasePath_DEFAULT string -func (p *Term) GetSchoolYear() (v string) { - return p.SchoolYear +func (p *PaperData) GetBasePath() (v string) { + if !p.IsSetBasePath() { + return PaperData_BasePath_DEFAULT + } + return *p.BasePath } -func (p *Term) GetTerm() (v string) { - return p.Term -} +var PaperData_Files_DEFAULT []string -func (p *Term) GetStartDate() (v string) { - return p.StartDate +func (p *PaperData) GetFiles() (v []string) { + if !p.IsSetFiles() { + return PaperData_Files_DEFAULT + } + return p.Files } -func (p *Term) GetEndDate() (v string) { - return p.EndDate +var PaperData_Folders_DEFAULT []string + +func (p *PaperData) GetFolders() (v []string) { + if !p.IsSetFolders() { + return PaperData_Folders_DEFAULT + } + return p.Folders } -func (p *Term) SetTermId(val string) { - p.TermId = val +func (p *PaperData) SetBasePath(val *string) { + p.BasePath = val } -func (p *Term) SetSchoolYear(val string) { - p.SchoolYear = val +func (p *PaperData) SetFiles(val []string) { + p.Files = val } -func (p *Term) SetTerm(val string) { - p.Term = val +func (p *PaperData) SetFolders(val []string) { + p.Folders = val } -func (p *Term) SetStartDate(val string) { - p.StartDate = val + +var fieldIDToName_PaperData = map[int16]string{ + 1: "base_path", + 2: "files", + 3: "folders", } -func (p *Term) SetEndDate(val string) { - p.EndDate = val + +func (p *PaperData) IsSetBasePath() bool { + return p.BasePath != nil } -var fieldIDToName_Term = map[int16]string{ - 1: "term_id", - 2: "school_year", - 3: "term", - 4: "start_date", - 5: "end_date", +func (p *PaperData) IsSetFiles() bool { + return p.Files != nil } -func (p *Term) Read(iprot thrift.TProtocol) (err error) { +func (p *PaperData) IsSetFolders() bool { + return p.Folders != nil +} + +func (p *PaperData) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetTermId bool = false - var issetSchoolYear bool = false - var issetTerm bool = false - var issetStartDate bool = false - var issetEndDate bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -5903,43 +5910,22 @@ func (p *Term) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetTermId = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } case 2: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.LIST { if err = p.ReadField2(iprot); err != nil { goto ReadFieldError } - issetSchoolYear = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } case 3: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.LIST { if err = p.ReadField3(iprot); err != nil { goto ReadFieldError } - issetTerm = true - } 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 - } - issetStartDate = true - } 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 - } - issetEndDate = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -5956,37 +5942,13 @@ func (p *Term) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetTermId { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetSchoolYear { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetTerm { - fieldId = 3 - goto RequiredFieldNotSetError - } - - if !issetStartDate { - fieldId = 4 - goto RequiredFieldNotSetError - } - - if !issetEndDate { - fieldId = 5 - goto RequiredFieldNotSetError - } 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_Term[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaperData[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -5994,70 +5956,69 @@ 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) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_Term[fieldId])) } -func (p *Term) ReadField1(iprot thrift.TProtocol) error { +func (p *PaperData) ReadField1(iprot thrift.TProtocol) error { - var _field string + var _field *string if v, err := iprot.ReadString(); err != nil { return err } else { - _field = v + _field = &v } - p.TermId = _field + p.BasePath = _field return nil } -func (p *Term) ReadField2(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { +func (p *PaperData) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { return err - } else { - _field = v } - p.SchoolYear = _field - return nil -} -func (p *Term) ReadField3(iprot thrift.TProtocol) error { + _field := make([]string, 0, size) + for i := 0; i < size; i++ { - var _field string - if v, err := iprot.ReadString(); err != nil { + var _elem string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _elem = v + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { return err - } else { - _field = v } - p.Term = _field + p.Files = _field return nil } -func (p *Term) ReadField4(iprot thrift.TProtocol) error { +func (p *PaperData) ReadField3(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]string, 0, size) + for i := 0; i < size; i++ { - var _field string - if v, err := iprot.ReadString(); err != nil { + var _elem string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _elem = v + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { return err - } else { - _field = v } - p.StartDate = _field + p.Folders = _field return nil } -func (p *Term) ReadField5(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.EndDate = _field - return nil -} - -func (p *Term) Write(oprot thrift.TProtocol) (err error) { +func (p *PaperData) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("Term"); err != nil { + if err = oprot.WriteStructBegin("PaperData"); err != nil { goto WriteStructBeginError } if p != nil { @@ -6073,14 +6034,6 @@ func (p *Term) Write(oprot thrift.TProtocol) (err error) { 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 @@ -6099,15 +6052,17 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *Term) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("term_id", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.TermId); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError +func (p *PaperData) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetBasePath() { + if err = oprot.WriteFieldBegin("base_path", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.BasePath); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } return nil WriteFieldBeginError: @@ -6116,15 +6071,25 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *Term) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("school_year", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.SchoolYear); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError +func (p *PaperData) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetFiles() { + if err = oprot.WriteFieldBegin("files", thrift.LIST, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Files)); err != nil { + return err + } + for _, v := range p.Files { + if err := oprot.WriteString(v); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } return nil WriteFieldBeginError: @@ -6133,15 +6098,25 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *Term) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("term", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Term); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError +func (p *PaperData) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetFolders() { + if err = oprot.WriteFieldBegin("folders", thrift.LIST, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Folders)); err != nil { + return err + } + for _, v := range p.Folders { + if err := oprot.WriteString(v); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } return nil WriteFieldBeginError: @@ -6150,155 +6125,98 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) } -func (p *Term) writeField4(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("start_date", thrift.STRING, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.StartDate); 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 *Term) writeField5(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("end_date", thrift.STRING, 5); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.EndDate); 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 *Term) String() string { +func (p *PaperData) String() string { if p == nil { return "" } - return fmt.Sprintf("Term(%+v)", *p) + return fmt.Sprintf("PaperData(%+v)", *p) } -func (p *Term) DeepEqual(ano *Term) bool { +func (p *PaperData) DeepEqual(ano *PaperData) bool { if p == ano { return true } else if p == nil || ano == nil { return false } - if !p.Field1DeepEqual(ano.TermId) { - return false - } - if !p.Field2DeepEqual(ano.SchoolYear) { - return false - } - if !p.Field3DeepEqual(ano.Term) { + if !p.Field1DeepEqual(ano.BasePath) { return false } - if !p.Field4DeepEqual(ano.StartDate) { + if !p.Field2DeepEqual(ano.Files) { return false } - if !p.Field5DeepEqual(ano.EndDate) { + if !p.Field3DeepEqual(ano.Folders) { return false } return true } -func (p *Term) Field1DeepEqual(src string) bool { +func (p *PaperData) Field1DeepEqual(src *string) bool { - if strings.Compare(p.TermId, src) != 0 { + if p.BasePath == src { + return true + } else if p.BasePath == nil || src == nil { return false } - return true -} -func (p *Term) Field2DeepEqual(src string) bool { - - if strings.Compare(p.SchoolYear, src) != 0 { + if strings.Compare(*p.BasePath, *src) != 0 { return false } return true } -func (p *Term) Field3DeepEqual(src string) bool { +func (p *PaperData) Field2DeepEqual(src []string) bool { - if strings.Compare(p.Term, src) != 0 { + if len(p.Files) != len(src) { return false } - return true -} -func (p *Term) Field4DeepEqual(src string) bool { - - if strings.Compare(p.StartDate, src) != 0 { - return false + for i, v := range p.Files { + _src := src[i] + if strings.Compare(v, _src) != 0 { + return false + } } return true } -func (p *Term) Field5DeepEqual(src string) bool { +func (p *PaperData) Field3DeepEqual(src []string) bool { - if strings.Compare(p.EndDate, src) != 0 { + if len(p.Folders) != len(src) { return false } + for i, v := range p.Folders { + _src := src[i] + if strings.Compare(v, _src) != 0 { + return false + } + } return true } -type TermEvent struct { - Name string `thrift:"name,1,required" frugal:"1,required,string" json:"name"` - StartDate string `thrift:"start_date,2,required" frugal:"2,required,string" json:"start_date"` - EndDate string `thrift:"end_date,3,required" frugal:"3,required,string" json:"end_date"` -} - -func NewTermEvent() *TermEvent { - return &TermEvent{} -} - -func (p *TermEvent) InitDefault() { +type PaperUrlData struct { + Url string `thrift:"url,1,required" frugal:"1,required,string" json:"url"` } -func (p *TermEvent) GetName() (v string) { - return p.Name +func NewPaperUrlData() *PaperUrlData { + return &PaperUrlData{} } -func (p *TermEvent) GetStartDate() (v string) { - return p.StartDate +func (p *PaperUrlData) InitDefault() { } -func (p *TermEvent) GetEndDate() (v string) { - return p.EndDate -} -func (p *TermEvent) SetName(val string) { - p.Name = val -} -func (p *TermEvent) SetStartDate(val string) { - p.StartDate = val +func (p *PaperUrlData) GetUrl() (v string) { + return p.Url } -func (p *TermEvent) SetEndDate(val string) { - p.EndDate = val +func (p *PaperUrlData) SetUrl(val string) { + p.Url = val } -var fieldIDToName_TermEvent = map[int16]string{ - 1: "name", - 2: "start_date", - 3: "end_date", +var fieldIDToName_PaperUrlData = map[int16]string{ + 1: "url", } -func (p *TermEvent) Read(iprot thrift.TProtocol) (err error) { +func (p *PaperUrlData) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetName bool = false - var issetStartDate bool = false - var issetEndDate bool = false + var issetUrl bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -6319,25 +6237,7 @@ func (p *TermEvent) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetName = true - } 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 - } - issetStartDate = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRING { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - issetEndDate = true + issetUrl = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -6354,27 +6254,17 @@ func (p *TermEvent) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetName { + if !issetUrl { fieldId = 1 goto RequiredFieldNotSetError } - - if !issetStartDate { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetEndDate { - fieldId = 3 - goto RequiredFieldNotSetError - } 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_TermEvent[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaperUrlData[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -6383,32 +6273,10 @@ ReadFieldEndError: ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TermEvent[fieldId])) -} - -func (p *TermEvent) ReadField1(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Name = _field - return nil + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_PaperUrlData[fieldId])) } -func (p *TermEvent) ReadField2(iprot thrift.TProtocol) error { - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.StartDate = _field - return nil -} -func (p *TermEvent) ReadField3(iprot thrift.TProtocol) error { +func (p *PaperUrlData) ReadField1(iprot thrift.TProtocol) error { var _field string if v, err := iprot.ReadString(); err != nil { @@ -6416,14 +6284,13 @@ func (p *TermEvent) ReadField3(iprot thrift.TProtocol) error { } else { _field = v } - p.EndDate = _field + p.Url = _field return nil } -func (p *TermEvent) Write(oprot thrift.TProtocol) (err error) { - +func (p *PaperUrlData) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("TermEvent"); err != nil { + if err = oprot.WriteStructBegin("PaperUrlData"); err != nil { goto WriteStructBeginError } if p != nil { @@ -6431,14 +6298,6 @@ func (p *TermEvent) Write(oprot thrift.TProtocol) (err error) { fieldId = 1 goto WriteFieldError } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -6457,11 +6316,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *TermEvent) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { +func (p *PaperUrlData) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("url", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(p.Name); err != nil { + if err := oprot.WriteString(p.Url); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -6474,135 +6333,141 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *TermEvent) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("start_date", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.StartDate); 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 *TermEvent) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("end_date", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.EndDate); 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 *TermEvent) String() string { +func (p *PaperUrlData) String() string { if p == nil { return "" } - return fmt.Sprintf("TermEvent(%+v)", *p) + return fmt.Sprintf("PaperUrlData(%+v)", *p) } -func (p *TermEvent) DeepEqual(ano *TermEvent) bool { +func (p *PaperUrlData) DeepEqual(ano *PaperUrlData) bool { if p == ano { return true } else if p == nil || ano == nil { return false } - if !p.Field1DeepEqual(ano.Name) { - return false - } - if !p.Field2DeepEqual(ano.StartDate) { - return false - } - if !p.Field3DeepEqual(ano.EndDate) { + if !p.Field1DeepEqual(ano.Url) { return false } return true } -func (p *TermEvent) Field1DeepEqual(src string) bool { +func (p *PaperUrlData) Field1DeepEqual(src string) bool { - if strings.Compare(p.Name, src) != 0 { + if strings.Compare(p.Url, src) != 0 { return false } return true } -func (p *TermEvent) Field2DeepEqual(src string) bool { - if strings.Compare(p.StartDate, src) != 0 { - return false - } - return true +type Term struct { + TermId *string `thrift:"term_id,1,optional" frugal:"1,optional,string" json:"term_id,omitempty"` + SchoolYear *string `thrift:"school_year,2,optional" frugal:"2,optional,string" json:"school_year,omitempty"` + Term *string `thrift:"term,3,optional" frugal:"3,optional,string" json:"term,omitempty"` + StartDate *string `thrift:"start_date,4,optional" frugal:"4,optional,string" json:"start_date,omitempty"` + EndDate *string `thrift:"end_date,5,optional" frugal:"5,optional,string" json:"end_date,omitempty"` } -func (p *TermEvent) Field3DeepEqual(src string) bool { - if strings.Compare(p.EndDate, src) != 0 { - return false +func NewTerm() *Term { + return &Term{} +} + +func (p *Term) InitDefault() { +} + +var Term_TermId_DEFAULT string + +func (p *Term) GetTermId() (v string) { + if !p.IsSetTermId() { + return Term_TermId_DEFAULT } - return true + return *p.TermId } -type PaperData struct { - BasePath string `thrift:"base_path,1,required" frugal:"1,required,string" json:"base_path"` - Files []string `thrift:"files,2,required" frugal:"2,required,list" json:"files"` - Folders []string `thrift:"folders,3,required" frugal:"3,required,list" json:"folders"` +var Term_SchoolYear_DEFAULT string + +func (p *Term) GetSchoolYear() (v string) { + if !p.IsSetSchoolYear() { + return Term_SchoolYear_DEFAULT + } + return *p.SchoolYear } -func NewPaperData() *PaperData { - return &PaperData{} +var Term_Term_DEFAULT string + +func (p *Term) GetTerm() (v string) { + if !p.IsSetTerm() { + return Term_Term_DEFAULT + } + return *p.Term } -func (p *PaperData) InitDefault() { +var Term_StartDate_DEFAULT string + +func (p *Term) GetStartDate() (v string) { + if !p.IsSetStartDate() { + return Term_StartDate_DEFAULT + } + return *p.StartDate } -func (p *PaperData) GetBasePath() (v string) { - return p.BasePath +var Term_EndDate_DEFAULT string + +func (p *Term) GetEndDate() (v string) { + if !p.IsSetEndDate() { + return Term_EndDate_DEFAULT + } + return *p.EndDate +} +func (p *Term) SetTermId(val *string) { + p.TermId = val +} +func (p *Term) SetSchoolYear(val *string) { + p.SchoolYear = val +} +func (p *Term) SetTerm(val *string) { + p.Term = val +} +func (p *Term) SetStartDate(val *string) { + p.StartDate = val +} +func (p *Term) SetEndDate(val *string) { + p.EndDate = val } -func (p *PaperData) GetFiles() (v []string) { - return p.Files +var fieldIDToName_Term = map[int16]string{ + 1: "term_id", + 2: "school_year", + 3: "term", + 4: "start_date", + 5: "end_date", } -func (p *PaperData) GetFolders() (v []string) { - return p.Folders +func (p *Term) IsSetTermId() bool { + return p.TermId != nil } -func (p *PaperData) SetBasePath(val string) { - p.BasePath = val + +func (p *Term) IsSetSchoolYear() bool { + return p.SchoolYear != nil } -func (p *PaperData) SetFiles(val []string) { - p.Files = val + +func (p *Term) IsSetTerm() bool { + return p.Term != nil } -func (p *PaperData) SetFolders(val []string) { - p.Folders = val + +func (p *Term) IsSetStartDate() bool { + return p.StartDate != nil } -var fieldIDToName_PaperData = map[int16]string{ - 1: "base_path", - 2: "files", - 3: "folders", +func (p *Term) IsSetEndDate() bool { + return p.EndDate != nil } -func (p *PaperData) Read(iprot thrift.TProtocol) (err error) { +func (p *Term) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetBasePath bool = false - var issetFiles bool = false - var issetFolders bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -6623,25 +6488,38 @@ func (p *PaperData) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetBasePath = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } case 2: - if fieldTypeId == thrift.LIST { + if fieldTypeId == thrift.STRING { if err = p.ReadField2(iprot); err != nil { goto ReadFieldError } - issetFiles = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } case 3: - if fieldTypeId == thrift.LIST { + if fieldTypeId == thrift.STRING { if err = p.ReadField3(iprot); err != nil { goto ReadFieldError } - issetFolders = true + } 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 } @@ -6658,27 +6536,13 @@ func (p *PaperData) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetBasePath { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetFiles { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetFolders { - fieldId = 3 - goto RequiredFieldNotSetError - } 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_PaperData[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Term[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -6686,72 +6550,67 @@ 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) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_PaperData[fieldId])) } -func (p *PaperData) ReadField1(iprot thrift.TProtocol) error { +func (p *Term) ReadField1(iprot thrift.TProtocol) error { - var _field string + var _field *string if v, err := iprot.ReadString(); err != nil { return err } else { - _field = v + _field = &v } - p.BasePath = _field + p.TermId = _field return nil } -func (p *PaperData) ReadField2(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { +func (p *Term) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { return err + } else { + _field = &v } - _field := make([]string, 0, size) - for i := 0; i < size; i++ { - - var _elem string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _elem = v - } + p.SchoolYear = _field + return nil +} +func (p *Term) ReadField3(iprot thrift.TProtocol) error { - _field = append(_field, _elem) - } - if err := iprot.ReadListEnd(); err != nil { + var _field *string + if v, err := iprot.ReadString(); err != nil { return err + } else { + _field = &v } - p.Files = _field + p.Term = _field return nil } -func (p *PaperData) ReadField3(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { +func (p *Term) ReadField4(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { return err + } else { + _field = &v } - _field := make([]string, 0, size) - for i := 0; i < size; i++ { - - var _elem string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _elem = v - } + p.StartDate = _field + return nil +} +func (p *Term) ReadField5(iprot thrift.TProtocol) error { - _field = append(_field, _elem) - } - if err := iprot.ReadListEnd(); err != nil { + var _field *string + if v, err := iprot.ReadString(); err != nil { return err + } else { + _field = &v } - p.Folders = _field + p.EndDate = _field return nil } -func (p *PaperData) Write(oprot thrift.TProtocol) (err error) { - +func (p *Term) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("PaperData"); err != nil { + if err = oprot.WriteStructBegin("Term"); err != nil { goto WriteStructBeginError } if p != nil { @@ -6767,6 +6626,14 @@ func (p *PaperData) Write(oprot thrift.TProtocol) (err error) { 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 @@ -6785,15 +6652,17 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *PaperData) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("base_path", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.BasePath); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError +func (p *Term) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetTermId() { + if err = oprot.WriteFieldBegin("term_id", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.TermId); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } return nil WriteFieldBeginError: @@ -6802,23 +6671,17 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *PaperData) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("files", thrift.LIST, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.STRING, len(p.Files)); err != nil { - return err - } - for _, v := range p.Files { - if err := oprot.WriteString(v); err != nil { +func (p *Term) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetSchoolYear() { + if err = oprot.WriteFieldBegin("school_year", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.SchoolYear); err != nil { return err } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } return nil WriteFieldBeginError: @@ -6827,23 +6690,17 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *PaperData) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("folders", thrift.LIST, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.STRING, len(p.Folders)); err != nil { - return err - } - for _, v := range p.Folders { - if err := oprot.WriteString(v); err != nil { +func (p *Term) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetTerm() { + if err = oprot.WriteFieldBegin("term", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Term); err != nil { return err } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } return nil WriteFieldBeginError: @@ -6852,93 +6709,208 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) } -func (p *PaperData) String() string { +func (p *Term) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetStartDate() { + if err = oprot.WriteFieldBegin("start_date", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.StartDate); 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 *Term) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetEndDate() { + if err = oprot.WriteFieldBegin("end_date", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.EndDate); 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 *Term) String() string { if p == nil { return "" } - return fmt.Sprintf("PaperData(%+v)", *p) + return fmt.Sprintf("Term(%+v)", *p) } -func (p *PaperData) DeepEqual(ano *PaperData) bool { +func (p *Term) DeepEqual(ano *Term) bool { if p == ano { return true } else if p == nil || ano == nil { return false } - if !p.Field1DeepEqual(ano.BasePath) { + if !p.Field1DeepEqual(ano.TermId) { return false } - if !p.Field2DeepEqual(ano.Files) { + if !p.Field2DeepEqual(ano.SchoolYear) { return false } - if !p.Field3DeepEqual(ano.Folders) { + if !p.Field3DeepEqual(ano.Term) { + return false + } + if !p.Field4DeepEqual(ano.StartDate) { + return false + } + if !p.Field5DeepEqual(ano.EndDate) { return false } return true } -func (p *PaperData) Field1DeepEqual(src string) bool { +func (p *Term) Field1DeepEqual(src *string) bool { - if strings.Compare(p.BasePath, src) != 0 { + if p.TermId == src { + return true + } else if p.TermId == nil || src == nil { + return false + } + if strings.Compare(*p.TermId, *src) != 0 { return false } return true } -func (p *PaperData) Field2DeepEqual(src []string) bool { +func (p *Term) Field2DeepEqual(src *string) bool { - if len(p.Files) != len(src) { + if p.SchoolYear == src { + return true + } else if p.SchoolYear == nil || src == nil { return false } - for i, v := range p.Files { - _src := src[i] - if strings.Compare(v, _src) != 0 { - return false - } + if strings.Compare(*p.SchoolYear, *src) != 0 { + return false } return true } -func (p *PaperData) Field3DeepEqual(src []string) bool { +func (p *Term) Field3DeepEqual(src *string) bool { - if len(p.Folders) != len(src) { + if p.Term == src { + return true + } else if p.Term == nil || src == nil { return false } - for i, v := range p.Folders { - _src := src[i] - if strings.Compare(v, _src) != 0 { - return false - } + if strings.Compare(*p.Term, *src) != 0 { + return false } return true } +func (p *Term) Field4DeepEqual(src *string) bool { -type PaperUrlData struct { - Url string `thrift:"url,1,required" frugal:"1,required,string" json:"url"` + if p.StartDate == src { + return true + } else if p.StartDate == nil || src == nil { + return false + } + if strings.Compare(*p.StartDate, *src) != 0 { + return false + } + return true } +func (p *Term) Field5DeepEqual(src *string) bool { -func NewPaperUrlData() *PaperUrlData { - return &PaperUrlData{} + if p.EndDate == src { + return true + } else if p.EndDate == nil || src == nil { + return false + } + if strings.Compare(*p.EndDate, *src) != 0 { + return false + } + return true } -func (p *PaperUrlData) InitDefault() { +type TermEvent struct { + Name *string `thrift:"name,1,optional" frugal:"1,optional,string" json:"name,omitempty"` + StartDate *string `thrift:"start_date,2,optional" frugal:"2,optional,string" json:"start_date,omitempty"` + EndDate *string `thrift:"end_date,3,optional" frugal:"3,optional,string" json:"end_date,omitempty"` } -func (p *PaperUrlData) GetUrl() (v string) { - return p.Url +func NewTermEvent() *TermEvent { + return &TermEvent{} } -func (p *PaperUrlData) SetUrl(val string) { - p.Url = val + +func (p *TermEvent) InitDefault() { } -var fieldIDToName_PaperUrlData = map[int16]string{ - 1: "url", +var TermEvent_Name_DEFAULT string + +func (p *TermEvent) GetName() (v string) { + if !p.IsSetName() { + return TermEvent_Name_DEFAULT + } + return *p.Name } -func (p *PaperUrlData) Read(iprot thrift.TProtocol) (err error) { +var TermEvent_StartDate_DEFAULT string + +func (p *TermEvent) GetStartDate() (v string) { + if !p.IsSetStartDate() { + return TermEvent_StartDate_DEFAULT + } + return *p.StartDate +} + +var TermEvent_EndDate_DEFAULT string + +func (p *TermEvent) GetEndDate() (v string) { + if !p.IsSetEndDate() { + return TermEvent_EndDate_DEFAULT + } + return *p.EndDate +} +func (p *TermEvent) SetName(val *string) { + p.Name = val +} +func (p *TermEvent) SetStartDate(val *string) { + p.StartDate = val +} +func (p *TermEvent) SetEndDate(val *string) { + p.EndDate = val +} + +var fieldIDToName_TermEvent = map[int16]string{ + 1: "name", + 2: "start_date", + 3: "end_date", +} + +func (p *TermEvent) IsSetName() bool { + return p.Name != nil +} + +func (p *TermEvent) IsSetStartDate() bool { + return p.StartDate != nil +} + +func (p *TermEvent) IsSetEndDate() bool { + return p.EndDate != nil +} + +func (p *TermEvent) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetUrl bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -6959,7 +6931,22 @@ func (p *PaperUrlData) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetUrl = true + } 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.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -6976,17 +6963,13 @@ func (p *PaperUrlData) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetUrl { - fieldId = 1 - goto RequiredFieldNotSetError - } 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_PaperUrlData[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TermEvent[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -6994,26 +6977,45 @@ 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) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_PaperUrlData[fieldId])) } -func (p *PaperUrlData) ReadField1(iprot thrift.TProtocol) error { +func (p *TermEvent) ReadField1(iprot thrift.TProtocol) error { - var _field string + var _field *string if v, err := iprot.ReadString(); err != nil { return err } else { - _field = v + _field = &v } - p.Url = _field + p.Name = _field return nil } +func (p *TermEvent) ReadField2(iprot thrift.TProtocol) error { -func (p *PaperUrlData) Write(oprot thrift.TProtocol) (err error) { + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.StartDate = _field + return nil +} +func (p *TermEvent) ReadField3(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.EndDate = _field + return nil +} +func (p *TermEvent) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("PaperUrlData"); err != nil { + if err = oprot.WriteStructBegin("TermEvent"); err != nil { goto WriteStructBeginError } if p != nil { @@ -7021,6 +7023,14 @@ func (p *PaperUrlData) Write(oprot thrift.TProtocol) (err error) { fieldId = 1 goto WriteFieldError } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -7039,15 +7049,17 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *PaperUrlData) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("url", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Url); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError +func (p *TermEvent) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetName() { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); 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: @@ -7056,30 +7068,803 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *PaperUrlData) String() string { - if p == nil { - return "" +func (p *TermEvent) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetStartDate() { + if err = oprot.WriteFieldBegin("start_date", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.StartDate); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } - return fmt.Sprintf("PaperUrlData(%+v)", *p) - + 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 *PaperUrlData) DeepEqual(ano *PaperUrlData) bool { +func (p *TermEvent) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetEndDate() { + if err = oprot.WriteFieldBegin("end_date", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.EndDate); 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 *TermEvent) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TermEvent(%+v)", *p) + +} + +func (p *TermEvent) DeepEqual(ano *TermEvent) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Name) { + return false + } + if !p.Field2DeepEqual(ano.StartDate) { + return false + } + if !p.Field3DeepEqual(ano.EndDate) { + return false + } + return true +} + +func (p *TermEvent) Field1DeepEqual(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 *TermEvent) Field2DeepEqual(src *string) bool { + + if p.StartDate == src { + return true + } else if p.StartDate == nil || src == nil { + return false + } + if strings.Compare(*p.StartDate, *src) != 0 { + return false + } + return true +} +func (p *TermEvent) Field3DeepEqual(src *string) bool { + + if p.EndDate == src { + return true + } else if p.EndDate == nil || src == nil { + return false + } + if strings.Compare(*p.EndDate, *src) != 0 { + return false + } + return true +} + +type TermList struct { + CurrentTerm *string `thrift:"current_term,1,optional" frugal:"1,optional,string" json:"current_term,omitempty"` + Terms []*Term `thrift:"terms,2,optional" frugal:"2,optional,list" json:"terms,omitempty"` +} + +func NewTermList() *TermList { + return &TermList{} +} + +func (p *TermList) InitDefault() { +} + +var TermList_CurrentTerm_DEFAULT string + +func (p *TermList) GetCurrentTerm() (v string) { + if !p.IsSetCurrentTerm() { + return TermList_CurrentTerm_DEFAULT + } + return *p.CurrentTerm +} + +var TermList_Terms_DEFAULT []*Term + +func (p *TermList) GetTerms() (v []*Term) { + if !p.IsSetTerms() { + return TermList_Terms_DEFAULT + } + return p.Terms +} +func (p *TermList) SetCurrentTerm(val *string) { + p.CurrentTerm = val +} +func (p *TermList) SetTerms(val []*Term) { + p.Terms = val +} + +var fieldIDToName_TermList = map[int16]string{ + 1: "current_term", + 2: "terms", +} + +func (p *TermList) IsSetCurrentTerm() bool { + return p.CurrentTerm != nil +} + +func (p *TermList) IsSetTerms() bool { + return p.Terms != nil +} + +func (p *TermList) 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.LIST { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TermList[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 *TermList) ReadField1(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.CurrentTerm = _field + return nil +} +func (p *TermList) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*Term, 0, size) + values := make([]Term, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.Terms = _field + return nil +} + +func (p *TermList) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("TermList"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *TermList) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetCurrentTerm() { + if err = oprot.WriteFieldBegin("current_term", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.CurrentTerm); 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 *TermList) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetTerms() { + if err = oprot.WriteFieldBegin("terms", thrift.LIST, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Terms)); err != nil { + return err + } + for _, v := range p.Terms { + 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 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *TermList) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TermList(%+v)", *p) + +} + +func (p *TermList) DeepEqual(ano *TermList) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.CurrentTerm) { + return false + } + if !p.Field2DeepEqual(ano.Terms) { + return false + } + return true +} + +func (p *TermList) Field1DeepEqual(src *string) bool { + + if p.CurrentTerm == src { + return true + } else if p.CurrentTerm == nil || src == nil { + return false + } + if strings.Compare(*p.CurrentTerm, *src) != 0 { + return false + } + return true +} +func (p *TermList) Field2DeepEqual(src []*Term) bool { + + if len(p.Terms) != len(src) { + return false + } + for i, v := range p.Terms { + _src := src[i] + if !v.DeepEqual(_src) { + return false + } + } + return true +} + +type TermInfo struct { + TermId *string `thrift:"term_id,1,optional" frugal:"1,optional,string" json:"term_id,omitempty"` + Term *string `thrift:"term,2,optional" frugal:"2,optional,string" json:"term,omitempty"` + SchoolYear *string `thrift:"school_year,3,optional" frugal:"3,optional,string" json:"school_year,omitempty"` + Events []*TermEvent `thrift:"events,4,optional" frugal:"4,optional,list" json:"events,omitempty"` +} + +func NewTermInfo() *TermInfo { + return &TermInfo{} +} + +func (p *TermInfo) InitDefault() { +} + +var TermInfo_TermId_DEFAULT string + +func (p *TermInfo) GetTermId() (v string) { + if !p.IsSetTermId() { + return TermInfo_TermId_DEFAULT + } + return *p.TermId +} + +var TermInfo_Term_DEFAULT string + +func (p *TermInfo) GetTerm() (v string) { + if !p.IsSetTerm() { + return TermInfo_Term_DEFAULT + } + return *p.Term +} + +var TermInfo_SchoolYear_DEFAULT string + +func (p *TermInfo) GetSchoolYear() (v string) { + if !p.IsSetSchoolYear() { + return TermInfo_SchoolYear_DEFAULT + } + return *p.SchoolYear +} + +var TermInfo_Events_DEFAULT []*TermEvent + +func (p *TermInfo) GetEvents() (v []*TermEvent) { + if !p.IsSetEvents() { + return TermInfo_Events_DEFAULT + } + return p.Events +} +func (p *TermInfo) SetTermId(val *string) { + p.TermId = val +} +func (p *TermInfo) SetTerm(val *string) { + p.Term = val +} +func (p *TermInfo) SetSchoolYear(val *string) { + p.SchoolYear = val +} +func (p *TermInfo) SetEvents(val []*TermEvent) { + p.Events = val +} + +var fieldIDToName_TermInfo = map[int16]string{ + 1: "term_id", + 2: "term", + 3: "school_year", + 4: "events", +} + +func (p *TermInfo) IsSetTermId() bool { + return p.TermId != nil +} + +func (p *TermInfo) IsSetTerm() bool { + return p.Term != nil +} + +func (p *TermInfo) IsSetSchoolYear() bool { + return p.SchoolYear != nil +} + +func (p *TermInfo) IsSetEvents() bool { + return p.Events != nil +} + +func (p *TermInfo) 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.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.LIST { + 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_TermInfo[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 *TermInfo) ReadField1(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.TermId = _field + return nil +} +func (p *TermInfo) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Term = _field + return nil +} +func (p *TermInfo) ReadField3(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.SchoolYear = _field + return nil +} +func (p *TermInfo) ReadField4(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*TermEvent, 0, size) + values := make([]TermEvent, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.Events = _field + return nil +} + +func (p *TermInfo) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("TermInfo"); 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 *TermInfo) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetTermId() { + if err = oprot.WriteFieldBegin("term_id", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.TermId); 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 *TermInfo) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetTerm() { + if err = oprot.WriteFieldBegin("term", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Term); 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 *TermInfo) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetSchoolYear() { + if err = oprot.WriteFieldBegin("school_year", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.SchoolYear); 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 *TermInfo) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetEvents() { + if err = oprot.WriteFieldBegin("events", thrift.LIST, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Events)); err != nil { + return err + } + for _, v := range p.Events { + 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 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *TermInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TermInfo(%+v)", *p) + +} + +func (p *TermInfo) DeepEqual(ano *TermInfo) bool { if p == ano { return true } else if p == nil || ano == nil { return false } - if !p.Field1DeepEqual(ano.Url) { + if !p.Field1DeepEqual(ano.TermId) { + return false + } + if !p.Field2DeepEqual(ano.Term) { + return false + } + if !p.Field3DeepEqual(ano.SchoolYear) { + return false + } + if !p.Field4DeepEqual(ano.Events) { return false } return true } -func (p *PaperUrlData) Field1DeepEqual(src string) bool { +func (p *TermInfo) Field1DeepEqual(src *string) bool { - if strings.Compare(p.Url, src) != 0 { + if p.TermId == src { + return true + } else if p.TermId == nil || src == nil { + return false + } + if strings.Compare(*p.TermId, *src) != 0 { + return false + } + return true +} +func (p *TermInfo) Field2DeepEqual(src *string) bool { + + if p.Term == src { + return true + } else if p.Term == nil || src == nil { + return false + } + if strings.Compare(*p.Term, *src) != 0 { + return false + } + return true +} +func (p *TermInfo) Field3DeepEqual(src *string) bool { + + if p.SchoolYear == src { + return true + } else if p.SchoolYear == nil || src == nil { + return false + } + if strings.Compare(*p.SchoolYear, *src) != 0 { + return false + } + return true +} +func (p *TermInfo) Field4DeepEqual(src []*TermEvent) bool { + + if len(p.Events) != len(src) { return false } + for i, v := range p.Events { + _src := src[i] + if !v.DeepEqual(_src) { + return false + } + } return true } diff --git a/pkg/base/pack.go b/pkg/base/pack.go index 3d6868e6..2ab81ceb 100644 --- a/pkg/base/pack.go +++ b/pkg/base/pack.go @@ -86,3 +86,15 @@ func HandleJwchError(err error) error { } return err } + +func BuildTypeList[T any, U any](items []U, buildFunc func(U) T) []T { + if len(items) == 0 { + return nil + } + + list := make([]T, len(items)) + for i, item := range items { + list[i] = buildFunc(item) + } + return list +} diff --git a/pkg/base/pack_test.go b/pkg/base/pack_test.go index f030273c..499d0153 100644 --- a/pkg/base/pack_test.go +++ b/pkg/base/pack_test.go @@ -18,6 +18,7 @@ package base import ( "fmt" + "strconv" "testing" . "github.com/smartystreets/goconvey/convey" @@ -72,3 +73,15 @@ func TestBuildRespAndLog(t *testing.T) { So(errnoError.Msg, ShouldEqual, "ok") }) } + +func TestBuildTypeList(t *testing.T) { + Convey("Test BuildTypeList", t, func() { + f := func(i int64) string { + return strconv.FormatInt(i, 10) + } + ints := []int64{1, 2, 3, 4} + strs := BuildTypeList(ints, f) + So(len(strs), ShouldEqual, len(ints)) + So([]string{"1", "2", "3", "4"}, ShouldResemble, strs) + }) +} diff --git a/pkg/upyun/paper.go b/pkg/upyun/paper.go index 114e75e7..88048f9c 100644 --- a/pkg/upyun/paper.go +++ b/pkg/upyun/paper.go @@ -47,7 +47,7 @@ func NewUpYun() { func GetDir(path string) (*model.UpYunFileDir, error) { var err error fileDir := &model.UpYunFileDir{ - BasePath: path, + BasePath: &path, Folders: []string{}, Files: []string{}, }