diff --git a/api/handler/api/academic_service.go b/api/handler/api/academic_service.go index 26ec966e..5af16f72 100644 --- a/api/handler/api/academic_service.go +++ b/api/handler/api/academic_service.go @@ -22,6 +22,7 @@ import ( "context" "github.com/cloudwego/hertz/pkg/app" + "github.com/cloudwego/hertz/pkg/protocol/consts" "github.com/west2-online/fzuhelper-server/api/model/api" "github.com/west2-online/fzuhelper-server/api/pack" @@ -152,3 +153,14 @@ func GetUnifiedExam(ctx context.Context, c *app.RequestContext) { resp.UnifiedExam = pack.BuildUnifiedExam(unifiedExam) pack.RespList(c, resp.UnifiedExam) } + +// GetPlan . +// @router /api/v1/jwch/academic/plan [GET] +func GetPlan(ctx context.Context, c *app.RequestContext) { + plan, err := rpc.GetCultivatePlanRPC(ctx, &academic.GetPlanRequest{}) + if err != nil { + pack.RespError(c, err) + return + } + c.Data(consts.StatusOK, "text/html", *plan) +} diff --git a/api/handler/api/academic_service_test.go b/api/handler/api/academic_service_test.go new file mode 100644 index 00000000..a051509c --- /dev/null +++ b/api/handler/api/academic_service_test.go @@ -0,0 +1,112 @@ +/* +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" + "net/http" + "testing" + + "github.com/bytedance/mockey" + "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/academic" + "github.com/west2-online/fzuhelper-server/kitex_gen/model" + "github.com/west2-online/fzuhelper-server/pkg/base/login_data" +) + +func TestGetPlan(t *testing.T) { + type TestCase struct { + Name string + Headers map[string]string + ExpectedError bool + ExpectedResult string + Url string + } + + testCases := []TestCase{ + { + Name: "获取计划成功", + Headers: map[string]string{ + "id": "202511012137102301000", + "Cookies": "ASP.NET_SessionId=db123abcdefgh5ijklzjv2et", + }, + ExpectedError: false, + ExpectedResult: "Plan Content", + Url: "/api/v1/jwch/academic/plan", + }, + { + Name: "RPC调用失败", + Headers: map[string]string{ + "id": "202511012137102301000", + "Cookies": "ASP.NET_SessionId=db123abcdefgh5ijklzjv2et", + }, + ExpectedError: true, + ExpectedResult: `{"code":"50001","message":"GetCultivatePlanRPC: RPC called failed:`, + Url: "/api/v1/jwch/academic/plan", + }, + { + Name: "RPC返回空HTML", + Headers: map[string]string{ + "id": "202511012137102301000", + "Cookies": "ASP.NET_SessionId=db123abcdefgh5ijklzjv2et", + }, + ExpectedError: true, + ExpectedResult: `{"code":"50001","message":`, + Url: "/api/v1/jwch/academic/plan", + }, + } + + // 初始化路由引擎并注册GetPlan路由 + router := route.NewEngine(&config.Options{}) + router.GET("/api/v1/jwch/academic/plan", GetPlan) + + for _, tc := range testCases { + mockey.PatchConvey(tc.Name, t, func() { + // 模拟RPC调用 + mockey.Mock(login_data.GetLoginData).To(func(ctx context.Context) (*model.LoginData, error) { + return &model.LoginData{ + Id: "20250000102301000", + Cookies: "ASP", + }, nil + }).Build() + mockey.Mock(rpc.GetCultivatePlanRPC).To(func(ctx context.Context, req *academic.GetPlanRequest) (*[]byte, error) { + if tc.ExpectedError { + // 根据测试用例的不同,可以自定义返回不同的错误信息 + + return nil, errors.New("GetCultivatePlanRPC: RPC called failed: 错误的文件路径") + } + // 成功返回HTML内容 + html := []byte("Plan Content") + return &html, nil + }).Build() + defer mockey.UnPatchAll() + + resp := ut.PerformRequest(router, consts.MethodGet, tc.Url, nil) + + // 断言响应 + assert.Equal(t, http.StatusOK, resp.Code) + assert.Contains(t, string(resp.Result().Body()), tc.ExpectedResult) + }) + } +} diff --git a/api/handler/api/user_service.go b/api/handler/api/user_service.go index 2bad289c..9b09db41 100644 --- a/api/handler/api/user_service.go +++ b/api/handler/api/user_service.go @@ -202,3 +202,14 @@ func TestAuth(ctx context.Context, c *app.RequestContext) { "message": "pong", }) } + +// GetUserInfo . +// @router /api/v1/jwch/user/info [GET] +func GetUserInfo(ctx context.Context, c *app.RequestContext) { + info, err := rpc.GetUserInfoRPC(ctx, &user.GetUserInfoRequest{}) + if err != nil { + pack.RespError(c, err) + return + } + pack.RespData(c, info) +} diff --git a/api/model/api/api.go b/api/model/api/api.go index 80f9bb66..4b7c84dd 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.17). DO NOT EDIT. +// Code generated by thriftgo (0.3.18). DO NOT EDIT. package api @@ -222,6 +222,7 @@ 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 @@ -445,6 +446,7 @@ 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 @@ -602,6 +604,7 @@ 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 @@ -762,6 +765,7 @@ 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 @@ -951,6 +955,7 @@ 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 @@ -1164,6 +1169,7 @@ 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 @@ -1341,6 +1347,7 @@ 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 @@ -1448,6 +1455,7 @@ ReadStructEndError: } func (p *ValidateCodeResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("ValidateCodeResponse"); err != nil { goto WriteStructBeginError } @@ -1573,6 +1581,7 @@ 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 @@ -1680,6 +1689,7 @@ ReadStructEndError: } func (p *ValidateCodeForAndroidResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("ValidateCodeForAndroidResponse"); err != nil { goto WriteStructBeginError } @@ -1763,6 +1773,7 @@ ReadStructEndError: } func (p *GetAccessTokenRequest) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetAccessTokenRequest"); err != nil { goto WriteStructBeginError } @@ -1904,6 +1915,7 @@ 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 @@ -2032,6 +2044,7 @@ ReadStructEndError: } func (p *RefreshTokenRequest) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("RefreshTokenRequest"); err != nil { goto WriteStructBeginError } @@ -2173,6 +2186,7 @@ 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 @@ -2301,6 +2315,7 @@ ReadStructEndError: } func (p *TestAuthRequest) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("TestAuthRequest"); err != nil { goto WriteStructBeginError } @@ -2417,6 +2432,7 @@ 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 @@ -2469,31 +2485,22 @@ func (p *TestAuthResponse) String() string { } -// course -type CourseListRequest struct { - Term string `thrift:"term,1,required" form:"term,required" json:"term,required" query:"term,required"` -} - -func NewCourseListRequest() *CourseListRequest { - return &CourseListRequest{} +type GetUserInfoRequest struct { } -func (p *CourseListRequest) InitDefault() { +func NewGetUserInfoRequest() *GetUserInfoRequest { + return &GetUserInfoRequest{} } -func (p *CourseListRequest) GetTerm() (v string) { - return p.Term +func (p *GetUserInfoRequest) InitDefault() { } -var fieldIDToName_CourseListRequest = map[int16]string{ - 1: "term", -} +var fieldIDToName_GetUserInfoRequest = map[int16]string{} -func (p *CourseListRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetUserInfoRequest) 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 @@ -2507,21 +2514,8 @@ func (p *CourseListRequest) Read(iprot thrift.TProtocol) (err error) { if fieldTypeId == thrift.STOP { break } - - 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.Skip(fieldTypeId); err != nil { + goto SkipFieldTypeError } if err = iprot.ReadFieldEnd(); err != nil { goto ReadFieldEndError @@ -2531,50 +2525,26 @@ func (p *CourseListRequest) 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_CourseListRequest[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) 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_CourseListRequest[fieldId])) } -func (p *CourseListRequest) ReadField1(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 *GetUserInfoRequest) Write(oprot thrift.TProtocol) (err error) { -func (p *CourseListRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("CourseListRequest"); err != nil { + if err = oprot.WriteStructBegin("GetUserInfoRequest"); 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 @@ -2585,79 +2555,68 @@ func (p *CourseListRequest) 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 *CourseListRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("term", thrift.STRING, 1); 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 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *CourseListRequest) String() string { +func (p *GetUserInfoRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("CourseListRequest(%+v)", *p) + return fmt.Sprintf("GetUserInfoRequest(%+v)", *p) } -type CourseListResponse struct { +type GetUserInfoResponse struct { Base *model.BaseResp `thrift:"base,1,required" form:"base,required" json:"base,required" query:"base,required"` - Data []*model.Course `thrift:"data,2,required" form:"data,required" json:"data,required" query:"data,required"` + Data *model.UserInfo `thrift:"data,2,optional" form:"data" json:"data,omitempty" query:"data"` } -func NewCourseListResponse() *CourseListResponse { - return &CourseListResponse{} +func NewGetUserInfoResponse() *GetUserInfoResponse { + return &GetUserInfoResponse{} } -func (p *CourseListResponse) InitDefault() { +func (p *GetUserInfoResponse) InitDefault() { } -var CourseListResponse_Base_DEFAULT *model.BaseResp +var GetUserInfoResponse_Base_DEFAULT *model.BaseResp -func (p *CourseListResponse) GetBase() (v *model.BaseResp) { +func (p *GetUserInfoResponse) GetBase() (v *model.BaseResp) { if !p.IsSetBase() { - return CourseListResponse_Base_DEFAULT + return GetUserInfoResponse_Base_DEFAULT } return p.Base } -func (p *CourseListResponse) GetData() (v []*model.Course) { +var GetUserInfoResponse_Data_DEFAULT *model.UserInfo + +func (p *GetUserInfoResponse) GetData() (v *model.UserInfo) { + if !p.IsSetData() { + return GetUserInfoResponse_Data_DEFAULT + } return p.Data } -var fieldIDToName_CourseListResponse = map[int16]string{ +var fieldIDToName_GetUserInfoResponse = map[int16]string{ 1: "base", 2: "data", } -func (p *CourseListResponse) IsSetBase() bool { +func (p *GetUserInfoResponse) IsSetBase() bool { return p.Base != nil } -func (p *CourseListResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetUserInfoResponse) IsSetData() bool { + return p.Data != nil +} + +func (p *GetUserInfoResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 var issetBase bool = false - var issetData bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -2683,11 +2642,10 @@ func (p *CourseListResponse) Read(iprot thrift.TProtocol) (err error) { goto SkipFieldError } case 2: - if fieldTypeId == thrift.LIST { + if fieldTypeId == thrift.STRUCT { if err = p.ReadField2(iprot); err != nil { goto ReadFieldError } - issetData = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -2708,18 +2666,13 @@ func (p *CourseListResponse) Read(iprot thrift.TProtocol) (err error) { fieldId = 1 goto RequiredFieldNotSetError } - - if !issetData { - 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_CourseListResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetUserInfoResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -2728,10 +2681,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_CourseListResponse[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetUserInfoResponse[fieldId])) } -func (p *CourseListResponse) ReadField1(iprot thrift.TProtocol) error { +func (p *GetUserInfoResponse) ReadField1(iprot thrift.TProtocol) error { _field := model.NewBaseResp() if err := _field.Read(iprot); err != nil { return err @@ -2739,33 +2692,19 @@ func (p *CourseListResponse) ReadField1(iprot thrift.TProtocol) error { p.Base = _field return nil } -func (p *CourseListResponse) ReadField2(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _field := make([]*model.Course, 0, size) - values := make([]model.Course, 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 { +func (p *GetUserInfoResponse) ReadField2(iprot thrift.TProtocol) error { + _field := model.NewUserInfo() + if err := _field.Read(iprot); err != nil { return err } p.Data = _field return nil } -func (p *CourseListResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *GetUserInfoResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("CourseListResponse"); err != nil { + if err = oprot.WriteStructBegin("GetUserInfoResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -2795,7 +2734,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *CourseListResponse) writeField1(oprot thrift.TProtocol) (err error) { +func (p *GetUserInfoResponse) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -2812,23 +2751,17 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *CourseListResponse) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("data", thrift.LIST, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Data)); err != nil { - return err - } - for _, v := range p.Data { - if err := v.Write(oprot); err != nil { +func (p *GetUserInfoResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetData() { + if err = oprot.WriteFieldBegin("data", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Data.Write(oprot); 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: @@ -2837,239 +2770,60 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *CourseListResponse) String() string { +func (p *GetUserInfoResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("CourseListResponse(%+v)", *p) - -} - -// launch_screen -type CreateImageRequest struct { - PicType int64 `thrift:"pic_type,1,required" form:"pic_type,required" json:"pic_type,required" query:"pic_type,required"` - Duration *int64 `thrift:"duration,2,optional" form:"duration" json:"duration,omitempty" query:"duration"` - Href string `thrift:"href,3" form:"href" json:"href" query:"href"` - Image []byte `thrift:"image,4" form:"image" json:"image" query:"image"` - StartAt int64 `thrift:"start_at,5,required" form:"start_at,required" json:"start_at,required" query:"start_at,required"` - EndAt int64 `thrift:"end_at,6,required" form:"end_at,required" json:"end_at,required" query:"end_at,required"` - SType int64 `thrift:"s_type,7,required" form:"s_type,required" json:"s_type,required" query:"s_type,required"` - Frequency int64 `thrift:"frequency,8,required" form:"frequency,required" json:"frequency,required" query:"frequency,required"` - StartTime int64 `thrift:"start_time,9,required" form:"start_time,required" json:"start_time,required" query:"start_time,required"` - EndTime int64 `thrift:"end_time,10,required" form:"end_time,required" json:"end_time,required" query:"end_time,required"` - Text string `thrift:"text,11,required" form:"text,required" json:"text,required" query:"text,required"` - Regex string `thrift:"regex,12,required" form:"regex,required" json:"regex,required" query:"regex,required"` -} - -func NewCreateImageRequest() *CreateImageRequest { - return &CreateImageRequest{} -} - -func (p *CreateImageRequest) InitDefault() { -} - -func (p *CreateImageRequest) GetPicType() (v int64) { - return p.PicType -} - -var CreateImageRequest_Duration_DEFAULT int64 + return fmt.Sprintf("GetUserInfoResponse(%+v)", *p) -func (p *CreateImageRequest) GetDuration() (v int64) { - if !p.IsSetDuration() { - return CreateImageRequest_Duration_DEFAULT - } - return *p.Duration } -func (p *CreateImageRequest) GetHref() (v string) { - return p.Href +// course +type CourseListRequest struct { + Term string `thrift:"term,1,required" form:"term,required" json:"term,required" query:"term,required"` } -func (p *CreateImageRequest) GetImage() (v []byte) { - return p.Image +func NewCourseListRequest() *CourseListRequest { + return &CourseListRequest{} } -func (p *CreateImageRequest) GetStartAt() (v int64) { - return p.StartAt +func (p *CourseListRequest) InitDefault() { } -func (p *CreateImageRequest) GetEndAt() (v int64) { - return p.EndAt +func (p *CourseListRequest) GetTerm() (v string) { + return p.Term } -func (p *CreateImageRequest) GetSType() (v int64) { - return p.SType +var fieldIDToName_CourseListRequest = map[int16]string{ + 1: "term", } -func (p *CreateImageRequest) GetFrequency() (v int64) { - return p.Frequency -} +func (p *CourseListRequest) Read(iprot thrift.TProtocol) (err error) { -func (p *CreateImageRequest) GetStartTime() (v int64) { - return p.StartTime -} + var fieldTypeId thrift.TType + var fieldId int16 + var issetTerm bool = false -func (p *CreateImageRequest) GetEndTime() (v int64) { - return p.EndTime -} + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } -func (p *CreateImageRequest) GetText() (v string) { - return p.Text -} - -func (p *CreateImageRequest) GetRegex() (v string) { - return p.Regex -} - -var fieldIDToName_CreateImageRequest = map[int16]string{ - 1: "pic_type", - 2: "duration", - 3: "href", - 4: "image", - 5: "start_at", - 6: "end_at", - 7: "s_type", - 8: "frequency", - 9: "start_time", - 10: "end_time", - 11: "text", - 12: "regex", -} - -func (p *CreateImageRequest) IsSetDuration() bool { - return p.Duration != nil -} - -func (p *CreateImageRequest) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetPicType bool = false - var issetStartAt bool = false - var issetEndAt bool = false - var issetSType bool = false - var issetFrequency bool = false - var issetStartTime bool = false - var issetEndTime bool = false - var issetText bool = false - var issetRegex 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 - } + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } switch fieldId { case 1: - if fieldTypeId == thrift.I64 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetPicType = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.I64 { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRING { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 4: - if fieldTypeId == thrift.STRING { - if err = p.ReadField4(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 5: - if fieldTypeId == thrift.I64 { - if err = p.ReadField5(iprot); err != nil { - goto ReadFieldError - } - issetStartAt = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 6: - if fieldTypeId == thrift.I64 { - if err = p.ReadField6(iprot); err != nil { - goto ReadFieldError - } - issetEndAt = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 7: - if fieldTypeId == thrift.I64 { - if err = p.ReadField7(iprot); err != nil { - goto ReadFieldError - } - issetSType = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 8: - if fieldTypeId == thrift.I64 { - if err = p.ReadField8(iprot); err != nil { - goto ReadFieldError - } - issetFrequency = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 9: - if fieldTypeId == thrift.I64 { - if err = p.ReadField9(iprot); err != nil { - goto ReadFieldError - } - issetStartTime = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 10: - if fieldTypeId == thrift.I64 { - if err = p.ReadField10(iprot); err != nil { - goto ReadFieldError - } - issetEndTime = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 11: - if fieldTypeId == thrift.STRING { - if err = p.ReadField11(iprot); err != nil { - goto ReadFieldError - } - issetText = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 12: if fieldTypeId == thrift.STRING { - if err = p.ReadField12(iprot); err != nil { + if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetRegex = true + issetTerm = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -3086,57 +2840,17 @@ func (p *CreateImageRequest) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetPicType { + if !issetTerm { fieldId = 1 goto RequiredFieldNotSetError } - - if !issetStartAt { - fieldId = 5 - goto RequiredFieldNotSetError - } - - if !issetEndAt { - fieldId = 6 - goto RequiredFieldNotSetError - } - - if !issetSType { - fieldId = 7 - goto RequiredFieldNotSetError - } - - if !issetFrequency { - fieldId = 8 - goto RequiredFieldNotSetError - } - - if !issetStartTime { - fieldId = 9 - goto RequiredFieldNotSetError - } - - if !issetEndTime { - fieldId = 10 - goto RequiredFieldNotSetError - } - - if !issetText { - fieldId = 11 - goto RequiredFieldNotSetError - } - - if !issetRegex { - fieldId = 12 - 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_CreateImageRequest[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CourseListRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -3145,145 +2859,224 @@ 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_CreateImageRequest[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_CourseListRequest[fieldId])) } -func (p *CreateImageRequest) ReadField1(iprot thrift.TProtocol) error { +func (p *CourseListRequest) ReadField1(iprot thrift.TProtocol) error { - var _field int64 - if v, err := iprot.ReadI64(); err != nil { + var _field string + if v, err := iprot.ReadString(); err != nil { return err } else { _field = v } - p.PicType = _field + p.Term = _field return nil } -func (p *CreateImageRequest) ReadField2(iprot thrift.TProtocol) error { - var _field *int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = &v +func (p *CourseListRequest) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("CourseListRequest"); 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 } - p.Duration = _field 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 *CreateImageRequest) ReadField3(iprot thrift.TProtocol) error { - var _field string - if v, err := iprot.ReadString(); err != nil { +func (p *CourseListRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("term", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Term); err != nil { return err - } else { - _field = v } - p.Href = _field + 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 *CreateImageRequest) ReadField4(iprot thrift.TProtocol) error { - var _field []byte - if v, err := iprot.ReadBinary(); err != nil { - return err - } else { - _field = []byte(v) +func (p *CourseListRequest) String() string { + if p == nil { + return "" } - p.Image = _field - return nil + return fmt.Sprintf("CourseListRequest(%+v)", *p) + } -func (p *CreateImageRequest) ReadField5(iprot thrift.TProtocol) error { - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.StartAt = _field - return nil +type CourseListResponse struct { + Base *model.BaseResp `thrift:"base,1,required" form:"base,required" json:"base,required" query:"base,required"` + Data []*model.Course `thrift:"data,2,required" form:"data,required" json:"data,required" query:"data,required"` } -func (p *CreateImageRequest) ReadField6(iprot thrift.TProtocol) error { - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.EndAt = _field - return nil +func NewCourseListResponse() *CourseListResponse { + return &CourseListResponse{} } -func (p *CreateImageRequest) ReadField7(iprot thrift.TProtocol) error { - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.SType = _field - return nil +func (p *CourseListResponse) InitDefault() { } -func (p *CreateImageRequest) ReadField8(iprot thrift.TProtocol) error { - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v +var CourseListResponse_Base_DEFAULT *model.BaseResp + +func (p *CourseListResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return CourseListResponse_Base_DEFAULT } - p.Frequency = _field - return nil + return p.Base } -func (p *CreateImageRequest) ReadField9(iprot thrift.TProtocol) error { - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.StartTime = _field - return nil +func (p *CourseListResponse) GetData() (v []*model.Course) { + return p.Data } -func (p *CreateImageRequest) ReadField10(iprot thrift.TProtocol) error { - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v +var fieldIDToName_CourseListResponse = map[int16]string{ + 1: "base", + 2: "data", +} + +func (p *CourseListResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *CourseListResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetBase bool = false + var issetData 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.LIST { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + issetData = 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 !issetData { + fieldId = 2 + goto RequiredFieldNotSetError } - p.EndTime = _field 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_CourseListResponse[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_CourseListResponse[fieldId])) } -func (p *CreateImageRequest) ReadField11(iprot thrift.TProtocol) error { - var _field string - if v, err := iprot.ReadString(); err != nil { +func (p *CourseListResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { return err - } else { - _field = v } - p.Text = _field + p.Base = _field return nil } -func (p *CreateImageRequest) ReadField12(iprot thrift.TProtocol) error { +func (p *CourseListResponse) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*model.Course, 0, size) + values := make([]model.Course, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() - var _field string - if v, err := iprot.ReadString(); err != nil { + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { return err - } else { - _field = v } - p.Regex = _field + p.Data = _field return nil } -func (p *CreateImageRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *CourseListResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("CreateImageRequest"); err != nil { + if err = oprot.WriteStructBegin("CourseListResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -3295,46 +3088,6 @@ func (p *CreateImageRequest) Write(oprot thrift.TProtocol) (err error) { fieldId = 2 goto WriteFieldError } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } - if err = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } - if err = p.writeField6(oprot); err != nil { - fieldId = 6 - goto WriteFieldError - } - if err = p.writeField7(oprot); err != nil { - fieldId = 7 - goto WriteFieldError - } - if err = p.writeField8(oprot); err != nil { - fieldId = 8 - goto WriteFieldError - } - if err = p.writeField9(oprot); err != nil { - fieldId = 9 - goto WriteFieldError - } - if err = p.writeField10(oprot); err != nil { - fieldId = 10 - goto WriteFieldError - } - if err = p.writeField11(oprot); err != nil { - fieldId = 11 - goto WriteFieldError - } - if err = p.writeField12(oprot); err != nil { - fieldId = 12 - goto WriteFieldError - } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -3353,11 +3106,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *CreateImageRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("pic_type", thrift.I64, 1); err != nil { +func (p *CourseListResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteI64(p.PicType); err != nil { + if err := p.Base.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -3370,47 +3123,19 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *CreateImageRequest) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetDuration() { - if err = oprot.WriteFieldBegin("duration", thrift.I64, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(*p.Duration); 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 *CreateImageRequest) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("href", thrift.STRING, 3); err != nil { +func (p *CourseListResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("data", thrift.LIST, 2); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(p.Href); err != nil { + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Data)); 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 *CreateImageRequest) writeField4(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("image", thrift.STRING, 4); err != nil { - goto WriteFieldBeginError + for _, v := range p.Data { + if err := v.Write(oprot); err != nil { + return err + } } - if err := oprot.WriteBinary([]byte(p.Image)); err != nil { + if err := oprot.WriteListEnd(); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -3418,204 +3143,129 @@ func (p *CreateImageRequest) writeField4(oprot thrift.TProtocol) (err error) { } return nil WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *CreateImageRequest) writeField5(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("start_at", thrift.I64, 5); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.StartAt); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError +func (p *CourseListResponse) String() string { + if p == nil { + return "" } - 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) -} + return fmt.Sprintf("CourseListResponse(%+v)", *p) -func (p *CreateImageRequest) writeField6(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("end_at", thrift.I64, 6); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.EndAt); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) } -func (p *CreateImageRequest) writeField7(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("s_type", thrift.I64, 7); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.SType); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +// launch_screen +type CreateImageRequest struct { + PicType int64 `thrift:"pic_type,1,required" form:"pic_type,required" json:"pic_type,required" query:"pic_type,required"` + Duration *int64 `thrift:"duration,2,optional" form:"duration" json:"duration,omitempty" query:"duration"` + Href string `thrift:"href,3" form:"href" json:"href" query:"href"` + Image []byte `thrift:"image,4" form:"image" json:"image" query:"image"` + StartAt int64 `thrift:"start_at,5,required" form:"start_at,required" json:"start_at,required" query:"start_at,required"` + EndAt int64 `thrift:"end_at,6,required" form:"end_at,required" json:"end_at,required" query:"end_at,required"` + SType int64 `thrift:"s_type,7,required" form:"s_type,required" json:"s_type,required" query:"s_type,required"` + Frequency int64 `thrift:"frequency,8,required" form:"frequency,required" json:"frequency,required" query:"frequency,required"` + StartTime int64 `thrift:"start_time,9,required" form:"start_time,required" json:"start_time,required" query:"start_time,required"` + EndTime int64 `thrift:"end_time,10,required" form:"end_time,required" json:"end_time,required" query:"end_time,required"` + Text string `thrift:"text,11,required" form:"text,required" json:"text,required" query:"text,required"` + Regex string `thrift:"regex,12,required" form:"regex,required" json:"regex,required" query:"regex,required"` } -func (p *CreateImageRequest) writeField8(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("frequency", thrift.I64, 8); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.Frequency); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) +func NewCreateImageRequest() *CreateImageRequest { + return &CreateImageRequest{} } -func (p *CreateImageRequest) writeField9(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("start_time", thrift.I64, 9); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.StartTime); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) +func (p *CreateImageRequest) InitDefault() { } -func (p *CreateImageRequest) writeField10(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("end_time", thrift.I64, 10); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.EndTime); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) +func (p *CreateImageRequest) GetPicType() (v int64) { + return p.PicType } -func (p *CreateImageRequest) writeField11(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("text", thrift.STRING, 11); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Text); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) -} +var CreateImageRequest_Duration_DEFAULT int64 -func (p *CreateImageRequest) writeField12(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("regex", thrift.STRING, 12); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Regex); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError +func (p *CreateImageRequest) GetDuration() (v int64) { + if !p.IsSetDuration() { + return CreateImageRequest_Duration_DEFAULT } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) + return *p.Duration } -func (p *CreateImageRequest) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("CreateImageRequest(%+v)", *p) +func (p *CreateImageRequest) GetHref() (v string) { + return p.Href +} +func (p *CreateImageRequest) GetImage() (v []byte) { + return p.Image } -type CreateImageResponse struct { - Base *model.BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` - Picture *model.Picture `thrift:"picture,2,optional" form:"picture" json:"picture,omitempty" query:"picture"` +func (p *CreateImageRequest) GetStartAt() (v int64) { + return p.StartAt } -func NewCreateImageResponse() *CreateImageResponse { - return &CreateImageResponse{} +func (p *CreateImageRequest) GetEndAt() (v int64) { + return p.EndAt } -func (p *CreateImageResponse) InitDefault() { +func (p *CreateImageRequest) GetSType() (v int64) { + return p.SType } -var CreateImageResponse_Base_DEFAULT *model.BaseResp +func (p *CreateImageRequest) GetFrequency() (v int64) { + return p.Frequency +} -func (p *CreateImageResponse) GetBase() (v *model.BaseResp) { - if !p.IsSetBase() { - return CreateImageResponse_Base_DEFAULT - } - return p.Base +func (p *CreateImageRequest) GetStartTime() (v int64) { + return p.StartTime } -var CreateImageResponse_Picture_DEFAULT *model.Picture +func (p *CreateImageRequest) GetEndTime() (v int64) { + return p.EndTime +} -func (p *CreateImageResponse) GetPicture() (v *model.Picture) { - if !p.IsSetPicture() { - return CreateImageResponse_Picture_DEFAULT - } - return p.Picture +func (p *CreateImageRequest) GetText() (v string) { + return p.Text } -var fieldIDToName_CreateImageResponse = map[int16]string{ - 1: "base", - 2: "picture", +func (p *CreateImageRequest) GetRegex() (v string) { + return p.Regex } -func (p *CreateImageResponse) IsSetBase() bool { - return p.Base != nil +var fieldIDToName_CreateImageRequest = map[int16]string{ + 1: "pic_type", + 2: "duration", + 3: "href", + 4: "image", + 5: "start_at", + 6: "end_at", + 7: "s_type", + 8: "frequency", + 9: "start_time", + 10: "end_time", + 11: "text", + 12: "regex", } -func (p *CreateImageResponse) IsSetPicture() bool { - return p.Picture != nil +func (p *CreateImageRequest) IsSetDuration() bool { + return p.Duration != nil } -func (p *CreateImageResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *CreateImageRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { + var issetPicType bool = false + var issetStartAt bool = false + var issetEndAt bool = false + var issetSType bool = false + var issetFrequency bool = false + var issetStartTime bool = false + var issetEndTime bool = false + var issetText bool = false + var issetRegex bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError } @@ -3630,21 +3280,110 @@ func (p *CreateImageResponse) Read(iprot thrift.TProtocol) (err error) { switch fieldId { case 1: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.I64 { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } + issetPicType = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } case 2: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.I64 { if err = p.ReadField2(iprot); err != nil { goto ReadFieldError } } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRING { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.I64 { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + issetStartAt = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.I64 { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + issetEndAt = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.I64 { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + issetSType = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 8: + if fieldTypeId == thrift.I64 { + if err = p.ReadField8(iprot); err != nil { + goto ReadFieldError + } + issetFrequency = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 9: + if fieldTypeId == thrift.I64 { + if err = p.ReadField9(iprot); err != nil { + goto ReadFieldError + } + issetStartTime = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 10: + if fieldTypeId == thrift.I64 { + if err = p.ReadField10(iprot); err != nil { + goto ReadFieldError + } + issetEndTime = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 11: + if fieldTypeId == thrift.STRING { + if err = p.ReadField11(iprot); err != nil { + goto ReadFieldError + } + issetText = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 12: + if fieldTypeId == thrift.STRING { + if err = p.ReadField12(iprot); err != nil { + goto ReadFieldError + } + issetRegex = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -3658,13 +3397,57 @@ func (p *CreateImageResponse) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } + if !issetPicType { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetStartAt { + fieldId = 5 + goto RequiredFieldNotSetError + } + + if !issetEndAt { + fieldId = 6 + goto RequiredFieldNotSetError + } + + if !issetSType { + fieldId = 7 + goto RequiredFieldNotSetError + } + + if !issetFrequency { + fieldId = 8 + goto RequiredFieldNotSetError + } + + if !issetStartTime { + fieldId = 9 + goto RequiredFieldNotSetError + } + + if !issetEndTime { + fieldId = 10 + goto RequiredFieldNotSetError + } + + if !issetText { + fieldId = 11 + goto RequiredFieldNotSetError + } + + if !issetRegex { + fieldId = 12 + 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_CreateImageResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CreateImageRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -3672,199 +3455,147 @@ 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_CreateImageRequest[fieldId])) } -func (p *CreateImageResponse) ReadField1(iprot thrift.TProtocol) error { - _field := model.NewBaseResp() - if err := _field.Read(iprot); err != nil { +func (p *CreateImageRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { return err + } else { + _field = v } - p.Base = _field + p.PicType = _field return nil } -func (p *CreateImageResponse) ReadField2(iprot thrift.TProtocol) error { - _field := model.NewPicture() - if err := _field.Read(iprot); err != nil { +func (p *CreateImageRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { return err + } else { + _field = &v } - p.Picture = _field + p.Duration = _field return nil } +func (p *CreateImageRequest) ReadField3(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 - } - 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 + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v } + p.Href = _field 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 *CreateImageRequest) ReadField4(iprot thrift.TProtocol) error { -func (p *CreateImageResponse) 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 { + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { return err + } else { + _field = []byte(v) } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } + p.Image = _field 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 *CreateImageRequest) ReadField5(iprot thrift.TProtocol) error { -func (p *CreateImageResponse) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetPicture() { - if err = oprot.WriteFieldBegin("picture", thrift.STRUCT, 2); err != nil { - goto WriteFieldBeginError - } - if err := p.Picture.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v } + p.StartAt = _field 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 *CreateImageRequest) ReadField6(iprot thrift.TProtocol) error { -func (p *CreateImageResponse) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("CreateImageResponse(%+v)", *p) - -} - -type GetImageRequest struct { - PictureID int64 `thrift:"picture_id,1,required" form:"picture_id,required" json:"picture_id,required" query:"picture_id,required"` -} - -func NewGetImageRequest() *GetImageRequest { - return &GetImageRequest{} -} - -func (p *GetImageRequest) InitDefault() { + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.EndAt = _field + return nil } +func (p *CreateImageRequest) ReadField7(iprot thrift.TProtocol) error { -func (p *GetImageRequest) GetPictureID() (v int64) { - return p.PictureID + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.SType = _field + return nil } +func (p *CreateImageRequest) ReadField8(iprot thrift.TProtocol) error { -var fieldIDToName_GetImageRequest = map[int16]string{ - 1: "picture_id", + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Frequency = _field + return nil } +func (p *CreateImageRequest) ReadField9(iprot thrift.TProtocol) error { -func (p *GetImageRequest) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetPictureID bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v } + p.StartTime = _field + return nil +} +func (p *CreateImageRequest) ReadField10(iprot thrift.TProtocol) error { - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetPictureID = 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 + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v } + p.EndTime = _field + return nil +} +func (p *CreateImageRequest) ReadField11(iprot thrift.TProtocol) error { - if !issetPictureID { - fieldId = 1 - goto RequiredFieldNotSetError + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v } + p.Text = _field 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_GetImageRequest[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_GetImageRequest[fieldId])) } +func (p *CreateImageRequest) ReadField12(iprot thrift.TProtocol) error { -func (p *GetImageRequest) ReadField1(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { + var _field string + if v, err := iprot.ReadString(); err != nil { return err } else { _field = v } - p.PictureID = _field + p.Regex = _field return nil } -func (p *GetImageRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *CreateImageRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetImageRequest"); err != nil { + if err = oprot.WriteStructBegin("CreateImageRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -3872,6 +3603,50 @@ func (p *GetImageRequest) 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 = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + goto WriteFieldError + } + if err = p.writeField8(oprot); err != nil { + fieldId = 8 + goto WriteFieldError + } + if err = p.writeField9(oprot); err != nil { + fieldId = 9 + goto WriteFieldError + } + if err = p.writeField10(oprot); err != nil { + fieldId = 10 + goto WriteFieldError + } + if err = p.writeField11(oprot); err != nil { + fieldId = 11 + goto WriteFieldError + } + if err = p.writeField12(oprot); err != nil { + fieldId = 12 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -3890,11 +3665,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetImageRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("picture_id", thrift.I64, 1); err != nil { +func (p *CreateImageRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("pic_type", thrift.I64, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteI64(p.PictureID); err != nil { + if err := oprot.WriteI64(p.PicType); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -3907,58 +3682,247 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetImageRequest) String() string { - if p == nil { - return "" +func (p *CreateImageRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetDuration() { + if err = oprot.WriteFieldBegin("duration", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.Duration); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } - return fmt.Sprintf("GetImageRequest(%+v)", *p) - -} - -type GetImageResponse struct { - Base *model.BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` - Picture *model.Picture `thrift:"picture,2,optional" form:"picture" json:"picture,omitempty" query:"picture"` -} - -func NewGetImageResponse() *GetImageResponse { - return &GetImageResponse{} + 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 *GetImageResponse) InitDefault() { +func (p *CreateImageRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("href", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Href); 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) } -var GetImageResponse_Base_DEFAULT *model.BaseResp - -func (p *GetImageResponse) GetBase() (v *model.BaseResp) { - if !p.IsSetBase() { - return GetImageResponse_Base_DEFAULT +func (p *CreateImageRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("image", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError } - return p.Base + if err := oprot.WriteBinary([]byte(p.Image)); 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) } -var GetImageResponse_Picture_DEFAULT *model.Picture - -func (p *GetImageResponse) GetPicture() (v *model.Picture) { - if !p.IsSetPicture() { - return GetImageResponse_Picture_DEFAULT +func (p *CreateImageRequest) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("start_at", thrift.I64, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.StartAt); 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 *CreateImageRequest) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("end_at", thrift.I64, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.EndAt); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField7(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("s_type", thrift.I64, 7); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.SType); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField8(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("frequency", thrift.I64, 8); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.Frequency); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField9(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("start_time", thrift.I64, 9); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.StartTime); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField10(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("end_time", thrift.I64, 10); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.EndTime); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField11(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("text", thrift.STRING, 11); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Text); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField12(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("regex", thrift.STRING, 12); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Regex); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) +} + +func (p *CreateImageRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateImageRequest(%+v)", *p) + +} + +type CreateImageResponse struct { + Base *model.BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` + Picture *model.Picture `thrift:"picture,2,optional" form:"picture" json:"picture,omitempty" query:"picture"` +} + +func NewCreateImageResponse() *CreateImageResponse { + return &CreateImageResponse{} +} + +func (p *CreateImageResponse) InitDefault() { +} + +var CreateImageResponse_Base_DEFAULT *model.BaseResp + +func (p *CreateImageResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return CreateImageResponse_Base_DEFAULT + } + return p.Base +} + +var CreateImageResponse_Picture_DEFAULT *model.Picture + +func (p *CreateImageResponse) GetPicture() (v *model.Picture) { + if !p.IsSetPicture() { + return CreateImageResponse_Picture_DEFAULT } return p.Picture } -var fieldIDToName_GetImageResponse = map[int16]string{ +var fieldIDToName_CreateImageResponse = map[int16]string{ 1: "base", 2: "picture", } -func (p *GetImageResponse) IsSetBase() bool { +func (p *CreateImageResponse) IsSetBase() bool { return p.Base != nil } -func (p *GetImageResponse) IsSetPicture() bool { +func (p *CreateImageResponse) IsSetPicture() bool { return p.Picture != nil } -func (p *GetImageResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *CreateImageResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -4012,7 +3976,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_GetImageResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CreateImageResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -4022,7 +3986,7 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetImageResponse) ReadField1(iprot thrift.TProtocol) error { +func (p *CreateImageResponse) ReadField1(iprot thrift.TProtocol) error { _field := model.NewBaseResp() if err := _field.Read(iprot); err != nil { return err @@ -4030,7 +3994,7 @@ func (p *GetImageResponse) ReadField1(iprot thrift.TProtocol) error { p.Base = _field return nil } -func (p *GetImageResponse) ReadField2(iprot thrift.TProtocol) error { +func (p *CreateImageResponse) ReadField2(iprot thrift.TProtocol) error { _field := model.NewPicture() if err := _field.Read(iprot); err != nil { return err @@ -4039,9 +4003,10 @@ func (p *GetImageResponse) ReadField2(iprot thrift.TProtocol) error { return nil } -func (p *GetImageResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *CreateImageResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetImageResponse"); err != nil { + if err = oprot.WriteStructBegin("CreateImageResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -4071,7 +4036,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetImageResponse) writeField1(oprot thrift.TProtocol) (err error) { +func (p *CreateImageResponse) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -4088,7 +4053,7 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetImageResponse) writeField2(oprot thrift.TProtocol) (err error) { +func (p *CreateImageResponse) writeField2(oprot thrift.TProtocol) (err error) { if p.IsSetPicture() { if err = oprot.WriteFieldBegin("picture", thrift.STRUCT, 2); err != nil { goto WriteFieldBeginError @@ -4107,139 +4072,42 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *GetImageResponse) String() string { +func (p *CreateImageResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetImageResponse(%+v)", *p) + return fmt.Sprintf("CreateImageResponse(%+v)", *p) } -type ChangeImagePropertyRequest struct { - // 1 为空,2 为页面跳转,3 为 APP 跳转 - PicType int64 `thrift:"pic_type,1,required" form:"pic_type,required" json:"pic_type,required" query:"pic_type,required"` - Duration *int64 `thrift:"duration,2,optional" form:"duration" json:"duration,omitempty" query:"duration"` - // 链接 - Href *string `thrift:"href,3,optional" form:"href" json:"href,omitempty" query:"href"` - StartAt int64 `thrift:"start_at,4,required" form:"start_at,required" json:"start_at,required" query:"start_at,required"` - EndAt int64 `thrift:"end_at,5,required" form:"end_at,required" json:"end_at,required" query:"end_at,required"` - SType int64 `thrift:"s_type,6,required" form:"s_type,required" json:"s_type,required" query:"s_type,required"` - Frequency int64 `thrift:"frequency,7,required" form:"frequency,required" json:"frequency,required" query:"frequency,required"` - // 例:6 表示 6点 - StartTime int64 `thrift:"start_time,8,required" form:"start_time,required" json:"start_time,required" query:"start_time,required"` - EndTime int64 `thrift:"end_time,9,required" form:"end_time,required" json:"end_time,required" query:"end_time,required"` - // 描述图片 - Text string `thrift:"text,10,required" form:"text,required" json:"text,required" query:"text,required"` - PictureID int64 `thrift:"picture_id,11,required" form:"picture_id,required" json:"picture_id,required" query:"picture_id,required"` - Regex string `thrift:"regex,12,required" form:"regex,required" json:"regex,required" query:"regex,required"` +type GetImageRequest struct { + PictureID int64 `thrift:"picture_id,1,required" form:"picture_id,required" json:"picture_id,required" query:"picture_id,required"` } -func NewChangeImagePropertyRequest() *ChangeImagePropertyRequest { - return &ChangeImagePropertyRequest{} +func NewGetImageRequest() *GetImageRequest { + return &GetImageRequest{} } -func (p *ChangeImagePropertyRequest) InitDefault() { +func (p *GetImageRequest) InitDefault() { } -func (p *ChangeImagePropertyRequest) GetPicType() (v int64) { - return p.PicType +func (p *GetImageRequest) GetPictureID() (v int64) { + return p.PictureID } -var ChangeImagePropertyRequest_Duration_DEFAULT int64 - -func (p *ChangeImagePropertyRequest) GetDuration() (v int64) { - if !p.IsSetDuration() { - return ChangeImagePropertyRequest_Duration_DEFAULT - } - return *p.Duration +var fieldIDToName_GetImageRequest = map[int16]string{ + 1: "picture_id", } -var ChangeImagePropertyRequest_Href_DEFAULT string +func (p *GetImageRequest) Read(iprot thrift.TProtocol) (err error) { -func (p *ChangeImagePropertyRequest) GetHref() (v string) { - if !p.IsSetHref() { - return ChangeImagePropertyRequest_Href_DEFAULT - } - return *p.Href -} + var fieldTypeId thrift.TType + var fieldId int16 + var issetPictureID bool = false -func (p *ChangeImagePropertyRequest) GetStartAt() (v int64) { - return p.StartAt -} - -func (p *ChangeImagePropertyRequest) GetEndAt() (v int64) { - return p.EndAt -} - -func (p *ChangeImagePropertyRequest) GetSType() (v int64) { - return p.SType -} - -func (p *ChangeImagePropertyRequest) GetFrequency() (v int64) { - return p.Frequency -} - -func (p *ChangeImagePropertyRequest) GetStartTime() (v int64) { - return p.StartTime -} - -func (p *ChangeImagePropertyRequest) GetEndTime() (v int64) { - return p.EndTime -} - -func (p *ChangeImagePropertyRequest) GetText() (v string) { - return p.Text -} - -func (p *ChangeImagePropertyRequest) GetPictureID() (v int64) { - return p.PictureID -} - -func (p *ChangeImagePropertyRequest) GetRegex() (v string) { - return p.Regex -} - -var fieldIDToName_ChangeImagePropertyRequest = map[int16]string{ - 1: "pic_type", - 2: "duration", - 3: "href", - 4: "start_at", - 5: "end_at", - 6: "s_type", - 7: "frequency", - 8: "start_time", - 9: "end_time", - 10: "text", - 11: "picture_id", - 12: "regex", -} - -func (p *ChangeImagePropertyRequest) IsSetDuration() bool { - return p.Duration != nil -} - -func (p *ChangeImagePropertyRequest) IsSetHref() bool { - return p.Href != nil -} - -func (p *ChangeImagePropertyRequest) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetPicType bool = false - var issetStartAt bool = false - var issetEndAt bool = false - var issetSType bool = false - var issetFrequency bool = false - var issetStartTime bool = false - var issetEndTime bool = false - var issetText bool = false - var issetPictureID bool = false - var issetRegex bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } for { _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() @@ -4256,107 +4124,10 @@ func (p *ChangeImagePropertyRequest) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetPicType = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.I64 { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRING { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 4: - if fieldTypeId == thrift.I64 { - if err = p.ReadField4(iprot); err != nil { - goto ReadFieldError - } - issetStartAt = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 5: - if fieldTypeId == thrift.I64 { - if err = p.ReadField5(iprot); err != nil { - goto ReadFieldError - } - issetEndAt = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 6: - if fieldTypeId == thrift.I64 { - if err = p.ReadField6(iprot); err != nil { - goto ReadFieldError - } - issetSType = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 7: - if fieldTypeId == thrift.I64 { - if err = p.ReadField7(iprot); err != nil { - goto ReadFieldError - } - issetFrequency = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 8: - if fieldTypeId == thrift.I64 { - if err = p.ReadField8(iprot); err != nil { - goto ReadFieldError - } - issetStartTime = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 9: - if fieldTypeId == thrift.I64 { - if err = p.ReadField9(iprot); err != nil { - goto ReadFieldError - } - issetEndTime = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 10: - if fieldTypeId == thrift.STRING { - if err = p.ReadField10(iprot); err != nil { - goto ReadFieldError - } - issetText = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 11: - if fieldTypeId == thrift.I64 { - if err = p.ReadField11(iprot); err != nil { - goto ReadFieldError - } issetPictureID = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } - case 12: - if fieldTypeId == thrift.STRING { - if err = p.ReadField12(iprot); err != nil { - goto ReadFieldError - } - issetRegex = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -4370,53 +4141,8 @@ func (p *ChangeImagePropertyRequest) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetPicType { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetStartAt { - fieldId = 4 - goto RequiredFieldNotSetError - } - - if !issetEndAt { - fieldId = 5 - goto RequiredFieldNotSetError - } - - if !issetSType { - fieldId = 6 - goto RequiredFieldNotSetError - } - - if !issetFrequency { - fieldId = 7 - goto RequiredFieldNotSetError - } - - if !issetStartTime { - fieldId = 8 - goto RequiredFieldNotSetError - } - - if !issetEndTime { - fieldId = 9 - goto RequiredFieldNotSetError - } - - if !issetText { - fieldId = 10 - goto RequiredFieldNotSetError - } - if !issetPictureID { - fieldId = 11 - goto RequiredFieldNotSetError - } - - if !issetRegex { - fieldId = 12 + fieldId = 1 goto RequiredFieldNotSetError } return nil @@ -4425,7 +4151,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_ChangeImagePropertyRequest[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetImageRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -4434,10 +4160,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_ChangeImagePropertyRequest[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetImageRequest[fieldId])) } -func (p *ChangeImagePropertyRequest) ReadField1(iprot thrift.TProtocol) error { +func (p *GetImageRequest) ReadField1(iprot thrift.TProtocol) error { var _field int64 if v, err := iprot.ReadI64(); err != nil { @@ -4445,134 +4171,192 @@ func (p *ChangeImagePropertyRequest) ReadField1(iprot thrift.TProtocol) error { } else { _field = v } - p.PicType = _field + p.PictureID = _field return nil } -func (p *ChangeImagePropertyRequest) ReadField2(iprot thrift.TProtocol) error { - var _field *int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = &v +func (p *GetImageRequest) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetImageRequest"); 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 } - p.Duration = _field 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 *ChangeImagePropertyRequest) ReadField3(iprot thrift.TProtocol) error { - var _field *string - if v, err := iprot.ReadString(); err != nil { +func (p *GetImageRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("picture_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.PictureID); err != nil { return err - } else { - _field = &v } - p.Href = _field + 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 *ChangeImagePropertyRequest) ReadField4(iprot thrift.TProtocol) error { - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v +func (p *GetImageRequest) String() string { + if p == nil { + return "" } - p.StartAt = _field - return nil + return fmt.Sprintf("GetImageRequest(%+v)", *p) + } -func (p *ChangeImagePropertyRequest) ReadField5(iprot thrift.TProtocol) error { - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.EndAt = _field - return nil +type GetImageResponse struct { + Base *model.BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` + Picture *model.Picture `thrift:"picture,2,optional" form:"picture" json:"picture,omitempty" query:"picture"` } -func (p *ChangeImagePropertyRequest) ReadField6(iprot thrift.TProtocol) error { - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.SType = _field - return nil +func NewGetImageResponse() *GetImageResponse { + return &GetImageResponse{} } -func (p *ChangeImagePropertyRequest) ReadField7(iprot thrift.TProtocol) error { - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.Frequency = _field - return nil +func (p *GetImageResponse) InitDefault() { } -func (p *ChangeImagePropertyRequest) ReadField8(iprot thrift.TProtocol) error { - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v +var GetImageResponse_Base_DEFAULT *model.BaseResp + +func (p *GetImageResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return GetImageResponse_Base_DEFAULT } - p.StartTime = _field - return nil + return p.Base } -func (p *ChangeImagePropertyRequest) ReadField9(iprot thrift.TProtocol) error { - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v +var GetImageResponse_Picture_DEFAULT *model.Picture + +func (p *GetImageResponse) GetPicture() (v *model.Picture) { + if !p.IsSetPicture() { + return GetImageResponse_Picture_DEFAULT } - p.EndTime = _field - return nil + return p.Picture } -func (p *ChangeImagePropertyRequest) ReadField10(iprot thrift.TProtocol) error { - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v +var fieldIDToName_GetImageResponse = map[int16]string{ + 1: "base", + 2: "picture", +} + +func (p *GetImageResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *GetImageResponse) IsSetPicture() bool { + return p.Picture != nil +} + +func (p *GetImageResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } - p.Text = _field + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetImageResponse[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 *ChangeImagePropertyRequest) ReadField11(iprot thrift.TProtocol) error { - var _field int64 - if v, err := iprot.ReadI64(); err != nil { +func (p *GetImageResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { return err - } else { - _field = v } - p.PictureID = _field + p.Base = _field return nil } -func (p *ChangeImagePropertyRequest) ReadField12(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { +func (p *GetImageResponse) ReadField2(iprot thrift.TProtocol) error { + _field := model.NewPicture() + if err := _field.Read(iprot); err != nil { return err - } else { - _field = v } - p.Regex = _field + p.Picture = _field return nil } -func (p *ChangeImagePropertyRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *GetImageResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("ChangeImagePropertyRequest"); err != nil { + if err = oprot.WriteStructBegin("GetImageResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -4584,46 +4368,6 @@ func (p *ChangeImagePropertyRequest) Write(oprot thrift.TProtocol) (err error) { fieldId = 2 goto WriteFieldError } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } - if err = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } - if err = p.writeField6(oprot); err != nil { - fieldId = 6 - goto WriteFieldError - } - if err = p.writeField7(oprot); err != nil { - fieldId = 7 - goto WriteFieldError - } - if err = p.writeField8(oprot); err != nil { - fieldId = 8 - goto WriteFieldError - } - if err = p.writeField9(oprot); err != nil { - fieldId = 9 - goto WriteFieldError - } - if err = p.writeField10(oprot); err != nil { - fieldId = 10 - goto WriteFieldError - } - if err = p.writeField11(oprot); err != nil { - fieldId = 11 - goto WriteFieldError - } - if err = p.writeField12(oprot); err != nil { - fieldId = 12 - goto WriteFieldError - } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -4642,11 +4386,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *ChangeImagePropertyRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("pic_type", thrift.I64, 1); err != nil { +func (p *GetImageResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteI64(p.PicType); err != nil { + if err := p.Base.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -4659,12 +4403,12 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *ChangeImagePropertyRequest) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetDuration() { - if err = oprot.WriteFieldBegin("duration", thrift.I64, 2); err != nil { +func (p *GetImageResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPicture() { + if err = oprot.WriteFieldBegin("picture", thrift.STRUCT, 2); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteI64(*p.Duration); err != nil { + if err := p.Picture.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -4678,236 +4422,138 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *ChangeImagePropertyRequest) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetHref() { - if err = oprot.WriteFieldBegin("href", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Href); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } +func (p *GetImageResponse) String() string { + if p == nil { + return "" } - 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 fmt.Sprintf("GetImageResponse(%+v)", *p) -func (p *ChangeImagePropertyRequest) writeField4(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("start_at", thrift.I64, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.StartAt); 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 *ChangeImagePropertyRequest) writeField5(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("end_at", thrift.I64, 5); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.EndAt); 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) +type ChangeImagePropertyRequest struct { + // 1 为空,2 为页面跳转,3 为 APP 跳转 + PicType int64 `thrift:"pic_type,1,required" form:"pic_type,required" json:"pic_type,required" query:"pic_type,required"` + Duration *int64 `thrift:"duration,2,optional" form:"duration" json:"duration,omitempty" query:"duration"` + // 链接 + Href *string `thrift:"href,3,optional" form:"href" json:"href,omitempty" query:"href"` + StartAt int64 `thrift:"start_at,4,required" form:"start_at,required" json:"start_at,required" query:"start_at,required"` + EndAt int64 `thrift:"end_at,5,required" form:"end_at,required" json:"end_at,required" query:"end_at,required"` + SType int64 `thrift:"s_type,6,required" form:"s_type,required" json:"s_type,required" query:"s_type,required"` + Frequency int64 `thrift:"frequency,7,required" form:"frequency,required" json:"frequency,required" query:"frequency,required"` + // 例:6 表示 6点 + StartTime int64 `thrift:"start_time,8,required" form:"start_time,required" json:"start_time,required" query:"start_time,required"` + EndTime int64 `thrift:"end_time,9,required" form:"end_time,required" json:"end_time,required" query:"end_time,required"` + // 描述图片 + Text string `thrift:"text,10,required" form:"text,required" json:"text,required" query:"text,required"` + PictureID int64 `thrift:"picture_id,11,required" form:"picture_id,required" json:"picture_id,required" query:"picture_id,required"` + Regex string `thrift:"regex,12,required" form:"regex,required" json:"regex,required" query:"regex,required"` } -func (p *ChangeImagePropertyRequest) writeField6(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("s_type", thrift.I64, 6); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.SType); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +func NewChangeImagePropertyRequest() *ChangeImagePropertyRequest { + return &ChangeImagePropertyRequest{} } -func (p *ChangeImagePropertyRequest) writeField7(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("frequency", thrift.I64, 7); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.Frequency); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +func (p *ChangeImagePropertyRequest) InitDefault() { } -func (p *ChangeImagePropertyRequest) writeField8(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("start_time", thrift.I64, 8); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.StartTime); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) +func (p *ChangeImagePropertyRequest) GetPicType() (v int64) { + return p.PicType } -func (p *ChangeImagePropertyRequest) writeField9(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("end_time", thrift.I64, 9); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.EndTime); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) -} +var ChangeImagePropertyRequest_Duration_DEFAULT int64 -func (p *ChangeImagePropertyRequest) writeField10(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("text", thrift.STRING, 10); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Text); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError +func (p *ChangeImagePropertyRequest) GetDuration() (v int64) { + if !p.IsSetDuration() { + return ChangeImagePropertyRequest_Duration_DEFAULT } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) + return *p.Duration } -func (p *ChangeImagePropertyRequest) writeField11(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("picture_id", thrift.I64, 11); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.PictureID); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) -} +var ChangeImagePropertyRequest_Href_DEFAULT string -func (p *ChangeImagePropertyRequest) writeField12(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("regex", thrift.STRING, 12); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Regex); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError +func (p *ChangeImagePropertyRequest) GetHref() (v string) { + if !p.IsSetHref() { + return ChangeImagePropertyRequest_Href_DEFAULT } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) + return *p.Href } -func (p *ChangeImagePropertyRequest) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ChangeImagePropertyRequest(%+v)", *p) +func (p *ChangeImagePropertyRequest) GetStartAt() (v int64) { + return p.StartAt +} +func (p *ChangeImagePropertyRequest) GetEndAt() (v int64) { + return p.EndAt } -type ChangeImagePropertyResponse struct { - Base *model.BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` - Picture *model.Picture `thrift:"picture,2,optional" form:"picture" json:"picture,omitempty" query:"picture"` +func (p *ChangeImagePropertyRequest) GetSType() (v int64) { + return p.SType } -func NewChangeImagePropertyResponse() *ChangeImagePropertyResponse { - return &ChangeImagePropertyResponse{} +func (p *ChangeImagePropertyRequest) GetFrequency() (v int64) { + return p.Frequency } -func (p *ChangeImagePropertyResponse) InitDefault() { +func (p *ChangeImagePropertyRequest) GetStartTime() (v int64) { + return p.StartTime } -var ChangeImagePropertyResponse_Base_DEFAULT *model.BaseResp +func (p *ChangeImagePropertyRequest) GetEndTime() (v int64) { + return p.EndTime +} -func (p *ChangeImagePropertyResponse) GetBase() (v *model.BaseResp) { - if !p.IsSetBase() { - return ChangeImagePropertyResponse_Base_DEFAULT - } - return p.Base +func (p *ChangeImagePropertyRequest) GetText() (v string) { + return p.Text } -var ChangeImagePropertyResponse_Picture_DEFAULT *model.Picture +func (p *ChangeImagePropertyRequest) GetPictureID() (v int64) { + return p.PictureID +} -func (p *ChangeImagePropertyResponse) GetPicture() (v *model.Picture) { - if !p.IsSetPicture() { - return ChangeImagePropertyResponse_Picture_DEFAULT - } - return p.Picture +func (p *ChangeImagePropertyRequest) GetRegex() (v string) { + return p.Regex } -var fieldIDToName_ChangeImagePropertyResponse = map[int16]string{ - 1: "base", - 2: "picture", +var fieldIDToName_ChangeImagePropertyRequest = map[int16]string{ + 1: "pic_type", + 2: "duration", + 3: "href", + 4: "start_at", + 5: "end_at", + 6: "s_type", + 7: "frequency", + 8: "start_time", + 9: "end_time", + 10: "text", + 11: "picture_id", + 12: "regex", } -func (p *ChangeImagePropertyResponse) IsSetBase() bool { - return p.Base != nil +func (p *ChangeImagePropertyRequest) IsSetDuration() bool { + return p.Duration != nil } -func (p *ChangeImagePropertyResponse) IsSetPicture() bool { - return p.Picture != nil +func (p *ChangeImagePropertyRequest) IsSetHref() bool { + return p.Href != nil } -func (p *ChangeImagePropertyResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *ChangeImagePropertyRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError + var issetPicType bool = false + var issetStartAt bool = false + var issetEndAt bool = false + var issetSType bool = false + var issetFrequency bool = false + var issetStartTime bool = false + var issetEndTime bool = false + var issetText bool = false + var issetPictureID bool = false + var issetRegex bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } for { @@ -4921,21 +4567,111 @@ func (p *ChangeImagePropertyResponse) Read(iprot thrift.TProtocol) (err error) { switch fieldId { case 1: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.I64 { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } + issetPicType = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } case 2: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.I64 { if err = p.ReadField2(iprot); err != nil { goto ReadFieldError } } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.I64 { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + issetStartAt = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.I64 { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + issetEndAt = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.I64 { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + issetSType = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.I64 { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + issetFrequency = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 8: + if fieldTypeId == thrift.I64 { + if err = p.ReadField8(iprot); err != nil { + goto ReadFieldError + } + issetStartTime = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 9: + if fieldTypeId == thrift.I64 { + if err = p.ReadField9(iprot); err != nil { + goto ReadFieldError + } + issetEndTime = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 10: + if fieldTypeId == thrift.STRING { + if err = p.ReadField10(iprot); err != nil { + goto ReadFieldError + } + issetText = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 11: + if fieldTypeId == thrift.I64 { + if err = p.ReadField11(iprot); err != nil { + goto ReadFieldError + } + issetPictureID = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 12: + if fieldTypeId == thrift.STRING { + if err = p.ReadField12(iprot); err != nil { + goto ReadFieldError + } + issetRegex = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -4949,13 +4685,62 @@ func (p *ChangeImagePropertyResponse) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } + if !issetPicType { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetStartAt { + fieldId = 4 + goto RequiredFieldNotSetError + } + + if !issetEndAt { + fieldId = 5 + goto RequiredFieldNotSetError + } + + if !issetSType { + fieldId = 6 + goto RequiredFieldNotSetError + } + + if !issetFrequency { + fieldId = 7 + goto RequiredFieldNotSetError + } + + if !issetStartTime { + fieldId = 8 + goto RequiredFieldNotSetError + } + + if !issetEndTime { + fieldId = 9 + goto RequiredFieldNotSetError + } + + if !issetText { + fieldId = 10 + goto RequiredFieldNotSetError + } + + if !issetPictureID { + fieldId = 11 + goto RequiredFieldNotSetError + } + + if !issetRegex { + fieldId = 12 + 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_ChangeImagePropertyResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ChangeImagePropertyRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -4963,199 +4748,121 @@ 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_ChangeImagePropertyRequest[fieldId])) } -func (p *ChangeImagePropertyResponse) ReadField1(iprot thrift.TProtocol) error { - _field := model.NewBaseResp() - if err := _field.Read(iprot); err != nil { +func (p *ChangeImagePropertyRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { return err + } else { + _field = v } - p.Base = _field + p.PicType = _field return nil } -func (p *ChangeImagePropertyResponse) ReadField2(iprot thrift.TProtocol) error { - _field := model.NewPicture() - if err := _field.Read(iprot); err != nil { +func (p *ChangeImagePropertyRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { return err + } else { + _field = &v } - p.Picture = _field + p.Duration = _field return nil } +func (p *ChangeImagePropertyRequest) ReadField3(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 - } - 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 + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v } + p.Href = _field 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 *ChangeImagePropertyRequest) ReadField4(iprot thrift.TProtocol) error { -func (p *ChangeImagePropertyResponse) 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 { + var _field int64 + if v, err := iprot.ReadI64(); err != nil { return err + } else { + _field = v } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } + p.StartAt = _field 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 *ChangeImagePropertyRequest) ReadField5(iprot thrift.TProtocol) error { -func (p *ChangeImagePropertyResponse) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetPicture() { - if err = oprot.WriteFieldBegin("picture", thrift.STRUCT, 2); err != nil { - goto WriteFieldBeginError - } - if err := p.Picture.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v } + p.EndAt = _field 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 *ChangeImagePropertyRequest) ReadField6(iprot thrift.TProtocol) error { -func (p *ChangeImagePropertyResponse) String() string { - if p == nil { - return "" + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v } - return fmt.Sprintf("ChangeImagePropertyResponse(%+v)", *p) - -} - -type ChangeImageRequest struct { - PictureID int64 `thrift:"picture_id,1,required" form:"picture_id,required" json:"picture_id,required" query:"picture_id,required"` - Image []byte `thrift:"image,2" form:"image" json:"image" query:"image"` -} - -func NewChangeImageRequest() *ChangeImageRequest { - return &ChangeImageRequest{} -} - -func (p *ChangeImageRequest) InitDefault() { -} - -func (p *ChangeImageRequest) GetPictureID() (v int64) { - return p.PictureID -} - -func (p *ChangeImageRequest) GetImage() (v []byte) { - return p.Image + p.SType = _field + return nil } +func (p *ChangeImagePropertyRequest) ReadField7(iprot thrift.TProtocol) error { -var fieldIDToName_ChangeImageRequest = map[int16]string{ - 1: "picture_id", - 2: "image", + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Frequency = _field + return nil } +func (p *ChangeImagePropertyRequest) ReadField8(iprot thrift.TProtocol) error { -func (p *ChangeImageRequest) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetPictureID bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v } + p.StartTime = _field + return nil +} +func (p *ChangeImagePropertyRequest) ReadField9(iprot thrift.TProtocol) error { - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetPictureID = 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 - } - 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 + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v } + p.EndTime = _field + return nil +} +func (p *ChangeImagePropertyRequest) ReadField10(iprot thrift.TProtocol) error { - if !issetPictureID { - fieldId = 1 - goto RequiredFieldNotSetError + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v } + p.Text = _field 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_ChangeImageRequest[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_ChangeImageRequest[fieldId])) } - -func (p *ChangeImageRequest) ReadField1(iprot thrift.TProtocol) error { +func (p *ChangeImagePropertyRequest) ReadField11(iprot thrift.TProtocol) error { var _field int64 if v, err := iprot.ReadI64(); err != nil { @@ -5166,21 +4873,22 @@ func (p *ChangeImageRequest) ReadField1(iprot thrift.TProtocol) error { p.PictureID = _field return nil } -func (p *ChangeImageRequest) ReadField2(iprot thrift.TProtocol) error { +func (p *ChangeImagePropertyRequest) ReadField12(iprot thrift.TProtocol) error { - var _field []byte - if v, err := iprot.ReadBinary(); err != nil { + var _field string + if v, err := iprot.ReadString(); err != nil { return err } else { - _field = []byte(v) + _field = v } - p.Image = _field + p.Regex = _field return nil } -func (p *ChangeImageRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *ChangeImagePropertyRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("ChangeImageRequest"); err != nil { + if err = oprot.WriteStructBegin("ChangeImagePropertyRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -5192,6 +4900,46 @@ func (p *ChangeImageRequest) Write(oprot thrift.TProtocol) (err error) { fieldId = 2 goto WriteFieldError } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + goto WriteFieldError + } + if err = p.writeField8(oprot); err != nil { + fieldId = 8 + goto WriteFieldError + } + if err = p.writeField9(oprot); err != nil { + fieldId = 9 + goto WriteFieldError + } + if err = p.writeField10(oprot); err != nil { + fieldId = 10 + goto WriteFieldError + } + if err = p.writeField11(oprot); err != nil { + fieldId = 11 + goto WriteFieldError + } + if err = p.writeField12(oprot); err != nil { + fieldId = 12 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -5210,11 +4958,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *ChangeImageRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("picture_id", thrift.I64, 1); err != nil { +func (p *ChangeImagePropertyRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("pic_type", thrift.I64, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteI64(p.PictureID); err != nil { + if err := oprot.WriteI64(p.PicType); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -5227,11 +4975,49 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *ChangeImageRequest) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("image", thrift.STRING, 2); err != nil { +func (p *ChangeImagePropertyRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetDuration() { + if err = oprot.WriteFieldBegin("duration", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.Duration); 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 *ChangeImagePropertyRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetHref() { + if err = oprot.WriteFieldBegin("href", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Href); 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 *ChangeImagePropertyRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("start_at", thrift.I64, 4); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteBinary([]byte(p.Image)); err != nil { + if err := oprot.WriteI64(p.StartAt); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -5239,63 +5025,199 @@ func (p *ChangeImageRequest) writeField2(oprot thrift.TProtocol) (err error) { } return nil WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) } -func (p *ChangeImageRequest) String() string { - if p == nil { - return "" +func (p *ChangeImagePropertyRequest) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("end_at", thrift.I64, 5); err != nil { + goto WriteFieldBeginError } - return fmt.Sprintf("ChangeImageRequest(%+v)", *p) - -} + if err := oprot.WriteI64(p.EndAt); 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) +} -type ChangeImageResponse struct { +func (p *ChangeImagePropertyRequest) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("s_type", thrift.I64, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.SType); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) writeField7(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("frequency", thrift.I64, 7); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.Frequency); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) writeField8(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("start_time", thrift.I64, 8); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.StartTime); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) writeField9(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("end_time", thrift.I64, 9); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.EndTime); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) writeField10(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("text", thrift.STRING, 10); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Text); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) writeField11(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("picture_id", thrift.I64, 11); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.PictureID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) writeField12(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("regex", thrift.STRING, 12); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Regex); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ChangeImagePropertyRequest(%+v)", *p) + +} + +type ChangeImagePropertyResponse struct { Base *model.BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` Picture *model.Picture `thrift:"picture,2,optional" form:"picture" json:"picture,omitempty" query:"picture"` } -func NewChangeImageResponse() *ChangeImageResponse { - return &ChangeImageResponse{} +func NewChangeImagePropertyResponse() *ChangeImagePropertyResponse { + return &ChangeImagePropertyResponse{} } -func (p *ChangeImageResponse) InitDefault() { +func (p *ChangeImagePropertyResponse) InitDefault() { } -var ChangeImageResponse_Base_DEFAULT *model.BaseResp +var ChangeImagePropertyResponse_Base_DEFAULT *model.BaseResp -func (p *ChangeImageResponse) GetBase() (v *model.BaseResp) { +func (p *ChangeImagePropertyResponse) GetBase() (v *model.BaseResp) { if !p.IsSetBase() { - return ChangeImageResponse_Base_DEFAULT + return ChangeImagePropertyResponse_Base_DEFAULT } return p.Base } -var ChangeImageResponse_Picture_DEFAULT *model.Picture +var ChangeImagePropertyResponse_Picture_DEFAULT *model.Picture -func (p *ChangeImageResponse) GetPicture() (v *model.Picture) { +func (p *ChangeImagePropertyResponse) GetPicture() (v *model.Picture) { if !p.IsSetPicture() { - return ChangeImageResponse_Picture_DEFAULT + return ChangeImagePropertyResponse_Picture_DEFAULT } return p.Picture } -var fieldIDToName_ChangeImageResponse = map[int16]string{ +var fieldIDToName_ChangeImagePropertyResponse = map[int16]string{ 1: "base", 2: "picture", } -func (p *ChangeImageResponse) IsSetBase() bool { +func (p *ChangeImagePropertyResponse) IsSetBase() bool { return p.Base != nil } -func (p *ChangeImageResponse) IsSetPicture() bool { +func (p *ChangeImagePropertyResponse) IsSetPicture() bool { return p.Picture != nil } -func (p *ChangeImageResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *ChangeImagePropertyResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -5349,7 +5271,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_ChangeImageResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ChangeImagePropertyResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -5359,7 +5281,7 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *ChangeImageResponse) ReadField1(iprot thrift.TProtocol) error { +func (p *ChangeImagePropertyResponse) ReadField1(iprot thrift.TProtocol) error { _field := model.NewBaseResp() if err := _field.Read(iprot); err != nil { return err @@ -5367,7 +5289,7 @@ func (p *ChangeImageResponse) ReadField1(iprot thrift.TProtocol) error { p.Base = _field return nil } -func (p *ChangeImageResponse) ReadField2(iprot thrift.TProtocol) error { +func (p *ChangeImagePropertyResponse) ReadField2(iprot thrift.TProtocol) error { _field := model.NewPicture() if err := _field.Read(iprot); err != nil { return err @@ -5376,9 +5298,10 @@ func (p *ChangeImageResponse) ReadField2(iprot thrift.TProtocol) error { return nil } -func (p *ChangeImageResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *ChangeImagePropertyResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("ChangeImageResponse"); err != nil { + if err = oprot.WriteStructBegin("ChangeImagePropertyResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -5408,7 +5331,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *ChangeImageResponse) writeField1(oprot thrift.TProtocol) (err error) { +func (p *ChangeImagePropertyResponse) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -5425,7 +5348,7 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *ChangeImageResponse) writeField2(oprot thrift.TProtocol) (err error) { +func (p *ChangeImagePropertyResponse) writeField2(oprot thrift.TProtocol) (err error) { if p.IsSetPicture() { if err = oprot.WriteFieldBegin("picture", thrift.STRUCT, 2); err != nil { goto WriteFieldBeginError @@ -5444,34 +5367,40 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *ChangeImageResponse) String() string { +func (p *ChangeImagePropertyResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("ChangeImageResponse(%+v)", *p) + return fmt.Sprintf("ChangeImagePropertyResponse(%+v)", *p) } -type DeleteImageRequest struct { - PictureID int64 `thrift:"picture_id,1,required" form:"picture_id,required" json:"picture_id,required" query:"picture_id,required"` +type ChangeImageRequest struct { + PictureID int64 `thrift:"picture_id,1,required" form:"picture_id,required" json:"picture_id,required" query:"picture_id,required"` + Image []byte `thrift:"image,2" form:"image" json:"image" query:"image"` } -func NewDeleteImageRequest() *DeleteImageRequest { - return &DeleteImageRequest{} +func NewChangeImageRequest() *ChangeImageRequest { + return &ChangeImageRequest{} } -func (p *DeleteImageRequest) InitDefault() { +func (p *ChangeImageRequest) InitDefault() { } -func (p *DeleteImageRequest) GetPictureID() (v int64) { +func (p *ChangeImageRequest) GetPictureID() (v int64) { return p.PictureID } -var fieldIDToName_DeleteImageRequest = map[int16]string{ +func (p *ChangeImageRequest) GetImage() (v []byte) { + return p.Image +} + +var fieldIDToName_ChangeImageRequest = map[int16]string{ 1: "picture_id", + 2: "image", } -func (p *DeleteImageRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *ChangeImageRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -5500,6 +5429,14 @@ func (p *DeleteImageRequest) Read(iprot thrift.TProtocol) (err error) { } 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 + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -5523,7 +5460,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_DeleteImageRequest[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ChangeImageRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -5532,10 +5469,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_DeleteImageRequest[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_ChangeImageRequest[fieldId])) } -func (p *DeleteImageRequest) ReadField1(iprot thrift.TProtocol) error { +func (p *ChangeImageRequest) ReadField1(iprot thrift.TProtocol) error { var _field int64 if v, err := iprot.ReadI64(); err != nil { @@ -5546,10 +5483,22 @@ func (p *DeleteImageRequest) ReadField1(iprot thrift.TProtocol) error { p.PictureID = _field return nil } +func (p *ChangeImageRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { + return err + } else { + _field = []byte(v) + } + p.Image = _field + return nil +} + +func (p *ChangeImageRequest) Write(oprot thrift.TProtocol) (err error) { -func (p *DeleteImageRequest) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("DeleteImageRequest"); err != nil { + if err = oprot.WriteStructBegin("ChangeImageRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -5557,6 +5506,10 @@ func (p *DeleteImageRequest) Write(oprot thrift.TProtocol) (err error) { fieldId = 1 goto WriteFieldError } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -5575,7 +5528,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *DeleteImageRequest) writeField1(oprot thrift.TProtocol) (err error) { +func (p *ChangeImageRequest) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("picture_id", thrift.I64, 1); err != nil { goto WriteFieldBeginError } @@ -5592,43 +5545,75 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *DeleteImageRequest) String() string { - if p == nil { - return "" +func (p *ChangeImageRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("image", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError } - return fmt.Sprintf("DeleteImageRequest(%+v)", *p) - -} - -type DeleteImageResponse struct { - Base *model.BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` + if err := oprot.WriteBinary([]byte(p.Image)); 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 NewDeleteImageResponse() *DeleteImageResponse { - return &DeleteImageResponse{} +func (p *ChangeImageRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ChangeImageRequest(%+v)", *p) + } -func (p *DeleteImageResponse) InitDefault() { +type ChangeImageResponse struct { + Base *model.BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` + Picture *model.Picture `thrift:"picture,2,optional" form:"picture" json:"picture,omitempty" query:"picture"` } -var DeleteImageResponse_Base_DEFAULT *model.BaseResp +func NewChangeImageResponse() *ChangeImageResponse { + return &ChangeImageResponse{} +} -func (p *DeleteImageResponse) GetBase() (v *model.BaseResp) { +func (p *ChangeImageResponse) InitDefault() { +} + +var ChangeImageResponse_Base_DEFAULT *model.BaseResp + +func (p *ChangeImageResponse) GetBase() (v *model.BaseResp) { if !p.IsSetBase() { - return DeleteImageResponse_Base_DEFAULT + return ChangeImageResponse_Base_DEFAULT } return p.Base } -var fieldIDToName_DeleteImageResponse = map[int16]string{ +var ChangeImageResponse_Picture_DEFAULT *model.Picture + +func (p *ChangeImageResponse) GetPicture() (v *model.Picture) { + if !p.IsSetPicture() { + return ChangeImageResponse_Picture_DEFAULT + } + return p.Picture +} + +var fieldIDToName_ChangeImageResponse = map[int16]string{ 1: "base", + 2: "picture", } -func (p *DeleteImageResponse) IsSetBase() bool { +func (p *ChangeImageResponse) IsSetBase() bool { return p.Base != nil } -func (p *DeleteImageResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *ChangeImageResponse) IsSetPicture() bool { + return p.Picture != nil +} + +func (p *ChangeImageResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -5655,6 +5640,14 @@ func (p *DeleteImageResponse) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -5674,7 +5667,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_DeleteImageResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ChangeImageResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -5684,7 +5677,7 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *DeleteImageResponse) ReadField1(iprot thrift.TProtocol) error { +func (p *ChangeImageResponse) ReadField1(iprot thrift.TProtocol) error { _field := model.NewBaseResp() if err := _field.Read(iprot); err != nil { return err @@ -5692,10 +5685,19 @@ func (p *DeleteImageResponse) ReadField1(iprot thrift.TProtocol) error { p.Base = _field return nil } +func (p *ChangeImageResponse) ReadField2(iprot thrift.TProtocol) error { + _field := model.NewPicture() + if err := _field.Read(iprot); err != nil { + return err + } + p.Picture = _field + return nil +} + +func (p *ChangeImageResponse) Write(oprot thrift.TProtocol) (err error) { -func (p *DeleteImageResponse) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("DeleteImageResponse"); err != nil { + if err = oprot.WriteStructBegin("ChangeImageResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -5703,6 +5705,10 @@ func (p *DeleteImageResponse) Write(oprot thrift.TProtocol) (err error) { fieldId = 1 goto WriteFieldError } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -5721,7 +5727,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *DeleteImageResponse) writeField1(oprot thrift.TProtocol) (err error) { +func (p *ChangeImageResponse) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -5738,67 +5744,57 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *DeleteImageResponse) String() string { - if p == nil { - return "" +func (p *ChangeImageResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPicture() { + if err = oprot.WriteFieldBegin("picture", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Picture.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } - return fmt.Sprintf("DeleteImageResponse(%+v)", *p) - -} - -type MobileGetImageRequest struct { - Type int64 `thrift:"type,1,required" form:"type,required" json:"type,required" query:"type,required"` - StudentID string `thrift:"student_id,2,required" form:"student_id,required" json:"student_id,required" query:"student_id,required"` - College *string `thrift:"college,3,optional" form:"college" json:"college,omitempty" query:"college"` - Device string `thrift:"device,4,required" form:"device,required" json:"device,required" query:"device,required"` -} - -func NewMobileGetImageRequest() *MobileGetImageRequest { - return &MobileGetImageRequest{} + 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 *MobileGetImageRequest) InitDefault() { -} +func (p *ChangeImageResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ChangeImageResponse(%+v)", *p) -func (p *MobileGetImageRequest) GetType() (v int64) { - return p.Type } -func (p *MobileGetImageRequest) GetStudentID() (v string) { - return p.StudentID +type DeleteImageRequest struct { + PictureID int64 `thrift:"picture_id,1,required" form:"picture_id,required" json:"picture_id,required" query:"picture_id,required"` } -var MobileGetImageRequest_College_DEFAULT string - -func (p *MobileGetImageRequest) GetCollege() (v string) { - if !p.IsSetCollege() { - return MobileGetImageRequest_College_DEFAULT - } - return *p.College +func NewDeleteImageRequest() *DeleteImageRequest { + return &DeleteImageRequest{} } -func (p *MobileGetImageRequest) GetDevice() (v string) { - return p.Device +func (p *DeleteImageRequest) InitDefault() { } -var fieldIDToName_MobileGetImageRequest = map[int16]string{ - 1: "type", - 2: "student_id", - 3: "college", - 4: "device", +func (p *DeleteImageRequest) GetPictureID() (v int64) { + return p.PictureID } -func (p *MobileGetImageRequest) IsSetCollege() bool { - return p.College != nil +var fieldIDToName_DeleteImageRequest = map[int16]string{ + 1: "picture_id", } -func (p *MobileGetImageRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *DeleteImageRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetType bool = false - var issetStudentID bool = false - var issetDevice bool = false + var issetPictureID bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -5819,33 +5815,7 @@ func (p *MobileGetImageRequest) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetType = 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 - } - issetStudentID = 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 - } - } 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 - } - issetDevice = true + issetPictureID = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -5862,27 +5832,17 @@ func (p *MobileGetImageRequest) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetType { + if !issetPictureID { fieldId = 1 goto RequiredFieldNotSetError } - - if !issetStudentID { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetDevice { - fieldId = 4 - 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_MobileGetImageRequest[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DeleteImageRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -5891,10 +5851,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_MobileGetImageRequest[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_DeleteImageRequest[fieldId])) } -func (p *MobileGetImageRequest) ReadField1(iprot thrift.TProtocol) error { +func (p *DeleteImageRequest) ReadField1(iprot thrift.TProtocol) error { var _field int64 if v, err := iprot.ReadI64(); err != nil { @@ -5902,46 +5862,14 @@ func (p *MobileGetImageRequest) ReadField1(iprot thrift.TProtocol) error { } else { _field = v } - p.Type = _field - return nil -} -func (p *MobileGetImageRequest) ReadField2(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.StudentID = _field - return nil -} -func (p *MobileGetImageRequest) ReadField3(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.College = _field + p.PictureID = _field return nil } -func (p *MobileGetImageRequest) ReadField4(iprot thrift.TProtocol) error { - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Device = _field - return nil -} +func (p *DeleteImageRequest) Write(oprot thrift.TProtocol) (err error) { -func (p *MobileGetImageRequest) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("MobileGetImageRequest"); err != nil { + if err = oprot.WriteStructBegin("DeleteImageRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -5949,18 +5877,6 @@ func (p *MobileGetImageRequest) 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 @@ -5979,11 +5895,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *MobileGetImageRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("type", thrift.I64, 1); err != nil { +func (p *DeleteImageRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("picture_id", thrift.I64, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteI64(p.Type); err != nil { + if err := oprot.WriteI64(p.PictureID); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -5996,126 +5912,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *MobileGetImageRequest) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("student_id", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.StudentID); 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 *MobileGetImageRequest) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetCollege() { - if err = oprot.WriteFieldBegin("college", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.College); 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 *MobileGetImageRequest) writeField4(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("device", thrift.STRING, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Device); 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 *MobileGetImageRequest) String() string { +func (p *DeleteImageRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("MobileGetImageRequest(%+v)", *p) + return fmt.Sprintf("DeleteImageRequest(%+v)", *p) } -type MobileGetImageResponse struct { - Base *model.BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` - Count *int64 `thrift:"count,2,optional" form:"count" json:"count,omitempty" query:"count"` - PictureList []*model.Picture `thrift:"picture_list,3,optional" form:"picture_list" json:"picture_list,omitempty" query:"picture_list"` +type DeleteImageResponse struct { + Base *model.BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` } -func NewMobileGetImageResponse() *MobileGetImageResponse { - return &MobileGetImageResponse{} +func NewDeleteImageResponse() *DeleteImageResponse { + return &DeleteImageResponse{} } -func (p *MobileGetImageResponse) InitDefault() { +func (p *DeleteImageResponse) InitDefault() { } -var MobileGetImageResponse_Base_DEFAULT *model.BaseResp +var DeleteImageResponse_Base_DEFAULT *model.BaseResp -func (p *MobileGetImageResponse) GetBase() (v *model.BaseResp) { +func (p *DeleteImageResponse) GetBase() (v *model.BaseResp) { if !p.IsSetBase() { - return MobileGetImageResponse_Base_DEFAULT + return DeleteImageResponse_Base_DEFAULT } return p.Base } -var MobileGetImageResponse_Count_DEFAULT int64 - -func (p *MobileGetImageResponse) GetCount() (v int64) { - if !p.IsSetCount() { - return MobileGetImageResponse_Count_DEFAULT - } - return *p.Count -} - -var MobileGetImageResponse_PictureList_DEFAULT []*model.Picture - -func (p *MobileGetImageResponse) GetPictureList() (v []*model.Picture) { - if !p.IsSetPictureList() { - return MobileGetImageResponse_PictureList_DEFAULT - } - return p.PictureList -} - -var fieldIDToName_MobileGetImageResponse = map[int16]string{ +var fieldIDToName_DeleteImageResponse = map[int16]string{ 1: "base", - 2: "count", - 3: "picture_list", } -func (p *MobileGetImageResponse) IsSetBase() bool { +func (p *DeleteImageResponse) IsSetBase() bool { return p.Base != nil } -func (p *MobileGetImageResponse) IsSetCount() bool { - return p.Count != nil -} - -func (p *MobileGetImageResponse) IsSetPictureList() bool { - return p.PictureList != nil -} - -func (p *MobileGetImageResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *DeleteImageResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -6142,22 +5975,6 @@ func (p *MobileGetImageResponse) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } - case 2: - if fieldTypeId == thrift.I64 { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.LIST { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -6177,7 +5994,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_MobileGetImageResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DeleteImageResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -6187,7 +6004,7 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *MobileGetImageResponse) ReadField1(iprot thrift.TProtocol) error { +func (p *DeleteImageResponse) ReadField1(iprot thrift.TProtocol) error { _field := model.NewBaseResp() if err := _field.Read(iprot); err != nil { return err @@ -6195,44 +6012,11 @@ func (p *MobileGetImageResponse) ReadField1(iprot thrift.TProtocol) error { p.Base = _field return nil } -func (p *MobileGetImageResponse) ReadField2(iprot thrift.TProtocol) error { - - var _field *int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = &v - } - p.Count = _field - return nil -} -func (p *MobileGetImageResponse) ReadField3(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _field := make([]*model.Picture, 0, size) - values := make([]model.Picture, 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.PictureList = _field - return nil -} +func (p *DeleteImageResponse) Write(oprot thrift.TProtocol) (err error) { -func (p *MobileGetImageResponse) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("MobileGetImageResponse"); err != nil { + if err = oprot.WriteStructBegin("DeleteImageResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -6240,14 +6024,6 @@ func (p *MobileGetImageResponse) 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 @@ -6266,7 +6042,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *MobileGetImageResponse) writeField1(oprot thrift.TProtocol) (err error) { +func (p *DeleteImageResponse) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -6283,84 +6059,67 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *MobileGetImageResponse) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetCount() { - if err = oprot.WriteFieldBegin("count", thrift.I64, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(*p.Count); 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 *MobileGetImageResponse) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetPictureList() { - if err = oprot.WriteFieldBegin("picture_list", thrift.LIST, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.PictureList)); err != nil { - return err - } - for _, v := range p.PictureList { - 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 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *MobileGetImageResponse) String() string { +func (p *DeleteImageResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("MobileGetImageResponse(%+v)", *p) + return fmt.Sprintf("DeleteImageResponse(%+v)", *p) } -type AddImagePointTimeRequest struct { - PictureID int64 `thrift:"picture_id,1,required" form:"picture_id,required" json:"picture_id,required" query:"picture_id,required"` +type MobileGetImageRequest struct { + Type int64 `thrift:"type,1,required" form:"type,required" json:"type,required" query:"type,required"` + StudentID string `thrift:"student_id,2,required" form:"student_id,required" json:"student_id,required" query:"student_id,required"` + College *string `thrift:"college,3,optional" form:"college" json:"college,omitempty" query:"college"` + Device string `thrift:"device,4,required" form:"device,required" json:"device,required" query:"device,required"` } -func NewAddImagePointTimeRequest() *AddImagePointTimeRequest { - return &AddImagePointTimeRequest{} +func NewMobileGetImageRequest() *MobileGetImageRequest { + return &MobileGetImageRequest{} } -func (p *AddImagePointTimeRequest) InitDefault() { +func (p *MobileGetImageRequest) InitDefault() { } -func (p *AddImagePointTimeRequest) GetPictureID() (v int64) { - return p.PictureID +func (p *MobileGetImageRequest) GetType() (v int64) { + return p.Type } -var fieldIDToName_AddImagePointTimeRequest = map[int16]string{ - 1: "picture_id", +func (p *MobileGetImageRequest) GetStudentID() (v string) { + return p.StudentID } -func (p *AddImagePointTimeRequest) Read(iprot thrift.TProtocol) (err error) { +var MobileGetImageRequest_College_DEFAULT string + +func (p *MobileGetImageRequest) GetCollege() (v string) { + if !p.IsSetCollege() { + return MobileGetImageRequest_College_DEFAULT + } + return *p.College +} + +func (p *MobileGetImageRequest) GetDevice() (v string) { + return p.Device +} + +var fieldIDToName_MobileGetImageRequest = map[int16]string{ + 1: "type", + 2: "student_id", + 3: "college", + 4: "device", +} + +func (p *MobileGetImageRequest) IsSetCollege() bool { + return p.College != nil +} + +func (p *MobileGetImageRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetPictureID bool = false + var issetType bool = false + var issetStudentID bool = false + var issetDevice bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -6381,7 +6140,33 @@ func (p *AddImagePointTimeRequest) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetPictureID = true + issetType = 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 + } + issetStudentID = 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 + } + } 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 + } + issetDevice = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -6398,17 +6183,27 @@ func (p *AddImagePointTimeRequest) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetPictureID { + if !issetType { fieldId = 1 goto RequiredFieldNotSetError } + + if !issetStudentID { + fieldId = 2 + goto RequiredFieldNotSetError + } + + if !issetDevice { + fieldId = 4 + 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_AddImagePointTimeRequest[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MobileGetImageRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -6417,10 +6212,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_AddImagePointTimeRequest[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_MobileGetImageRequest[fieldId])) } -func (p *AddImagePointTimeRequest) ReadField1(iprot thrift.TProtocol) error { +func (p *MobileGetImageRequest) ReadField1(iprot thrift.TProtocol) error { var _field int64 if v, err := iprot.ReadI64(); err != nil { @@ -6428,13 +6223,47 @@ func (p *AddImagePointTimeRequest) ReadField1(iprot thrift.TProtocol) error { } else { _field = v } - p.PictureID = _field + p.Type = _field return nil } +func (p *MobileGetImageRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.StudentID = _field + return nil +} +func (p *MobileGetImageRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.College = _field + return nil +} +func (p *MobileGetImageRequest) ReadField4(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Device = _field + return nil +} + +func (p *MobileGetImageRequest) Write(oprot thrift.TProtocol) (err error) { -func (p *AddImagePointTimeRequest) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("AddImagePointTimeRequest"); err != nil { + if err = oprot.WriteStructBegin("MobileGetImageRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -6442,6 +6271,18 @@ func (p *AddImagePointTimeRequest) 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 @@ -6460,11 +6301,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *AddImagePointTimeRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("picture_id", thrift.I64, 1); err != nil { +func (p *MobileGetImageRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("type", thrift.I64, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteI64(p.PictureID); err != nil { + if err := oprot.WriteI64(p.Type); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -6477,58 +6318,126 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *AddImagePointTimeRequest) String() string { +func (p *MobileGetImageRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("student_id", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.StudentID); 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 *MobileGetImageRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetCollege() { + if err = oprot.WriteFieldBegin("college", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.College); 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 *MobileGetImageRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("device", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Device); 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 *MobileGetImageRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("AddImagePointTimeRequest(%+v)", *p) + return fmt.Sprintf("MobileGetImageRequest(%+v)", *p) } -type AddImagePointTimeResponse struct { - Base *model.BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` - Picture *model.Picture `thrift:"picture,2,optional" form:"picture" json:"picture,omitempty" query:"picture"` +type MobileGetImageResponse struct { + Base *model.BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` + Count *int64 `thrift:"count,2,optional" form:"count" json:"count,omitempty" query:"count"` + PictureList []*model.Picture `thrift:"picture_list,3,optional" form:"picture_list" json:"picture_list,omitempty" query:"picture_list"` } -func NewAddImagePointTimeResponse() *AddImagePointTimeResponse { - return &AddImagePointTimeResponse{} +func NewMobileGetImageResponse() *MobileGetImageResponse { + return &MobileGetImageResponse{} } -func (p *AddImagePointTimeResponse) InitDefault() { +func (p *MobileGetImageResponse) InitDefault() { } -var AddImagePointTimeResponse_Base_DEFAULT *model.BaseResp +var MobileGetImageResponse_Base_DEFAULT *model.BaseResp -func (p *AddImagePointTimeResponse) GetBase() (v *model.BaseResp) { +func (p *MobileGetImageResponse) GetBase() (v *model.BaseResp) { if !p.IsSetBase() { - return AddImagePointTimeResponse_Base_DEFAULT + return MobileGetImageResponse_Base_DEFAULT } return p.Base } -var AddImagePointTimeResponse_Picture_DEFAULT *model.Picture +var MobileGetImageResponse_Count_DEFAULT int64 -func (p *AddImagePointTimeResponse) GetPicture() (v *model.Picture) { - if !p.IsSetPicture() { - return AddImagePointTimeResponse_Picture_DEFAULT +func (p *MobileGetImageResponse) GetCount() (v int64) { + if !p.IsSetCount() { + return MobileGetImageResponse_Count_DEFAULT } - return p.Picture + return *p.Count } -var fieldIDToName_AddImagePointTimeResponse = map[int16]string{ +var MobileGetImageResponse_PictureList_DEFAULT []*model.Picture + +func (p *MobileGetImageResponse) GetPictureList() (v []*model.Picture) { + if !p.IsSetPictureList() { + return MobileGetImageResponse_PictureList_DEFAULT + } + return p.PictureList +} + +var fieldIDToName_MobileGetImageResponse = map[int16]string{ 1: "base", - 2: "picture", + 2: "count", + 3: "picture_list", } -func (p *AddImagePointTimeResponse) IsSetBase() bool { +func (p *MobileGetImageResponse) IsSetBase() bool { return p.Base != nil } -func (p *AddImagePointTimeResponse) IsSetPicture() bool { - return p.Picture != nil +func (p *MobileGetImageResponse) IsSetCount() bool { + return p.Count != nil } -func (p *AddImagePointTimeResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *MobileGetImageResponse) IsSetPictureList() bool { + return p.PictureList != nil +} + +func (p *MobileGetImageResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -6556,13 +6465,21 @@ func (p *AddImagePointTimeResponse) Read(iprot thrift.TProtocol) (err error) { goto SkipFieldError } case 2: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.I64 { if err = p.ReadField2(iprot); err != nil { goto ReadFieldError } } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 3: + if fieldTypeId == thrift.LIST { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -6582,7 +6499,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_AddImagePointTimeResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MobileGetImageResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -6592,7 +6509,7 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *AddImagePointTimeResponse) ReadField1(iprot thrift.TProtocol) error { +func (p *MobileGetImageResponse) ReadField1(iprot thrift.TProtocol) error { _field := model.NewBaseResp() if err := _field.Read(iprot); err != nil { return err @@ -6600,18 +6517,45 @@ func (p *AddImagePointTimeResponse) ReadField1(iprot thrift.TProtocol) error { p.Base = _field return nil } -func (p *AddImagePointTimeResponse) ReadField2(iprot thrift.TProtocol) error { - _field := model.NewPicture() - if err := _field.Read(iprot); err != nil { +func (p *MobileGetImageResponse) ReadField2(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { return err + } else { + _field = &v } - p.Picture = _field + p.Count = _field return nil } +func (p *MobileGetImageResponse) ReadField3(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*model.Picture, 0, size) + values := make([]model.Picture, 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.PictureList = _field + return nil +} + +func (p *MobileGetImageResponse) Write(oprot thrift.TProtocol) (err error) { -func (p *AddImagePointTimeResponse) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("AddImagePointTimeResponse"); err != nil { + if err = oprot.WriteStructBegin("MobileGetImageResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -6623,6 +6567,10 @@ func (p *AddImagePointTimeResponse) 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 @@ -6641,7 +6589,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *AddImagePointTimeResponse) writeField1(oprot thrift.TProtocol) (err error) { +func (p *MobileGetImageResponse) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -6658,12 +6606,12 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *AddImagePointTimeResponse) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetPicture() { - if err = oprot.WriteFieldBegin("picture", thrift.STRUCT, 2); err != nil { +func (p *MobileGetImageResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetCount() { + if err = oprot.WriteFieldBegin("count", thrift.I64, 2); err != nil { goto WriteFieldBeginError } - if err := p.Picture.Write(oprot); err != nil { + if err := oprot.WriteI64(*p.Count); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -6677,39 +6625,65 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *AddImagePointTimeResponse) String() string { +func (p *MobileGetImageResponse) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetPictureList() { + if err = oprot.WriteFieldBegin("picture_list", thrift.LIST, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.PictureList)); err != nil { + return err + } + for _, v := range p.PictureList { + 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 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *MobileGetImageResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("AddImagePointTimeResponse(%+v)", *p) + return fmt.Sprintf("MobileGetImageResponse(%+v)", *p) } -// paper -type ListDirFilesRequest struct { - Path string `thrift:"path,1,required" form:"path,required" json:"path,required" query:"path,required"` +type AddImagePointTimeRequest struct { + PictureID int64 `thrift:"picture_id,1,required" form:"picture_id,required" json:"picture_id,required" query:"picture_id,required"` } -func NewListDirFilesRequest() *ListDirFilesRequest { - return &ListDirFilesRequest{} +func NewAddImagePointTimeRequest() *AddImagePointTimeRequest { + return &AddImagePointTimeRequest{} } -func (p *ListDirFilesRequest) InitDefault() { +func (p *AddImagePointTimeRequest) InitDefault() { } -func (p *ListDirFilesRequest) GetPath() (v string) { - return p.Path +func (p *AddImagePointTimeRequest) GetPictureID() (v int64) { + return p.PictureID } -var fieldIDToName_ListDirFilesRequest = map[int16]string{ - 1: "path", +var fieldIDToName_AddImagePointTimeRequest = map[int16]string{ + 1: "picture_id", } -func (p *ListDirFilesRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *AddImagePointTimeRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetPath bool = false + var issetPictureID bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -6726,11 +6700,11 @@ func (p *ListDirFilesRequest) Read(iprot thrift.TProtocol) (err error) { switch fieldId { case 1: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.I64 { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetPath = true + issetPictureID = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -6747,7 +6721,7 @@ func (p *ListDirFilesRequest) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetPath { + if !issetPictureID { fieldId = 1 goto RequiredFieldNotSetError } @@ -6757,7 +6731,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_ListDirFilesRequest[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AddImagePointTimeRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -6766,24 +6740,25 @@ 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_ListDirFilesRequest[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_AddImagePointTimeRequest[fieldId])) } -func (p *ListDirFilesRequest) ReadField1(iprot thrift.TProtocol) error { +func (p *AddImagePointTimeRequest) ReadField1(iprot thrift.TProtocol) error { - var _field string - if v, err := iprot.ReadString(); err != nil { + var _field int64 + if v, err := iprot.ReadI64(); err != nil { return err } else { _field = v } - p.Path = _field + p.PictureID = _field return nil } -func (p *ListDirFilesRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *AddImagePointTimeRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("ListDirFilesRequest"); err != nil { + if err = oprot.WriteStructBegin("AddImagePointTimeRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -6809,11 +6784,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *ListDirFilesRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("path", thrift.STRING, 1); err != nil { +func (p *AddImagePointTimeRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("picture_id", thrift.I64, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(p.Path); err != nil { + if err := oprot.WriteI64(p.PictureID); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -6826,47 +6801,61 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *ListDirFilesRequest) String() string { +func (p *AddImagePointTimeRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("ListDirFilesRequest(%+v)", *p) + return fmt.Sprintf("AddImagePointTimeRequest(%+v)", *p) } -type ListDirFilesResponse struct { - Dir *model.UpYunFileDir `thrift:"dir,1,required" form:"dir,required" json:"dir,required" query:"dir,required"` +type AddImagePointTimeResponse struct { + Base *model.BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` + Picture *model.Picture `thrift:"picture,2,optional" form:"picture" json:"picture,omitempty" query:"picture"` } -func NewListDirFilesResponse() *ListDirFilesResponse { - return &ListDirFilesResponse{} +func NewAddImagePointTimeResponse() *AddImagePointTimeResponse { + return &AddImagePointTimeResponse{} } -func (p *ListDirFilesResponse) InitDefault() { +func (p *AddImagePointTimeResponse) InitDefault() { } -var ListDirFilesResponse_Dir_DEFAULT *model.UpYunFileDir +var AddImagePointTimeResponse_Base_DEFAULT *model.BaseResp -func (p *ListDirFilesResponse) GetDir() (v *model.UpYunFileDir) { - if !p.IsSetDir() { - return ListDirFilesResponse_Dir_DEFAULT +func (p *AddImagePointTimeResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return AddImagePointTimeResponse_Base_DEFAULT } - return p.Dir + return p.Base } -var fieldIDToName_ListDirFilesResponse = map[int16]string{ - 1: "dir", +var AddImagePointTimeResponse_Picture_DEFAULT *model.Picture + +func (p *AddImagePointTimeResponse) GetPicture() (v *model.Picture) { + if !p.IsSetPicture() { + return AddImagePointTimeResponse_Picture_DEFAULT + } + return p.Picture } -func (p *ListDirFilesResponse) IsSetDir() bool { - return p.Dir != nil +var fieldIDToName_AddImagePointTimeResponse = map[int16]string{ + 1: "base", + 2: "picture", } -func (p *ListDirFilesResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *AddImagePointTimeResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *AddImagePointTimeResponse) IsSetPicture() bool { + return p.Picture != nil +} + +func (p *AddImagePointTimeResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetDir bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -6887,7 +6876,14 @@ func (p *ListDirFilesResponse) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetDir = 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 + } } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -6904,17 +6900,13 @@ func (p *ListDirFilesResponse) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetDir { - 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_ListDirFilesResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AddImagePointTimeResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -6922,22 +6914,29 @@ 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_ListDirFilesResponse[fieldId])) } -func (p *ListDirFilesResponse) ReadField1(iprot thrift.TProtocol) error { - _field := model.NewUpYunFileDir() +func (p *AddImagePointTimeResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() if err := _field.Read(iprot); err != nil { return err } - p.Dir = _field + p.Base = _field + return nil +} +func (p *AddImagePointTimeResponse) ReadField2(iprot thrift.TProtocol) error { + _field := model.NewPicture() + if err := _field.Read(iprot); err != nil { + return err + } + p.Picture = _field return nil } -func (p *ListDirFilesResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *AddImagePointTimeResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("ListDirFilesResponse"); err != nil { + if err = oprot.WriteStructBegin("AddImagePointTimeResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -6945,6 +6944,10 @@ func (p *ListDirFilesResponse) Write(oprot thrift.TProtocol) (err error) { fieldId = 1 goto WriteFieldError } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -6963,11 +6966,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *ListDirFilesResponse) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("dir", thrift.STRUCT, 1); err != nil { +func (p *AddImagePointTimeResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } - if err := p.Dir.Write(oprot); err != nil { + if err := p.Base.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -6980,38 +6983,58 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *ListDirFilesResponse) String() string { - if p == nil { - return "" +func (p *AddImagePointTimeResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPicture() { + if err = oprot.WriteFieldBegin("picture", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Picture.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } - return fmt.Sprintf("ListDirFilesResponse(%+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) } -type GetDownloadUrlRequest struct { - Filepath string `thrift:"filepath,1,required" form:"filepath,required" json:"filepath,required" query:"filepath,required"` +func (p *AddImagePointTimeResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AddImagePointTimeResponse(%+v)", *p) + } -func NewGetDownloadUrlRequest() *GetDownloadUrlRequest { - return &GetDownloadUrlRequest{} +// paper +type ListDirFilesRequest struct { + Path string `thrift:"path,1,required" form:"path,required" json:"path,required" query:"path,required"` } -func (p *GetDownloadUrlRequest) InitDefault() { +func NewListDirFilesRequest() *ListDirFilesRequest { + return &ListDirFilesRequest{} } -func (p *GetDownloadUrlRequest) GetFilepath() (v string) { - return p.Filepath +func (p *ListDirFilesRequest) InitDefault() { } -var fieldIDToName_GetDownloadUrlRequest = map[int16]string{ - 1: "filepath", +func (p *ListDirFilesRequest) GetPath() (v string) { + return p.Path } -func (p *GetDownloadUrlRequest) Read(iprot thrift.TProtocol) (err error) { +var fieldIDToName_ListDirFilesRequest = map[int16]string{ + 1: "path", +} + +func (p *ListDirFilesRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetFilepath bool = false + var issetPath bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -7032,7 +7055,7 @@ func (p *GetDownloadUrlRequest) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetFilepath = true + issetPath = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -7049,7 +7072,7 @@ func (p *GetDownloadUrlRequest) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetFilepath { + if !issetPath { fieldId = 1 goto RequiredFieldNotSetError } @@ -7059,7 +7082,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_GetDownloadUrlRequest[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ListDirFilesRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -7068,10 +7091,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_GetDownloadUrlRequest[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_ListDirFilesRequest[fieldId])) } -func (p *GetDownloadUrlRequest) ReadField1(iprot thrift.TProtocol) error { +func (p *ListDirFilesRequest) ReadField1(iprot thrift.TProtocol) error { var _field string if v, err := iprot.ReadString(); err != nil { @@ -7079,13 +7102,14 @@ func (p *GetDownloadUrlRequest) ReadField1(iprot thrift.TProtocol) error { } else { _field = v } - p.Filepath = _field + p.Path = _field return nil } -func (p *GetDownloadUrlRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *ListDirFilesRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetDownloadUrlRequest"); err != nil { + if err = oprot.WriteStructBegin("ListDirFilesRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -7111,11 +7135,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetDownloadUrlRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("filepath", thrift.STRING, 1); err != nil { +func (p *ListDirFilesRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("path", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(p.Filepath); err != nil { + if err := oprot.WriteString(p.Path); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -7128,38 +7152,47 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetDownloadUrlRequest) String() string { +func (p *ListDirFilesRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetDownloadUrlRequest(%+v)", *p) + return fmt.Sprintf("ListDirFilesRequest(%+v)", *p) } -type GetDownloadUrlResponse struct { - URL string `thrift:"url,1,required" form:"url,required" json:"url,required" query:"url,required"` +type ListDirFilesResponse struct { + Dir *model.UpYunFileDir `thrift:"dir,1,required" form:"dir,required" json:"dir,required" query:"dir,required"` } -func NewGetDownloadUrlResponse() *GetDownloadUrlResponse { - return &GetDownloadUrlResponse{} +func NewListDirFilesResponse() *ListDirFilesResponse { + return &ListDirFilesResponse{} } -func (p *GetDownloadUrlResponse) InitDefault() { +func (p *ListDirFilesResponse) InitDefault() { } -func (p *GetDownloadUrlResponse) GetURL() (v string) { - return p.URL +var ListDirFilesResponse_Dir_DEFAULT *model.UpYunFileDir + +func (p *ListDirFilesResponse) GetDir() (v *model.UpYunFileDir) { + if !p.IsSetDir() { + return ListDirFilesResponse_Dir_DEFAULT + } + return p.Dir } -var fieldIDToName_GetDownloadUrlResponse = map[int16]string{ - 1: "url", +var fieldIDToName_ListDirFilesResponse = map[int16]string{ + 1: "dir", } -func (p *GetDownloadUrlResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *ListDirFilesResponse) IsSetDir() bool { + return p.Dir != nil +} + +func (p *ListDirFilesResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetURL bool = false + var issetDir bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -7176,11 +7209,11 @@ func (p *GetDownloadUrlResponse) Read(iprot thrift.TProtocol) (err error) { switch fieldId { case 1: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.STRUCT { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetURL = true + issetDir = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -7197,7 +7230,7 @@ func (p *GetDownloadUrlResponse) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetURL { + if !issetDir { fieldId = 1 goto RequiredFieldNotSetError } @@ -7207,7 +7240,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_GetDownloadUrlResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ListDirFilesResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -7216,24 +7249,22 @@ 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_GetDownloadUrlResponse[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_ListDirFilesResponse[fieldId])) } -func (p *GetDownloadUrlResponse) ReadField1(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { +func (p *ListDirFilesResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewUpYunFileDir() + if err := _field.Read(iprot); err != nil { return err - } else { - _field = v } - p.URL = _field + p.Dir = _field return nil } -func (p *GetDownloadUrlResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *ListDirFilesResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetDownloadUrlResponse"); err != nil { + if err = oprot.WriteStructBegin("ListDirFilesResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -7259,11 +7290,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetDownloadUrlResponse) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("url", thrift.STRING, 1); err != nil { +func (p *ListDirFilesResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("dir", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(p.URL); err != nil { + if err := p.Dir.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -7276,39 +7307,38 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetDownloadUrlResponse) String() string { +func (p *ListDirFilesResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetDownloadUrlResponse(%+v)", *p) + return fmt.Sprintf("ListDirFilesResponse(%+v)", *p) } -// 兼容 -type ListDirFilesForAndroidRequest struct { - Path string `thrift:"path,1,required" form:"path,required" json:"path,required" query:"path,required"` +type GetDownloadUrlRequest struct { + Filepath string `thrift:"filepath,1,required" form:"filepath,required" json:"filepath,required" query:"filepath,required"` } -func NewListDirFilesForAndroidRequest() *ListDirFilesForAndroidRequest { - return &ListDirFilesForAndroidRequest{} +func NewGetDownloadUrlRequest() *GetDownloadUrlRequest { + return &GetDownloadUrlRequest{} } -func (p *ListDirFilesForAndroidRequest) InitDefault() { +func (p *GetDownloadUrlRequest) InitDefault() { } -func (p *ListDirFilesForAndroidRequest) GetPath() (v string) { - return p.Path +func (p *GetDownloadUrlRequest) GetFilepath() (v string) { + return p.Filepath } -var fieldIDToName_ListDirFilesForAndroidRequest = map[int16]string{ - 1: "path", +var fieldIDToName_GetDownloadUrlRequest = map[int16]string{ + 1: "filepath", } -func (p *ListDirFilesForAndroidRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetDownloadUrlRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetPath bool = false + var issetFilepath bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -7329,7 +7359,7 @@ func (p *ListDirFilesForAndroidRequest) Read(iprot thrift.TProtocol) (err error) if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetPath = true + issetFilepath = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -7346,7 +7376,7 @@ func (p *ListDirFilesForAndroidRequest) Read(iprot thrift.TProtocol) (err error) goto ReadStructEndError } - if !issetPath { + if !issetFilepath { fieldId = 1 goto RequiredFieldNotSetError } @@ -7356,7 +7386,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_ListDirFilesForAndroidRequest[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetDownloadUrlRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -7365,10 +7395,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_ListDirFilesForAndroidRequest[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetDownloadUrlRequest[fieldId])) } -func (p *ListDirFilesForAndroidRequest) ReadField1(iprot thrift.TProtocol) error { +func (p *GetDownloadUrlRequest) ReadField1(iprot thrift.TProtocol) error { var _field string if v, err := iprot.ReadString(); err != nil { @@ -7376,13 +7406,14 @@ func (p *ListDirFilesForAndroidRequest) ReadField1(iprot thrift.TProtocol) error } else { _field = v } - p.Path = _field + p.Filepath = _field return nil } -func (p *ListDirFilesForAndroidRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *GetDownloadUrlRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("ListDirFilesForAndroidRequest"); err != nil { + if err = oprot.WriteStructBegin("GetDownloadUrlRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -7408,11 +7439,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *ListDirFilesForAndroidRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("path", thrift.STRING, 1); err != nil { +func (p *GetDownloadUrlRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("filepath", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(p.Path); err != nil { + if err := oprot.WriteString(p.Filepath); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -7425,30 +7456,38 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *ListDirFilesForAndroidRequest) String() string { +func (p *GetDownloadUrlRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("ListDirFilesForAndroidRequest(%+v)", *p) + return fmt.Sprintf("GetDownloadUrlRequest(%+v)", *p) } -type ListDirFilesForAndroidResponse struct { +type GetDownloadUrlResponse struct { + URL string `thrift:"url,1,required" form:"url,required" json:"url,required" query:"url,required"` } -func NewListDirFilesForAndroidResponse() *ListDirFilesForAndroidResponse { - return &ListDirFilesForAndroidResponse{} +func NewGetDownloadUrlResponse() *GetDownloadUrlResponse { + return &GetDownloadUrlResponse{} } -func (p *ListDirFilesForAndroidResponse) InitDefault() { +func (p *GetDownloadUrlResponse) InitDefault() { } -var fieldIDToName_ListDirFilesForAndroidResponse = map[int16]string{} +func (p *GetDownloadUrlResponse) GetURL() (v string) { + return p.URL +} -func (p *ListDirFilesForAndroidResponse) Read(iprot thrift.TProtocol) (err error) { +var fieldIDToName_GetDownloadUrlResponse = map[int16]string{ + 1: "url", +} + +func (p *GetDownloadUrlResponse) 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 @@ -7462,8 +7501,21 @@ func (p *ListDirFilesForAndroidResponse) Read(iprot thrift.TProtocol) (err error if fieldTypeId == thrift.STOP { break } - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldTypeError + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetURL = 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 @@ -7473,25 +7525,51 @@ func (p *ListDirFilesForAndroidResponse) 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) -SkipFieldTypeError: - return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, fieldTypeId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetDownloadUrlResponse[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_GetDownloadUrlResponse[fieldId])) } -func (p *ListDirFilesForAndroidResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("ListDirFilesForAndroidResponse"); err != nil { +func (p *GetDownloadUrlResponse) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.URL = _field + return nil +} + +func (p *GetDownloadUrlResponse) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetDownloadUrlResponse"); 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 @@ -7502,44 +7580,64 @@ func (p *ListDirFilesForAndroidResponse) Write(oprot thrift.TProtocol) (err erro 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 *ListDirFilesForAndroidResponse) String() string { - if p == nil { - return "" +func (p *GetDownloadUrlResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("url", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError } - return fmt.Sprintf("ListDirFilesForAndroidResponse(%+v)", *p) - -} + if err := oprot.WriteString(p.URL); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *GetDownloadUrlResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetDownloadUrlResponse(%+v)", *p) -type GetDownloadUrlForAndroidRequest struct { - Filepath string `thrift:"filepath,1,required" form:"filepath,required" json:"filepath,required" query:"filepath,required"` } -func NewGetDownloadUrlForAndroidRequest() *GetDownloadUrlForAndroidRequest { - return &GetDownloadUrlForAndroidRequest{} +// 兼容 +type ListDirFilesForAndroidRequest struct { + Path string `thrift:"path,1,required" form:"path,required" json:"path,required" query:"path,required"` } -func (p *GetDownloadUrlForAndroidRequest) InitDefault() { +func NewListDirFilesForAndroidRequest() *ListDirFilesForAndroidRequest { + return &ListDirFilesForAndroidRequest{} } -func (p *GetDownloadUrlForAndroidRequest) GetFilepath() (v string) { - return p.Filepath +func (p *ListDirFilesForAndroidRequest) InitDefault() { } -var fieldIDToName_GetDownloadUrlForAndroidRequest = map[int16]string{ - 1: "filepath", +func (p *ListDirFilesForAndroidRequest) GetPath() (v string) { + return p.Path } -func (p *GetDownloadUrlForAndroidRequest) Read(iprot thrift.TProtocol) (err error) { +var fieldIDToName_ListDirFilesForAndroidRequest = map[int16]string{ + 1: "path", +} + +func (p *ListDirFilesForAndroidRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetFilepath bool = false + var issetPath bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -7560,7 +7658,7 @@ func (p *GetDownloadUrlForAndroidRequest) Read(iprot thrift.TProtocol) (err erro if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetFilepath = true + issetPath = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -7577,7 +7675,7 @@ func (p *GetDownloadUrlForAndroidRequest) Read(iprot thrift.TProtocol) (err erro goto ReadStructEndError } - if !issetFilepath { + if !issetPath { fieldId = 1 goto RequiredFieldNotSetError } @@ -7587,7 +7685,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_GetDownloadUrlForAndroidRequest[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ListDirFilesForAndroidRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -7596,10 +7694,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_GetDownloadUrlForAndroidRequest[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_ListDirFilesForAndroidRequest[fieldId])) } -func (p *GetDownloadUrlForAndroidRequest) ReadField1(iprot thrift.TProtocol) error { +func (p *ListDirFilesForAndroidRequest) ReadField1(iprot thrift.TProtocol) error { var _field string if v, err := iprot.ReadString(); err != nil { @@ -7607,13 +7705,14 @@ func (p *GetDownloadUrlForAndroidRequest) ReadField1(iprot thrift.TProtocol) err } else { _field = v } - p.Filepath = _field + p.Path = _field return nil } -func (p *GetDownloadUrlForAndroidRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *ListDirFilesForAndroidRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetDownloadUrlForAndroidRequest"); err != nil { + if err = oprot.WriteStructBegin("ListDirFilesForAndroidRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -7639,11 +7738,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetDownloadUrlForAndroidRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("filepath", thrift.STRING, 1); err != nil { +func (p *ListDirFilesForAndroidRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("path", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(p.Filepath); err != nil { + if err := oprot.WriteString(p.Path); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -7656,27 +7755,27 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetDownloadUrlForAndroidRequest) String() string { +func (p *ListDirFilesForAndroidRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetDownloadUrlForAndroidRequest(%+v)", *p) + return fmt.Sprintf("ListDirFilesForAndroidRequest(%+v)", *p) } -type GetDownloadUrlForAndroidResponse struct { +type ListDirFilesForAndroidResponse struct { } -func NewGetDownloadUrlForAndroidResponse() *GetDownloadUrlForAndroidResponse { - return &GetDownloadUrlForAndroidResponse{} +func NewListDirFilesForAndroidResponse() *ListDirFilesForAndroidResponse { + return &ListDirFilesForAndroidResponse{} } -func (p *GetDownloadUrlForAndroidResponse) InitDefault() { +func (p *ListDirFilesForAndroidResponse) InitDefault() { } -var fieldIDToName_GetDownloadUrlForAndroidResponse = map[int16]string{} +var fieldIDToName_ListDirFilesForAndroidResponse = map[int16]string{} -func (p *GetDownloadUrlForAndroidResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *ListDirFilesForAndroidResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -7718,92 +7817,9 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetDownloadUrlForAndroidResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetDownloadUrlForAndroidResponse"); err != nil { - goto WriteStructBeginError - } - if p != 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) -} - -func (p *GetDownloadUrlForAndroidResponse) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("GetDownloadUrlForAndroidResponse(%+v)", *p) - -} - -// academic -type GetScoresRequest struct { -} - -func NewGetScoresRequest() *GetScoresRequest { - return &GetScoresRequest{} -} - -func (p *GetScoresRequest) InitDefault() { -} - -var fieldIDToName_GetScoresRequest = map[int16]string{} - -func (p *GetScoresRequest) 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 - } - 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 - } - - 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 *ListDirFilesForAndroidResponse) Write(oprot thrift.TProtocol) (err error) { -func (p *GetScoresRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetScoresRequest"); err != nil { + if err = oprot.WriteStructBegin("ListDirFilesForAndroidResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -7823,38 +7839,38 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetScoresRequest) String() string { +func (p *ListDirFilesForAndroidResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetScoresRequest(%+v)", *p) + return fmt.Sprintf("ListDirFilesForAndroidResponse(%+v)", *p) } -type GetScoresResponse struct { - Scores []*model.Score `thrift:"scores,1,required" form:"scores,required" json:"scores,required" query:"scores,required"` +type GetDownloadUrlForAndroidRequest struct { + Filepath string `thrift:"filepath,1,required" form:"filepath,required" json:"filepath,required" query:"filepath,required"` } -func NewGetScoresResponse() *GetScoresResponse { - return &GetScoresResponse{} +func NewGetDownloadUrlForAndroidRequest() *GetDownloadUrlForAndroidRequest { + return &GetDownloadUrlForAndroidRequest{} } -func (p *GetScoresResponse) InitDefault() { +func (p *GetDownloadUrlForAndroidRequest) InitDefault() { } -func (p *GetScoresResponse) GetScores() (v []*model.Score) { - return p.Scores +func (p *GetDownloadUrlForAndroidRequest) GetFilepath() (v string) { + return p.Filepath } -var fieldIDToName_GetScoresResponse = map[int16]string{ - 1: "scores", +var fieldIDToName_GetDownloadUrlForAndroidRequest = map[int16]string{ + 1: "filepath", } -func (p *GetScoresResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetDownloadUrlForAndroidRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetScores bool = false + var issetFilepath bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -7871,11 +7887,11 @@ func (p *GetScoresResponse) Read(iprot thrift.TProtocol) (err error) { switch fieldId { case 1: - if fieldTypeId == thrift.LIST { + if fieldTypeId == thrift.STRING { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetScores = true + issetFilepath = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -7892,7 +7908,7 @@ func (p *GetScoresResponse) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetScores { + if !issetFilepath { fieldId = 1 goto RequiredFieldNotSetError } @@ -7902,7 +7918,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_GetScoresResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetDownloadUrlForAndroidRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -7911,36 +7927,25 @@ 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_GetScoresResponse[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetDownloadUrlForAndroidRequest[fieldId])) } -func (p *GetScoresResponse) ReadField1(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _field := make([]*model.Score, 0, size) - values := make([]model.Score, size) - for i := 0; i < size; i++ { - _elem := &values[i] - _elem.InitDefault() - - if err := _elem.Read(iprot); err != nil { - return err - } +func (p *GetDownloadUrlForAndroidRequest) ReadField1(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.Scores = _field + p.Filepath = _field return nil } -func (p *GetScoresResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *GetDownloadUrlForAndroidRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetScoresResponse"); err != nil { + if err = oprot.WriteStructBegin("GetDownloadUrlForAndroidRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -7966,19 +7971,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetScoresResponse) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("scores", thrift.LIST, 1); err != nil { +func (p *GetDownloadUrlForAndroidRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("filepath", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Scores)); err != nil { - return err - } - for _, v := range p.Scores { - if err := v.Write(oprot); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { + if err := oprot.WriteString(p.Filepath); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -7991,27 +7988,27 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetScoresResponse) String() string { +func (p *GetDownloadUrlForAndroidRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetScoresResponse(%+v)", *p) + return fmt.Sprintf("GetDownloadUrlForAndroidRequest(%+v)", *p) } -type GetGPARequest struct { +type GetDownloadUrlForAndroidResponse struct { } -func NewGetGPARequest() *GetGPARequest { - return &GetGPARequest{} +func NewGetDownloadUrlForAndroidResponse() *GetDownloadUrlForAndroidResponse { + return &GetDownloadUrlForAndroidResponse{} } -func (p *GetGPARequest) InitDefault() { +func (p *GetDownloadUrlForAndroidResponse) InitDefault() { } -var fieldIDToName_GetGPARequest = map[int16]string{} +var fieldIDToName_GetDownloadUrlForAndroidResponse = map[int16]string{} -func (p *GetGPARequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetDownloadUrlForAndroidResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -8053,8 +8050,9 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetGPARequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetGPARequest"); err != nil { +func (p *GetDownloadUrlForAndroidResponse) Write(oprot thrift.TProtocol) (err error) { + + if err = oprot.WriteStructBegin("GetDownloadUrlForAndroidResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -8074,47 +8072,123 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetGPARequest) String() string { +func (p *GetDownloadUrlForAndroidResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetGPARequest(%+v)", *p) + return fmt.Sprintf("GetDownloadUrlForAndroidResponse(%+v)", *p) } -type GetGPAResponse struct { - Gpa *model.GPABean `thrift:"gpa,1,required" form:"gpa,required" json:"gpa,required" query:"gpa,required"` +// academic +type GetScoresRequest struct { } -func NewGetGPAResponse() *GetGPAResponse { - return &GetGPAResponse{} +func NewGetScoresRequest() *GetScoresRequest { + return &GetScoresRequest{} } -func (p *GetGPAResponse) InitDefault() { +func (p *GetScoresRequest) InitDefault() { } -var GetGPAResponse_Gpa_DEFAULT *model.GPABean +var fieldIDToName_GetScoresRequest = map[int16]string{} -func (p *GetGPAResponse) GetGpa() (v *model.GPABean) { - if !p.IsSetGpa() { - return GetGPAResponse_Gpa_DEFAULT +func (p *GetScoresRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } - return p.Gpa + + 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 + } + + 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) } -var fieldIDToName_GetGPAResponse = map[int16]string{ - 1: "gpa", +func (p *GetScoresRequest) Write(oprot thrift.TProtocol) (err error) { + + if err = oprot.WriteStructBegin("GetScoresRequest"); err != nil { + goto WriteStructBeginError + } + if p != 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) } -func (p *GetGPAResponse) IsSetGpa() bool { - return p.Gpa != nil +func (p *GetScoresRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetScoresRequest(%+v)", *p) + } -func (p *GetGPAResponse) Read(iprot thrift.TProtocol) (err error) { +type GetScoresResponse struct { + Scores []*model.Score `thrift:"scores,1,required" form:"scores,required" json:"scores,required" query:"scores,required"` +} + +func NewGetScoresResponse() *GetScoresResponse { + return &GetScoresResponse{} +} + +func (p *GetScoresResponse) InitDefault() { +} + +func (p *GetScoresResponse) GetScores() (v []*model.Score) { + return p.Scores +} + +var fieldIDToName_GetScoresResponse = map[int16]string{ + 1: "scores", +} + +func (p *GetScoresResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetGpa bool = false + var issetScores bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -8131,11 +8205,11 @@ func (p *GetGPAResponse) Read(iprot thrift.TProtocol) (err error) { switch fieldId { case 1: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.LIST { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetGpa = true + issetScores = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -8152,7 +8226,7 @@ func (p *GetGPAResponse) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetGpa { + if !issetScores { fieldId = 1 goto RequiredFieldNotSetError } @@ -8162,7 +8236,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_GetGPAResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetScoresResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -8171,21 +8245,37 @@ 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_GetGPAResponse[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetScoresResponse[fieldId])) } -func (p *GetGPAResponse) ReadField1(iprot thrift.TProtocol) error { - _field := model.NewGPABean() - if err := _field.Read(iprot); err != nil { +func (p *GetScoresResponse) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { return err } - p.Gpa = _field + _field := make([]*model.Score, 0, size) + values := make([]model.Score, 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.Scores = _field return nil } -func (p *GetGPAResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *GetScoresResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetGPAResponse"); err != nil { + if err = oprot.WriteStructBegin("GetScoresResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -8211,11 +8301,19 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetGPAResponse) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("gpa", thrift.STRUCT, 1); err != nil { +func (p *GetScoresResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("scores", thrift.LIST, 1); err != nil { goto WriteFieldBeginError } - if err := p.Gpa.Write(oprot); err != nil { + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Scores)); err != nil { + return err + } + for _, v := range p.Scores { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -8228,27 +8326,27 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetGPAResponse) String() string { +func (p *GetScoresResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetGPAResponse(%+v)", *p) + return fmt.Sprintf("GetScoresResponse(%+v)", *p) } -type GetCreditRequest struct { +type GetGPARequest struct { } -func NewGetCreditRequest() *GetCreditRequest { - return &GetCreditRequest{} +func NewGetGPARequest() *GetGPARequest { + return &GetGPARequest{} } -func (p *GetCreditRequest) InitDefault() { +func (p *GetGPARequest) InitDefault() { } -var fieldIDToName_GetCreditRequest = map[int16]string{} +var fieldIDToName_GetGPARequest = map[int16]string{} -func (p *GetCreditRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetGPARequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -8290,8 +8388,9 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetCreditRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetCreditRequest"); err != nil { +func (p *GetGPARequest) Write(oprot thrift.TProtocol) (err error) { + + if err = oprot.WriteStructBegin("GetGPARequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -8311,38 +8410,47 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetCreditRequest) String() string { +func (p *GetGPARequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetCreditRequest(%+v)", *p) + return fmt.Sprintf("GetGPARequest(%+v)", *p) } -type GetCreditResponse struct { - Major []*model.Credit `thrift:"major,1,required" form:"major,required" json:"major,required" query:"major,required"` +type GetGPAResponse struct { + Gpa *model.GPABean `thrift:"gpa,1,required" form:"gpa,required" json:"gpa,required" query:"gpa,required"` } -func NewGetCreditResponse() *GetCreditResponse { - return &GetCreditResponse{} +func NewGetGPAResponse() *GetGPAResponse { + return &GetGPAResponse{} } -func (p *GetCreditResponse) InitDefault() { +func (p *GetGPAResponse) InitDefault() { } -func (p *GetCreditResponse) GetMajor() (v []*model.Credit) { - return p.Major +var GetGPAResponse_Gpa_DEFAULT *model.GPABean + +func (p *GetGPAResponse) GetGpa() (v *model.GPABean) { + if !p.IsSetGpa() { + return GetGPAResponse_Gpa_DEFAULT + } + return p.Gpa } -var fieldIDToName_GetCreditResponse = map[int16]string{ - 1: "major", +var fieldIDToName_GetGPAResponse = map[int16]string{ + 1: "gpa", } -func (p *GetCreditResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetGPAResponse) IsSetGpa() bool { + return p.Gpa != nil +} + +func (p *GetGPAResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetMajor bool = false + var issetGpa bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -8359,11 +8467,11 @@ func (p *GetCreditResponse) Read(iprot thrift.TProtocol) (err error) { switch fieldId { case 1: - if fieldTypeId == thrift.LIST { + if fieldTypeId == thrift.STRUCT { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetMajor = true + issetGpa = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -8380,7 +8488,7 @@ func (p *GetCreditResponse) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetMajor { + if !issetGpa { fieldId = 1 goto RequiredFieldNotSetError } @@ -8390,7 +8498,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_GetCreditResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetGPAResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -8399,36 +8507,22 @@ 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_GetCreditResponse[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetGPAResponse[fieldId])) } -func (p *GetCreditResponse) ReadField1(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { +func (p *GetGPAResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewGPABean() + if err := _field.Read(iprot); err != nil { return err } - _field := make([]*model.Credit, 0, size) - values := make([]model.Credit, 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.Major = _field + p.Gpa = _field return nil } -func (p *GetCreditResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *GetGPAResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetCreditResponse"); err != nil { + if err = oprot.WriteStructBegin("GetGPAResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -8454,19 +8548,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetCreditResponse) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("major", thrift.LIST, 1); err != nil { +func (p *GetGPAResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("gpa", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Major)); err != nil { - return err - } - for _, v := range p.Major { - if err := v.Write(oprot); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { + if err := p.Gpa.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -8479,27 +8565,27 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetCreditResponse) String() string { +func (p *GetGPAResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetCreditResponse(%+v)", *p) + return fmt.Sprintf("GetGPAResponse(%+v)", *p) } -type GetUnifiedExamRequest struct { +type GetCreditRequest struct { } -func NewGetUnifiedExamRequest() *GetUnifiedExamRequest { - return &GetUnifiedExamRequest{} +func NewGetCreditRequest() *GetCreditRequest { + return &GetCreditRequest{} } -func (p *GetUnifiedExamRequest) InitDefault() { +func (p *GetCreditRequest) InitDefault() { } -var fieldIDToName_GetUnifiedExamRequest = map[int16]string{} +var fieldIDToName_GetCreditRequest = map[int16]string{} -func (p *GetUnifiedExamRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetCreditRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -8541,8 +8627,9 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetUnifiedExamRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetUnifiedExamRequest"); err != nil { +func (p *GetCreditRequest) Write(oprot thrift.TProtocol) (err error) { + + if err = oprot.WriteStructBegin("GetCreditRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -8562,38 +8649,38 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetUnifiedExamRequest) String() string { +func (p *GetCreditRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetUnifiedExamRequest(%+v)", *p) + return fmt.Sprintf("GetCreditRequest(%+v)", *p) } -type GetUnifiedExamResponse struct { - UnifiedExam []*model.UnifiedExam `thrift:"unifiedExam,1,required" form:"unifiedExam,required" json:"unifiedExam,required" query:"unifiedExam,required"` +type GetCreditResponse struct { + Major []*model.Credit `thrift:"major,1,required" form:"major,required" json:"major,required" query:"major,required"` } -func NewGetUnifiedExamResponse() *GetUnifiedExamResponse { - return &GetUnifiedExamResponse{} +func NewGetCreditResponse() *GetCreditResponse { + return &GetCreditResponse{} } -func (p *GetUnifiedExamResponse) InitDefault() { +func (p *GetCreditResponse) InitDefault() { } -func (p *GetUnifiedExamResponse) GetUnifiedExam() (v []*model.UnifiedExam) { - return p.UnifiedExam +func (p *GetCreditResponse) GetMajor() (v []*model.Credit) { + return p.Major } -var fieldIDToName_GetUnifiedExamResponse = map[int16]string{ - 1: "unifiedExam", +var fieldIDToName_GetCreditResponse = map[int16]string{ + 1: "major", } -func (p *GetUnifiedExamResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetCreditResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetUnifiedExam bool = false + var issetMajor bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -8614,7 +8701,7 @@ func (p *GetUnifiedExamResponse) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetUnifiedExam = true + issetMajor = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -8631,7 +8718,7 @@ func (p *GetUnifiedExamResponse) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetUnifiedExam { + if !issetMajor { fieldId = 1 goto RequiredFieldNotSetError } @@ -8641,7 +8728,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_GetUnifiedExamResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetCreditResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -8650,16 +8737,16 @@ 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_GetUnifiedExamResponse[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetCreditResponse[fieldId])) } -func (p *GetUnifiedExamResponse) ReadField1(iprot thrift.TProtocol) error { +func (p *GetCreditResponse) ReadField1(iprot thrift.TProtocol) error { _, size, err := iprot.ReadListBegin() if err != nil { return err } - _field := make([]*model.UnifiedExam, 0, size) - values := make([]model.UnifiedExam, size) + _field := make([]*model.Credit, 0, size) + values := make([]model.Credit, size) for i := 0; i < size; i++ { _elem := &values[i] _elem.InitDefault() @@ -8673,13 +8760,14 @@ func (p *GetUnifiedExamResponse) ReadField1(iprot thrift.TProtocol) error { if err := iprot.ReadListEnd(); err != nil { return err } - p.UnifiedExam = _field + p.Major = _field return nil } -func (p *GetUnifiedExamResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *GetCreditResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetUnifiedExamResponse"); err != nil { + if err = oprot.WriteStructBegin("GetCreditResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -8705,14 +8793,14 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetUnifiedExamResponse) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("unifiedExam", thrift.LIST, 1); err != nil { +func (p *GetCreditResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("major", thrift.LIST, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.UnifiedExam)); err != nil { + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Major)); err != nil { return err } - for _, v := range p.UnifiedExam { + for _, v := range p.Major { if err := v.Write(oprot); err != nil { return err } @@ -8730,39 +8818,30 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetUnifiedExamResponse) String() string { +func (p *GetCreditResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetUnifiedExamResponse(%+v)", *p) - -} + return fmt.Sprintf("GetCreditResponse(%+v)", *p) -// url_refactor->version -type LoginRequest struct { - Password string `thrift:"password,1,required" form:"password,required" json:"password,required" query:"password,required"` } -func NewLoginRequest() *LoginRequest { - return &LoginRequest{} +type GetUnifiedExamRequest struct { } -func (p *LoginRequest) InitDefault() { +func NewGetUnifiedExamRequest() *GetUnifiedExamRequest { + return &GetUnifiedExamRequest{} } -func (p *LoginRequest) GetPassword() (v string) { - return p.Password +func (p *GetUnifiedExamRequest) InitDefault() { } -var fieldIDToName_LoginRequest = map[int16]string{ - 1: "password", -} +var fieldIDToName_GetUnifiedExamRequest = map[int16]string{} -func (p *LoginRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetUnifiedExamRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetPassword bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -8776,21 +8855,8 @@ func (p *LoginRequest) Read(iprot thrift.TProtocol) (err error) { if fieldTypeId == thrift.STOP { break } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetPassword = true - } 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 @@ -8800,50 +8866,26 @@ func (p *LoginRequest) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetPassword { - 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_LoginRequest[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) 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_LoginRequest[fieldId])) } -func (p *LoginRequest) ReadField1(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Password = _field - return nil -} +func (p *GetUnifiedExamRequest) Write(oprot thrift.TProtocol) (err error) { -func (p *LoginRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("LoginRequest"); err != nil { + if err = oprot.WriteStructBegin("GetUnifiedExamRequest"); 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 @@ -8854,71 +8896,44 @@ func (p *LoginRequest) 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 *LoginRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("password", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Password); 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 *LoginRequest) String() string { +func (p *GetUnifiedExamRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("LoginRequest(%+v)", *p) - -} + return fmt.Sprintf("GetUnifiedExamRequest(%+v)", *p) -type LoginResponse struct { - Base *model.BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` } -func NewLoginResponse() *LoginResponse { - return &LoginResponse{} +type GetUnifiedExamResponse struct { + UnifiedExam []*model.UnifiedExam `thrift:"unifiedExam,1,required" form:"unifiedExam,required" json:"unifiedExam,required" query:"unifiedExam,required"` } -func (p *LoginResponse) InitDefault() { +func NewGetUnifiedExamResponse() *GetUnifiedExamResponse { + return &GetUnifiedExamResponse{} } -var LoginResponse_Base_DEFAULT *model.BaseResp - -func (p *LoginResponse) GetBase() (v *model.BaseResp) { - if !p.IsSetBase() { - return LoginResponse_Base_DEFAULT - } - return p.Base +func (p *GetUnifiedExamResponse) InitDefault() { } -var fieldIDToName_LoginResponse = map[int16]string{ - 1: "base", +func (p *GetUnifiedExamResponse) GetUnifiedExam() (v []*model.UnifiedExam) { + return p.UnifiedExam } -func (p *LoginResponse) IsSetBase() bool { - return p.Base != nil +var fieldIDToName_GetUnifiedExamResponse = map[int16]string{ + 1: "unifiedExam", } -func (p *LoginResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetUnifiedExamResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 + var issetUnifiedExam bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -8935,10 +8950,11 @@ func (p *LoginResponse) Read(iprot thrift.TProtocol) (err error) { switch fieldId { case 1: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.LIST { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } + issetUnifiedExam = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -8955,13 +8971,17 @@ func (p *LoginResponse) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } + if !issetUnifiedExam { + 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_LoginResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetUnifiedExamResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -8969,20 +8989,38 @@ 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_GetUnifiedExamResponse[fieldId])) } -func (p *LoginResponse) ReadField1(iprot thrift.TProtocol) error { - _field := model.NewBaseResp() - if err := _field.Read(iprot); err != nil { +func (p *GetUnifiedExamResponse) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { return err } - p.Base = _field - return nil -} - -func (p *LoginResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("LoginResponse"); err != nil { + _field := make([]*model.UnifiedExam, 0, size) + values := make([]model.UnifiedExam, 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.UnifiedExam = _field + return nil +} + +func (p *GetUnifiedExamResponse) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetUnifiedExamResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -9008,11 +9046,19 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *LoginResponse) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { +func (p *GetUnifiedExamResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("unifiedExam", thrift.LIST, 1); err != nil { goto WriteFieldBeginError } - if err := p.Base.Write(oprot); err != nil { + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.UnifiedExam)); err != nil { + return err + } + for _, v := range p.UnifiedExam { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -9025,73 +9071,45 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *LoginResponse) String() string { +func (p *GetUnifiedExamResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("LoginResponse(%+v)", *p) - -} - -type UploadRequest struct { - Version string `thrift:"version,1,required" form:"version,required" json:"version,required" query:"version,required"` - Code string `thrift:"code,2,required" form:"code,required" json:"code,required" query:"code,required"` - URL string `thrift:"url,3,required" form:"url,required" json:"url,required" query:"url,required"` - Feature string `thrift:"feature,4,required" form:"feature,required" json:"feature,required" query:"feature,required"` - Type string `thrift:"type,5,required" form:"type,required" json:"type,required" query:"type,required"` - Password string `thrift:"password,6,required" form:"password,required" json:"password,required" query:"password,required"` -} - -func NewUploadRequest() *UploadRequest { - return &UploadRequest{} -} - -func (p *UploadRequest) InitDefault() { -} + return fmt.Sprintf("GetUnifiedExamResponse(%+v)", *p) -func (p *UploadRequest) GetVersion() (v string) { - return p.Version } -func (p *UploadRequest) GetCode() (v string) { - return p.Code +type GetPlanRequest struct { + ID string `thrift:"id,1,required" form:"id,required" json:"id,required" query:"id,required"` + Cookies string `thrift:"cookies,2,required" form:"cookies,required" json:"cookies,required" query:"cookies,required"` } -func (p *UploadRequest) GetURL() (v string) { - return p.URL +func NewGetPlanRequest() *GetPlanRequest { + return &GetPlanRequest{} } -func (p *UploadRequest) GetFeature() (v string) { - return p.Feature +func (p *GetPlanRequest) InitDefault() { } -func (p *UploadRequest) GetType() (v string) { - return p.Type +func (p *GetPlanRequest) GetID() (v string) { + return p.ID } -func (p *UploadRequest) GetPassword() (v string) { - return p.Password +func (p *GetPlanRequest) GetCookies() (v string) { + return p.Cookies } -var fieldIDToName_UploadRequest = map[int16]string{ - 1: "version", - 2: "code", - 3: "url", - 4: "feature", - 5: "type", - 6: "password", +var fieldIDToName_GetPlanRequest = map[int16]string{ + 1: "id", + 2: "cookies", } -func (p *UploadRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetPlanRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetVersion bool = false - var issetCode bool = false - var issetURL bool = false - var issetFeature bool = false - var issetType bool = false - var issetPassword bool = false + var issetID bool = false + var issetCookies bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -9112,7 +9130,7 @@ func (p *UploadRequest) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetVersion = true + issetID = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -9121,43 +9139,7 @@ func (p *UploadRequest) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField2(iprot); err != nil { goto ReadFieldError } - issetCode = 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 - } - issetURL = 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 - } - issetFeature = 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 - } - issetType = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 6: - if fieldTypeId == thrift.STRING { - if err = p.ReadField6(iprot); err != nil { - goto ReadFieldError - } - issetPassword = true + issetCookies = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -9174,42 +9156,22 @@ func (p *UploadRequest) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetVersion { + if !issetID { fieldId = 1 goto RequiredFieldNotSetError } - if !issetCode { + if !issetCookies { fieldId = 2 goto RequiredFieldNotSetError } - - if !issetURL { - fieldId = 3 - goto RequiredFieldNotSetError - } - - if !issetFeature { - fieldId = 4 - goto RequiredFieldNotSetError - } - - if !issetType { - fieldId = 5 - goto RequiredFieldNotSetError - } - - if !issetPassword { - fieldId = 6 - 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_UploadRequest[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetPlanRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -9218,43 +9180,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_UploadRequest[fieldId])) -} - -func (p *UploadRequest) ReadField1(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Version = _field - return nil -} -func (p *UploadRequest) ReadField2(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Code = _field - return nil + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetPlanRequest[fieldId])) } -func (p *UploadRequest) ReadField3(iprot thrift.TProtocol) error { - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.URL = _field - return nil -} -func (p *UploadRequest) ReadField4(iprot thrift.TProtocol) error { +func (p *GetPlanRequest) ReadField1(iprot thrift.TProtocol) error { var _field string if v, err := iprot.ReadString(); err != nil { @@ -9262,10 +9191,10 @@ func (p *UploadRequest) ReadField4(iprot thrift.TProtocol) error { } else { _field = v } - p.Feature = _field + p.ID = _field return nil } -func (p *UploadRequest) ReadField5(iprot thrift.TProtocol) error { +func (p *GetPlanRequest) ReadField2(iprot thrift.TProtocol) error { var _field string if v, err := iprot.ReadString(); err != nil { @@ -9273,24 +9202,14 @@ func (p *UploadRequest) ReadField5(iprot thrift.TProtocol) error { } else { _field = v } - p.Type = _field + p.Cookies = _field return nil } -func (p *UploadRequest) ReadField6(iprot thrift.TProtocol) error { - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Password = _field - return nil -} +func (p *GetPlanRequest) Write(oprot thrift.TProtocol) (err error) { -func (p *UploadRequest) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("UploadRequest"); err != nil { + if err = oprot.WriteStructBegin("GetPlanRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -9302,22 +9221,6 @@ func (p *UploadRequest) Write(oprot thrift.TProtocol) (err error) { fieldId = 2 goto WriteFieldError } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } - if err = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } - if err = p.writeField6(oprot); err != nil { - fieldId = 6 - goto WriteFieldError - } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -9336,11 +9239,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UploadRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("version", thrift.STRING, 1); err != nil { +func (p *GetPlanRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("id", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(p.Version); err != nil { + if err := oprot.WriteString(p.ID); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -9353,11 +9256,11 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UploadRequest) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("code", thrift.STRING, 2); err != nil { +func (p *GetPlanRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("cookies", thrift.STRING, 2); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(p.Code); err != nil { + if err := oprot.WriteString(p.Cookies); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -9370,111 +9273,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *UploadRequest) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("url", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.URL); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError +func (p *GetPlanRequest) String() string { + if p == nil { + return "" } - 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 fmt.Sprintf("GetPlanRequest(%+v)", *p) + } -func (p *UploadRequest) writeField4(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("feature", thrift.STRING, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Feature); 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 *UploadRequest) writeField5(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("type", thrift.STRING, 5); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Type); 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 *UploadRequest) writeField6(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("password", thrift.STRING, 6); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Password); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) -} - -func (p *UploadRequest) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("UploadRequest(%+v)", *p) - -} - -type UploadResponse struct { +type GetPlanResponse struct { Base *model.BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` } -func NewUploadResponse() *UploadResponse { - return &UploadResponse{} +func NewGetPlanResponse() *GetPlanResponse { + return &GetPlanResponse{} } -func (p *UploadResponse) InitDefault() { +func (p *GetPlanResponse) InitDefault() { } -var UploadResponse_Base_DEFAULT *model.BaseResp +var GetPlanResponse_Base_DEFAULT *model.BaseResp -func (p *UploadResponse) GetBase() (v *model.BaseResp) { +func (p *GetPlanResponse) GetBase() (v *model.BaseResp) { if !p.IsSetBase() { - return UploadResponse_Base_DEFAULT + return GetPlanResponse_Base_DEFAULT } return p.Base } -var fieldIDToName_UploadResponse = map[int16]string{ +var fieldIDToName_GetPlanResponse = map[int16]string{ 1: "base", } -func (p *UploadResponse) IsSetBase() bool { +func (p *GetPlanResponse) IsSetBase() bool { return p.Base != nil } -func (p *UploadResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetPlanResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -9520,7 +9355,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_UploadResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetPlanResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -9530,7 +9365,7 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UploadResponse) ReadField1(iprot thrift.TProtocol) error { +func (p *GetPlanResponse) ReadField1(iprot thrift.TProtocol) error { _field := model.NewBaseResp() if err := _field.Read(iprot); err != nil { return err @@ -9539,9 +9374,10 @@ func (p *UploadResponse) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *UploadResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *GetPlanResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("UploadResponse"); err != nil { + if err = oprot.WriteStructBegin("GetPlanResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -9567,7 +9403,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UploadResponse) writeField1(oprot thrift.TProtocol) (err error) { +func (p *GetPlanResponse) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -9584,34 +9420,35 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UploadResponse) String() string { +func (p *GetPlanResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("UploadResponse(%+v)", *p) + return fmt.Sprintf("GetPlanResponse(%+v)", *p) } -type UploadParamsRequest struct { +// url_refactor->version +type LoginRequest struct { Password string `thrift:"password,1,required" form:"password,required" json:"password,required" query:"password,required"` } -func NewUploadParamsRequest() *UploadParamsRequest { - return &UploadParamsRequest{} +func NewLoginRequest() *LoginRequest { + return &LoginRequest{} } -func (p *UploadParamsRequest) InitDefault() { +func (p *LoginRequest) InitDefault() { } -func (p *UploadParamsRequest) GetPassword() (v string) { +func (p *LoginRequest) GetPassword() (v string) { return p.Password } -var fieldIDToName_UploadParamsRequest = map[int16]string{ +var fieldIDToName_LoginRequest = map[int16]string{ 1: "password", } -func (p *UploadParamsRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *LoginRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -9663,7 +9500,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_UploadParamsRequest[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LoginRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -9672,10 +9509,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_UploadParamsRequest[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_LoginRequest[fieldId])) } -func (p *UploadParamsRequest) ReadField1(iprot thrift.TProtocol) error { +func (p *LoginRequest) ReadField1(iprot thrift.TProtocol) error { var _field string if v, err := iprot.ReadString(); err != nil { @@ -9687,9 +9524,10 @@ func (p *UploadParamsRequest) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *UploadParamsRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *LoginRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("UploadParamsRequest"); err != nil { + if err = oprot.WriteStructBegin("LoginRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -9715,7 +9553,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UploadParamsRequest) writeField1(oprot thrift.TProtocol) (err error) { +func (p *LoginRequest) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("password", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } @@ -9732,73 +9570,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UploadParamsRequest) String() string { +func (p *LoginRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("UploadParamsRequest(%+v)", *p) + return fmt.Sprintf("LoginRequest(%+v)", *p) } -type UploadParamsResponse struct { - Base *model.BaseResp `thrift:"base,1,optional" form:"base" json:"base,omitempty" query:"base"` - Policy *string `thrift:"policy,2,optional" form:"policy" json:"policy,omitempty" query:"policy"` - Authorization *string `thrift:"authorization,3,optional" form:"authorization" json:"authorization,omitempty" query:"authorization"` +type LoginResponse struct { + Base *model.BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` } -func NewUploadParamsResponse() *UploadParamsResponse { - return &UploadParamsResponse{} +func NewLoginResponse() *LoginResponse { + return &LoginResponse{} } -func (p *UploadParamsResponse) InitDefault() { +func (p *LoginResponse) InitDefault() { } -var UploadParamsResponse_Base_DEFAULT *model.BaseResp +var LoginResponse_Base_DEFAULT *model.BaseResp -func (p *UploadParamsResponse) GetBase() (v *model.BaseResp) { +func (p *LoginResponse) GetBase() (v *model.BaseResp) { if !p.IsSetBase() { - return UploadParamsResponse_Base_DEFAULT + return LoginResponse_Base_DEFAULT } return p.Base } -var UploadParamsResponse_Policy_DEFAULT string - -func (p *UploadParamsResponse) GetPolicy() (v string) { - if !p.IsSetPolicy() { - return UploadParamsResponse_Policy_DEFAULT - } - return *p.Policy -} - -var UploadParamsResponse_Authorization_DEFAULT string - -func (p *UploadParamsResponse) GetAuthorization() (v string) { - if !p.IsSetAuthorization() { - return UploadParamsResponse_Authorization_DEFAULT - } - return *p.Authorization -} - -var fieldIDToName_UploadParamsResponse = map[int16]string{ +var fieldIDToName_LoginResponse = map[int16]string{ 1: "base", - 2: "policy", - 3: "authorization", } -func (p *UploadParamsResponse) IsSetBase() bool { +func (p *LoginResponse) IsSetBase() bool { return p.Base != nil } -func (p *UploadParamsResponse) IsSetPolicy() bool { - return p.Policy != nil -} - -func (p *UploadParamsResponse) IsSetAuthorization() bool { - return p.Authorization != nil -} - -func (p *UploadParamsResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *LoginResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -9825,22 +9633,6 @@ func (p *UploadParamsResponse) Read(iprot thrift.TProtocol) (err error) { } 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 - } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -9860,7 +9652,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_UploadParamsResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LoginResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -9870,7 +9662,7 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UploadParamsResponse) ReadField1(iprot thrift.TProtocol) error { +func (p *LoginResponse) ReadField1(iprot thrift.TProtocol) error { _field := model.NewBaseResp() if err := _field.Read(iprot); err != nil { return err @@ -9878,32 +9670,11 @@ func (p *UploadParamsResponse) ReadField1(iprot thrift.TProtocol) error { p.Base = _field return nil } -func (p *UploadParamsResponse) ReadField2(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Policy = _field - return nil -} -func (p *UploadParamsResponse) ReadField3(iprot thrift.TProtocol) error { - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Authorization = _field - return nil -} +func (p *LoginResponse) Write(oprot thrift.TProtocol) (err error) { -func (p *UploadParamsResponse) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("UploadParamsResponse"); err != nil { + if err = oprot.WriteStructBegin("LoginResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -9911,14 +9682,6 @@ func (p *UploadParamsResponse) 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 @@ -9937,17 +9700,15 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UploadParamsResponse) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetBase() { - 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 - } +func (p *LoginResponse) 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: @@ -9956,167 +9717,73 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UploadParamsResponse) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetPolicy() { - if err = oprot.WriteFieldBegin("policy", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Policy); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } +func (p *LoginResponse) String() string { + if p == nil { + return "" } - 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) + return fmt.Sprintf("LoginResponse(%+v)", *p) + } -func (p *UploadParamsResponse) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetAuthorization() { - if err = oprot.WriteFieldBegin("authorization", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Authorization); 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 *UploadParamsResponse) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("UploadParamsResponse(%+v)", *p) - -} - -type DownloadReleaseApkRequest struct { -} - -func NewDownloadReleaseApkRequest() *DownloadReleaseApkRequest { - return &DownloadReleaseApkRequest{} -} - -func (p *DownloadReleaseApkRequest) InitDefault() { +type UploadRequest struct { + Version string `thrift:"version,1,required" form:"version,required" json:"version,required" query:"version,required"` + Code string `thrift:"code,2,required" form:"code,required" json:"code,required" query:"code,required"` + URL string `thrift:"url,3,required" form:"url,required" json:"url,required" query:"url,required"` + Feature string `thrift:"feature,4,required" form:"feature,required" json:"feature,required" query:"feature,required"` + Type string `thrift:"type,5,required" form:"type,required" json:"type,required" query:"type,required"` + Password string `thrift:"password,6,required" form:"password,required" json:"password,required" query:"password,required"` } -var fieldIDToName_DownloadReleaseApkRequest = map[int16]string{} - -func (p *DownloadReleaseApkRequest) 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 - } - 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 - } - - 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 NewUploadRequest() *UploadRequest { + return &UploadRequest{} } -func (p *DownloadReleaseApkRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("DownloadReleaseApkRequest"); err != nil { - goto WriteStructBeginError - } - if p != 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) +func (p *UploadRequest) InitDefault() { } -func (p *DownloadReleaseApkRequest) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("DownloadReleaseApkRequest(%+v)", *p) - +func (p *UploadRequest) GetVersion() (v string) { + return p.Version } -type DownloadReleaseApkResponse struct { - File []byte `thrift:"file,1,optional" form:"file" json:"file,omitempty" query:"file"` +func (p *UploadRequest) GetCode() (v string) { + return p.Code } -func NewDownloadReleaseApkResponse() *DownloadReleaseApkResponse { - return &DownloadReleaseApkResponse{} +func (p *UploadRequest) GetURL() (v string) { + return p.URL } -func (p *DownloadReleaseApkResponse) InitDefault() { +func (p *UploadRequest) GetFeature() (v string) { + return p.Feature } -var DownloadReleaseApkResponse_File_DEFAULT []byte - -func (p *DownloadReleaseApkResponse) GetFile() (v []byte) { - if !p.IsSetFile() { - return DownloadReleaseApkResponse_File_DEFAULT - } - return p.File +func (p *UploadRequest) GetType() (v string) { + return p.Type } -var fieldIDToName_DownloadReleaseApkResponse = map[int16]string{ - 1: "file", +func (p *UploadRequest) GetPassword() (v string) { + return p.Password } -func (p *DownloadReleaseApkResponse) IsSetFile() bool { - return p.File != nil +var fieldIDToName_UploadRequest = map[int16]string{ + 1: "version", + 2: "code", + 3: "url", + 4: "feature", + 5: "type", + 6: "password", } -func (p *DownloadReleaseApkResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *UploadRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 + var issetVersion bool = false + var issetCode bool = false + var issetURL bool = false + var issetFeature bool = false + var issetType bool = false + var issetPassword bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -10137,6 +9804,52 @@ func (p *DownloadReleaseApkResponse) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } + issetVersion = 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 + } + issetCode = 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 + } + issetURL = 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 + } + issetFeature = 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 + } + issetType = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.STRING { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + issetPassword = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -10153,13 +9866,42 @@ func (p *DownloadReleaseApkResponse) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } + if !issetVersion { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetCode { + fieldId = 2 + goto RequiredFieldNotSetError + } + + if !issetURL { + fieldId = 3 + goto RequiredFieldNotSetError + } + + if !issetFeature { + fieldId = 4 + goto RequiredFieldNotSetError + } + + if !issetType { + fieldId = 5 + goto RequiredFieldNotSetError + } + + if !issetPassword { + fieldId = 6 + 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_DownloadReleaseApkResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UploadRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -10167,35 +9909,113 @@ 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_UploadRequest[fieldId])) } -func (p *DownloadReleaseApkResponse) ReadField1(iprot thrift.TProtocol) error { +func (p *UploadRequest) ReadField1(iprot thrift.TProtocol) error { - var _field []byte - if v, err := iprot.ReadBinary(); err != nil { + var _field string + if v, err := iprot.ReadString(); err != nil { return err } else { - _field = []byte(v) + _field = v } - p.File = _field + p.Version = _field return nil } +func (p *UploadRequest) ReadField2(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 - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v } - if err = oprot.WriteStructEnd(); err != nil { + p.Code = _field + return nil +} +func (p *UploadRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.URL = _field + return nil +} +func (p *UploadRequest) ReadField4(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Feature = _field + return nil +} +func (p *UploadRequest) ReadField5(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Type = _field + return nil +} +func (p *UploadRequest) ReadField6(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Password = _field + return nil +} + +func (p *UploadRequest) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("UploadRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { goto WriteStructEndError } return nil @@ -10209,17 +10029,15 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *DownloadReleaseApkResponse) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetFile() { - if err = oprot.WriteFieldBegin("file", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteBinary([]byte(p.File)); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } +func (p *UploadRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("version", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Version); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError } return nil WriteFieldBeginError: @@ -10228,27 +10046,128 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *DownloadReleaseApkResponse) String() string { +func (p *UploadRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("code", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Code); 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 *UploadRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("url", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.URL); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *UploadRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("feature", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Feature); 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 *UploadRequest) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("type", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Type); 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 *UploadRequest) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("password", thrift.STRING, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Password); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *UploadRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("DownloadReleaseApkResponse(%+v)", *p) + return fmt.Sprintf("UploadRequest(%+v)", *p) } -type DownloadBetaApkRequest struct { +type UploadResponse struct { + Base *model.BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` } -func NewDownloadBetaApkRequest() *DownloadBetaApkRequest { - return &DownloadBetaApkRequest{} +func NewUploadResponse() *UploadResponse { + return &UploadResponse{} } -func (p *DownloadBetaApkRequest) InitDefault() { +func (p *UploadResponse) InitDefault() { } -var fieldIDToName_DownloadBetaApkRequest = map[int16]string{} +var UploadResponse_Base_DEFAULT *model.BaseResp -func (p *DownloadBetaApkRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *UploadResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return UploadResponse_Base_DEFAULT + } + return p.Base +} + +var fieldIDToName_UploadResponse = map[int16]string{ + 1: "base", +} + +func (p *UploadResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *UploadResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -10265,8 +10184,20 @@ func (p *DownloadBetaApkRequest) Read(iprot thrift.TProtocol) (err error) { if fieldTypeId == thrift.STOP { break } - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldTypeError + + 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 @@ -10281,8 +10212,10 @@ 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) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UploadResponse[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) @@ -10290,67 +10223,93 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *DownloadBetaApkRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("DownloadBetaApkRequest"); err != nil { - goto WriteStructBeginError - } - if p != nil { - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError +func (p *UploadResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err } - if err = oprot.WriteStructEnd(); err != nil { + p.Base = _field + return nil +} + +func (p *UploadResponse) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("UploadResponse"); 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 *DownloadBetaApkRequest) String() string { +func (p *UploadResponse) 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 *UploadResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("DownloadBetaApkRequest(%+v)", *p) - -} + return fmt.Sprintf("UploadResponse(%+v)", *p) -type DownloadBetaApkResponse struct { - File []byte `thrift:"file,1,optional" form:"file" json:"file,omitempty" query:"file"` } -func NewDownloadBetaApkResponse() *DownloadBetaApkResponse { - return &DownloadBetaApkResponse{} +type UploadParamsRequest struct { + Password string `thrift:"password,1,required" form:"password,required" json:"password,required" query:"password,required"` } -func (p *DownloadBetaApkResponse) InitDefault() { +func NewUploadParamsRequest() *UploadParamsRequest { + return &UploadParamsRequest{} } -var DownloadBetaApkResponse_File_DEFAULT []byte - -func (p *DownloadBetaApkResponse) GetFile() (v []byte) { - if !p.IsSetFile() { - return DownloadBetaApkResponse_File_DEFAULT - } - return p.File +func (p *UploadParamsRequest) InitDefault() { } -var fieldIDToName_DownloadBetaApkResponse = map[int16]string{ - 1: "file", +func (p *UploadParamsRequest) GetPassword() (v string) { + return p.Password } -func (p *DownloadBetaApkResponse) IsSetFile() bool { - return p.File != nil +var fieldIDToName_UploadParamsRequest = map[int16]string{ + 1: "password", } -func (p *DownloadBetaApkResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *UploadParamsRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 + var issetPassword bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -10371,6 +10330,7 @@ func (p *DownloadBetaApkResponse) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } + issetPassword = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -10387,13 +10347,17 @@ func (p *DownloadBetaApkResponse) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } + if !issetPassword { + 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_DownloadBetaApkResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UploadParamsRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -10401,23 +10365,26 @@ 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_UploadParamsRequest[fieldId])) } -func (p *DownloadBetaApkResponse) ReadField1(iprot thrift.TProtocol) error { +func (p *UploadParamsRequest) ReadField1(iprot thrift.TProtocol) error { - var _field []byte - if v, err := iprot.ReadBinary(); err != nil { + var _field string + if v, err := iprot.ReadString(); err != nil { return err } else { - _field = []byte(v) + _field = v } - p.File = _field + p.Password = _field return nil } -func (p *DownloadBetaApkResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *UploadParamsRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("DownloadBetaApkResponse"); err != nil { + if err = oprot.WriteStructBegin("UploadParamsRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -10443,17 +10410,15 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *DownloadBetaApkResponse) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetFile() { - if err = oprot.WriteFieldBegin("file", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteBinary([]byte(p.File)); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } +func (p *UploadParamsRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("password", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Password); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError } return nil WriteFieldBeginError: @@ -10462,27 +10427,73 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *DownloadBetaApkResponse) String() string { +func (p *UploadParamsRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("DownloadBetaApkResponse(%+v)", *p) + return fmt.Sprintf("UploadParamsRequest(%+v)", *p) } -type GetReleaseVersionRequest struct { +type UploadParamsResponse struct { + Base *model.BaseResp `thrift:"base,1,optional" form:"base" json:"base,omitempty" query:"base"` + Policy *string `thrift:"policy,2,optional" form:"policy" json:"policy,omitempty" query:"policy"` + Authorization *string `thrift:"authorization,3,optional" form:"authorization" json:"authorization,omitempty" query:"authorization"` } -func NewGetReleaseVersionRequest() *GetReleaseVersionRequest { - return &GetReleaseVersionRequest{} +func NewUploadParamsResponse() *UploadParamsResponse { + return &UploadParamsResponse{} } -func (p *GetReleaseVersionRequest) InitDefault() { +func (p *UploadParamsResponse) InitDefault() { } -var fieldIDToName_GetReleaseVersionRequest = map[int16]string{} +var UploadParamsResponse_Base_DEFAULT *model.BaseResp -func (p *GetReleaseVersionRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *UploadParamsResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return UploadParamsResponse_Base_DEFAULT + } + return p.Base +} + +var UploadParamsResponse_Policy_DEFAULT string + +func (p *UploadParamsResponse) GetPolicy() (v string) { + if !p.IsSetPolicy() { + return UploadParamsResponse_Policy_DEFAULT + } + return *p.Policy +} + +var UploadParamsResponse_Authorization_DEFAULT string + +func (p *UploadParamsResponse) GetAuthorization() (v string) { + if !p.IsSetAuthorization() { + return UploadParamsResponse_Authorization_DEFAULT + } + return *p.Authorization +} + +var fieldIDToName_UploadParamsResponse = map[int16]string{ + 1: "base", + 2: "policy", + 3: "authorization", +} + +func (p *UploadParamsResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *UploadParamsResponse) IsSetPolicy() bool { + return p.Policy != nil +} + +func (p *UploadParamsResponse) IsSetAuthorization() bool { + return p.Authorization != nil +} + +func (p *UploadParamsResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -10499,8 +10510,36 @@ func (p *GetReleaseVersionRequest) Read(iprot thrift.TProtocol) (err error) { if fieldTypeId == thrift.STOP { break } - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldTypeError + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.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 + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } } if err = iprot.ReadFieldEnd(); err != nil { goto ReadFieldEndError @@ -10515,8 +10554,10 @@ 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) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UploadParamsResponse[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) @@ -10524,242 +10565,26 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetReleaseVersionRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetReleaseVersionRequest"); err != nil { - goto WriteStructBeginError - } - if p != nil { - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError +func (p *UploadParamsResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err } + p.Base = _field 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) } +func (p *UploadParamsResponse) ReadField2(iprot thrift.TProtocol) error { -func (p *GetReleaseVersionRequest) String() string { - if p == nil { - return "" + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v } - return fmt.Sprintf("GetReleaseVersionRequest(%+v)", *p) - + p.Policy = _field + return nil } - -type GetReleaseVersionResponse struct { - Base *model.BaseResp `thrift:"base,1,optional" form:"base" json:"base,omitempty" query:"base"` - Code *string `thrift:"code,2,optional" form:"code" json:"code,omitempty" query:"code"` - Feature *string `thrift:"feature,3,optional" form:"feature" json:"feature,omitempty" query:"feature"` - URL *string `thrift:"url,4,optional" form:"url" json:"url,omitempty" query:"url"` - Version *string `thrift:"version,5,optional" form:"version" json:"version,omitempty" query:"version"` -} - -func NewGetReleaseVersionResponse() *GetReleaseVersionResponse { - return &GetReleaseVersionResponse{} -} - -func (p *GetReleaseVersionResponse) InitDefault() { -} - -var GetReleaseVersionResponse_Base_DEFAULT *model.BaseResp - -func (p *GetReleaseVersionResponse) GetBase() (v *model.BaseResp) { - if !p.IsSetBase() { - return GetReleaseVersionResponse_Base_DEFAULT - } - return p.Base -} - -var GetReleaseVersionResponse_Code_DEFAULT string - -func (p *GetReleaseVersionResponse) GetCode() (v string) { - if !p.IsSetCode() { - return GetReleaseVersionResponse_Code_DEFAULT - } - return *p.Code -} - -var GetReleaseVersionResponse_Feature_DEFAULT string - -func (p *GetReleaseVersionResponse) GetFeature() (v string) { - if !p.IsSetFeature() { - return GetReleaseVersionResponse_Feature_DEFAULT - } - return *p.Feature -} - -var GetReleaseVersionResponse_URL_DEFAULT string - -func (p *GetReleaseVersionResponse) GetURL() (v string) { - if !p.IsSetURL() { - return GetReleaseVersionResponse_URL_DEFAULT - } - return *p.URL -} - -var GetReleaseVersionResponse_Version_DEFAULT string - -func (p *GetReleaseVersionResponse) GetVersion() (v string) { - if !p.IsSetVersion() { - return GetReleaseVersionResponse_Version_DEFAULT - } - return *p.Version -} - -var fieldIDToName_GetReleaseVersionResponse = map[int16]string{ - 1: "base", - 2: "code", - 3: "feature", - 4: "url", - 5: "version", -} - -func (p *GetReleaseVersionResponse) IsSetBase() bool { - return p.Base != nil -} - -func (p *GetReleaseVersionResponse) IsSetCode() bool { - return p.Code != nil -} - -func (p *GetReleaseVersionResponse) IsSetFeature() bool { - return p.Feature != nil -} - -func (p *GetReleaseVersionResponse) IsSetURL() bool { - return p.URL != nil -} - -func (p *GetReleaseVersionResponse) IsSetVersion() bool { - return p.Version != nil -} - -func (p *GetReleaseVersionResponse) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.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_GetReleaseVersionResponse[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 *GetReleaseVersionResponse) ReadField1(iprot thrift.TProtocol) error { - _field := model.NewBaseResp() - if err := _field.Read(iprot); err != nil { - return err - } - p.Base = _field - return nil -} -func (p *GetReleaseVersionResponse) ReadField2(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Code = _field - return nil -} -func (p *GetReleaseVersionResponse) ReadField3(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Feature = _field - return nil -} -func (p *GetReleaseVersionResponse) ReadField4(iprot thrift.TProtocol) error { +func (p *UploadParamsResponse) ReadField3(iprot thrift.TProtocol) error { var _field *string if v, err := iprot.ReadString(); err != nil { @@ -10767,24 +10592,14 @@ func (p *GetReleaseVersionResponse) ReadField4(iprot thrift.TProtocol) error { } else { _field = &v } - p.URL = _field + p.Authorization = _field return nil } -func (p *GetReleaseVersionResponse) ReadField5(iprot thrift.TProtocol) error { - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Version = _field - return nil -} +func (p *UploadParamsResponse) Write(oprot thrift.TProtocol) (err error) { -func (p *GetReleaseVersionResponse) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetReleaseVersionResponse"); err != nil { + if err = oprot.WriteStructBegin("UploadParamsResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -10800,14 +10615,6 @@ func (p *GetReleaseVersionResponse) 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 @@ -10826,7 +10633,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetReleaseVersionResponse) writeField1(oprot thrift.TProtocol) (err error) { +func (p *UploadParamsResponse) writeField1(oprot thrift.TProtocol) (err error) { if p.IsSetBase() { if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError @@ -10845,12 +10652,12 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetReleaseVersionResponse) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetCode() { - if err = oprot.WriteFieldBegin("code", thrift.STRING, 2); err != nil { +func (p *UploadParamsResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPolicy() { + if err = oprot.WriteFieldBegin("policy", thrift.STRING, 2); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(*p.Code); err != nil { + if err := oprot.WriteString(*p.Policy); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -10864,12 +10671,12 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *GetReleaseVersionResponse) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetFeature() { - if err = oprot.WriteFieldBegin("feature", thrift.STRING, 3); err != nil { +func (p *UploadParamsResponse) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetAuthorization() { + if err = oprot.WriteFieldBegin("authorization", thrift.STRING, 3); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(*p.Feature); err != nil { + if err := oprot.WriteString(*p.Authorization); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -10883,65 +10690,27 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) } -func (p *GetReleaseVersionResponse) writeField4(oprot thrift.TProtocol) (err error) { - if p.IsSetURL() { - if err = oprot.WriteFieldBegin("url", thrift.STRING, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.URL); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} - -func (p *GetReleaseVersionResponse) writeField5(oprot thrift.TProtocol) (err error) { - if p.IsSetVersion() { - if err = oprot.WriteFieldBegin("version", thrift.STRING, 5); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Version); 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 *GetReleaseVersionResponse) String() string { +func (p *UploadParamsResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetReleaseVersionResponse(%+v)", *p) + return fmt.Sprintf("UploadParamsResponse(%+v)", *p) } -type GetBetaVersionRequest struct { +type DownloadReleaseApkRequest struct { } -func NewGetBetaVersionRequest() *GetBetaVersionRequest { - return &GetBetaVersionRequest{} +func NewDownloadReleaseApkRequest() *DownloadReleaseApkRequest { + return &DownloadReleaseApkRequest{} } -func (p *GetBetaVersionRequest) InitDefault() { +func (p *DownloadReleaseApkRequest) InitDefault() { } -var fieldIDToName_GetBetaVersionRequest = map[int16]string{} +var fieldIDToName_DownloadReleaseApkRequest = map[int16]string{} -func (p *GetBetaVersionRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *DownloadReleaseApkRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -10983,8 +10752,9 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetBetaVersionRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetBetaVersionRequest"); err != nil { +func (p *DownloadReleaseApkRequest) Write(oprot thrift.TProtocol) (err error) { + + if err = oprot.WriteStructBegin("DownloadReleaseApkRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -11004,103 +10774,43 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetBetaVersionRequest) String() string { +func (p *DownloadReleaseApkRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetBetaVersionRequest(%+v)", *p) - -} - -type GetBetaVersionResponse struct { - Base *model.BaseResp `thrift:"base,1,optional" form:"base" json:"base,omitempty" query:"base"` - Code *string `thrift:"code,2,optional" form:"code" json:"code,omitempty" query:"code"` - Feature *string `thrift:"feature,3,optional" form:"feature" json:"feature,omitempty" query:"feature"` - URL *string `thrift:"url,4,optional" form:"url" json:"url,omitempty" query:"url"` - Version *string `thrift:"version,5,optional" form:"version" json:"version,omitempty" query:"version"` -} - -func NewGetBetaVersionResponse() *GetBetaVersionResponse { - return &GetBetaVersionResponse{} -} - -func (p *GetBetaVersionResponse) InitDefault() { -} - -var GetBetaVersionResponse_Base_DEFAULT *model.BaseResp + return fmt.Sprintf("DownloadReleaseApkRequest(%+v)", *p) -func (p *GetBetaVersionResponse) GetBase() (v *model.BaseResp) { - if !p.IsSetBase() { - return GetBetaVersionResponse_Base_DEFAULT - } - return p.Base } -var GetBetaVersionResponse_Code_DEFAULT string - -func (p *GetBetaVersionResponse) GetCode() (v string) { - if !p.IsSetCode() { - return GetBetaVersionResponse_Code_DEFAULT - } - return *p.Code +type DownloadReleaseApkResponse struct { + File []byte `thrift:"file,1,optional" form:"file" json:"file,omitempty" query:"file"` } -var GetBetaVersionResponse_Feature_DEFAULT string - -func (p *GetBetaVersionResponse) GetFeature() (v string) { - if !p.IsSetFeature() { - return GetBetaVersionResponse_Feature_DEFAULT - } - return *p.Feature +func NewDownloadReleaseApkResponse() *DownloadReleaseApkResponse { + return &DownloadReleaseApkResponse{} } -var GetBetaVersionResponse_URL_DEFAULT string - -func (p *GetBetaVersionResponse) GetURL() (v string) { - if !p.IsSetURL() { - return GetBetaVersionResponse_URL_DEFAULT - } - return *p.URL +func (p *DownloadReleaseApkResponse) InitDefault() { } -var GetBetaVersionResponse_Version_DEFAULT string +var DownloadReleaseApkResponse_File_DEFAULT []byte -func (p *GetBetaVersionResponse) GetVersion() (v string) { - if !p.IsSetVersion() { - return GetBetaVersionResponse_Version_DEFAULT +func (p *DownloadReleaseApkResponse) GetFile() (v []byte) { + if !p.IsSetFile() { + return DownloadReleaseApkResponse_File_DEFAULT } - return *p.Version -} - -var fieldIDToName_GetBetaVersionResponse = map[int16]string{ - 1: "base", - 2: "code", - 3: "feature", - 4: "url", - 5: "version", -} - -func (p *GetBetaVersionResponse) IsSetBase() bool { - return p.Base != nil -} - -func (p *GetBetaVersionResponse) IsSetCode() bool { - return p.Code != nil -} - -func (p *GetBetaVersionResponse) IsSetFeature() bool { - return p.Feature != nil + return p.File } -func (p *GetBetaVersionResponse) IsSetURL() bool { - return p.URL != nil +var fieldIDToName_DownloadReleaseApkResponse = map[int16]string{ + 1: "file", } -func (p *GetBetaVersionResponse) IsSetVersion() bool { - return p.Version != nil +func (p *DownloadReleaseApkResponse) IsSetFile() bool { + return p.File != nil } -func (p *GetBetaVersionResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *DownloadReleaseApkResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -11120,40 +10830,8 @@ func (p *GetBetaVersionResponse) Read(iprot thrift.TProtocol) (err error) { switch fieldId { case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.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 { + if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } } else if err = iprot.Skip(fieldTypeId); err != nil { @@ -11178,7 +10856,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_GetBetaVersionResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DownloadReleaseApkResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -11188,62 +10866,22 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetBetaVersionResponse) ReadField1(iprot thrift.TProtocol) error { - _field := model.NewBaseResp() - if err := _field.Read(iprot); err != nil { - return err - } - p.Base = _field - return nil -} -func (p *GetBetaVersionResponse) ReadField2(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Code = _field - return nil -} -func (p *GetBetaVersionResponse) ReadField3(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Feature = _field - return nil -} -func (p *GetBetaVersionResponse) ReadField4(iprot thrift.TProtocol) error { +func (p *DownloadReleaseApkResponse) ReadField1(iprot thrift.TProtocol) error { - var _field *string - if v, err := iprot.ReadString(); err != nil { + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { return err } else { - _field = &v + _field = []byte(v) } - p.URL = _field + p.File = _field return nil } -func (p *GetBetaVersionResponse) ReadField5(iprot thrift.TProtocol) error { - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Version = _field - return nil -} +func (p *DownloadReleaseApkResponse) Write(oprot thrift.TProtocol) (err error) { -func (p *GetBetaVersionResponse) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetBetaVersionResponse"); err != nil { + if err = oprot.WriteStructBegin("DownloadReleaseApkResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -11251,22 +10889,6 @@ func (p *GetBetaVersionResponse) 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 = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -11285,12 +10907,12 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetBetaVersionResponse) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetBase() { - if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { +func (p *DownloadReleaseApkResponse) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetFile() { + if err = oprot.WriteFieldBegin("file", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } - if err := p.Base.Write(oprot); err != nil { + if err := oprot.WriteBinary([]byte(p.File)); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -11304,194 +10926,127 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetBetaVersionResponse) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetCode() { - if err = oprot.WriteFieldBegin("code", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Code); 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 *GetBetaVersionResponse) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetFeature() { - if err = oprot.WriteFieldBegin("feature", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Feature); 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 *GetBetaVersionResponse) writeField4(oprot thrift.TProtocol) (err error) { - if p.IsSetURL() { - if err = oprot.WriteFieldBegin("url", thrift.STRING, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.URL); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} - -func (p *GetBetaVersionResponse) writeField5(oprot thrift.TProtocol) (err error) { - if p.IsSetVersion() { - if err = oprot.WriteFieldBegin("version", thrift.STRING, 5); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Version); 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 *GetBetaVersionResponse) String() string { +func (p *DownloadReleaseApkResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetBetaVersionResponse(%+v)", *p) + return fmt.Sprintf("DownloadReleaseApkResponse(%+v)", *p) } -type GetSettingRequest struct { - Account *string `thrift:"account,1,optional" form:"account" json:"account,omitempty" query:"account"` - Version *string `thrift:"version,2,optional" form:"version" json:"version,omitempty" query:"version"` - Beta *bool `thrift:"beta,3,optional" form:"beta" json:"beta,omitempty" query:"beta"` - Phone *string `thrift:"phone,4,optional" form:"phone" json:"phone,omitempty" query:"phone"` - IsLogin *bool `thrift:"isLogin,5,optional" form:"isLogin" json:"isLogin,omitempty" query:"isLogin"` - LoginType *string `thrift:"loginType,6,optional" form:"loginType" json:"loginType,omitempty" query:"loginType"` +type DownloadBetaApkRequest struct { } -func NewGetSettingRequest() *GetSettingRequest { - return &GetSettingRequest{} +func NewDownloadBetaApkRequest() *DownloadBetaApkRequest { + return &DownloadBetaApkRequest{} } -func (p *GetSettingRequest) InitDefault() { +func (p *DownloadBetaApkRequest) InitDefault() { } -var GetSettingRequest_Account_DEFAULT string +var fieldIDToName_DownloadBetaApkRequest = map[int16]string{} -func (p *GetSettingRequest) GetAccount() (v string) { - if !p.IsSetAccount() { - return GetSettingRequest_Account_DEFAULT - } - return *p.Account -} +func (p *DownloadBetaApkRequest) Read(iprot thrift.TProtocol) (err error) { -var GetSettingRequest_Version_DEFAULT string + var fieldTypeId thrift.TType + var fieldId int16 -func (p *GetSettingRequest) GetVersion() (v string) { - if !p.IsSetVersion() { - return GetSettingRequest_Version_DEFAULT + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } - return *p.Version -} - -var GetSettingRequest_Beta_DEFAULT bool -func (p *GetSettingRequest) GetBeta() (v bool) { - if !p.IsSetBeta() { - return GetSettingRequest_Beta_DEFAULT + 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 } - return *p.Beta -} -var GetSettingRequest_Phone_DEFAULT string + 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) -func (p *GetSettingRequest) GetPhone() (v string) { - if !p.IsSetPhone() { - return GetSettingRequest_Phone_DEFAULT - } - return *p.Phone +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) } -var GetSettingRequest_IsLogin_DEFAULT bool +func (p *DownloadBetaApkRequest) Write(oprot thrift.TProtocol) (err error) { -func (p *GetSettingRequest) GetIsLogin() (v bool) { - if !p.IsSetIsLogin() { - return GetSettingRequest_IsLogin_DEFAULT + if err = oprot.WriteStructBegin("DownloadBetaApkRequest"); err != nil { + goto WriteStructBeginError } - return *p.IsLogin + if p != 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) } -var GetSettingRequest_LoginType_DEFAULT string - -func (p *GetSettingRequest) GetLoginType() (v string) { - if !p.IsSetLoginType() { - return GetSettingRequest_LoginType_DEFAULT +func (p *DownloadBetaApkRequest) String() string { + if p == nil { + return "" } - return *p.LoginType -} + return fmt.Sprintf("DownloadBetaApkRequest(%+v)", *p) -var fieldIDToName_GetSettingRequest = map[int16]string{ - 1: "account", - 2: "version", - 3: "beta", - 4: "phone", - 5: "isLogin", - 6: "loginType", } -func (p *GetSettingRequest) IsSetAccount() bool { - return p.Account != nil +type DownloadBetaApkResponse struct { + File []byte `thrift:"file,1,optional" form:"file" json:"file,omitempty" query:"file"` } -func (p *GetSettingRequest) IsSetVersion() bool { - return p.Version != nil +func NewDownloadBetaApkResponse() *DownloadBetaApkResponse { + return &DownloadBetaApkResponse{} } -func (p *GetSettingRequest) IsSetBeta() bool { - return p.Beta != nil +func (p *DownloadBetaApkResponse) InitDefault() { } -func (p *GetSettingRequest) IsSetPhone() bool { - return p.Phone != nil +var DownloadBetaApkResponse_File_DEFAULT []byte + +func (p *DownloadBetaApkResponse) GetFile() (v []byte) { + if !p.IsSetFile() { + return DownloadBetaApkResponse_File_DEFAULT + } + return p.File } -func (p *GetSettingRequest) IsSetIsLogin() bool { - return p.IsLogin != nil +var fieldIDToName_DownloadBetaApkResponse = map[int16]string{ + 1: "file", } -func (p *GetSettingRequest) IsSetLoginType() bool { - return p.LoginType != nil +func (p *DownloadBetaApkResponse) IsSetFile() bool { + return p.File != nil } -func (p *GetSettingRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *DownloadBetaApkResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -11518,48 +11073,8 @@ func (p *GetSettingRequest) Read(iprot thrift.TProtocol) (err error) { } 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.BOOL { - 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.BOOL { - if err = p.ReadField5(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 6: - if fieldTypeId == thrift.STRING { - if err = p.ReadField6(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { + default: + if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } } @@ -11577,7 +11092,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_GetSettingRequest[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DownloadBetaApkResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -11587,76 +11102,22 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetSettingRequest) ReadField1(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Account = _field - return nil -} -func (p *GetSettingRequest) ReadField2(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Version = _field - return nil -} -func (p *GetSettingRequest) ReadField3(iprot thrift.TProtocol) error { - - var _field *bool - if v, err := iprot.ReadBool(); err != nil { - return err - } else { - _field = &v - } - p.Beta = _field - return nil -} -func (p *GetSettingRequest) ReadField4(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Phone = _field - return nil -} -func (p *GetSettingRequest) ReadField5(iprot thrift.TProtocol) error { +func (p *DownloadBetaApkResponse) ReadField1(iprot thrift.TProtocol) error { - var _field *bool - if v, err := iprot.ReadBool(); err != nil { + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { return err } else { - _field = &v + _field = []byte(v) } - p.IsLogin = _field + p.File = _field return nil } -func (p *GetSettingRequest) ReadField6(iprot thrift.TProtocol) error { - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.LoginType = _field - return nil -} +func (p *DownloadBetaApkResponse) Write(oprot thrift.TProtocol) (err error) { -func (p *GetSettingRequest) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetSettingRequest"); err != nil { + if err = oprot.WriteStructBegin("DownloadBetaApkResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -11664,26 +11125,6 @@ func (p *GetSettingRequest) 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 = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } - if err = p.writeField6(oprot); err != nil { - fieldId = 6 - goto WriteFieldError - } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -11702,12 +11143,12 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetSettingRequest) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetAccount() { - if err = oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { +func (p *DownloadBetaApkResponse) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetFile() { + if err = oprot.WriteFieldBegin("file", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(*p.Account); err != nil { + if err := oprot.WriteBinary([]byte(p.File)); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -11721,144 +11162,27 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetSettingRequest) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetVersion() { - if err = oprot.WriteFieldBegin("version", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Version); 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 *GetSettingRequest) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetBeta() { - if err = oprot.WriteFieldBegin("beta", thrift.BOOL, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteBool(*p.Beta); 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 *GetSettingRequest) writeField4(oprot thrift.TProtocol) (err error) { - if p.IsSetPhone() { - if err = oprot.WriteFieldBegin("phone", thrift.STRING, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Phone); 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 *GetSettingRequest) writeField5(oprot thrift.TProtocol) (err error) { - if p.IsSetIsLogin() { - if err = oprot.WriteFieldBegin("isLogin", thrift.BOOL, 5); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteBool(*p.IsLogin); 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 *GetSettingRequest) writeField6(oprot thrift.TProtocol) (err error) { - if p.IsSetLoginType() { - if err = oprot.WriteFieldBegin("loginType", thrift.STRING, 6); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.LoginType); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) -} - -func (p *GetSettingRequest) String() string { +func (p *DownloadBetaApkResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetSettingRequest(%+v)", *p) - -} - -type GetSettingResponse struct { - Base *model.BaseResp `thrift:"base,1,optional" form:"base" json:"base,omitempty" query:"base"` - CloudSetting []byte `thrift:"cloud_setting,2" form:"cloud_setting" json:"cloud_setting" query:"cloud_setting"` -} - -func NewGetSettingResponse() *GetSettingResponse { - return &GetSettingResponse{} -} + return fmt.Sprintf("DownloadBetaApkResponse(%+v)", *p) -func (p *GetSettingResponse) InitDefault() { } -var GetSettingResponse_Base_DEFAULT *model.BaseResp - -func (p *GetSettingResponse) GetBase() (v *model.BaseResp) { - if !p.IsSetBase() { - return GetSettingResponse_Base_DEFAULT - } - return p.Base +type GetReleaseVersionRequest struct { } -func (p *GetSettingResponse) GetCloudSetting() (v []byte) { - return p.CloudSetting +func NewGetReleaseVersionRequest() *GetReleaseVersionRequest { + return &GetReleaseVersionRequest{} } -var fieldIDToName_GetSettingResponse = map[int16]string{ - 1: "base", - 2: "cloud_setting", +func (p *GetReleaseVersionRequest) InitDefault() { } -func (p *GetSettingResponse) IsSetBase() bool { - return p.Base != nil -} +var fieldIDToName_GetReleaseVersionRequest = map[int16]string{} -func (p *GetSettingResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetReleaseVersionRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -11875,46 +11199,24 @@ func (p *GetSettingResponse) 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 - } - 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 - } - 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 err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldTypeError + } + 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_GetSettingResponse[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) @@ -11922,40 +11224,12 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetSettingResponse) ReadField1(iprot thrift.TProtocol) error { - _field := model.NewBaseResp() - if err := _field.Read(iprot); err != nil { - return err - } - p.Base = _field - return nil -} -func (p *GetSettingResponse) ReadField2(iprot thrift.TProtocol) error { - - var _field []byte - if v, err := iprot.ReadBinary(); err != nil { - return err - } else { - _field = []byte(v) - } - p.CloudSetting = _field - return nil -} +func (p *GetReleaseVersionRequest) Write(oprot thrift.TProtocol) (err error) { -func (p *GetSettingResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("GetSettingResponse"); err != nil { + if err = oprot.WriteStructBegin("GetReleaseVersionRequest"); 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 @@ -11966,177 +11240,109 @@ func (p *GetSettingResponse) 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 *GetSettingResponse) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetBase() { - 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 *GetSettingResponse) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("cloud_setting", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteBinary([]byte(p.CloudSetting)); 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 *GetSettingResponse) String() string { +func (p *GetReleaseVersionRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetSettingResponse(%+v)", *p) - -} - -type GetTestRequest struct { - Account *string `thrift:"account,1,optional" form:"account" json:"account,omitempty" query:"account"` - Version *string `thrift:"version,2,optional" form:"version" json:"version,omitempty" query:"version"` - Beta *bool `thrift:"beta,3,optional" form:"beta" json:"beta,omitempty" query:"beta"` - Phone *string `thrift:"phone,4,optional" form:"phone" json:"phone,omitempty" query:"phone"` - IsLogin *bool `thrift:"isLogin,5,optional" form:"isLogin" json:"isLogin,omitempty" query:"isLogin"` - LoginType *string `thrift:"loginType,6,optional" form:"loginType" json:"loginType,omitempty" query:"loginType"` - Setting *string `thrift:"setting,7,optional" form:"setting" json:"setting,omitempty" query:"setting"` -} + return fmt.Sprintf("GetReleaseVersionRequest(%+v)", *p) -func NewGetTestRequest() *GetTestRequest { - return &GetTestRequest{} } -func (p *GetTestRequest) InitDefault() { +type GetReleaseVersionResponse struct { + Base *model.BaseResp `thrift:"base,1,optional" form:"base" json:"base,omitempty" query:"base"` + Code *string `thrift:"code,2,optional" form:"code" json:"code,omitempty" query:"code"` + Feature *string `thrift:"feature,3,optional" form:"feature" json:"feature,omitempty" query:"feature"` + URL *string `thrift:"url,4,optional" form:"url" json:"url,omitempty" query:"url"` + Version *string `thrift:"version,5,optional" form:"version" json:"version,omitempty" query:"version"` } -var GetTestRequest_Account_DEFAULT string - -func (p *GetTestRequest) GetAccount() (v string) { - if !p.IsSetAccount() { - return GetTestRequest_Account_DEFAULT - } - return *p.Account +func NewGetReleaseVersionResponse() *GetReleaseVersionResponse { + return &GetReleaseVersionResponse{} } -var GetTestRequest_Version_DEFAULT string - -func (p *GetTestRequest) GetVersion() (v string) { - if !p.IsSetVersion() { - return GetTestRequest_Version_DEFAULT - } - return *p.Version +func (p *GetReleaseVersionResponse) InitDefault() { } -var GetTestRequest_Beta_DEFAULT bool +var GetReleaseVersionResponse_Base_DEFAULT *model.BaseResp -func (p *GetTestRequest) GetBeta() (v bool) { - if !p.IsSetBeta() { - return GetTestRequest_Beta_DEFAULT +func (p *GetReleaseVersionResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return GetReleaseVersionResponse_Base_DEFAULT } - return *p.Beta + return p.Base } -var GetTestRequest_Phone_DEFAULT string +var GetReleaseVersionResponse_Code_DEFAULT string -func (p *GetTestRequest) GetPhone() (v string) { - if !p.IsSetPhone() { - return GetTestRequest_Phone_DEFAULT +func (p *GetReleaseVersionResponse) GetCode() (v string) { + if !p.IsSetCode() { + return GetReleaseVersionResponse_Code_DEFAULT } - return *p.Phone + return *p.Code } -var GetTestRequest_IsLogin_DEFAULT bool +var GetReleaseVersionResponse_Feature_DEFAULT string -func (p *GetTestRequest) GetIsLogin() (v bool) { - if !p.IsSetIsLogin() { - return GetTestRequest_IsLogin_DEFAULT +func (p *GetReleaseVersionResponse) GetFeature() (v string) { + if !p.IsSetFeature() { + return GetReleaseVersionResponse_Feature_DEFAULT } - return *p.IsLogin + return *p.Feature } -var GetTestRequest_LoginType_DEFAULT string +var GetReleaseVersionResponse_URL_DEFAULT string -func (p *GetTestRequest) GetLoginType() (v string) { - if !p.IsSetLoginType() { - return GetTestRequest_LoginType_DEFAULT +func (p *GetReleaseVersionResponse) GetURL() (v string) { + if !p.IsSetURL() { + return GetReleaseVersionResponse_URL_DEFAULT } - return *p.LoginType + return *p.URL } -var GetTestRequest_Setting_DEFAULT string +var GetReleaseVersionResponse_Version_DEFAULT string -func (p *GetTestRequest) GetSetting() (v string) { - if !p.IsSetSetting() { - return GetTestRequest_Setting_DEFAULT +func (p *GetReleaseVersionResponse) GetVersion() (v string) { + if !p.IsSetVersion() { + return GetReleaseVersionResponse_Version_DEFAULT } - return *p.Setting -} - -var fieldIDToName_GetTestRequest = map[int16]string{ - 1: "account", - 2: "version", - 3: "beta", - 4: "phone", - 5: "isLogin", - 6: "loginType", - 7: "setting", -} - -func (p *GetTestRequest) IsSetAccount() bool { - return p.Account != nil + return *p.Version } -func (p *GetTestRequest) IsSetVersion() bool { - return p.Version != nil +var fieldIDToName_GetReleaseVersionResponse = map[int16]string{ + 1: "base", + 2: "code", + 3: "feature", + 4: "url", + 5: "version", } -func (p *GetTestRequest) IsSetBeta() bool { - return p.Beta != nil +func (p *GetReleaseVersionResponse) IsSetBase() bool { + return p.Base != nil } -func (p *GetTestRequest) IsSetPhone() bool { - return p.Phone != nil +func (p *GetReleaseVersionResponse) IsSetCode() bool { + return p.Code != nil } -func (p *GetTestRequest) IsSetIsLogin() bool { - return p.IsLogin != nil +func (p *GetReleaseVersionResponse) IsSetFeature() bool { + return p.Feature != nil } -func (p *GetTestRequest) IsSetLoginType() bool { - return p.LoginType != nil +func (p *GetReleaseVersionResponse) IsSetURL() bool { + return p.URL != nil } -func (p *GetTestRequest) IsSetSetting() bool { - return p.Setting != nil +func (p *GetReleaseVersionResponse) IsSetVersion() bool { + return p.Version != nil } -func (p *GetTestRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetReleaseVersionResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -12156,7 +11362,7 @@ func (p *GetTestRequest) Read(iprot thrift.TProtocol) (err error) { switch fieldId { case 1: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.STRUCT { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } @@ -12172,7 +11378,7 @@ func (p *GetTestRequest) Read(iprot thrift.TProtocol) (err error) { goto SkipFieldError } case 3: - if fieldTypeId == thrift.BOOL { + if fieldTypeId == thrift.STRING { if err = p.ReadField3(iprot); err != nil { goto ReadFieldError } @@ -12188,31 +11394,15 @@ func (p *GetTestRequest) Read(iprot thrift.TProtocol) (err error) { goto SkipFieldError } case 5: - if fieldTypeId == thrift.BOOL { + if fieldTypeId == thrift.STRING { if err = p.ReadField5(iprot); err != nil { goto ReadFieldError } } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } - case 6: - if fieldTypeId == thrift.STRING { - if err = p.ReadField6(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 7: - if fieldTypeId == thrift.STRING { - if err = p.ReadField7(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { + default: + if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } } @@ -12230,7 +11420,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_GetTestRequest[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetReleaseVersionResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -12240,18 +11430,15 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetTestRequest) ReadField1(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { +func (p *GetReleaseVersionResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { return err - } else { - _field = &v } - p.Account = _field + p.Base = _field return nil } -func (p *GetTestRequest) ReadField2(iprot thrift.TProtocol) error { +func (p *GetReleaseVersionResponse) ReadField2(iprot thrift.TProtocol) error { var _field *string if v, err := iprot.ReadString(); err != nil { @@ -12259,21 +11446,10 @@ func (p *GetTestRequest) ReadField2(iprot thrift.TProtocol) error { } else { _field = &v } - p.Version = _field - return nil -} -func (p *GetTestRequest) ReadField3(iprot thrift.TProtocol) error { - - var _field *bool - if v, err := iprot.ReadBool(); err != nil { - return err - } else { - _field = &v - } - p.Beta = _field + p.Code = _field return nil } -func (p *GetTestRequest) ReadField4(iprot thrift.TProtocol) error { +func (p *GetReleaseVersionResponse) ReadField3(iprot thrift.TProtocol) error { var _field *string if v, err := iprot.ReadString(); err != nil { @@ -12281,21 +11457,10 @@ func (p *GetTestRequest) ReadField4(iprot thrift.TProtocol) error { } else { _field = &v } - p.Phone = _field - return nil -} -func (p *GetTestRequest) ReadField5(iprot thrift.TProtocol) error { - - var _field *bool - if v, err := iprot.ReadBool(); err != nil { - return err - } else { - _field = &v - } - p.IsLogin = _field + p.Feature = _field return nil } -func (p *GetTestRequest) ReadField6(iprot thrift.TProtocol) error { +func (p *GetReleaseVersionResponse) ReadField4(iprot thrift.TProtocol) error { var _field *string if v, err := iprot.ReadString(); err != nil { @@ -12303,10 +11468,10 @@ func (p *GetTestRequest) ReadField6(iprot thrift.TProtocol) error { } else { _field = &v } - p.LoginType = _field + p.URL = _field return nil } -func (p *GetTestRequest) ReadField7(iprot thrift.TProtocol) error { +func (p *GetReleaseVersionResponse) ReadField5(iprot thrift.TProtocol) error { var _field *string if v, err := iprot.ReadString(); err != nil { @@ -12314,13 +11479,14 @@ func (p *GetTestRequest) ReadField7(iprot thrift.TProtocol) error { } else { _field = &v } - p.Setting = _field + p.Version = _field return nil } -func (p *GetTestRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *GetReleaseVersionResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetTestRequest"); err != nil { + if err = oprot.WriteStructBegin("GetReleaseVersionResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -12344,14 +11510,6 @@ func (p *GetTestRequest) Write(oprot thrift.TProtocol) (err error) { fieldId = 5 goto WriteFieldError } - if err = p.writeField6(oprot); err != nil { - fieldId = 6 - goto WriteFieldError - } - if err = p.writeField7(oprot); err != nil { - fieldId = 7 - goto WriteFieldError - } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -12370,12 +11528,12 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetTestRequest) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetAccount() { - if err = oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { +func (p *GetReleaseVersionResponse) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(*p.Account); err != nil { + if err := p.Base.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -12389,12 +11547,12 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetTestRequest) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetVersion() { - if err = oprot.WriteFieldBegin("version", thrift.STRING, 2); err != nil { +func (p *GetReleaseVersionResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetCode() { + if err = oprot.WriteFieldBegin("code", thrift.STRING, 2); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(*p.Version); err != nil { + if err := oprot.WriteString(*p.Code); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -12408,12 +11566,12 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *GetTestRequest) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetBeta() { - if err = oprot.WriteFieldBegin("beta", thrift.BOOL, 3); err != nil { +func (p *GetReleaseVersionResponse) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetFeature() { + if err = oprot.WriteFieldBegin("feature", thrift.STRING, 3); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteBool(*p.Beta); err != nil { + if err := oprot.WriteString(*p.Feature); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -12427,12 +11585,12 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) } -func (p *GetTestRequest) writeField4(oprot thrift.TProtocol) (err error) { - if p.IsSetPhone() { - if err = oprot.WriteFieldBegin("phone", thrift.STRING, 4); err != nil { +func (p *GetReleaseVersionResponse) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetURL() { + if err = oprot.WriteFieldBegin("url", thrift.STRING, 4); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(*p.Phone); err != nil { + if err := oprot.WriteString(*p.URL); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -12446,12 +11604,12 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) } -func (p *GetTestRequest) writeField5(oprot thrift.TProtocol) (err error) { - if p.IsSetIsLogin() { - if err = oprot.WriteFieldBegin("isLogin", thrift.BOOL, 5); err != nil { +func (p *GetReleaseVersionResponse) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetVersion() { + if err = oprot.WriteFieldBegin("version", thrift.STRING, 5); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteBool(*p.IsLogin); err != nil { + if err := oprot.WriteString(*p.Version); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -12465,87 +11623,27 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) } -func (p *GetTestRequest) writeField6(oprot thrift.TProtocol) (err error) { - if p.IsSetLoginType() { - if err = oprot.WriteFieldBegin("loginType", thrift.STRING, 6); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.LoginType); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) -} - -func (p *GetTestRequest) writeField7(oprot thrift.TProtocol) (err error) { - if p.IsSetSetting() { - if err = oprot.WriteFieldBegin("setting", thrift.STRING, 7); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Setting); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) -} - -func (p *GetTestRequest) String() string { +func (p *GetReleaseVersionResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetTestRequest(%+v)", *p) - -} - -type GetTestResponse struct { - Base *model.BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` - CloudSetting []byte `thrift:"cloud_setting,2" form:"cloud_setting" json:"cloud_setting" query:"cloud_setting"` -} - -func NewGetTestResponse() *GetTestResponse { - return &GetTestResponse{} -} + return fmt.Sprintf("GetReleaseVersionResponse(%+v)", *p) -func (p *GetTestResponse) InitDefault() { } -var GetTestResponse_Base_DEFAULT *model.BaseResp - -func (p *GetTestResponse) GetBase() (v *model.BaseResp) { - if !p.IsSetBase() { - return GetTestResponse_Base_DEFAULT - } - return p.Base +type GetBetaVersionRequest struct { } -func (p *GetTestResponse) GetCloudSetting() (v []byte) { - return p.CloudSetting +func NewGetBetaVersionRequest() *GetBetaVersionRequest { + return &GetBetaVersionRequest{} } -var fieldIDToName_GetTestResponse = map[int16]string{ - 1: "base", - 2: "cloud_setting", +func (p *GetBetaVersionRequest) InitDefault() { } -func (p *GetTestResponse) IsSetBase() bool { - return p.Base != nil -} +var fieldIDToName_GetBetaVersionRequest = map[int16]string{} -func (p *GetTestResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetBetaVersionRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -12562,28 +11660,8 @@ func (p *GetTestResponse) 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 - } - 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 - } - 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 @@ -12598,10 +11676,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_GetTestResponse[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) @@ -12609,40 +11685,12 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetTestResponse) ReadField1(iprot thrift.TProtocol) error { - _field := model.NewBaseResp() - if err := _field.Read(iprot); err != nil { - return err - } - p.Base = _field - return nil -} -func (p *GetTestResponse) ReadField2(iprot thrift.TProtocol) error { - - var _field []byte - if v, err := iprot.ReadBinary(); err != nil { - return err - } else { - _field = []byte(v) - } - p.CloudSetting = _field - return nil -} +func (p *GetBetaVersionRequest) Write(oprot thrift.TProtocol) (err error) { -func (p *GetTestResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("GetTestResponse"); err != nil { + if err = oprot.WriteStructBegin("GetBetaVersionRequest"); 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 @@ -12653,174 +11701,109 @@ func (p *GetTestResponse) 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 *GetTestResponse) 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 *GetTestResponse) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("cloud_setting", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteBinary([]byte(p.CloudSetting)); 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 *GetTestResponse) String() string { +func (p *GetBetaVersionRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetTestResponse(%+v)", *p) + return fmt.Sprintf("GetBetaVersionRequest(%+v)", *p) } -type GetCloudRequest struct { +type GetBetaVersionResponse struct { + Base *model.BaseResp `thrift:"base,1,optional" form:"base" json:"base,omitempty" query:"base"` + Code *string `thrift:"code,2,optional" form:"code" json:"code,omitempty" query:"code"` + Feature *string `thrift:"feature,3,optional" form:"feature" json:"feature,omitempty" query:"feature"` + URL *string `thrift:"url,4,optional" form:"url" json:"url,omitempty" query:"url"` + Version *string `thrift:"version,5,optional" form:"version" json:"version,omitempty" query:"version"` } -func NewGetCloudRequest() *GetCloudRequest { - return &GetCloudRequest{} +func NewGetBetaVersionResponse() *GetBetaVersionResponse { + return &GetBetaVersionResponse{} } -func (p *GetCloudRequest) InitDefault() { +func (p *GetBetaVersionResponse) InitDefault() { } -var fieldIDToName_GetCloudRequest = map[int16]string{} - -func (p *GetCloudRequest) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } +var GetBetaVersionResponse_Base_DEFAULT *model.BaseResp - 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 *GetBetaVersionResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return GetBetaVersionResponse_Base_DEFAULT } + return p.Base +} - 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) +var GetBetaVersionResponse_Code_DEFAULT string -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 *GetBetaVersionResponse) GetCode() (v string) { + if !p.IsSetCode() { + return GetBetaVersionResponse_Code_DEFAULT + } + return *p.Code } -func (p *GetCloudRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetCloudRequest"); err != nil { - goto WriteStructBeginError - } - if p != nil { - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError +var GetBetaVersionResponse_Feature_DEFAULT string + +func (p *GetBetaVersionResponse) GetFeature() (v string) { + if !p.IsSetFeature() { + return GetBetaVersionResponse_Feature_DEFAULT } - 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) + return *p.Feature } -func (p *GetCloudRequest) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("GetCloudRequest(%+v)", *p) +var GetBetaVersionResponse_URL_DEFAULT string +func (p *GetBetaVersionResponse) GetURL() (v string) { + if !p.IsSetURL() { + return GetBetaVersionResponse_URL_DEFAULT + } + return *p.URL } -type GetCloudResponse struct { - Base *model.BaseResp `thrift:"base,1,optional" form:"base" json:"base,omitempty" query:"base"` - CloudSetting []byte `thrift:"cloud_setting,2" form:"cloud_setting" json:"cloud_setting" query:"cloud_setting"` -} +var GetBetaVersionResponse_Version_DEFAULT string -func NewGetCloudResponse() *GetCloudResponse { - return &GetCloudResponse{} +func (p *GetBetaVersionResponse) GetVersion() (v string) { + if !p.IsSetVersion() { + return GetBetaVersionResponse_Version_DEFAULT + } + return *p.Version } -func (p *GetCloudResponse) InitDefault() { +var fieldIDToName_GetBetaVersionResponse = map[int16]string{ + 1: "base", + 2: "code", + 3: "feature", + 4: "url", + 5: "version", } -var GetCloudResponse_Base_DEFAULT *model.BaseResp +func (p *GetBetaVersionResponse) IsSetBase() bool { + return p.Base != nil +} -func (p *GetCloudResponse) GetBase() (v *model.BaseResp) { - if !p.IsSetBase() { - return GetCloudResponse_Base_DEFAULT - } - return p.Base +func (p *GetBetaVersionResponse) IsSetCode() bool { + return p.Code != nil } -func (p *GetCloudResponse) GetCloudSetting() (v []byte) { - return p.CloudSetting +func (p *GetBetaVersionResponse) IsSetFeature() bool { + return p.Feature != nil } -var fieldIDToName_GetCloudResponse = map[int16]string{ - 1: "base", - 2: "cloud_setting", +func (p *GetBetaVersionResponse) IsSetURL() bool { + return p.URL != nil } -func (p *GetCloudResponse) IsSetBase() bool { - return p.Base != nil +func (p *GetBetaVersionResponse) IsSetVersion() bool { + return p.Version != nil } -func (p *GetCloudResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetBetaVersionResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -12855,6 +11838,30 @@ func (p *GetCloudResponse) Read(iprot thrift.TProtocol) (err error) { } 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 @@ -12874,7 +11881,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_GetCloudResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetBetaVersionResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -12884,7 +11891,7 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetCloudResponse) ReadField1(iprot thrift.TProtocol) error { +func (p *GetBetaVersionResponse) ReadField1(iprot thrift.TProtocol) error { _field := model.NewBaseResp() if err := _field.Read(iprot); err != nil { return err @@ -12892,51 +11899,97 @@ func (p *GetCloudResponse) ReadField1(iprot thrift.TProtocol) error { p.Base = _field return nil } -func (p *GetCloudResponse) ReadField2(iprot thrift.TProtocol) error { +func (p *GetBetaVersionResponse) ReadField2(iprot thrift.TProtocol) error { - var _field []byte - if v, err := iprot.ReadBinary(); err != nil { + var _field *string + if v, err := iprot.ReadString(); err != nil { return err } else { - _field = []byte(v) + _field = &v } - p.CloudSetting = _field + p.Code = _field return nil } +func (p *GetBetaVersionResponse) ReadField3(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 - } - 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 + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v } + p.Feature = _field 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 *GetBetaVersionResponse) ReadField4(iprot thrift.TProtocol) error { -func (p *GetCloudResponse) writeField1(oprot thrift.TProtocol) (err error) { + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.URL = _field + return nil +} +func (p *GetBetaVersionResponse) ReadField5(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Version = _field + return nil +} + +func (p *GetBetaVersionResponse) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetBetaVersionResponse"); 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 *GetBetaVersionResponse) writeField1(oprot thrift.TProtocol) (err error) { if p.IsSetBase() { if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError @@ -12955,15 +12008,17 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetCloudResponse) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("cloud_setting", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteBinary([]byte(p.CloudSetting)); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError +func (p *GetBetaVersionResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetCode() { + if err = oprot.WriteFieldBegin("code", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Code); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } return nil WriteFieldBeginError: @@ -12972,45 +12027,178 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *GetCloudResponse) String() string { +func (p *GetBetaVersionResponse) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetFeature() { + if err = oprot.WriteFieldBegin("feature", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Feature); 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 *GetBetaVersionResponse) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetURL() { + if err = oprot.WriteFieldBegin("url", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.URL); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *GetBetaVersionResponse) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetVersion() { + if err = oprot.WriteFieldBegin("version", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Version); 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 *GetBetaVersionResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetCloudResponse(%+v)", *p) + return fmt.Sprintf("GetBetaVersionResponse(%+v)", *p) } -type SetCloudRequest struct { - Password string `thrift:"password,1,required" form:"password,required" json:"password,required" query:"password,required"` - Setting string `thrift:"setting,2,required" form:"setting,required" json:"setting,required" query:"setting,required"` +type GetSettingRequest struct { + Account *string `thrift:"account,1,optional" form:"account" json:"account,omitempty" query:"account"` + Version *string `thrift:"version,2,optional" form:"version" json:"version,omitempty" query:"version"` + Beta *bool `thrift:"beta,3,optional" form:"beta" json:"beta,omitempty" query:"beta"` + Phone *string `thrift:"phone,4,optional" form:"phone" json:"phone,omitempty" query:"phone"` + IsLogin *bool `thrift:"isLogin,5,optional" form:"isLogin" json:"isLogin,omitempty" query:"isLogin"` + LoginType *string `thrift:"loginType,6,optional" form:"loginType" json:"loginType,omitempty" query:"loginType"` } -func NewSetCloudRequest() *SetCloudRequest { - return &SetCloudRequest{} +func NewGetSettingRequest() *GetSettingRequest { + return &GetSettingRequest{} } -func (p *SetCloudRequest) InitDefault() { +func (p *GetSettingRequest) InitDefault() { } -func (p *SetCloudRequest) GetPassword() (v string) { - return p.Password +var GetSettingRequest_Account_DEFAULT string + +func (p *GetSettingRequest) GetAccount() (v string) { + if !p.IsSetAccount() { + return GetSettingRequest_Account_DEFAULT + } + return *p.Account } -func (p *SetCloudRequest) GetSetting() (v string) { - return p.Setting +var GetSettingRequest_Version_DEFAULT string + +func (p *GetSettingRequest) GetVersion() (v string) { + if !p.IsSetVersion() { + return GetSettingRequest_Version_DEFAULT + } + return *p.Version } -var fieldIDToName_SetCloudRequest = map[int16]string{ - 1: "password", - 2: "setting", +var GetSettingRequest_Beta_DEFAULT bool + +func (p *GetSettingRequest) GetBeta() (v bool) { + if !p.IsSetBeta() { + return GetSettingRequest_Beta_DEFAULT + } + return *p.Beta } -func (p *SetCloudRequest) Read(iprot thrift.TProtocol) (err error) { +var GetSettingRequest_Phone_DEFAULT string + +func (p *GetSettingRequest) GetPhone() (v string) { + if !p.IsSetPhone() { + return GetSettingRequest_Phone_DEFAULT + } + return *p.Phone +} + +var GetSettingRequest_IsLogin_DEFAULT bool + +func (p *GetSettingRequest) GetIsLogin() (v bool) { + if !p.IsSetIsLogin() { + return GetSettingRequest_IsLogin_DEFAULT + } + return *p.IsLogin +} + +var GetSettingRequest_LoginType_DEFAULT string + +func (p *GetSettingRequest) GetLoginType() (v string) { + if !p.IsSetLoginType() { + return GetSettingRequest_LoginType_DEFAULT + } + return *p.LoginType +} + +var fieldIDToName_GetSettingRequest = map[int16]string{ + 1: "account", + 2: "version", + 3: "beta", + 4: "phone", + 5: "isLogin", + 6: "loginType", +} + +func (p *GetSettingRequest) IsSetAccount() bool { + return p.Account != nil +} + +func (p *GetSettingRequest) IsSetVersion() bool { + return p.Version != nil +} + +func (p *GetSettingRequest) IsSetBeta() bool { + return p.Beta != nil +} + +func (p *GetSettingRequest) IsSetPhone() bool { + return p.Phone != nil +} + +func (p *GetSettingRequest) IsSetIsLogin() bool { + return p.IsLogin != nil +} + +func (p *GetSettingRequest) IsSetLoginType() bool { + return p.LoginType != nil +} + +func (p *GetSettingRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetPassword bool = false - var issetSetting bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -13031,7 +12219,6 @@ func (p *SetCloudRequest) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetPassword = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -13040,7 +12227,38 @@ func (p *SetCloudRequest) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField2(iprot); err != nil { goto ReadFieldError } - issetSetting = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.BOOL { + 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.BOOL { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.STRING { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -13057,22 +12275,13 @@ func (p *SetCloudRequest) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetPassword { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetSetting { - 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_SetCloudRequest[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetSettingRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -13080,36 +12289,79 @@ 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_SetCloudRequest[fieldId])) } -func (p *SetCloudRequest) ReadField1(iprot thrift.TProtocol) error { +func (p *GetSettingRequest) 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.Password = _field + p.Account = _field return nil } -func (p *SetCloudRequest) ReadField2(iprot thrift.TProtocol) error { +func (p *GetSettingRequest) ReadField2(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.Setting = _field + p.Version = _field + return nil +} +func (p *GetSettingRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field *bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = &v + } + p.Beta = _field return nil } +func (p *GetSettingRequest) ReadField4(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Phone = _field + return nil +} +func (p *GetSettingRequest) ReadField5(iprot thrift.TProtocol) error { + + var _field *bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = &v + } + p.IsLogin = _field + return nil +} +func (p *GetSettingRequest) ReadField6(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.LoginType = _field + return nil +} + +func (p *GetSettingRequest) Write(oprot thrift.TProtocol) (err error) { -func (p *SetCloudRequest) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("SetCloudRequest"); err != nil { + if err = oprot.WriteStructBegin("GetSettingRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -13121,6 +12373,22 @@ func (p *SetCloudRequest) Write(oprot thrift.TProtocol) (err error) { fieldId = 2 goto WriteFieldError } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -13139,15 +12407,17 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *SetCloudRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("password", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Password); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError +func (p *GetSettingRequest) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetAccount() { + if err = oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Account); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } return nil WriteFieldBeginError: @@ -13156,15 +12426,17 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *SetCloudRequest) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("setting", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Setting); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError +func (p *GetSettingRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetVersion() { + if err = oprot.WriteFieldBegin("version", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Version); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } return nil WriteFieldBeginError: @@ -13173,43 +12445,125 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *SetCloudRequest) String() string { - if p == nil { - return "" +func (p *GetSettingRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetBeta() { + if err = oprot.WriteFieldBegin("beta", thrift.BOOL, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(*p.Beta); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } - return fmt.Sprintf("SetCloudRequest(%+v)", *p) - + 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) } -type SetCloudResponse struct { - Base *model.BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` +func (p *GetSettingRequest) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetPhone() { + if err = oprot.WriteFieldBegin("phone", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Phone); 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 NewSetCloudResponse() *SetCloudResponse { - return &SetCloudResponse{} +func (p *GetSettingRequest) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetIsLogin() { + if err = oprot.WriteFieldBegin("isLogin", thrift.BOOL, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(*p.IsLogin); 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 *SetCloudResponse) InitDefault() { +func (p *GetSettingRequest) writeField6(oprot thrift.TProtocol) (err error) { + if p.IsSetLoginType() { + if err = oprot.WriteFieldBegin("loginType", thrift.STRING, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.LoginType); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) } -var SetCloudResponse_Base_DEFAULT *model.BaseResp - -func (p *SetCloudResponse) GetBase() (v *model.BaseResp) { - if !p.IsSetBase() { - return SetCloudResponse_Base_DEFAULT +func (p *GetSettingRequest) String() string { + if p == nil { + return "" } - return p.Base + return fmt.Sprintf("GetSettingRequest(%+v)", *p) + } -var fieldIDToName_SetCloudResponse = map[int16]string{ +type GetSettingResponse struct { + Base *model.BaseResp `thrift:"base,1,optional" form:"base" json:"base,omitempty" query:"base"` + CloudSetting []byte `thrift:"cloud_setting,2" form:"cloud_setting" json:"cloud_setting" query:"cloud_setting"` +} + +func NewGetSettingResponse() *GetSettingResponse { + return &GetSettingResponse{} +} + +func (p *GetSettingResponse) InitDefault() { +} + +var GetSettingResponse_Base_DEFAULT *model.BaseResp + +func (p *GetSettingResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return GetSettingResponse_Base_DEFAULT + } + return p.Base +} + +func (p *GetSettingResponse) GetCloudSetting() (v []byte) { + return p.CloudSetting +} + +var fieldIDToName_GetSettingResponse = map[int16]string{ 1: "base", + 2: "cloud_setting", } -func (p *SetCloudResponse) IsSetBase() bool { +func (p *GetSettingResponse) IsSetBase() bool { return p.Base != nil } -func (p *SetCloudResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetSettingResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -13236,6 +12590,14 @@ func (p *SetCloudResponse) Read(iprot thrift.TProtocol) (err error) { } 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 + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -13255,7 +12617,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_SetCloudResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetSettingResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -13265,7 +12627,7 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *SetCloudResponse) ReadField1(iprot thrift.TProtocol) error { +func (p *GetSettingResponse) ReadField1(iprot thrift.TProtocol) error { _field := model.NewBaseResp() if err := _field.Read(iprot); err != nil { return err @@ -13273,10 +12635,22 @@ func (p *SetCloudResponse) ReadField1(iprot thrift.TProtocol) error { p.Base = _field return nil } +func (p *GetSettingResponse) ReadField2(iprot thrift.TProtocol) error { + + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { + return err + } else { + _field = []byte(v) + } + p.CloudSetting = _field + return nil +} + +func (p *GetSettingResponse) Write(oprot thrift.TProtocol) (err error) { -func (p *SetCloudResponse) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("SetCloudResponse"); err != nil { + if err = oprot.WriteStructBegin("GetSettingResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -13284,6 +12658,10 @@ func (p *SetCloudResponse) Write(oprot thrift.TProtocol) (err error) { fieldId = 1 goto WriteFieldError } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -13302,11 +12680,30 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *SetCloudResponse) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { +func (p *GetSettingResponse) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + 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 *GetSettingResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("cloud_setting", thrift.STRING, 2); err != nil { goto WriteFieldBeginError } - if err := p.Base.Write(oprot); err != nil { + if err := oprot.WriteBinary([]byte(p.CloudSetting)); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -13314,137 +12711,138 @@ func (p *SetCloudResponse) writeField1(oprot thrift.TProtocol) (err error) { } return nil WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *SetCloudResponse) String() string { +func (p *GetSettingResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("SetCloudResponse(%+v)", *p) + return fmt.Sprintf("GetSettingResponse(%+v)", *p) } -type GetDumpRequest struct { +type GetTestRequest struct { + Account *string `thrift:"account,1,optional" form:"account" json:"account,omitempty" query:"account"` + Version *string `thrift:"version,2,optional" form:"version" json:"version,omitempty" query:"version"` + Beta *bool `thrift:"beta,3,optional" form:"beta" json:"beta,omitempty" query:"beta"` + Phone *string `thrift:"phone,4,optional" form:"phone" json:"phone,omitempty" query:"phone"` + IsLogin *bool `thrift:"isLogin,5,optional" form:"isLogin" json:"isLogin,omitempty" query:"isLogin"` + LoginType *string `thrift:"loginType,6,optional" form:"loginType" json:"loginType,omitempty" query:"loginType"` + Setting *string `thrift:"setting,7,optional" form:"setting" json:"setting,omitempty" query:"setting"` } -func NewGetDumpRequest() *GetDumpRequest { - return &GetDumpRequest{} +func NewGetTestRequest() *GetTestRequest { + return &GetTestRequest{} } -func (p *GetDumpRequest) InitDefault() { +func (p *GetTestRequest) InitDefault() { } -var fieldIDToName_GetDumpRequest = map[int16]string{} +var GetTestRequest_Account_DEFAULT string -func (p *GetDumpRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetTestRequest) GetAccount() (v string) { + if !p.IsSetAccount() { + return GetTestRequest_Account_DEFAULT + } + return *p.Account +} - var fieldTypeId thrift.TType - var fieldId int16 +var GetTestRequest_Version_DEFAULT string - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError +func (p *GetTestRequest) GetVersion() (v string) { + if !p.IsSetVersion() { + return GetTestRequest_Version_DEFAULT } + return *p.Version +} - 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 +var GetTestRequest_Beta_DEFAULT bool + +func (p *GetTestRequest) GetBeta() (v bool) { + if !p.IsSetBeta() { + return GetTestRequest_Beta_DEFAULT } + return *p.Beta +} - 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) +var GetTestRequest_Phone_DEFAULT string -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 *GetTestRequest) GetPhone() (v string) { + if !p.IsSetPhone() { + return GetTestRequest_Phone_DEFAULT + } + return *p.Phone } -func (p *GetDumpRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetDumpRequest"); err != nil { - goto WriteStructBeginError - } - if p != nil { - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError +var GetTestRequest_IsLogin_DEFAULT bool + +func (p *GetTestRequest) GetIsLogin() (v bool) { + if !p.IsSetIsLogin() { + return GetTestRequest_IsLogin_DEFAULT } - 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) + return *p.IsLogin } -func (p *GetDumpRequest) String() string { - if p == nil { - return "" +var GetTestRequest_LoginType_DEFAULT string + +func (p *GetTestRequest) GetLoginType() (v string) { + if !p.IsSetLoginType() { + return GetTestRequest_LoginType_DEFAULT } - return fmt.Sprintf("GetDumpRequest(%+v)", *p) + return *p.LoginType +} + +var GetTestRequest_Setting_DEFAULT string +func (p *GetTestRequest) GetSetting() (v string) { + if !p.IsSetSetting() { + return GetTestRequest_Setting_DEFAULT + } + return *p.Setting } -type GetDumpResponse struct { - Base *model.BaseResp `thrift:"base,1,optional" form:"base" json:"base,omitempty" query:"base"` - Data string `thrift:"data,2" form:"data" json:"data" query:"data"` +var fieldIDToName_GetTestRequest = map[int16]string{ + 1: "account", + 2: "version", + 3: "beta", + 4: "phone", + 5: "isLogin", + 6: "loginType", + 7: "setting", } -func NewGetDumpResponse() *GetDumpResponse { - return &GetDumpResponse{} +func (p *GetTestRequest) IsSetAccount() bool { + return p.Account != nil } -func (p *GetDumpResponse) InitDefault() { +func (p *GetTestRequest) IsSetVersion() bool { + return p.Version != nil } -var GetDumpResponse_Base_DEFAULT *model.BaseResp +func (p *GetTestRequest) IsSetBeta() bool { + return p.Beta != nil +} -func (p *GetDumpResponse) GetBase() (v *model.BaseResp) { - if !p.IsSetBase() { - return GetDumpResponse_Base_DEFAULT - } - return p.Base +func (p *GetTestRequest) IsSetPhone() bool { + return p.Phone != nil } -func (p *GetDumpResponse) GetData() (v string) { - return p.Data +func (p *GetTestRequest) IsSetIsLogin() bool { + return p.IsLogin != nil } -var fieldIDToName_GetDumpResponse = map[int16]string{ - 1: "base", - 2: "data", +func (p *GetTestRequest) IsSetLoginType() bool { + return p.LoginType != nil } -func (p *GetDumpResponse) IsSetBase() bool { - return p.Base != nil +func (p *GetTestRequest) IsSetSetting() bool { + return p.Setting != nil } -func (p *GetDumpResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetTestRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -13464,7 +12862,7 @@ func (p *GetDumpResponse) 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 } @@ -13479,6 +12877,46 @@ func (p *GetDumpResponse) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 3: + if fieldTypeId == thrift.BOOL { + 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.BOOL { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.STRING { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.STRING { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -13498,7 +12936,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_GetDumpResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetTestRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -13508,29 +12946,88 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetDumpResponse) ReadField1(iprot thrift.TProtocol) error { - _field := model.NewBaseResp() - if err := _field.Read(iprot); err != nil { +func (p *GetTestRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { return err + } else { + _field = &v } - p.Base = _field + p.Account = _field return nil } -func (p *GetDumpResponse) ReadField2(iprot thrift.TProtocol) error { +func (p *GetTestRequest) ReadField2(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.Data = _field + p.Version = _field return nil } +func (p *GetTestRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field *bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = &v + } + p.Beta = _field + return nil +} +func (p *GetTestRequest) ReadField4(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Phone = _field + return nil +} +func (p *GetTestRequest) ReadField5(iprot thrift.TProtocol) error { + + var _field *bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = &v + } + p.IsLogin = _field + return nil +} +func (p *GetTestRequest) ReadField6(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.LoginType = _field + return nil +} +func (p *GetTestRequest) ReadField7(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Setting = _field + return nil +} + +func (p *GetTestRequest) Write(oprot thrift.TProtocol) (err error) { -func (p *GetDumpResponse) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetDumpResponse"); err != nil { + if err = oprot.WriteStructBegin("GetTestRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -13542,6 +13039,26 @@ func (p *GetDumpResponse) Write(oprot thrift.TProtocol) (err error) { fieldId = 2 goto WriteFieldError } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -13560,12 +13077,12 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetDumpResponse) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetBase() { - if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { +func (p *GetTestRequest) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetAccount() { + if err = oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } - if err := p.Base.Write(oprot); err != nil { + if err := oprot.WriteString(*p.Account); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -13579,15 +13096,17 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetDumpResponse) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("data", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Data); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError +func (p *GetTestRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetVersion() { + if err = oprot.WriteFieldBegin("version", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Version); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } return nil WriteFieldBeginError: @@ -13596,118 +13115,144 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *GetDumpResponse) String() string { - if p == nil { - return "" +func (p *GetTestRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetBeta() { + if err = oprot.WriteFieldBegin("beta", thrift.BOOL, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(*p.Beta); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } - return fmt.Sprintf("GetDumpResponse(%+v)", *p) - -} - -// common -type GetCSSRequest struct { -} - -func NewGetCSSRequest() *GetCSSRequest { - return &GetCSSRequest{} -} - -func (p *GetCSSRequest) InitDefault() { + 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) } -var fieldIDToName_GetCSSRequest = map[int16]string{} - -func (p *GetCSSRequest) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break +func (p *GetTestRequest) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetPhone() { + if err = oprot.WriteFieldBegin("phone", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError } - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldTypeError + if err := oprot.WriteString(*p.Phone); err != nil { + return err } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError } } - 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) -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) +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 *GetCSSRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetCSSRequest"); err != nil { - goto WriteStructBeginError - } - if p != nil { +func (p *GetTestRequest) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetIsLogin() { + if err = oprot.WriteFieldBegin("isLogin", thrift.BOOL, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(*p.IsLogin); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError + 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 *GetTestRequest) writeField6(oprot thrift.TProtocol) (err error) { + if p.IsSetLoginType() { + if err = oprot.WriteFieldBegin("loginType", thrift.STRING, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.LoginType); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *GetTestRequest) writeField7(oprot thrift.TProtocol) (err error) { + if p.IsSetSetting() { + if err = oprot.WriteFieldBegin("setting", thrift.STRING, 7); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Setting); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } 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) +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) } -func (p *GetCSSRequest) String() string { +func (p *GetTestRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetCSSRequest(%+v)", *p) + return fmt.Sprintf("GetTestRequest(%+v)", *p) } -type GetCSSResponse struct { - CSS []byte `thrift:"css,1" form:"css" json:"css" query:"css"` +type GetTestResponse struct { + Base *model.BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` + CloudSetting []byte `thrift:"cloud_setting,2" form:"cloud_setting" json:"cloud_setting" query:"cloud_setting"` } -func NewGetCSSResponse() *GetCSSResponse { - return &GetCSSResponse{} +func NewGetTestResponse() *GetTestResponse { + return &GetTestResponse{} } -func (p *GetCSSResponse) InitDefault() { +func (p *GetTestResponse) InitDefault() { } -func (p *GetCSSResponse) GetCSS() (v []byte) { - return p.CSS +var GetTestResponse_Base_DEFAULT *model.BaseResp + +func (p *GetTestResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return GetTestResponse_Base_DEFAULT + } + return p.Base } -var fieldIDToName_GetCSSResponse = map[int16]string{ - 1: "css", +func (p *GetTestResponse) GetCloudSetting() (v []byte) { + return p.CloudSetting } -func (p *GetCSSResponse) Read(iprot thrift.TProtocol) (err error) { +var fieldIDToName_GetTestResponse = map[int16]string{ + 1: "base", + 2: "cloud_setting", +} + +func (p *GetTestResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *GetTestResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -13727,13 +13272,21 @@ func (p *GetCSSResponse) Read(iprot thrift.TProtocol) (err error) { switch fieldId { case 1: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.STRUCT { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 2: + if fieldTypeId == thrift.STRING { + 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 @@ -13753,7 +13306,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_GetCSSResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetTestResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -13763,7 +13316,15 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetCSSResponse) ReadField1(iprot thrift.TProtocol) error { +func (p *GetTestResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *GetTestResponse) ReadField2(iprot thrift.TProtocol) error { var _field []byte if v, err := iprot.ReadBinary(); err != nil { @@ -13771,13 +13332,14 @@ func (p *GetCSSResponse) ReadField1(iprot thrift.TProtocol) error { } else { _field = []byte(v) } - p.CSS = _field + p.CloudSetting = _field return nil } -func (p *GetCSSResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *GetTestResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetCSSResponse"); err != nil { + if err = oprot.WriteStructBegin("GetTestResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -13785,6 +13347,10 @@ func (p *GetCSSResponse) Write(oprot thrift.TProtocol) (err error) { fieldId = 1 goto WriteFieldError } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -13803,11 +13369,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetCSSResponse) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("css", thrift.STRING, 1); err != nil { +func (p *GetTestResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteBinary([]byte(p.CSS)); err != nil { + if err := p.Base.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -13820,27 +13386,44 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetCSSResponse) String() string { +func (p *GetTestResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("cloud_setting", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBinary([]byte(p.CloudSetting)); 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 *GetTestResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetCSSResponse(%+v)", *p) + return fmt.Sprintf("GetTestResponse(%+v)", *p) } -type GetHtmlRequest struct { +type GetCloudRequest struct { } -func NewGetHtmlRequest() *GetHtmlRequest { - return &GetHtmlRequest{} +func NewGetCloudRequest() *GetCloudRequest { + return &GetCloudRequest{} } -func (p *GetHtmlRequest) InitDefault() { +func (p *GetCloudRequest) InitDefault() { } -var fieldIDToName_GetHtmlRequest = map[int16]string{} +var fieldIDToName_GetCloudRequest = map[int16]string{} -func (p *GetHtmlRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetCloudRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -13882,8 +13465,9 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetHtmlRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetHtmlRequest"); err != nil { +func (p *GetCloudRequest) Write(oprot thrift.TProtocol) (err error) { + + if err = oprot.WriteStructBegin("GetCloudRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -13903,34 +13487,49 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetHtmlRequest) String() string { +func (p *GetCloudRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetHtmlRequest(%+v)", *p) + return fmt.Sprintf("GetCloudRequest(%+v)", *p) } -type GetHtmlResponse struct { - HTML []byte `thrift:"html,1" form:"html" json:"html" query:"html"` +type GetCloudResponse struct { + Base *model.BaseResp `thrift:"base,1,optional" form:"base" json:"base,omitempty" query:"base"` + CloudSetting []byte `thrift:"cloud_setting,2" form:"cloud_setting" json:"cloud_setting" query:"cloud_setting"` } -func NewGetHtmlResponse() *GetHtmlResponse { - return &GetHtmlResponse{} +func NewGetCloudResponse() *GetCloudResponse { + return &GetCloudResponse{} } -func (p *GetHtmlResponse) InitDefault() { +func (p *GetCloudResponse) InitDefault() { } -func (p *GetHtmlResponse) GetHTML() (v []byte) { - return p.HTML +var GetCloudResponse_Base_DEFAULT *model.BaseResp + +func (p *GetCloudResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return GetCloudResponse_Base_DEFAULT + } + return p.Base } -var fieldIDToName_GetHtmlResponse = map[int16]string{ - 1: "html", +func (p *GetCloudResponse) GetCloudSetting() (v []byte) { + return p.CloudSetting } -func (p *GetHtmlResponse) Read(iprot thrift.TProtocol) (err error) { +var fieldIDToName_GetCloudResponse = map[int16]string{ + 1: "base", + 2: "cloud_setting", +} + +func (p *GetCloudResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *GetCloudResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -13950,13 +13549,21 @@ func (p *GetHtmlResponse) Read(iprot thrift.TProtocol) (err error) { switch fieldId { case 1: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.STRUCT { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 2: + if fieldTypeId == thrift.STRING { + 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 @@ -13976,7 +13583,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_GetHtmlResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetCloudResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -13986,7 +13593,15 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetHtmlResponse) ReadField1(iprot thrift.TProtocol) error { +func (p *GetCloudResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *GetCloudResponse) ReadField2(iprot thrift.TProtocol) error { var _field []byte if v, err := iprot.ReadBinary(); err != nil { @@ -13994,13 +13609,14 @@ func (p *GetHtmlResponse) ReadField1(iprot thrift.TProtocol) error { } else { _field = []byte(v) } - p.HTML = _field + p.CloudSetting = _field return nil } -func (p *GetHtmlResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *GetCloudResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetHtmlResponse"); err != nil { + if err = oprot.WriteStructBegin("GetCloudResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -14008,6 +13624,10 @@ func (p *GetHtmlResponse) Write(oprot thrift.TProtocol) (err error) { fieldId = 1 goto WriteFieldError } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -14026,11 +13646,30 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetHtmlResponse) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("html", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteBinary([]byte(p.HTML)); err != nil { +func (p *GetCloudResponse) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + 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 *GetCloudResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("cloud_setting", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBinary([]byte(p.CloudSetting)); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -14038,35 +13677,50 @@ func (p *GetHtmlResponse) writeField1(oprot thrift.TProtocol) (err error) { } return nil WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *GetHtmlResponse) String() string { +func (p *GetCloudResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetHtmlResponse(%+v)", *p) + return fmt.Sprintf("GetCloudResponse(%+v)", *p) } -type GetUserAgreementRequest struct { +type SetCloudRequest struct { + Password string `thrift:"password,1,required" form:"password,required" json:"password,required" query:"password,required"` + Setting string `thrift:"setting,2,required" form:"setting,required" json:"setting,required" query:"setting,required"` } -func NewGetUserAgreementRequest() *GetUserAgreementRequest { - return &GetUserAgreementRequest{} +func NewSetCloudRequest() *SetCloudRequest { + return &SetCloudRequest{} } -func (p *GetUserAgreementRequest) InitDefault() { +func (p *SetCloudRequest) InitDefault() { } -var fieldIDToName_GetUserAgreementRequest = map[int16]string{} +func (p *SetCloudRequest) GetPassword() (v string) { + return p.Password +} -func (p *GetUserAgreementRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *SetCloudRequest) GetSetting() (v string) { + return p.Setting +} + +var fieldIDToName_SetCloudRequest = map[int16]string{ + 1: "password", + 2: "setting", +} + +func (p *SetCloudRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 + var issetPassword bool = false + var issetSetting bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -14080,8 +13734,30 @@ func (p *GetUserAgreementRequest) Read(iprot thrift.TProtocol) (err error) { if fieldTypeId == thrift.STOP { break } - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldTypeError + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetPassword = 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 + } + issetSetting = 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 @@ -14091,25 +13767,71 @@ func (p *GetUserAgreementRequest) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } + if !issetPassword { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetSetting { + 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) -SkipFieldTypeError: - return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, fieldTypeId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SetCloudRequest[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_SetCloudRequest[fieldId])) } -func (p *GetUserAgreementRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetUserAgreementRequest"); err != nil { +func (p *SetCloudRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Password = _field + return nil +} +func (p *SetCloudRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Setting = _field + return nil +} + +func (p *SetCloudRequest) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("SetCloudRequest"); 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 @@ -14120,40 +13842,85 @@ func (p *GetUserAgreementRequest) 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 *GetUserAgreementRequest) String() string { +func (p *SetCloudRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("password", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Password); 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 *SetCloudRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("setting", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Setting); 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 *SetCloudRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetUserAgreementRequest(%+v)", *p) + return fmt.Sprintf("SetCloudRequest(%+v)", *p) } -type GetUserAgreementResponse struct { - UserAgreement []byte `thrift:"user_agreement,1" form:"user_agreement" json:"user_agreement" query:"user_agreement"` +type SetCloudResponse struct { + Base *model.BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` } -func NewGetUserAgreementResponse() *GetUserAgreementResponse { - return &GetUserAgreementResponse{} +func NewSetCloudResponse() *SetCloudResponse { + return &SetCloudResponse{} } -func (p *GetUserAgreementResponse) InitDefault() { +func (p *SetCloudResponse) InitDefault() { } -func (p *GetUserAgreementResponse) GetUserAgreement() (v []byte) { - return p.UserAgreement +var SetCloudResponse_Base_DEFAULT *model.BaseResp + +func (p *SetCloudResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return SetCloudResponse_Base_DEFAULT + } + return p.Base } -var fieldIDToName_GetUserAgreementResponse = map[int16]string{ - 1: "user_agreement", +var fieldIDToName_SetCloudResponse = map[int16]string{ + 1: "base", } -func (p *GetUserAgreementResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *SetCloudResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *SetCloudResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -14173,7 +13940,7 @@ func (p *GetUserAgreementResponse) Read(iprot thrift.TProtocol) (err error) { switch fieldId { case 1: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.STRUCT { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } @@ -14199,7 +13966,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_GetUserAgreementResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SetCloudResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -14209,21 +13976,19 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetUserAgreementResponse) ReadField1(iprot thrift.TProtocol) error { - - var _field []byte - if v, err := iprot.ReadBinary(); err != nil { +func (p *SetCloudResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { return err - } else { - _field = []byte(v) } - p.UserAgreement = _field + p.Base = _field return nil } -func (p *GetUserAgreementResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *SetCloudResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetUserAgreementResponse"); err != nil { + if err = oprot.WriteStructBegin("SetCloudResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -14249,11 +14014,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetUserAgreementResponse) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("user_agreement", thrift.STRING, 1); err != nil { +func (p *SetCloudResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteBinary([]byte(p.UserAgreement)); err != nil { + if err := p.Base.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -14266,28 +14031,27 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetUserAgreementResponse) String() string { +func (p *SetCloudResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetUserAgreementResponse(%+v)", *p) + return fmt.Sprintf("SetCloudResponse(%+v)", *p) } -// 学期列表 -type TermListRequest struct { +type GetDumpRequest struct { } -func NewTermListRequest() *TermListRequest { - return &TermListRequest{} +func NewGetDumpRequest() *GetDumpRequest { + return &GetDumpRequest{} } -func (p *TermListRequest) InitDefault() { +func (p *GetDumpRequest) InitDefault() { } -var fieldIDToName_TermListRequest = map[int16]string{} +var fieldIDToName_GetDumpRequest = map[int16]string{} -func (p *TermListRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetDumpRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -14329,10 +14093,11 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *TermListRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("TermListRequest"); err != nil { - goto WriteStructBeginError - } +func (p *GetDumpRequest) Write(oprot thrift.TProtocol) (err error) { + + if err = oprot.WriteStructBegin("GetDumpRequest"); err != nil { + goto WriteStructBeginError + } if p != nil { } if err = oprot.WriteFieldStop(); err != nil { @@ -14350,63 +14115,52 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *TermListRequest) String() string { +func (p *GetDumpRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("TermListRequest(%+v)", *p) + return fmt.Sprintf("GetDumpRequest(%+v)", *p) } -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"` +type GetDumpResponse struct { + Base *model.BaseResp `thrift:"base,1,optional" form:"base" json:"base,omitempty" query:"base"` + Data string `thrift:"data,2" form:"data" json:"data" query:"data"` } -func NewTermListResponse() *TermListResponse { - return &TermListResponse{} +func NewGetDumpResponse() *GetDumpResponse { + return &GetDumpResponse{} } -func (p *TermListResponse) InitDefault() { +func (p *GetDumpResponse) InitDefault() { } -var TermListResponse_Base_DEFAULT *model.BaseResp +var GetDumpResponse_Base_DEFAULT *model.BaseResp -func (p *TermListResponse) GetBase() (v *model.BaseResp) { +func (p *GetDumpResponse) GetBase() (v *model.BaseResp) { if !p.IsSetBase() { - return TermListResponse_Base_DEFAULT + return GetDumpResponse_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 *GetDumpResponse) GetData() (v string) { + return p.Data } -var fieldIDToName_TermListResponse = map[int16]string{ +var fieldIDToName_GetDumpResponse = map[int16]string{ 1: "base", - 2: "term_lists", + 2: "data", } -func (p *TermListResponse) IsSetBase() bool { +func (p *GetDumpResponse) IsSetBase() bool { return p.Base != nil } -func (p *TermListResponse) IsSetTermLists() bool { - return p.TermLists != nil -} - -func (p *TermListResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetDumpResponse) 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 @@ -14427,16 +14181,14 @@ func (p *TermListResponse) Read(iprot thrift.TProtocol) (err error) { 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 fieldTypeId == thrift.STRING { if err = p.ReadField2(iprot); err != nil { goto ReadFieldError } - issetTermLists = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -14453,22 +14205,13 @@ func (p *TermListResponse) Read(iprot thrift.TProtocol) (err error) { 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) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetDumpResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -14476,11 +14219,9 @@ 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 { +func (p *GetDumpResponse) ReadField1(iprot thrift.TProtocol) error { _field := model.NewBaseResp() if err := _field.Read(iprot); err != nil { return err @@ -14488,18 +14229,22 @@ func (p *TermListResponse) ReadField1(iprot thrift.TProtocol) error { p.Base = _field return nil } -func (p *TermListResponse) ReadField2(iprot thrift.TProtocol) error { - _field := model.NewTermList() - if err := _field.Read(iprot); err != nil { +func (p *GetDumpResponse) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { return err + } else { + _field = v } - p.TermLists = _field + p.Data = _field return nil } -func (p *TermListResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *GetDumpResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("TermListResponse"); err != nil { + if err = oprot.WriteStructBegin("GetDumpResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -14529,15 +14274,17 @@ 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 +func (p *GetDumpResponse) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + 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: @@ -14546,11 +14293,11 @@ 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 { +func (p *GetDumpResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("data", thrift.STRING, 2); err != nil { goto WriteFieldBeginError } - if err := p.TermLists.Write(oprot); err != nil { + if err := oprot.WriteString(p.Data); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -14563,39 +14310,122 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *TermListResponse) String() string { +func (p *GetDumpResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("TermListResponse(%+v)", *p) + return fmt.Sprintf("GetDumpResponse(%+v)", *p) } -// 学期信息 -type TermRequest struct { - Term string `thrift:"term,1,required" form:"term,required" json:"term,required" query:"term,required"` +// common +type GetCSSRequest struct { } -func NewTermRequest() *TermRequest { - return &TermRequest{} +func NewGetCSSRequest() *GetCSSRequest { + return &GetCSSRequest{} } -func (p *TermRequest) InitDefault() { +func (p *GetCSSRequest) InitDefault() { } -func (p *TermRequest) GetTerm() (v string) { - return p.Term +var fieldIDToName_GetCSSRequest = map[int16]string{} + +func (p *GetCSSRequest) 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 + } + 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 + } + + 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) } -var fieldIDToName_TermRequest = map[int16]string{ - 1: "term", +func (p *GetCSSRequest) Write(oprot thrift.TProtocol) (err error) { + + if err = oprot.WriteStructBegin("GetCSSRequest"); err != nil { + goto WriteStructBeginError + } + if p != 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) } -func (p *TermRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetCSSRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetCSSRequest(%+v)", *p) + +} + +type GetCSSResponse struct { + CSS []byte `thrift:"css,1" form:"css" json:"css" query:"css"` +} + +func NewGetCSSResponse() *GetCSSResponse { + return &GetCSSResponse{} +} + +func (p *GetCSSResponse) InitDefault() { +} + +func (p *GetCSSResponse) GetCSS() (v []byte) { + return p.CSS +} + +var fieldIDToName_GetCSSResponse = map[int16]string{ + 1: "css", +} + +func (p *GetCSSResponse) 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 @@ -14616,7 +14446,6 @@ func (p *TermRequest) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetTerm = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -14633,17 +14462,13 @@ func (p *TermRequest) 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_TermRequest[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetCSSResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -14651,25 +14476,24 @@ 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 *TermRequest) ReadField1(iprot thrift.TProtocol) error { +func (p *GetCSSResponse) ReadField1(iprot thrift.TProtocol) error { - var _field string - if v, err := iprot.ReadString(); err != nil { + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { return err } else { - _field = v + _field = []byte(v) } - p.Term = _field + p.CSS = _field return nil } -func (p *TermRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *GetCSSResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("TermRequest"); err != nil { + if err = oprot.WriteStructBegin("GetCSSResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -14695,11 +14519,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *TermRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("term", thrift.STRING, 1); err != nil { +func (p *GetCSSResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("css", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(p.Term); err != nil { + if err := oprot.WriteBinary([]byte(p.CSS)); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -14712,63 +14536,121 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *TermRequest) String() string { +func (p *GetCSSResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("TermRequest(%+v)", *p) + return fmt.Sprintf("GetCSSResponse(%+v)", *p) } -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"` +type GetHtmlRequest struct { } -func NewTermResponse() *TermResponse { - return &TermResponse{} +func NewGetHtmlRequest() *GetHtmlRequest { + return &GetHtmlRequest{} } -func (p *TermResponse) InitDefault() { +func (p *GetHtmlRequest) InitDefault() { } -var TermResponse_Base_DEFAULT *model.BaseResp +var fieldIDToName_GetHtmlRequest = map[int16]string{} -func (p *TermResponse) GetBase() (v *model.BaseResp) { - if !p.IsSetBase() { - return TermResponse_Base_DEFAULT +func (p *GetHtmlRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } - return p.Base + + 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 + } + + 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) } -var TermResponse_TermInfo_DEFAULT *model.TermInfo +func (p *GetHtmlRequest) Write(oprot thrift.TProtocol) (err error) { -func (p *TermResponse) GetTermInfo() (v *model.TermInfo) { - if !p.IsSetTermInfo() { - return TermResponse_TermInfo_DEFAULT + if err = oprot.WriteStructBegin("GetHtmlRequest"); err != nil { + goto WriteStructBeginError } - return p.TermInfo + if p != 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) } -var fieldIDToName_TermResponse = map[int16]string{ - 1: "base", - 2: "term_info", +func (p *GetHtmlRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetHtmlRequest(%+v)", *p) + } -func (p *TermResponse) IsSetBase() bool { - return p.Base != nil +type GetHtmlResponse struct { + HTML []byte `thrift:"html,1" form:"html" json:"html" query:"html"` } -func (p *TermResponse) IsSetTermInfo() bool { - return p.TermInfo != nil +func NewGetHtmlResponse() *GetHtmlResponse { + return &GetHtmlResponse{} } -func (p *TermResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetHtmlResponse) InitDefault() { +} + +func (p *GetHtmlResponse) GetHTML() (v []byte) { + return p.HTML +} + +var fieldIDToName_GetHtmlResponse = map[int16]string{ + 1: "html", +} + +func (p *GetHtmlResponse) 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 @@ -14785,20 +14667,10 @@ func (p *TermResponse) 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 } - 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 } @@ -14815,22 +14687,13 @@ func (p *TermResponse) 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_TermResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetHtmlResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -14838,30 +14701,24 @@ 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 *TermResponse) ReadField1(iprot thrift.TProtocol) error { - _field := model.NewBaseResp() - if err := _field.Read(iprot); err != nil { - return err - } - p.Base = _field - return nil -} -func (p *TermResponse) ReadField2(iprot thrift.TProtocol) error { - _field := model.NewTermInfo() - if err := _field.Read(iprot); err != nil { +func (p *GetHtmlResponse) ReadField1(iprot thrift.TProtocol) error { + + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { return err + } else { + _field = []byte(v) } - p.TermInfo = _field + p.HTML = _field return nil } -func (p *TermResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *GetHtmlResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("TermResponse"); err != nil { + if err = oprot.WriteStructBegin("GetHtmlResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -14869,10 +14726,6 @@ func (p *TermResponse) Write(oprot thrift.TProtocol) (err error) { fieldId = 1 goto WriteFieldError } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -14891,11 +14744,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *TermResponse) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { +func (p *GetHtmlResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("html", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } - if err := p.Base.Write(oprot); err != nil { + if err := oprot.WriteBinary([]byte(p.HTML)); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -14908,433 +14761,1317 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -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 { +func (p *GetHtmlResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("TermResponse(%+v)", *p) + return fmt.Sprintf("GetHtmlResponse(%+v)", *p) } -type ClassRoomService interface { - GetEmptyClassrooms(ctx context.Context, request *EmptyClassroomRequest) (r *EmptyClassroomResponse, err error) - - GetExamRoomInfo(ctx context.Context, request *ExamRoomInfoRequest) (r *ExamRoomInfoResponse, err error) +type GetUserAgreementRequest struct { } -type ClassRoomServiceClient struct { - c thrift.TClient +func NewGetUserAgreementRequest() *GetUserAgreementRequest { + return &GetUserAgreementRequest{} } -func NewClassRoomServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *ClassRoomServiceClient { - return &ClassRoomServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), - } +func (p *GetUserAgreementRequest) InitDefault() { } -func NewClassRoomServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *ClassRoomServiceClient { - return &ClassRoomServiceClient{ - c: thrift.NewTStandardClient(iprot, oprot), +var fieldIDToName_GetUserAgreementRequest = map[int16]string{} + +func (p *GetUserAgreementRequest) 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 *GetUserAgreementRequest) Write(oprot thrift.TProtocol) (err error) { + + if err = oprot.WriteStructBegin("GetUserAgreementRequest"); 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) +func (p *GetUserAgreementRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetUserAgreementRequest(%+v)", *p) - ValidateCode(ctx context.Context, request *ValidateCodeRequest) (r *ValidateCodeResponse, err error) +} - ValidateCodeForAndroid(ctx context.Context, request *ValidateCodeForAndroidRequest) (r *ValidateCodeForAndroidResponse, err error) +type GetUserAgreementResponse struct { + UserAgreement []byte `thrift:"user_agreement,1" form:"user_agreement" json:"user_agreement" query:"user_agreement"` +} - GetToken(ctx context.Context, request *GetAccessTokenRequest) (r *GetAccessTokenResponse, err error) +func NewGetUserAgreementResponse() *GetUserAgreementResponse { + return &GetUserAgreementResponse{} +} - RefreshToken(ctx context.Context, request *RefreshTokenRequest) (r *RefreshTokenResponse, err error) +func (p *GetUserAgreementResponse) InitDefault() { +} - TestAuth(ctx context.Context, request *TestAuthRequest) (r *TestAuthResponse, err error) +func (p *GetUserAgreementResponse) GetUserAgreement() (v []byte) { + return p.UserAgreement } -type UserServiceClient struct { - c thrift.TClient +var fieldIDToName_GetUserAgreementResponse = map[int16]string{ + 1: "user_agreement", } -func NewUserServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *UserServiceClient { - return &UserServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), +func (p *GetUserAgreementResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } -} -func NewUserServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *UserServiceClient { - return &UserServiceClient{ - c: thrift.NewTStandardClient(iprot, oprot), + 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 + } + 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_GetUserAgreementResponse[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 NewUserServiceClient(c thrift.TClient) *UserServiceClient { - return &UserServiceClient{ - c: c, +func (p *GetUserAgreementResponse) ReadField1(iprot thrift.TProtocol) error { + + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { + return err + } else { + _field = []byte(v) } + p.UserAgreement = _field + return nil } -func (p *UserServiceClient) Client_() thrift.TClient { - return p.c -} +func (p *GetUserAgreementResponse) Write(oprot thrift.TProtocol) (err error) { -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 + var fieldId int16 + if err = oprot.WriteStructBegin("GetUserAgreementResponse"); err != nil { + goto WriteStructBeginError } - 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 p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } } - 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 err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError } - 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 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 *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 *GetUserAgreementResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("user_agreement", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError } - 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 + if err := oprot.WriteBinary([]byte(p.UserAgreement)); err != nil { + return err } - return _result.GetSuccess(), nil -} - -type CourseService interface { - GetCourseList(ctx context.Context, req *CourseListRequest) (r *CourseListResponse, err error) -} - -type CourseServiceClient struct { - c thrift.TClient -} - -func NewCourseServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *CourseServiceClient { - return &CourseServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + 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 NewCourseServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *CourseServiceClient { - return &CourseServiceClient{ - c: thrift.NewTStandardClient(iprot, oprot), +func (p *GetUserAgreementResponse) String() string { + if p == nil { + return "" } + return fmt.Sprintf("GetUserAgreementResponse(%+v)", *p) + } -func NewCourseServiceClient(c thrift.TClient) *CourseServiceClient { - return &CourseServiceClient{ - c: c, - } +// 学期列表 +type TermListRequest struct { } -func (p *CourseServiceClient) Client_() thrift.TClient { - return p.c +func NewTermListRequest() *TermListRequest { + return &TermListRequest{} } -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 _result.GetSuccess(), nil +func (p *TermListRequest) InitDefault() { } -type LaunchScreenService interface { - CreateImage(ctx context.Context, req *CreateImageRequest) (r *CreateImageResponse, err error) +var fieldIDToName_TermListRequest = map[int16]string{} - GetImage(ctx context.Context, req *GetImageRequest) (r *GetImageResponse, err error) +func (p *TermListRequest) Read(iprot thrift.TProtocol) (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) -} - -type LaunchScreenServiceClient struct { - c thrift.TClient -} + var fieldTypeId thrift.TType + var fieldId int16 -func NewLaunchScreenServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *LaunchScreenServiceClient { - return &LaunchScreenServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } -} -func NewLaunchScreenServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *LaunchScreenServiceClient { - return &LaunchScreenServiceClient{ - c: thrift.NewTStandardClient(iprot, oprot), + 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 + } } -} - -func NewLaunchScreenServiceClient(c thrift.TClient) *LaunchScreenServiceClient { - return &LaunchScreenServiceClient{ - c: c, + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError } -} -func (p *LaunchScreenServiceClient) 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) -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 - } - 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 _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 - } - return _result.GetSuccess(), nil +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 *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 *TermListRequest) Write(oprot thrift.TProtocol) (err error) { + + if err = oprot.WriteStructBegin("TermListRequest"); err != nil { + goto WriteStructBeginError } - 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 p != nil { } - 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.WriteFieldStop(); err != nil { + goto WriteFieldStopError } - 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 + 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) +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 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 *TermListRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TermListRequest(%+v)", *p) - GetDownloadUrlForAndroid(ctx context.Context, req *GetDownloadUrlForAndroidRequest) (r *GetDownloadUrlForAndroidResponse, err error) } -type PaperServiceClient 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 NewPaperServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *PaperServiceClient { - return &PaperServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), - } +func NewTermListResponse() *TermListResponse { + return &TermListResponse{} } -func NewPaperServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *PaperServiceClient { - return &PaperServiceClient{ - c: thrift.NewTStandardClient(iprot, oprot), - } +func (p *TermListResponse) InitDefault() { } -func NewPaperServiceClient(c thrift.TClient) *PaperServiceClient { - return &PaperServiceClient{ - 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 *PaperServiceClient) Client_() thrift.TClient { - return p.c -} +var TermListResponse_TermLists_DEFAULT *model.TermList -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 *TermListResponse) GetTermLists() (v *model.TermList) { + if !p.IsSetTermLists() { + return TermListResponse_TermLists_DEFAULT } - return _result.GetSuccess(), nil + return p.TermLists } -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 fieldIDToName_TermListResponse = map[int16]string{ + 1: "base", + 2: "term_lists", } -type AcademicServiceClient struct { - c thrift.TClient +func (p *TermListResponse) IsSetBase() bool { + return p.Base != nil } -func NewAcademicServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *AcademicServiceClient { - return &AcademicServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), - } +func (p *TermListResponse) IsSetTermLists() bool { + return p.TermLists != nil } -func NewAcademicServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *AcademicServiceClient { - return &AcademicServiceClient{ - c: thrift.NewTStandardClient(iprot, oprot), - } -} +func (p *TermListResponse) Read(iprot thrift.TProtocol) (err error) { -func NewAcademicServiceClient(c thrift.TClient) *AcademicServiceClient { - return &AcademicServiceClient{ - c: c, - } -} + var fieldTypeId thrift.TType + var fieldId int16 + var issetBase bool = false + var issetTermLists bool = false -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) { + 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) + +} + +// 学期信息 +type TermRequest struct { + Term string `thrift:"term,1,required" form:"term,required" json:"term,required" query:"term,required"` +} + +func NewTermRequest() *TermRequest { + return &TermRequest{} +} + +func (p *TermRequest) InitDefault() { +} + +func (p *TermRequest) GetTerm() (v string) { + return p.Term +} + +var fieldIDToName_TermRequest = map[int16]string{ + 1: "term", +} + +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 + } + + 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 + } + 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 + } + + 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) + +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 *TermRequest) ReadField1(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 *TermRequest) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("TermRequest"); 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 *TermRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("term", thrift.STRING, 1); 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 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *TermRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TermRequest(%+v)", *p) + +} + +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"` +} + +func NewTermResponse() *TermResponse { + return &TermResponse{} +} + +func (p *TermResponse) InitDefault() { +} + +var TermResponse_Base_DEFAULT *model.BaseResp + +func (p *TermResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return TermResponse_Base_DEFAULT + } + return p.Base +} + +var TermResponse_TermInfo_DEFAULT *model.TermInfo + +func (p *TermResponse) GetTermInfo() (v *model.TermInfo) { + if !p.IsSetTermInfo() { + return TermResponse_TermInfo_DEFAULT + } + return p.TermInfo +} + +var fieldIDToName_TermResponse = map[int16]string{ + 1: "base", + 2: "term_info", +} + +func (p *TermResponse) IsSetBase() bool { + return p.Base != nil +} + +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 + } + + 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 + } + } + if err = iprot.ReadStructEnd(); err != nil { + 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_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 *TermResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + 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 *TermResponse) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("TermResponse"); 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 *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 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +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("TermResponse(%+v)", *p) + +} + +type ClassRoomService interface { + GetEmptyClassrooms(ctx context.Context, request *EmptyClassroomRequest) (r *EmptyClassroomResponse, err error) + + GetExamRoomInfo(ctx context.Context, request *ExamRoomInfoRequest) (r *ExamRoomInfoResponse, err error) +} + +type ClassRoomServiceClient struct { + c thrift.TClient +} + +func NewClassRoomServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *ClassRoomServiceClient { + return &ClassRoomServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewClassRoomServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *ClassRoomServiceClient { + return &ClassRoomServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewClassRoomServiceClient(c thrift.TClient) *ClassRoomServiceClient { + return &ClassRoomServiceClient{ + c: c, + } +} + +func (p *ClassRoomServiceClient) Client_() thrift.TClient { + return p.c +} + +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 *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 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) + + TestAuth(ctx context.Context, request *TestAuthRequest) (r *TestAuthResponse, err error) + + GetUserInfo(ctx context.Context, request *GetUserInfoRequest) (r *GetUserInfoResponse, err error) +} + +type UserServiceClient struct { + c thrift.TClient +} + +func NewUserServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *UserServiceClient { + return &UserServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewUserServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *UserServiceClient { + return &UserServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewUserServiceClient(c thrift.TClient) *UserServiceClient { + return &UserServiceClient{ + c: c, + } +} + +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 + } + 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 + } + 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 _result.GetSuccess(), nil +} +func (p *UserServiceClient) GetUserInfo(ctx context.Context, request *GetUserInfoRequest) (r *GetUserInfoResponse, err error) { + var _args UserServiceGetUserInfoArgs + _args.Request = request + var _result UserServiceGetUserInfoResult + if err = p.Client_().Call(ctx, "GetUserInfo", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +type CourseService interface { + GetCourseList(ctx context.Context, req *CourseListRequest) (r *CourseListResponse, err error) +} + +type CourseServiceClient struct { + c thrift.TClient +} + +func NewCourseServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *CourseServiceClient { + return &CourseServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewCourseServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *CourseServiceClient { + return &CourseServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewCourseServiceClient(c thrift.TClient) *CourseServiceClient { + return &CourseServiceClient{ + c: c, + } +} + +func (p *CourseServiceClient) Client_() thrift.TClient { + return p.c +} + +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 _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) + + AddImagePointTime(ctx context.Context, req *AddImagePointTimeRequest) (r *AddImagePointTimeResponse, err error) +} + +type LaunchScreenServiceClient struct { + c thrift.TClient +} + +func NewLaunchScreenServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *LaunchScreenServiceClient { + return &LaunchScreenServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewLaunchScreenServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *LaunchScreenServiceClient { + return &LaunchScreenServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewLaunchScreenServiceClient(c thrift.TClient) *LaunchScreenServiceClient { + return &LaunchScreenServiceClient{ + c: c, + } +} + +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 + } + 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 _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 + } + return _result.GetSuccess(), nil +} +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 + } + 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 + } + 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 + } + 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 _result.GetSuccess(), nil +} + +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)), + } +} + +func NewPaperServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *PaperServiceClient { + return &PaperServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewPaperServiceClient(c thrift.TClient) *PaperServiceClient { + return &PaperServiceClient{ + c: c, + } +} + +func (p *PaperServiceClient) Client_() thrift.TClient { + return p.c +} + +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 +} + +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) + + GetPlan(ctx context.Context, req *GetPlanRequest) (r *GetPlanResponse, err error) +} + +type AcademicServiceClient struct { + c thrift.TClient +} + +func NewAcademicServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *AcademicServiceClient { + return &AcademicServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewAcademicServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *AcademicServiceClient { + return &AcademicServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewAcademicServiceClient(c thrift.TClient) *AcademicServiceClient { + return &AcademicServiceClient{ + c: c, + } +} + +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 @@ -15370,6 +16107,15 @@ func (p *AcademicServiceClient) GetUnifiedExam(ctx context.Context, req *GetUnif } return _result.GetSuccess(), nil } +func (p *AcademicServiceClient) GetPlan(ctx context.Context, req *GetPlanRequest) (r *GetPlanResponse, err error) { + var _args AcademicServiceGetPlanArgs + _args.Req = req + var _result AcademicServiceGetPlanResult + if err = p.Client_().Call(ctx, "GetPlan", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} type VersionService interface { Login(ctx context.Context, req *LoginRequest) (r *LoginResponse, err error) @@ -15848,6 +16594,7 @@ func (p *ClassRoomServiceGetEmptyClassroomsArgs) ReadField1(iprot thrift.TProtoc } func (p *ClassRoomServiceGetEmptyClassroomsArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetEmptyClassrooms_args"); err != nil { goto WriteStructBeginError @@ -15994,6 +16741,7 @@ func (p *ClassRoomServiceGetEmptyClassroomsResult) ReadField0(iprot thrift.TProt } func (p *ClassRoomServiceGetEmptyClassroomsResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetEmptyClassrooms_result"); err != nil { goto WriteStructBeginError @@ -16142,6 +16890,7 @@ func (p *ClassRoomServiceGetExamRoomInfoArgs) ReadField1(iprot thrift.TProtocol) } func (p *ClassRoomServiceGetExamRoomInfoArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetExamRoomInfo_args"); err != nil { goto WriteStructBeginError @@ -16288,6 +17037,7 @@ func (p *ClassRoomServiceGetExamRoomInfoResult) ReadField0(iprot thrift.TProtoco } func (p *ClassRoomServiceGetExamRoomInfoResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetExamRoomInfo_result"); err != nil { goto WriteStructBeginError @@ -16368,36 +17118,181 @@ func NewUserServiceProcessor(handler UserService) *UserServiceProcessor { self.AddToProcessorMap("GetToken", &userServiceProcessorGetToken{handler: handler}) self.AddToProcessorMap("RefreshToken", &userServiceProcessorRefreshToken{handler: handler}) self.AddToProcessorMap("TestAuth", &userServiceProcessorTestAuth{handler: handler}) + self.AddToProcessorMap("GetUserInfo", &userServiceProcessorGetUserInfo{handler: handler}) return self } 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 + 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 userServiceProcessorGetLoginData struct { + handler UserService +} + +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 + } + + 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 err2 = oprot.WriteMessageBegin("GetLoginData", 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 userServiceProcessorValidateCode struct { + handler UserService +} + +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 + } + + 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 err2 = oprot.WriteMessageBegin("ValidateCode", 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 } - if processor, ok := p.GetProcessorFunction(name); ok { - return processor.Process(ctx, seqId, iprot, oprot) + return true, err +} + +type userServiceProcessorValidateCodeForAndroid struct { + handler UserService +} + +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.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 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 } -type userServiceProcessorGetLoginData struct { +type userServiceProcessorGetToken struct { handler UserService } -func (p *userServiceProcessorGetLoginData) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UserServiceGetLoginDataArgs{} +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("GetLoginData", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("GetToken", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -16406,11 +17301,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 := 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) @@ -16418,7 +17313,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("GetToken", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -16436,16 +17331,16 @@ func (p *userServiceProcessorGetLoginData) Process(ctx context.Context, seqId in return true, err } -type userServiceProcessorValidateCode struct { +type userServiceProcessorRefreshToken struct { handler UserService } -func (p *userServiceProcessorValidateCode) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UserServiceValidateCodeArgs{} +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("ValidateCode", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("RefreshToken", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -16454,11 +17349,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 := 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) @@ -16466,7 +17361,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("RefreshToken", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -16484,16 +17379,16 @@ func (p *userServiceProcessorValidateCode) Process(ctx context.Context, seqId in return true, err } -type userServiceProcessorValidateCodeForAndroid struct { +type userServiceProcessorTestAuth struct { handler UserService } -func (p *userServiceProcessorValidateCodeForAndroid) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UserServiceValidateCodeForAndroidArgs{} +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("ValidateCodeForAndroid", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("TestAuth", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -16502,11 +17397,11 @@ func (p *userServiceProcessorValidateCodeForAndroid) Process(ctx context.Context 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) + 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) @@ -16514,7 +17409,7 @@ func (p *userServiceProcessorValidateCodeForAndroid) Process(ctx context.Context } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("ValidateCodeForAndroid", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("TestAuth", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -16532,16 +17427,16 @@ func (p *userServiceProcessorValidateCodeForAndroid) Process(ctx context.Context return true, err } -type userServiceProcessorGetToken struct { +type userServiceProcessorGetUserInfo struct { handler UserService } -func (p *userServiceProcessorGetToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UserServiceGetTokenArgs{} +func (p *userServiceProcessorGetUserInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := UserServiceGetUserInfoArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetToken", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("GetUserInfo", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -16550,11 +17445,11 @@ func (p *userServiceProcessorGetToken) Process(ctx context.Context, seqId int32, 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) + result := UserServiceGetUserInfoResult{} + var retval *GetUserInfoResponse + if retval, err2 = p.handler.GetUserInfo(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetUserInfo: "+err2.Error()) + oprot.WriteMessageBegin("GetUserInfo", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -16562,149 +17457,349 @@ func (p *userServiceProcessorGetToken) Process(ctx context.Context, seqId int32, } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("GetToken", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("GetUserInfo", 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 = result.Write(oprot); 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 + + 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_UserServiceGetLoginDataArgs[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 *UserServiceGetLoginDataArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetLoginDataRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Request = _field + return nil +} + +func (p *UserServiceGetLoginDataArgs) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetLoginData_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 *UserServiceGetLoginDataArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + if err := p.Request.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) +} + +func (p *UserServiceGetLoginDataArgs) String() string { + if p == nil { + return "" } - return true, err + return fmt.Sprintf("UserServiceGetLoginDataArgs(%+v)", *p) + } -type userServiceProcessorRefreshToken struct { - handler UserService +type UserServiceGetLoginDataResult struct { + Success *GetLoginDataResponse `thrift:"success,0,optional"` } -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 - } +func NewUserServiceGetLoginDataResult() *UserServiceGetLoginDataResult { + return &UserServiceGetLoginDataResult{} +} - 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 +func (p *UserServiceGetLoginDataResult) InitDefault() { +} + +var UserServiceGetLoginDataResult_Success_DEFAULT *GetLoginDataResponse + +func (p *UserServiceGetLoginDataResult) GetSuccess() (v *GetLoginDataResponse) { + if !p.IsSetSuccess() { + return UserServiceGetLoginDataResult_Success_DEFAULT } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + return p.Success +} + +var fieldIDToName_UserServiceGetLoginDataResult = map[int16]string{ + 0: "success", +} + +func (p *UserServiceGetLoginDataResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *UserServiceGetLoginDataResult) 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 userServiceProcessorTestAuth struct { - handler UserService + 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_UserServiceGetLoginDataResult[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 *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 +func (p *UserServiceGetLoginDataResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetLoginDataResponse() + if err := _field.Read(iprot); err != nil { + return err } + p.Success = _field + return nil +} - 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 +func (p *UserServiceGetLoginDataResult) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetLoginData_result"); err != nil { + goto WriteStructBeginError } - if err2 = oprot.WriteMessageBegin("TestAuth", 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 *UserServiceGetLoginDataResult) 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 *UserServiceGetLoginDataResult) String() string { + if p == nil { + return "" } - return true, err + return fmt.Sprintf("UserServiceGetLoginDataResult(%+v)", *p) + } -type UserServiceGetLoginDataArgs struct { - Request *GetLoginDataRequest `thrift:"request,1"` +type UserServiceValidateCodeArgs struct { + Request *ValidateCodeRequest `thrift:"request,1"` } -func NewUserServiceGetLoginDataArgs() *UserServiceGetLoginDataArgs { - return &UserServiceGetLoginDataArgs{} +func NewUserServiceValidateCodeArgs() *UserServiceValidateCodeArgs { + return &UserServiceValidateCodeArgs{} } -func (p *UserServiceGetLoginDataArgs) InitDefault() { +func (p *UserServiceValidateCodeArgs) InitDefault() { } -var UserServiceGetLoginDataArgs_Request_DEFAULT *GetLoginDataRequest +var UserServiceValidateCodeArgs_Request_DEFAULT *ValidateCodeRequest -func (p *UserServiceGetLoginDataArgs) GetRequest() (v *GetLoginDataRequest) { +func (p *UserServiceValidateCodeArgs) GetRequest() (v *ValidateCodeRequest) { if !p.IsSetRequest() { - return UserServiceGetLoginDataArgs_Request_DEFAULT + return UserServiceValidateCodeArgs_Request_DEFAULT } return p.Request } -var fieldIDToName_UserServiceGetLoginDataArgs = map[int16]string{ +var fieldIDToName_UserServiceValidateCodeArgs = map[int16]string{ 1: "request", } -func (p *UserServiceGetLoginDataArgs) IsSetRequest() bool { +func (p *UserServiceValidateCodeArgs) IsSetRequest() bool { return p.Request != nil } -func (p *UserServiceGetLoginDataArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceValidateCodeArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -16750,7 +17845,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_UserServiceValidateCodeArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -16760,8 +17855,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 *UserServiceValidateCodeArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewValidateCodeRequest() if err := _field.Read(iprot); err != nil { return err } @@ -16769,9 +17864,10 @@ func (p *UserServiceGetLoginDataArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *UserServiceGetLoginDataArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *UserServiceValidateCodeArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetLoginData_args"); err != nil { + if err = oprot.WriteStructBegin("ValidateCode_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -16797,7 +17893,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 *UserServiceValidateCodeArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -16814,43 +17910,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UserServiceGetLoginDataArgs) String() string { +func (p *UserServiceValidateCodeArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceGetLoginDataArgs(%+v)", *p) + return fmt.Sprintf("UserServiceValidateCodeArgs(%+v)", *p) } -type UserServiceGetLoginDataResult struct { - Success *GetLoginDataResponse `thrift:"success,0,optional"` +type UserServiceValidateCodeResult struct { + Success *ValidateCodeResponse `thrift:"success,0,optional"` } -func NewUserServiceGetLoginDataResult() *UserServiceGetLoginDataResult { - return &UserServiceGetLoginDataResult{} +func NewUserServiceValidateCodeResult() *UserServiceValidateCodeResult { + return &UserServiceValidateCodeResult{} } -func (p *UserServiceGetLoginDataResult) InitDefault() { +func (p *UserServiceValidateCodeResult) InitDefault() { } -var UserServiceGetLoginDataResult_Success_DEFAULT *GetLoginDataResponse +var UserServiceValidateCodeResult_Success_DEFAULT *ValidateCodeResponse -func (p *UserServiceGetLoginDataResult) GetSuccess() (v *GetLoginDataResponse) { +func (p *UserServiceValidateCodeResult) GetSuccess() (v *ValidateCodeResponse) { if !p.IsSetSuccess() { - return UserServiceGetLoginDataResult_Success_DEFAULT + return UserServiceValidateCodeResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UserServiceGetLoginDataResult = map[int16]string{ +var fieldIDToName_UserServiceValidateCodeResult = map[int16]string{ 0: "success", } -func (p *UserServiceGetLoginDataResult) IsSetSuccess() bool { +func (p *UserServiceValidateCodeResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UserServiceGetLoginDataResult) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceValidateCodeResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -16896,7 +17992,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_UserServiceValidateCodeResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -16906,8 +18002,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 *UserServiceValidateCodeResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewValidateCodeResponse() if err := _field.Read(iprot); err != nil { return err } @@ -16915,9 +18011,10 @@ func (p *UserServiceGetLoginDataResult) ReadField0(iprot thrift.TProtocol) error return nil } -func (p *UserServiceGetLoginDataResult) Write(oprot thrift.TProtocol) (err error) { +func (p *UserServiceValidateCodeResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetLoginData_result"); err != nil { + if err = oprot.WriteStructBegin("ValidateCode_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -16943,7 +18040,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 *UserServiceValidateCodeResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -16962,43 +18059,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UserServiceGetLoginDataResult) String() string { +func (p *UserServiceValidateCodeResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceGetLoginDataResult(%+v)", *p) + return fmt.Sprintf("UserServiceValidateCodeResult(%+v)", *p) } -type UserServiceValidateCodeArgs struct { - Request *ValidateCodeRequest `thrift:"request,1"` +type UserServiceValidateCodeForAndroidArgs struct { + Request *ValidateCodeForAndroidRequest `thrift:"request,1"` } -func NewUserServiceValidateCodeArgs() *UserServiceValidateCodeArgs { - return &UserServiceValidateCodeArgs{} +func NewUserServiceValidateCodeForAndroidArgs() *UserServiceValidateCodeForAndroidArgs { + return &UserServiceValidateCodeForAndroidArgs{} } -func (p *UserServiceValidateCodeArgs) InitDefault() { +func (p *UserServiceValidateCodeForAndroidArgs) InitDefault() { } -var UserServiceValidateCodeArgs_Request_DEFAULT *ValidateCodeRequest +var UserServiceValidateCodeForAndroidArgs_Request_DEFAULT *ValidateCodeForAndroidRequest -func (p *UserServiceValidateCodeArgs) GetRequest() (v *ValidateCodeRequest) { +func (p *UserServiceValidateCodeForAndroidArgs) GetRequest() (v *ValidateCodeForAndroidRequest) { if !p.IsSetRequest() { - return UserServiceValidateCodeArgs_Request_DEFAULT + return UserServiceValidateCodeForAndroidArgs_Request_DEFAULT } return p.Request } -var fieldIDToName_UserServiceValidateCodeArgs = map[int16]string{ +var fieldIDToName_UserServiceValidateCodeForAndroidArgs = map[int16]string{ 1: "request", } -func (p *UserServiceValidateCodeArgs) IsSetRequest() bool { +func (p *UserServiceValidateCodeForAndroidArgs) IsSetRequest() bool { return p.Request != nil } -func (p *UserServiceValidateCodeArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceValidateCodeForAndroidArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -17044,7 +18141,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_UserServiceValidateCodeForAndroidArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -17054,8 +18151,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 *UserServiceValidateCodeForAndroidArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewValidateCodeForAndroidRequest() if err := _field.Read(iprot); err != nil { return err } @@ -17063,9 +18160,10 @@ func (p *UserServiceValidateCodeArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *UserServiceValidateCodeArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *UserServiceValidateCodeForAndroidArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("ValidateCode_args"); err != nil { + if err = oprot.WriteStructBegin("ValidateCodeForAndroid_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -17091,7 +18189,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 *UserServiceValidateCodeForAndroidArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -17108,43 +18206,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UserServiceValidateCodeArgs) String() string { +func (p *UserServiceValidateCodeForAndroidArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceValidateCodeArgs(%+v)", *p) + return fmt.Sprintf("UserServiceValidateCodeForAndroidArgs(%+v)", *p) } -type UserServiceValidateCodeResult struct { - Success *ValidateCodeResponse `thrift:"success,0,optional"` +type UserServiceValidateCodeForAndroidResult struct { + Success *ValidateCodeForAndroidResponse `thrift:"success,0,optional"` } -func NewUserServiceValidateCodeResult() *UserServiceValidateCodeResult { - return &UserServiceValidateCodeResult{} +func NewUserServiceValidateCodeForAndroidResult() *UserServiceValidateCodeForAndroidResult { + return &UserServiceValidateCodeForAndroidResult{} } -func (p *UserServiceValidateCodeResult) InitDefault() { +func (p *UserServiceValidateCodeForAndroidResult) InitDefault() { } -var UserServiceValidateCodeResult_Success_DEFAULT *ValidateCodeResponse +var UserServiceValidateCodeForAndroidResult_Success_DEFAULT *ValidateCodeForAndroidResponse -func (p *UserServiceValidateCodeResult) GetSuccess() (v *ValidateCodeResponse) { +func (p *UserServiceValidateCodeForAndroidResult) GetSuccess() (v *ValidateCodeForAndroidResponse) { if !p.IsSetSuccess() { - return UserServiceValidateCodeResult_Success_DEFAULT + return UserServiceValidateCodeForAndroidResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UserServiceValidateCodeResult = map[int16]string{ +var fieldIDToName_UserServiceValidateCodeForAndroidResult = map[int16]string{ 0: "success", } -func (p *UserServiceValidateCodeResult) IsSetSuccess() bool { +func (p *UserServiceValidateCodeForAndroidResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UserServiceValidateCodeResult) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceValidateCodeForAndroidResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -17190,7 +18288,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_UserServiceValidateCodeForAndroidResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -17200,8 +18298,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 *UserServiceValidateCodeForAndroidResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewValidateCodeForAndroidResponse() if err := _field.Read(iprot); err != nil { return err } @@ -17209,9 +18307,10 @@ func (p *UserServiceValidateCodeResult) ReadField0(iprot thrift.TProtocol) error return nil } -func (p *UserServiceValidateCodeResult) Write(oprot thrift.TProtocol) (err error) { +func (p *UserServiceValidateCodeForAndroidResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("ValidateCode_result"); err != nil { + if err = oprot.WriteStructBegin("ValidateCodeForAndroid_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -17237,7 +18336,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 *UserServiceValidateCodeForAndroidResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -17256,43 +18355,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UserServiceValidateCodeResult) String() string { +func (p *UserServiceValidateCodeForAndroidResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceValidateCodeResult(%+v)", *p) + return fmt.Sprintf("UserServiceValidateCodeForAndroidResult(%+v)", *p) } -type UserServiceValidateCodeForAndroidArgs struct { - Request *ValidateCodeForAndroidRequest `thrift:"request,1"` +type UserServiceGetTokenArgs struct { + Request *GetAccessTokenRequest `thrift:"request,1"` } -func NewUserServiceValidateCodeForAndroidArgs() *UserServiceValidateCodeForAndroidArgs { - return &UserServiceValidateCodeForAndroidArgs{} +func NewUserServiceGetTokenArgs() *UserServiceGetTokenArgs { + return &UserServiceGetTokenArgs{} } -func (p *UserServiceValidateCodeForAndroidArgs) InitDefault() { +func (p *UserServiceGetTokenArgs) InitDefault() { } -var UserServiceValidateCodeForAndroidArgs_Request_DEFAULT *ValidateCodeForAndroidRequest +var UserServiceGetTokenArgs_Request_DEFAULT *GetAccessTokenRequest -func (p *UserServiceValidateCodeForAndroidArgs) GetRequest() (v *ValidateCodeForAndroidRequest) { +func (p *UserServiceGetTokenArgs) GetRequest() (v *GetAccessTokenRequest) { if !p.IsSetRequest() { - return UserServiceValidateCodeForAndroidArgs_Request_DEFAULT + return UserServiceGetTokenArgs_Request_DEFAULT } return p.Request } -var fieldIDToName_UserServiceValidateCodeForAndroidArgs = map[int16]string{ +var fieldIDToName_UserServiceGetTokenArgs = map[int16]string{ 1: "request", } -func (p *UserServiceValidateCodeForAndroidArgs) IsSetRequest() bool { +func (p *UserServiceGetTokenArgs) IsSetRequest() bool { return p.Request != nil } -func (p *UserServiceValidateCodeForAndroidArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceGetTokenArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -17338,7 +18437,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_UserServiceValidateCodeForAndroidArgs[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) @@ -17348,8 +18447,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UserServiceValidateCodeForAndroidArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewValidateCodeForAndroidRequest() +func (p *UserServiceGetTokenArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetAccessTokenRequest() if err := _field.Read(iprot); err != nil { return err } @@ -17357,9 +18456,10 @@ func (p *UserServiceValidateCodeForAndroidArgs) ReadField1(iprot thrift.TProtoco return nil } -func (p *UserServiceValidateCodeForAndroidArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *UserServiceGetTokenArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("ValidateCodeForAndroid_args"); err != nil { + if err = oprot.WriteStructBegin("GetToken_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -17385,7 +18485,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UserServiceValidateCodeForAndroidArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *UserServiceGetTokenArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -17402,43 +18502,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UserServiceValidateCodeForAndroidArgs) String() string { +func (p *UserServiceGetTokenArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceValidateCodeForAndroidArgs(%+v)", *p) + return fmt.Sprintf("UserServiceGetTokenArgs(%+v)", *p) } -type UserServiceValidateCodeForAndroidResult struct { - Success *ValidateCodeForAndroidResponse `thrift:"success,0,optional"` +type UserServiceGetTokenResult struct { + Success *GetAccessTokenResponse `thrift:"success,0,optional"` } -func NewUserServiceValidateCodeForAndroidResult() *UserServiceValidateCodeForAndroidResult { - return &UserServiceValidateCodeForAndroidResult{} +func NewUserServiceGetTokenResult() *UserServiceGetTokenResult { + return &UserServiceGetTokenResult{} } -func (p *UserServiceValidateCodeForAndroidResult) InitDefault() { +func (p *UserServiceGetTokenResult) InitDefault() { } -var UserServiceValidateCodeForAndroidResult_Success_DEFAULT *ValidateCodeForAndroidResponse +var UserServiceGetTokenResult_Success_DEFAULT *GetAccessTokenResponse -func (p *UserServiceValidateCodeForAndroidResult) GetSuccess() (v *ValidateCodeForAndroidResponse) { +func (p *UserServiceGetTokenResult) GetSuccess() (v *GetAccessTokenResponse) { if !p.IsSetSuccess() { - return UserServiceValidateCodeForAndroidResult_Success_DEFAULT + return UserServiceGetTokenResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UserServiceValidateCodeForAndroidResult = map[int16]string{ +var fieldIDToName_UserServiceGetTokenResult = map[int16]string{ 0: "success", } -func (p *UserServiceValidateCodeForAndroidResult) IsSetSuccess() bool { +func (p *UserServiceGetTokenResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UserServiceValidateCodeForAndroidResult) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceGetTokenResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -17484,7 +18584,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_UserServiceValidateCodeForAndroidResult[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) @@ -17494,8 +18594,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UserServiceValidateCodeForAndroidResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewValidateCodeForAndroidResponse() +func (p *UserServiceGetTokenResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetAccessTokenResponse() if err := _field.Read(iprot); err != nil { return err } @@ -17503,9 +18603,10 @@ func (p *UserServiceValidateCodeForAndroidResult) ReadField0(iprot thrift.TProto return nil } -func (p *UserServiceValidateCodeForAndroidResult) Write(oprot thrift.TProtocol) (err error) { +func (p *UserServiceGetTokenResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("ValidateCodeForAndroid_result"); err != nil { + if err = oprot.WriteStructBegin("GetToken_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -17531,7 +18632,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UserServiceValidateCodeForAndroidResult) 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 @@ -17550,43 +18651,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UserServiceValidateCodeForAndroidResult) String() string { +func (p *UserServiceGetTokenResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceValidateCodeForAndroidResult(%+v)", *p) + return fmt.Sprintf("UserServiceGetTokenResult(%+v)", *p) } -type UserServiceGetTokenArgs struct { - Request *GetAccessTokenRequest `thrift:"request,1"` +type UserServiceRefreshTokenArgs struct { + Request *RefreshTokenRequest `thrift:"request,1"` } -func NewUserServiceGetTokenArgs() *UserServiceGetTokenArgs { - return &UserServiceGetTokenArgs{} +func NewUserServiceRefreshTokenArgs() *UserServiceRefreshTokenArgs { + return &UserServiceRefreshTokenArgs{} } -func (p *UserServiceGetTokenArgs) InitDefault() { +func (p *UserServiceRefreshTokenArgs) InitDefault() { } -var UserServiceGetTokenArgs_Request_DEFAULT *GetAccessTokenRequest +var UserServiceRefreshTokenArgs_Request_DEFAULT *RefreshTokenRequest -func (p *UserServiceGetTokenArgs) GetRequest() (v *GetAccessTokenRequest) { +func (p *UserServiceRefreshTokenArgs) GetRequest() (v *RefreshTokenRequest) { if !p.IsSetRequest() { - return UserServiceGetTokenArgs_Request_DEFAULT + return UserServiceRefreshTokenArgs_Request_DEFAULT } return p.Request } -var fieldIDToName_UserServiceGetTokenArgs = map[int16]string{ +var fieldIDToName_UserServiceRefreshTokenArgs = map[int16]string{ 1: "request", } -func (p *UserServiceGetTokenArgs) IsSetRequest() bool { +func (p *UserServiceRefreshTokenArgs) IsSetRequest() bool { return p.Request != nil } -func (p *UserServiceGetTokenArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceRefreshTokenArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -17632,7 +18733,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_UserServiceRefreshTokenArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -17642,8 +18743,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 *UserServiceRefreshTokenArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewRefreshTokenRequest() if err := _field.Read(iprot); err != nil { return err } @@ -17651,9 +18752,10 @@ func (p *UserServiceGetTokenArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *UserServiceGetTokenArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *UserServiceRefreshTokenArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetToken_args"); err != nil { + if err = oprot.WriteStructBegin("RefreshToken_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -17679,7 +18781,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 *UserServiceRefreshTokenArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -17696,43 +18798,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UserServiceGetTokenArgs) String() string { +func (p *UserServiceRefreshTokenArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceGetTokenArgs(%+v)", *p) + return fmt.Sprintf("UserServiceRefreshTokenArgs(%+v)", *p) } -type UserServiceGetTokenResult struct { - Success *GetAccessTokenResponse `thrift:"success,0,optional"` +type UserServiceRefreshTokenResult struct { + Success *RefreshTokenResponse `thrift:"success,0,optional"` } -func NewUserServiceGetTokenResult() *UserServiceGetTokenResult { - return &UserServiceGetTokenResult{} +func NewUserServiceRefreshTokenResult() *UserServiceRefreshTokenResult { + return &UserServiceRefreshTokenResult{} } -func (p *UserServiceGetTokenResult) InitDefault() { +func (p *UserServiceRefreshTokenResult) InitDefault() { } -var UserServiceGetTokenResult_Success_DEFAULT *GetAccessTokenResponse +var UserServiceRefreshTokenResult_Success_DEFAULT *RefreshTokenResponse -func (p *UserServiceGetTokenResult) GetSuccess() (v *GetAccessTokenResponse) { +func (p *UserServiceRefreshTokenResult) GetSuccess() (v *RefreshTokenResponse) { if !p.IsSetSuccess() { - return UserServiceGetTokenResult_Success_DEFAULT + return UserServiceRefreshTokenResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UserServiceGetTokenResult = map[int16]string{ +var fieldIDToName_UserServiceRefreshTokenResult = map[int16]string{ 0: "success", } -func (p *UserServiceGetTokenResult) IsSetSuccess() bool { +func (p *UserServiceRefreshTokenResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UserServiceGetTokenResult) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceRefreshTokenResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -17778,7 +18880,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_UserServiceRefreshTokenResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -17788,8 +18890,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 *UserServiceRefreshTokenResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewRefreshTokenResponse() if err := _field.Read(iprot); err != nil { return err } @@ -17797,9 +18899,10 @@ func (p *UserServiceGetTokenResult) ReadField0(iprot thrift.TProtocol) error { return nil } -func (p *UserServiceGetTokenResult) Write(oprot thrift.TProtocol) (err error) { +func (p *UserServiceRefreshTokenResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetToken_result"); err != nil { + if err = oprot.WriteStructBegin("RefreshToken_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -17825,7 +18928,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 *UserServiceRefreshTokenResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -17844,43 +18947,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UserServiceGetTokenResult) String() string { +func (p *UserServiceRefreshTokenResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceGetTokenResult(%+v)", *p) + return fmt.Sprintf("UserServiceRefreshTokenResult(%+v)", *p) } -type UserServiceRefreshTokenArgs struct { - Request *RefreshTokenRequest `thrift:"request,1"` +type UserServiceTestAuthArgs struct { + Request *TestAuthRequest `thrift:"request,1"` } -func NewUserServiceRefreshTokenArgs() *UserServiceRefreshTokenArgs { - return &UserServiceRefreshTokenArgs{} +func NewUserServiceTestAuthArgs() *UserServiceTestAuthArgs { + return &UserServiceTestAuthArgs{} } -func (p *UserServiceRefreshTokenArgs) InitDefault() { +func (p *UserServiceTestAuthArgs) InitDefault() { } -var UserServiceRefreshTokenArgs_Request_DEFAULT *RefreshTokenRequest +var UserServiceTestAuthArgs_Request_DEFAULT *TestAuthRequest -func (p *UserServiceRefreshTokenArgs) GetRequest() (v *RefreshTokenRequest) { +func (p *UserServiceTestAuthArgs) GetRequest() (v *TestAuthRequest) { if !p.IsSetRequest() { - return UserServiceRefreshTokenArgs_Request_DEFAULT + return UserServiceTestAuthArgs_Request_DEFAULT } return p.Request } -var fieldIDToName_UserServiceRefreshTokenArgs = map[int16]string{ +var fieldIDToName_UserServiceTestAuthArgs = map[int16]string{ 1: "request", } -func (p *UserServiceRefreshTokenArgs) IsSetRequest() bool { +func (p *UserServiceTestAuthArgs) IsSetRequest() bool { return p.Request != nil } -func (p *UserServiceRefreshTokenArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceTestAuthArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -17926,7 +19029,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_UserServiceTestAuthArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -17936,8 +19039,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 *UserServiceTestAuthArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewTestAuthRequest() if err := _field.Read(iprot); err != nil { return err } @@ -17945,9 +19048,10 @@ func (p *UserServiceRefreshTokenArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *UserServiceRefreshTokenArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *UserServiceTestAuthArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("RefreshToken_args"); err != nil { + if err = oprot.WriteStructBegin("TestAuth_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -17973,7 +19077,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 *UserServiceTestAuthArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -17990,43 +19094,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UserServiceRefreshTokenArgs) String() string { +func (p *UserServiceTestAuthArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceRefreshTokenArgs(%+v)", *p) + return fmt.Sprintf("UserServiceTestAuthArgs(%+v)", *p) } -type UserServiceRefreshTokenResult struct { - Success *RefreshTokenResponse `thrift:"success,0,optional"` +type UserServiceTestAuthResult struct { + Success *TestAuthResponse `thrift:"success,0,optional"` } -func NewUserServiceRefreshTokenResult() *UserServiceRefreshTokenResult { - return &UserServiceRefreshTokenResult{} +func NewUserServiceTestAuthResult() *UserServiceTestAuthResult { + return &UserServiceTestAuthResult{} } -func (p *UserServiceRefreshTokenResult) InitDefault() { +func (p *UserServiceTestAuthResult) InitDefault() { } -var UserServiceRefreshTokenResult_Success_DEFAULT *RefreshTokenResponse +var UserServiceTestAuthResult_Success_DEFAULT *TestAuthResponse -func (p *UserServiceRefreshTokenResult) GetSuccess() (v *RefreshTokenResponse) { +func (p *UserServiceTestAuthResult) GetSuccess() (v *TestAuthResponse) { if !p.IsSetSuccess() { - return UserServiceRefreshTokenResult_Success_DEFAULT + return UserServiceTestAuthResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UserServiceRefreshTokenResult = map[int16]string{ +var fieldIDToName_UserServiceTestAuthResult = map[int16]string{ 0: "success", } -func (p *UserServiceRefreshTokenResult) IsSetSuccess() bool { +func (p *UserServiceTestAuthResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UserServiceRefreshTokenResult) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceTestAuthResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -18072,7 +19176,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_UserServiceTestAuthResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -18082,8 +19186,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 *UserServiceTestAuthResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewTestAuthResponse() if err := _field.Read(iprot); err != nil { return err } @@ -18091,9 +19195,10 @@ func (p *UserServiceRefreshTokenResult) ReadField0(iprot thrift.TProtocol) error return nil } -func (p *UserServiceRefreshTokenResult) Write(oprot thrift.TProtocol) (err error) { +func (p *UserServiceTestAuthResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("RefreshToken_result"); err != nil { + if err = oprot.WriteStructBegin("TestAuth_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -18119,7 +19224,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 *UserServiceTestAuthResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -18138,43 +19243,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UserServiceRefreshTokenResult) String() string { +func (p *UserServiceTestAuthResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceRefreshTokenResult(%+v)", *p) + return fmt.Sprintf("UserServiceTestAuthResult(%+v)", *p) } -type UserServiceTestAuthArgs struct { - Request *TestAuthRequest `thrift:"request,1"` +type UserServiceGetUserInfoArgs struct { + Request *GetUserInfoRequest `thrift:"request,1"` } -func NewUserServiceTestAuthArgs() *UserServiceTestAuthArgs { - return &UserServiceTestAuthArgs{} +func NewUserServiceGetUserInfoArgs() *UserServiceGetUserInfoArgs { + return &UserServiceGetUserInfoArgs{} } -func (p *UserServiceTestAuthArgs) InitDefault() { +func (p *UserServiceGetUserInfoArgs) InitDefault() { } -var UserServiceTestAuthArgs_Request_DEFAULT *TestAuthRequest +var UserServiceGetUserInfoArgs_Request_DEFAULT *GetUserInfoRequest -func (p *UserServiceTestAuthArgs) GetRequest() (v *TestAuthRequest) { +func (p *UserServiceGetUserInfoArgs) GetRequest() (v *GetUserInfoRequest) { if !p.IsSetRequest() { - return UserServiceTestAuthArgs_Request_DEFAULT + return UserServiceGetUserInfoArgs_Request_DEFAULT } return p.Request } -var fieldIDToName_UserServiceTestAuthArgs = map[int16]string{ +var fieldIDToName_UserServiceGetUserInfoArgs = map[int16]string{ 1: "request", } -func (p *UserServiceTestAuthArgs) IsSetRequest() bool { +func (p *UserServiceGetUserInfoArgs) IsSetRequest() bool { return p.Request != nil } -func (p *UserServiceTestAuthArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceGetUserInfoArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -18220,7 +19325,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_UserServiceGetUserInfoArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -18230,8 +19335,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 *UserServiceGetUserInfoArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetUserInfoRequest() if err := _field.Read(iprot); err != nil { return err } @@ -18239,9 +19344,10 @@ func (p *UserServiceTestAuthArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *UserServiceTestAuthArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *UserServiceGetUserInfoArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("TestAuth_args"); err != nil { + if err = oprot.WriteStructBegin("GetUserInfo_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -18267,7 +19373,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 *UserServiceGetUserInfoArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -18284,43 +19390,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UserServiceTestAuthArgs) String() string { +func (p *UserServiceGetUserInfoArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceTestAuthArgs(%+v)", *p) + return fmt.Sprintf("UserServiceGetUserInfoArgs(%+v)", *p) } -type UserServiceTestAuthResult struct { - Success *TestAuthResponse `thrift:"success,0,optional"` +type UserServiceGetUserInfoResult struct { + Success *GetUserInfoResponse `thrift:"success,0,optional"` } -func NewUserServiceTestAuthResult() *UserServiceTestAuthResult { - return &UserServiceTestAuthResult{} +func NewUserServiceGetUserInfoResult() *UserServiceGetUserInfoResult { + return &UserServiceGetUserInfoResult{} } -func (p *UserServiceTestAuthResult) InitDefault() { +func (p *UserServiceGetUserInfoResult) InitDefault() { } -var UserServiceTestAuthResult_Success_DEFAULT *TestAuthResponse +var UserServiceGetUserInfoResult_Success_DEFAULT *GetUserInfoResponse -func (p *UserServiceTestAuthResult) GetSuccess() (v *TestAuthResponse) { +func (p *UserServiceGetUserInfoResult) GetSuccess() (v *GetUserInfoResponse) { if !p.IsSetSuccess() { - return UserServiceTestAuthResult_Success_DEFAULT + return UserServiceGetUserInfoResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UserServiceTestAuthResult = map[int16]string{ +var fieldIDToName_UserServiceGetUserInfoResult = map[int16]string{ 0: "success", } -func (p *UserServiceTestAuthResult) IsSetSuccess() bool { +func (p *UserServiceGetUserInfoResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UserServiceTestAuthResult) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceGetUserInfoResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -18366,7 +19472,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_UserServiceGetUserInfoResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -18376,8 +19482,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 *UserServiceGetUserInfoResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetUserInfoResponse() if err := _field.Read(iprot); err != nil { return err } @@ -18385,9 +19491,10 @@ func (p *UserServiceTestAuthResult) ReadField0(iprot thrift.TProtocol) error { return nil } -func (p *UserServiceTestAuthResult) Write(oprot thrift.TProtocol) (err error) { +func (p *UserServiceGetUserInfoResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("TestAuth_result"); err != nil { + if err = oprot.WriteStructBegin("GetUserInfo_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -18413,7 +19520,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 *UserServiceGetUserInfoResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -18432,11 +19539,11 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UserServiceTestAuthResult) String() string { +func (p *UserServiceGetUserInfoResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceTestAuthResult(%+v)", *p) + return fmt.Sprintf("UserServiceGetUserInfoResult(%+v)", *p) } @@ -18623,6 +19730,7 @@ func (p *CourseServiceGetCourseListArgs) ReadField1(iprot thrift.TProtocol) erro } func (p *CourseServiceGetCourseListArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetCourseList_args"); err != nil { goto WriteStructBeginError @@ -18769,6 +19877,7 @@ func (p *CourseServiceGetCourseListResult) ReadField0(iprot thrift.TProtocol) er } func (p *CourseServiceGetCourseListResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetCourseList_result"); err != nil { goto WriteStructBeginError @@ -18900,7 +20009,103 @@ func (p *launchScreenServiceProcessorCreateImage) Process(ctx context.Context, s } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("CreateImage", thrift.REPLY, seqId); err2 != nil { + 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 +} + +type launchScreenServiceProcessorGetImage struct { + handler LaunchScreenService +} + +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 + } + + 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 err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type launchScreenServiceProcessorChangeImageProperty struct { + handler LaunchScreenService +} + +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 + } + + 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 { @@ -18918,16 +20123,16 @@ func (p *launchScreenServiceProcessorCreateImage) Process(ctx context.Context, s return true, err } -type launchScreenServiceProcessorGetImage struct { +type launchScreenServiceProcessorChangeImage struct { handler LaunchScreenService } -func (p *launchScreenServiceProcessorGetImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := LaunchScreenServiceGetImageArgs{} +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("GetImage", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("ChangeImage", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -18936,11 +20141,11 @@ func (p *launchScreenServiceProcessorGetImage) Process(ctx context.Context, seqI 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) + 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) @@ -18948,7 +20153,7 @@ func (p *launchScreenServiceProcessorGetImage) Process(ctx context.Context, seqI } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("GetImage", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("ChangeImage", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -18966,16 +20171,16 @@ func (p *launchScreenServiceProcessorGetImage) Process(ctx context.Context, seqI return true, err } -type launchScreenServiceProcessorChangeImageProperty struct { +type launchScreenServiceProcessorDeleteImage struct { handler LaunchScreenService } -func (p *launchScreenServiceProcessorChangeImageProperty) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := LaunchScreenServiceChangeImagePropertyArgs{} +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("ChangeImageProperty", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("DeleteImage", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -18984,11 +20189,11 @@ func (p *launchScreenServiceProcessorChangeImageProperty) Process(ctx context.Co 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) + 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) @@ -18996,7 +20201,7 @@ func (p *launchScreenServiceProcessorChangeImageProperty) Process(ctx context.Co } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("ChangeImageProperty", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("DeleteImage", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -19014,16 +20219,16 @@ func (p *launchScreenServiceProcessorChangeImageProperty) Process(ctx context.Co return true, err } -type launchScreenServiceProcessorChangeImage struct { +type launchScreenServiceProcessorMobileGetImage struct { handler LaunchScreenService } -func (p *launchScreenServiceProcessorChangeImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := LaunchScreenServiceChangeImageArgs{} +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("ChangeImage", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("MobileGetImage", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -19032,11 +20237,11 @@ func (p *launchScreenServiceProcessorChangeImage) Process(ctx context.Context, s 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) + 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) @@ -19044,7 +20249,7 @@ func (p *launchScreenServiceProcessorChangeImage) Process(ctx context.Context, s } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("ChangeImage", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("MobileGetImage", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -19062,16 +20267,16 @@ func (p *launchScreenServiceProcessorChangeImage) Process(ctx context.Context, s return true, err } -type launchScreenServiceProcessorDeleteImage struct { +type launchScreenServiceProcessorAddImagePointTime struct { handler LaunchScreenService } -func (p *launchScreenServiceProcessorDeleteImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := LaunchScreenServiceDeleteImageArgs{} +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("DeleteImage", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("AddImagePointTime", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -19080,11 +20285,11 @@ func (p *launchScreenServiceProcessorDeleteImage) Process(ctx context.Context, s 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) + 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) @@ -19092,7 +20297,7 @@ func (p *launchScreenServiceProcessorDeleteImage) Process(ctx context.Context, s } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("DeleteImage", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("AddImagePointTime", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -19110,131 +20315,331 @@ func (p *launchScreenServiceProcessorDeleteImage) Process(ctx context.Context, s return true, err } -type launchScreenServiceProcessorMobileGetImage struct { - handler LaunchScreenService +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 + + 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_LaunchScreenServiceCreateImageArgs[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 *LaunchScreenServiceCreateImageArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewCreateImageRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *LaunchScreenServiceCreateImageArgs) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("CreateImage_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 *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 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *LaunchScreenServiceCreateImageArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceCreateImageArgs(%+v)", *p) + +} + +type LaunchScreenServiceCreateImageResult struct { + Success *CreateImageResponse `thrift:"success,0,optional"` +} + +func NewLaunchScreenServiceCreateImageResult() *LaunchScreenServiceCreateImageResult { + return &LaunchScreenServiceCreateImageResult{} +} + +func (p *LaunchScreenServiceCreateImageResult) InitDefault() { +} + +var LaunchScreenServiceCreateImageResult_Success_DEFAULT *CreateImageResponse + +func (p *LaunchScreenServiceCreateImageResult) GetSuccess() (v *CreateImageResponse) { + if !p.IsSetSuccess() { + return LaunchScreenServiceCreateImageResult_Success_DEFAULT + } + return p.Success +} + +var fieldIDToName_LaunchScreenServiceCreateImageResult = map[int16]string{ + 0: "success", +} + +func (p *LaunchScreenServiceCreateImageResult) IsSetSuccess() bool { + return p.Success != nil } -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 *LaunchScreenServiceCreateImageResult) Read(iprot thrift.TProtocol) (err error) { - 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 + 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 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_LaunchScreenServiceCreateImageResult[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 *LaunchScreenServiceCreateImageResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewCreateImageResponse() + 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 *LaunchScreenServiceCreateImageResult) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("CreateImage_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 *LaunchScreenServiceCreateImageResult) 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 *LaunchScreenServiceCreateImageResult) String() string { + if p == nil { + return "" } - return true, err + return fmt.Sprintf("LaunchScreenServiceCreateImageResult(%+v)", *p) + } -type LaunchScreenServiceCreateImageArgs struct { - Req *CreateImageRequest `thrift:"req,1"` +type LaunchScreenServiceGetImageArgs struct { + Req *GetImageRequest `thrift:"req,1"` } -func NewLaunchScreenServiceCreateImageArgs() *LaunchScreenServiceCreateImageArgs { - return &LaunchScreenServiceCreateImageArgs{} +func NewLaunchScreenServiceGetImageArgs() *LaunchScreenServiceGetImageArgs { + return &LaunchScreenServiceGetImageArgs{} } -func (p *LaunchScreenServiceCreateImageArgs) InitDefault() { +func (p *LaunchScreenServiceGetImageArgs) InitDefault() { } -var LaunchScreenServiceCreateImageArgs_Req_DEFAULT *CreateImageRequest +var LaunchScreenServiceGetImageArgs_Req_DEFAULT *GetImageRequest -func (p *LaunchScreenServiceCreateImageArgs) GetReq() (v *CreateImageRequest) { +func (p *LaunchScreenServiceGetImageArgs) GetReq() (v *GetImageRequest) { if !p.IsSetReq() { - return LaunchScreenServiceCreateImageArgs_Req_DEFAULT + return LaunchScreenServiceGetImageArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_LaunchScreenServiceCreateImageArgs = map[int16]string{ +var fieldIDToName_LaunchScreenServiceGetImageArgs = map[int16]string{ 1: "req", } -func (p *LaunchScreenServiceCreateImageArgs) IsSetReq() bool { +func (p *LaunchScreenServiceGetImageArgs) IsSetReq() bool { return p.Req != nil } -func (p *LaunchScreenServiceCreateImageArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceGetImageArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -19280,7 +20685,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_LaunchScreenServiceGetImageArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -19290,8 +20695,8 @@ 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 *LaunchScreenServiceGetImageArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetImageRequest() if err := _field.Read(iprot); err != nil { return err } @@ -19299,9 +20704,10 @@ func (p *LaunchScreenServiceCreateImageArgs) ReadField1(iprot thrift.TProtocol) return nil } -func (p *LaunchScreenServiceCreateImageArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceGetImageArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("CreateImage_args"); err != nil { + if err = oprot.WriteStructBegin("GetImage_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -19327,7 +20733,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *LaunchScreenServiceCreateImageArgs) 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 } @@ -19344,43 +20750,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *LaunchScreenServiceCreateImageArgs) String() string { +func (p *LaunchScreenServiceGetImageArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceCreateImageArgs(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceGetImageArgs(%+v)", *p) } -type LaunchScreenServiceCreateImageResult struct { - Success *CreateImageResponse `thrift:"success,0,optional"` +type LaunchScreenServiceGetImageResult struct { + Success *GetImageResponse `thrift:"success,0,optional"` } -func NewLaunchScreenServiceCreateImageResult() *LaunchScreenServiceCreateImageResult { - return &LaunchScreenServiceCreateImageResult{} +func NewLaunchScreenServiceGetImageResult() *LaunchScreenServiceGetImageResult { + return &LaunchScreenServiceGetImageResult{} } -func (p *LaunchScreenServiceCreateImageResult) InitDefault() { +func (p *LaunchScreenServiceGetImageResult) InitDefault() { } -var LaunchScreenServiceCreateImageResult_Success_DEFAULT *CreateImageResponse +var LaunchScreenServiceGetImageResult_Success_DEFAULT *GetImageResponse -func (p *LaunchScreenServiceCreateImageResult) GetSuccess() (v *CreateImageResponse) { +func (p *LaunchScreenServiceGetImageResult) GetSuccess() (v *GetImageResponse) { if !p.IsSetSuccess() { - return LaunchScreenServiceCreateImageResult_Success_DEFAULT + return LaunchScreenServiceGetImageResult_Success_DEFAULT } return p.Success } -var fieldIDToName_LaunchScreenServiceCreateImageResult = map[int16]string{ +var fieldIDToName_LaunchScreenServiceGetImageResult = map[int16]string{ 0: "success", } -func (p *LaunchScreenServiceCreateImageResult) IsSetSuccess() bool { +func (p *LaunchScreenServiceGetImageResult) IsSetSuccess() bool { return p.Success != nil } -func (p *LaunchScreenServiceCreateImageResult) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceGetImageResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -19426,7 +20832,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_LaunchScreenServiceGetImageResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -19436,8 +20842,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 *LaunchScreenServiceGetImageResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetImageResponse() if err := _field.Read(iprot); err != nil { return err } @@ -19445,9 +20851,10 @@ func (p *LaunchScreenServiceCreateImageResult) ReadField0(iprot thrift.TProtocol return nil } -func (p *LaunchScreenServiceCreateImageResult) Write(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceGetImageResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("CreateImage_result"); err != nil { + if err = oprot.WriteStructBegin("GetImage_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -19473,7 +20880,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 *LaunchScreenServiceGetImageResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -19492,43 +20899,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *LaunchScreenServiceCreateImageResult) String() string { +func (p *LaunchScreenServiceGetImageResult) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceCreateImageResult(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceGetImageResult(%+v)", *p) } -type LaunchScreenServiceGetImageArgs struct { - Req *GetImageRequest `thrift:"req,1"` +type LaunchScreenServiceChangeImagePropertyArgs struct { + Req *ChangeImagePropertyRequest `thrift:"req,1"` } -func NewLaunchScreenServiceGetImageArgs() *LaunchScreenServiceGetImageArgs { - return &LaunchScreenServiceGetImageArgs{} +func NewLaunchScreenServiceChangeImagePropertyArgs() *LaunchScreenServiceChangeImagePropertyArgs { + return &LaunchScreenServiceChangeImagePropertyArgs{} } -func (p *LaunchScreenServiceGetImageArgs) InitDefault() { +func (p *LaunchScreenServiceChangeImagePropertyArgs) InitDefault() { } -var LaunchScreenServiceGetImageArgs_Req_DEFAULT *GetImageRequest +var LaunchScreenServiceChangeImagePropertyArgs_Req_DEFAULT *ChangeImagePropertyRequest -func (p *LaunchScreenServiceGetImageArgs) GetReq() (v *GetImageRequest) { +func (p *LaunchScreenServiceChangeImagePropertyArgs) GetReq() (v *ChangeImagePropertyRequest) { if !p.IsSetReq() { - return LaunchScreenServiceGetImageArgs_Req_DEFAULT + return LaunchScreenServiceChangeImagePropertyArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_LaunchScreenServiceGetImageArgs = map[int16]string{ +var fieldIDToName_LaunchScreenServiceChangeImagePropertyArgs = map[int16]string{ 1: "req", } -func (p *LaunchScreenServiceGetImageArgs) IsSetReq() bool { +func (p *LaunchScreenServiceChangeImagePropertyArgs) IsSetReq() bool { return p.Req != nil } -func (p *LaunchScreenServiceGetImageArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceChangeImagePropertyArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -19574,7 +20981,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_LaunchScreenServiceChangeImagePropertyArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -19584,8 +20991,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 *LaunchScreenServiceChangeImagePropertyArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewChangeImagePropertyRequest() if err := _field.Read(iprot); err != nil { return err } @@ -19593,9 +21000,10 @@ func (p *LaunchScreenServiceGetImageArgs) ReadField1(iprot thrift.TProtocol) err return nil } -func (p *LaunchScreenServiceGetImageArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceChangeImagePropertyArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetImage_args"); err != nil { + if err = oprot.WriteStructBegin("ChangeImageProperty_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -19621,7 +21029,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 *LaunchScreenServiceChangeImagePropertyArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -19638,43 +21046,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *LaunchScreenServiceGetImageArgs) String() string { +func (p *LaunchScreenServiceChangeImagePropertyArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceGetImageArgs(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceChangeImagePropertyArgs(%+v)", *p) } -type LaunchScreenServiceGetImageResult struct { - Success *GetImageResponse `thrift:"success,0,optional"` +type LaunchScreenServiceChangeImagePropertyResult struct { + Success *ChangeImagePropertyResponse `thrift:"success,0,optional"` } -func NewLaunchScreenServiceGetImageResult() *LaunchScreenServiceGetImageResult { - return &LaunchScreenServiceGetImageResult{} +func NewLaunchScreenServiceChangeImagePropertyResult() *LaunchScreenServiceChangeImagePropertyResult { + return &LaunchScreenServiceChangeImagePropertyResult{} } -func (p *LaunchScreenServiceGetImageResult) InitDefault() { +func (p *LaunchScreenServiceChangeImagePropertyResult) InitDefault() { } -var LaunchScreenServiceGetImageResult_Success_DEFAULT *GetImageResponse +var LaunchScreenServiceChangeImagePropertyResult_Success_DEFAULT *ChangeImagePropertyResponse -func (p *LaunchScreenServiceGetImageResult) GetSuccess() (v *GetImageResponse) { +func (p *LaunchScreenServiceChangeImagePropertyResult) GetSuccess() (v *ChangeImagePropertyResponse) { if !p.IsSetSuccess() { - return LaunchScreenServiceGetImageResult_Success_DEFAULT + return LaunchScreenServiceChangeImagePropertyResult_Success_DEFAULT } return p.Success } -var fieldIDToName_LaunchScreenServiceGetImageResult = map[int16]string{ +var fieldIDToName_LaunchScreenServiceChangeImagePropertyResult = map[int16]string{ 0: "success", } -func (p *LaunchScreenServiceGetImageResult) IsSetSuccess() bool { +func (p *LaunchScreenServiceChangeImagePropertyResult) IsSetSuccess() bool { return p.Success != nil } -func (p *LaunchScreenServiceGetImageResult) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceChangeImagePropertyResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -19720,7 +21128,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_LaunchScreenServiceChangeImagePropertyResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -19730,8 +21138,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 *LaunchScreenServiceChangeImagePropertyResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewChangeImagePropertyResponse() if err := _field.Read(iprot); err != nil { return err } @@ -19739,9 +21147,10 @@ func (p *LaunchScreenServiceGetImageResult) ReadField0(iprot thrift.TProtocol) e return nil } -func (p *LaunchScreenServiceGetImageResult) Write(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceChangeImagePropertyResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetImage_result"); err != nil { + if err = oprot.WriteStructBegin("ChangeImageProperty_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -19767,7 +21176,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 *LaunchScreenServiceChangeImagePropertyResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -19786,43 +21195,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *LaunchScreenServiceGetImageResult) String() string { +func (p *LaunchScreenServiceChangeImagePropertyResult) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceGetImageResult(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceChangeImagePropertyResult(%+v)", *p) } -type LaunchScreenServiceChangeImagePropertyArgs struct { - Req *ChangeImagePropertyRequest `thrift:"req,1"` +type LaunchScreenServiceChangeImageArgs struct { + Req *ChangeImageRequest `thrift:"req,1"` } -func NewLaunchScreenServiceChangeImagePropertyArgs() *LaunchScreenServiceChangeImagePropertyArgs { - return &LaunchScreenServiceChangeImagePropertyArgs{} +func NewLaunchScreenServiceChangeImageArgs() *LaunchScreenServiceChangeImageArgs { + return &LaunchScreenServiceChangeImageArgs{} } -func (p *LaunchScreenServiceChangeImagePropertyArgs) InitDefault() { +func (p *LaunchScreenServiceChangeImageArgs) InitDefault() { } -var LaunchScreenServiceChangeImagePropertyArgs_Req_DEFAULT *ChangeImagePropertyRequest +var LaunchScreenServiceChangeImageArgs_Req_DEFAULT *ChangeImageRequest -func (p *LaunchScreenServiceChangeImagePropertyArgs) GetReq() (v *ChangeImagePropertyRequest) { +func (p *LaunchScreenServiceChangeImageArgs) GetReq() (v *ChangeImageRequest) { if !p.IsSetReq() { - return LaunchScreenServiceChangeImagePropertyArgs_Req_DEFAULT + return LaunchScreenServiceChangeImageArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_LaunchScreenServiceChangeImagePropertyArgs = map[int16]string{ +var fieldIDToName_LaunchScreenServiceChangeImageArgs = map[int16]string{ 1: "req", } -func (p *LaunchScreenServiceChangeImagePropertyArgs) IsSetReq() bool { +func (p *LaunchScreenServiceChangeImageArgs) IsSetReq() bool { return p.Req != nil } -func (p *LaunchScreenServiceChangeImagePropertyArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceChangeImageArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -19868,7 +21277,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_LaunchScreenServiceChangeImagePropertyArgs[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) @@ -19878,8 +21287,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *LaunchScreenServiceChangeImagePropertyArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewChangeImagePropertyRequest() +func (p *LaunchScreenServiceChangeImageArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewChangeImageRequest() if err := _field.Read(iprot); err != nil { return err } @@ -19887,9 +21296,10 @@ func (p *LaunchScreenServiceChangeImagePropertyArgs) ReadField1(iprot thrift.TPr return nil } -func (p *LaunchScreenServiceChangeImagePropertyArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceChangeImageArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("ChangeImageProperty_args"); err != nil { + if err = oprot.WriteStructBegin("ChangeImage_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -19915,7 +21325,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *LaunchScreenServiceChangeImagePropertyArgs) 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 } @@ -19932,43 +21342,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *LaunchScreenServiceChangeImagePropertyArgs) String() string { +func (p *LaunchScreenServiceChangeImageArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceChangeImagePropertyArgs(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceChangeImageArgs(%+v)", *p) } -type LaunchScreenServiceChangeImagePropertyResult struct { - Success *ChangeImagePropertyResponse `thrift:"success,0,optional"` +type LaunchScreenServiceChangeImageResult struct { + Success *ChangeImageResponse `thrift:"success,0,optional"` } -func NewLaunchScreenServiceChangeImagePropertyResult() *LaunchScreenServiceChangeImagePropertyResult { - return &LaunchScreenServiceChangeImagePropertyResult{} +func NewLaunchScreenServiceChangeImageResult() *LaunchScreenServiceChangeImageResult { + return &LaunchScreenServiceChangeImageResult{} } -func (p *LaunchScreenServiceChangeImagePropertyResult) InitDefault() { +func (p *LaunchScreenServiceChangeImageResult) InitDefault() { } -var LaunchScreenServiceChangeImagePropertyResult_Success_DEFAULT *ChangeImagePropertyResponse +var LaunchScreenServiceChangeImageResult_Success_DEFAULT *ChangeImageResponse -func (p *LaunchScreenServiceChangeImagePropertyResult) GetSuccess() (v *ChangeImagePropertyResponse) { +func (p *LaunchScreenServiceChangeImageResult) GetSuccess() (v *ChangeImageResponse) { if !p.IsSetSuccess() { - return LaunchScreenServiceChangeImagePropertyResult_Success_DEFAULT + return LaunchScreenServiceChangeImageResult_Success_DEFAULT } return p.Success } -var fieldIDToName_LaunchScreenServiceChangeImagePropertyResult = map[int16]string{ +var fieldIDToName_LaunchScreenServiceChangeImageResult = map[int16]string{ 0: "success", } -func (p *LaunchScreenServiceChangeImagePropertyResult) IsSetSuccess() bool { +func (p *LaunchScreenServiceChangeImageResult) IsSetSuccess() bool { return p.Success != nil } -func (p *LaunchScreenServiceChangeImagePropertyResult) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceChangeImageResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -20014,7 +21424,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_LaunchScreenServiceChangeImageResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -20024,8 +21434,8 @@ 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 *LaunchScreenServiceChangeImageResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewChangeImageResponse() if err := _field.Read(iprot); err != nil { return err } @@ -20033,9 +21443,10 @@ func (p *LaunchScreenServiceChangeImagePropertyResult) ReadField0(iprot thrift.T return nil } -func (p *LaunchScreenServiceChangeImagePropertyResult) Write(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceChangeImageResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("ChangeImageProperty_result"); err != nil { + if err = oprot.WriteStructBegin("ChangeImage_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -20061,7 +21472,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *LaunchScreenServiceChangeImagePropertyResult) 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 @@ -20080,43 +21491,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *LaunchScreenServiceChangeImagePropertyResult) String() string { +func (p *LaunchScreenServiceChangeImageResult) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceChangeImagePropertyResult(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceChangeImageResult(%+v)", *p) } -type LaunchScreenServiceChangeImageArgs struct { - Req *ChangeImageRequest `thrift:"req,1"` +type LaunchScreenServiceDeleteImageArgs struct { + Req *DeleteImageRequest `thrift:"req,1"` } -func NewLaunchScreenServiceChangeImageArgs() *LaunchScreenServiceChangeImageArgs { - return &LaunchScreenServiceChangeImageArgs{} +func NewLaunchScreenServiceDeleteImageArgs() *LaunchScreenServiceDeleteImageArgs { + return &LaunchScreenServiceDeleteImageArgs{} } -func (p *LaunchScreenServiceChangeImageArgs) InitDefault() { +func (p *LaunchScreenServiceDeleteImageArgs) InitDefault() { } -var LaunchScreenServiceChangeImageArgs_Req_DEFAULT *ChangeImageRequest +var LaunchScreenServiceDeleteImageArgs_Req_DEFAULT *DeleteImageRequest -func (p *LaunchScreenServiceChangeImageArgs) GetReq() (v *ChangeImageRequest) { +func (p *LaunchScreenServiceDeleteImageArgs) GetReq() (v *DeleteImageRequest) { if !p.IsSetReq() { - return LaunchScreenServiceChangeImageArgs_Req_DEFAULT + return LaunchScreenServiceDeleteImageArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_LaunchScreenServiceChangeImageArgs = map[int16]string{ +var fieldIDToName_LaunchScreenServiceDeleteImageArgs = map[int16]string{ 1: "req", } -func (p *LaunchScreenServiceChangeImageArgs) IsSetReq() bool { +func (p *LaunchScreenServiceDeleteImageArgs) IsSetReq() bool { return p.Req != nil } -func (p *LaunchScreenServiceChangeImageArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceDeleteImageArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -20162,7 +21573,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_LaunchScreenServiceDeleteImageArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -20172,8 +21583,8 @@ 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 *LaunchScreenServiceDeleteImageArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewDeleteImageRequest() if err := _field.Read(iprot); err != nil { return err } @@ -20181,9 +21592,10 @@ func (p *LaunchScreenServiceChangeImageArgs) ReadField1(iprot thrift.TProtocol) return nil } -func (p *LaunchScreenServiceChangeImageArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceDeleteImageArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("ChangeImage_args"); err != nil { + if err = oprot.WriteStructBegin("DeleteImage_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -20209,7 +21621,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *LaunchScreenServiceChangeImageArgs) 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 } @@ -20226,43 +21638,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *LaunchScreenServiceChangeImageArgs) String() string { +func (p *LaunchScreenServiceDeleteImageArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceChangeImageArgs(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceDeleteImageArgs(%+v)", *p) } -type LaunchScreenServiceChangeImageResult struct { - Success *ChangeImageResponse `thrift:"success,0,optional"` +type LaunchScreenServiceDeleteImageResult struct { + Success *DeleteImageResponse `thrift:"success,0,optional"` } -func NewLaunchScreenServiceChangeImageResult() *LaunchScreenServiceChangeImageResult { - return &LaunchScreenServiceChangeImageResult{} +func NewLaunchScreenServiceDeleteImageResult() *LaunchScreenServiceDeleteImageResult { + return &LaunchScreenServiceDeleteImageResult{} } -func (p *LaunchScreenServiceChangeImageResult) InitDefault() { +func (p *LaunchScreenServiceDeleteImageResult) InitDefault() { } -var LaunchScreenServiceChangeImageResult_Success_DEFAULT *ChangeImageResponse +var LaunchScreenServiceDeleteImageResult_Success_DEFAULT *DeleteImageResponse -func (p *LaunchScreenServiceChangeImageResult) GetSuccess() (v *ChangeImageResponse) { +func (p *LaunchScreenServiceDeleteImageResult) GetSuccess() (v *DeleteImageResponse) { if !p.IsSetSuccess() { - return LaunchScreenServiceChangeImageResult_Success_DEFAULT + return LaunchScreenServiceDeleteImageResult_Success_DEFAULT } return p.Success } -var fieldIDToName_LaunchScreenServiceChangeImageResult = map[int16]string{ +var fieldIDToName_LaunchScreenServiceDeleteImageResult = map[int16]string{ 0: "success", } -func (p *LaunchScreenServiceChangeImageResult) IsSetSuccess() bool { +func (p *LaunchScreenServiceDeleteImageResult) IsSetSuccess() bool { return p.Success != nil } -func (p *LaunchScreenServiceChangeImageResult) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceDeleteImageResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -20308,7 +21720,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_LaunchScreenServiceChangeImageResult[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) @@ -20318,8 +21730,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *LaunchScreenServiceChangeImageResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewChangeImageResponse() +func (p *LaunchScreenServiceDeleteImageResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewDeleteImageResponse() if err := _field.Read(iprot); err != nil { return err } @@ -20327,9 +21739,10 @@ func (p *LaunchScreenServiceChangeImageResult) ReadField0(iprot thrift.TProtocol return nil } -func (p *LaunchScreenServiceChangeImageResult) Write(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceDeleteImageResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("ChangeImage_result"); err != nil { + if err = oprot.WriteStructBegin("DeleteImage_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -20355,7 +21768,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 *LaunchScreenServiceDeleteImageResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -20374,43 +21787,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *LaunchScreenServiceChangeImageResult) String() string { +func (p *LaunchScreenServiceDeleteImageResult) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceChangeImageResult(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceDeleteImageResult(%+v)", *p) } -type LaunchScreenServiceDeleteImageArgs struct { - Req *DeleteImageRequest `thrift:"req,1"` +type LaunchScreenServiceMobileGetImageArgs struct { + Req *MobileGetImageRequest `thrift:"req,1"` } -func NewLaunchScreenServiceDeleteImageArgs() *LaunchScreenServiceDeleteImageArgs { - return &LaunchScreenServiceDeleteImageArgs{} +func NewLaunchScreenServiceMobileGetImageArgs() *LaunchScreenServiceMobileGetImageArgs { + return &LaunchScreenServiceMobileGetImageArgs{} } -func (p *LaunchScreenServiceDeleteImageArgs) InitDefault() { +func (p *LaunchScreenServiceMobileGetImageArgs) InitDefault() { } -var LaunchScreenServiceDeleteImageArgs_Req_DEFAULT *DeleteImageRequest +var LaunchScreenServiceMobileGetImageArgs_Req_DEFAULT *MobileGetImageRequest -func (p *LaunchScreenServiceDeleteImageArgs) GetReq() (v *DeleteImageRequest) { +func (p *LaunchScreenServiceMobileGetImageArgs) GetReq() (v *MobileGetImageRequest) { if !p.IsSetReq() { - return LaunchScreenServiceDeleteImageArgs_Req_DEFAULT + return LaunchScreenServiceMobileGetImageArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_LaunchScreenServiceDeleteImageArgs = map[int16]string{ +var fieldIDToName_LaunchScreenServiceMobileGetImageArgs = map[int16]string{ 1: "req", } -func (p *LaunchScreenServiceDeleteImageArgs) IsSetReq() bool { +func (p *LaunchScreenServiceMobileGetImageArgs) IsSetReq() bool { return p.Req != nil } -func (p *LaunchScreenServiceDeleteImageArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceMobileGetImageArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -20456,7 +21869,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_LaunchScreenServiceMobileGetImageArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -20466,8 +21879,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 *LaunchScreenServiceMobileGetImageArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewMobileGetImageRequest() if err := _field.Read(iprot); err != nil { return err } @@ -20475,9 +21888,10 @@ func (p *LaunchScreenServiceDeleteImageArgs) ReadField1(iprot thrift.TProtocol) return nil } -func (p *LaunchScreenServiceDeleteImageArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceMobileGetImageArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("DeleteImage_args"); err != nil { + if err = oprot.WriteStructBegin("MobileGetImage_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -20503,7 +21917,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 *LaunchScreenServiceMobileGetImageArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -20520,43 +21934,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *LaunchScreenServiceDeleteImageArgs) String() string { +func (p *LaunchScreenServiceMobileGetImageArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceDeleteImageArgs(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceMobileGetImageArgs(%+v)", *p) } -type LaunchScreenServiceDeleteImageResult struct { - Success *DeleteImageResponse `thrift:"success,0,optional"` +type LaunchScreenServiceMobileGetImageResult struct { + Success *MobileGetImageResponse `thrift:"success,0,optional"` } -func NewLaunchScreenServiceDeleteImageResult() *LaunchScreenServiceDeleteImageResult { - return &LaunchScreenServiceDeleteImageResult{} +func NewLaunchScreenServiceMobileGetImageResult() *LaunchScreenServiceMobileGetImageResult { + return &LaunchScreenServiceMobileGetImageResult{} } -func (p *LaunchScreenServiceDeleteImageResult) InitDefault() { +func (p *LaunchScreenServiceMobileGetImageResult) InitDefault() { } -var LaunchScreenServiceDeleteImageResult_Success_DEFAULT *DeleteImageResponse +var LaunchScreenServiceMobileGetImageResult_Success_DEFAULT *MobileGetImageResponse -func (p *LaunchScreenServiceDeleteImageResult) GetSuccess() (v *DeleteImageResponse) { +func (p *LaunchScreenServiceMobileGetImageResult) GetSuccess() (v *MobileGetImageResponse) { if !p.IsSetSuccess() { - return LaunchScreenServiceDeleteImageResult_Success_DEFAULT + return LaunchScreenServiceMobileGetImageResult_Success_DEFAULT } return p.Success } -var fieldIDToName_LaunchScreenServiceDeleteImageResult = map[int16]string{ +var fieldIDToName_LaunchScreenServiceMobileGetImageResult = map[int16]string{ 0: "success", } -func (p *LaunchScreenServiceDeleteImageResult) IsSetSuccess() bool { +func (p *LaunchScreenServiceMobileGetImageResult) IsSetSuccess() bool { return p.Success != nil } -func (p *LaunchScreenServiceDeleteImageResult) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceMobileGetImageResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -20602,7 +22016,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_LaunchScreenServiceMobileGetImageResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -20612,8 +22026,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 *LaunchScreenServiceMobileGetImageResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewMobileGetImageResponse() if err := _field.Read(iprot); err != nil { return err } @@ -20621,9 +22035,10 @@ func (p *LaunchScreenServiceDeleteImageResult) ReadField0(iprot thrift.TProtocol return nil } -func (p *LaunchScreenServiceDeleteImageResult) Write(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceMobileGetImageResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("DeleteImage_result"); err != nil { + if err = oprot.WriteStructBegin("MobileGetImage_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -20649,7 +22064,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 *LaunchScreenServiceMobileGetImageResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -20668,43 +22083,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *LaunchScreenServiceDeleteImageResult) String() string { +func (p *LaunchScreenServiceMobileGetImageResult) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceDeleteImageResult(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceMobileGetImageResult(%+v)", *p) } -type LaunchScreenServiceMobileGetImageArgs struct { - Req *MobileGetImageRequest `thrift:"req,1"` +type LaunchScreenServiceAddImagePointTimeArgs struct { + Req *AddImagePointTimeRequest `thrift:"req,1"` } -func NewLaunchScreenServiceMobileGetImageArgs() *LaunchScreenServiceMobileGetImageArgs { - return &LaunchScreenServiceMobileGetImageArgs{} +func NewLaunchScreenServiceAddImagePointTimeArgs() *LaunchScreenServiceAddImagePointTimeArgs { + return &LaunchScreenServiceAddImagePointTimeArgs{} } -func (p *LaunchScreenServiceMobileGetImageArgs) InitDefault() { +func (p *LaunchScreenServiceAddImagePointTimeArgs) InitDefault() { } -var LaunchScreenServiceMobileGetImageArgs_Req_DEFAULT *MobileGetImageRequest +var LaunchScreenServiceAddImagePointTimeArgs_Req_DEFAULT *AddImagePointTimeRequest -func (p *LaunchScreenServiceMobileGetImageArgs) GetReq() (v *MobileGetImageRequest) { +func (p *LaunchScreenServiceAddImagePointTimeArgs) GetReq() (v *AddImagePointTimeRequest) { if !p.IsSetReq() { - return LaunchScreenServiceMobileGetImageArgs_Req_DEFAULT + return LaunchScreenServiceAddImagePointTimeArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_LaunchScreenServiceMobileGetImageArgs = map[int16]string{ +var fieldIDToName_LaunchScreenServiceAddImagePointTimeArgs = map[int16]string{ 1: "req", } -func (p *LaunchScreenServiceMobileGetImageArgs) IsSetReq() bool { +func (p *LaunchScreenServiceAddImagePointTimeArgs) IsSetReq() bool { return p.Req != nil } -func (p *LaunchScreenServiceMobileGetImageArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceAddImagePointTimeArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -20750,7 +22165,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_LaunchScreenServiceAddImagePointTimeArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -20760,8 +22175,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 *LaunchScreenServiceAddImagePointTimeArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewAddImagePointTimeRequest() if err := _field.Read(iprot); err != nil { return err } @@ -20769,9 +22184,10 @@ func (p *LaunchScreenServiceMobileGetImageArgs) ReadField1(iprot thrift.TProtoco return nil } -func (p *LaunchScreenServiceMobileGetImageArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceAddImagePointTimeArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("MobileGetImage_args"); err != nil { + if err = oprot.WriteStructBegin("AddImagePointTime_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -20797,7 +22213,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 *LaunchScreenServiceAddImagePointTimeArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -20814,43 +22230,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *LaunchScreenServiceMobileGetImageArgs) String() string { +func (p *LaunchScreenServiceAddImagePointTimeArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceMobileGetImageArgs(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceAddImagePointTimeArgs(%+v)", *p) } -type LaunchScreenServiceMobileGetImageResult struct { - Success *MobileGetImageResponse `thrift:"success,0,optional"` +type LaunchScreenServiceAddImagePointTimeResult struct { + Success *AddImagePointTimeResponse `thrift:"success,0,optional"` } -func NewLaunchScreenServiceMobileGetImageResult() *LaunchScreenServiceMobileGetImageResult { - return &LaunchScreenServiceMobileGetImageResult{} +func NewLaunchScreenServiceAddImagePointTimeResult() *LaunchScreenServiceAddImagePointTimeResult { + return &LaunchScreenServiceAddImagePointTimeResult{} } -func (p *LaunchScreenServiceMobileGetImageResult) InitDefault() { +func (p *LaunchScreenServiceAddImagePointTimeResult) InitDefault() { } -var LaunchScreenServiceMobileGetImageResult_Success_DEFAULT *MobileGetImageResponse +var LaunchScreenServiceAddImagePointTimeResult_Success_DEFAULT *AddImagePointTimeResponse -func (p *LaunchScreenServiceMobileGetImageResult) GetSuccess() (v *MobileGetImageResponse) { +func (p *LaunchScreenServiceAddImagePointTimeResult) GetSuccess() (v *AddImagePointTimeResponse) { if !p.IsSetSuccess() { - return LaunchScreenServiceMobileGetImageResult_Success_DEFAULT + return LaunchScreenServiceAddImagePointTimeResult_Success_DEFAULT } return p.Success } -var fieldIDToName_LaunchScreenServiceMobileGetImageResult = map[int16]string{ +var fieldIDToName_LaunchScreenServiceAddImagePointTimeResult = map[int16]string{ 0: "success", } -func (p *LaunchScreenServiceMobileGetImageResult) IsSetSuccess() bool { +func (p *LaunchScreenServiceAddImagePointTimeResult) IsSetSuccess() bool { return p.Success != nil } -func (p *LaunchScreenServiceMobileGetImageResult) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceAddImagePointTimeResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -20896,7 +22312,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_LaunchScreenServiceAddImagePointTimeResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -20906,8 +22322,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 *LaunchScreenServiceAddImagePointTimeResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewAddImagePointTimeResponse() if err := _field.Read(iprot); err != nil { return err } @@ -20915,236 +22331,327 @@ func (p *LaunchScreenServiceMobileGetImageResult) ReadField0(iprot thrift.TProto return nil } -func (p *LaunchScreenServiceMobileGetImageResult) Write(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceAddImagePointTimeResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("MobileGetImage_result"); err != nil { + if err = oprot.WriteStructBegin("AddImagePointTime_result"); err != nil { goto WriteStructBeginError } - if p != nil { - if err = p.writeField0(oprot); err != nil { - fieldId = 0 - goto WriteFieldError - } + 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 *LaunchScreenServiceAddImagePointTimeResult) 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 *LaunchScreenServiceAddImagePointTimeResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceAddImagePointTimeResult(%+v)", *p) + +} + +type PaperServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler PaperService +} + +func (p *PaperServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *PaperServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *PaperServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +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) + } + 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 paperServiceProcessorListDirFiles struct { + handler PaperService +} + +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 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) -} - -func (p *LaunchScreenServiceMobileGetImageResult) 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 err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 } - 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 *LaunchScreenServiceMobileGetImageResult) String() string { - if p == nil { - return "" + if err != nil { + return } - return fmt.Sprintf("LaunchScreenServiceMobileGetImageResult(%+v)", *p) - -} - -type LaunchScreenServiceAddImagePointTimeArgs struct { - Req *AddImagePointTimeRequest `thrift:"req,1"` -} - -func NewLaunchScreenServiceAddImagePointTimeArgs() *LaunchScreenServiceAddImagePointTimeArgs { - return &LaunchScreenServiceAddImagePointTimeArgs{} + return true, err } -func (p *LaunchScreenServiceAddImagePointTimeArgs) InitDefault() { +type paperServiceProcessorGetDownloadUrl struct { + handler PaperService } -var LaunchScreenServiceAddImagePointTimeArgs_Req_DEFAULT *AddImagePointTimeRequest - -func (p *LaunchScreenServiceAddImagePointTimeArgs) GetReq() (v *AddImagePointTimeRequest) { - if !p.IsSetReq() { - return LaunchScreenServiceAddImagePointTimeArgs_Req_DEFAULT +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 } - return p.Req -} -var fieldIDToName_LaunchScreenServiceAddImagePointTimeArgs = map[int16]string{ - 1: "req", + 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 } -func (p *LaunchScreenServiceAddImagePointTimeArgs) IsSetReq() bool { - return p.Req != nil +type paperServiceProcessorListDirFilesForAndroid struct { + handler PaperService } -func (p *LaunchScreenServiceAddImagePointTimeArgs) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError +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 } - 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 := 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 err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError + if err2 = oprot.WriteMessageBegin("ListDirFilesForAndroid", 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_LaunchScreenServiceAddImagePointTimeArgs[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 *LaunchScreenServiceAddImagePointTimeArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewAddImagePointTimeRequest() - if err := _field.Read(iprot); err != nil { - return err - } - p.Req = _field - return nil +type paperServiceProcessorGetDownloadUrlForAndroid struct { + handler PaperService } -func (p *LaunchScreenServiceAddImagePointTimeArgs) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("AddImagePointTime_args"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } +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 } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError + + 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 err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError + if err2 = oprot.WriteMessageBegin("GetDownloadUrlForAndroid", 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 *LaunchScreenServiceAddImagePointTimeArgs) 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 *LaunchScreenServiceAddImagePointTimeArgs) String() string { - if p == nil { - return "" + if err != nil { + return } - return fmt.Sprintf("LaunchScreenServiceAddImagePointTimeArgs(%+v)", *p) - + return true, err } -type LaunchScreenServiceAddImagePointTimeResult struct { - Success *AddImagePointTimeResponse `thrift:"success,0,optional"` +type PaperServiceListDirFilesArgs struct { + Req *ListDirFilesRequest `thrift:"req,1"` } -func NewLaunchScreenServiceAddImagePointTimeResult() *LaunchScreenServiceAddImagePointTimeResult { - return &LaunchScreenServiceAddImagePointTimeResult{} +func NewPaperServiceListDirFilesArgs() *PaperServiceListDirFilesArgs { + return &PaperServiceListDirFilesArgs{} } -func (p *LaunchScreenServiceAddImagePointTimeResult) InitDefault() { +func (p *PaperServiceListDirFilesArgs) InitDefault() { } -var LaunchScreenServiceAddImagePointTimeResult_Success_DEFAULT *AddImagePointTimeResponse +var PaperServiceListDirFilesArgs_Req_DEFAULT *ListDirFilesRequest -func (p *LaunchScreenServiceAddImagePointTimeResult) GetSuccess() (v *AddImagePointTimeResponse) { - if !p.IsSetSuccess() { - return LaunchScreenServiceAddImagePointTimeResult_Success_DEFAULT +func (p *PaperServiceListDirFilesArgs) GetReq() (v *ListDirFilesRequest) { + if !p.IsSetReq() { + return PaperServiceListDirFilesArgs_Req_DEFAULT } - return p.Success + return p.Req } -var fieldIDToName_LaunchScreenServiceAddImagePointTimeResult = map[int16]string{ - 0: "success", +var fieldIDToName_PaperServiceListDirFilesArgs = map[int16]string{ + 1: "req", } -func (p *LaunchScreenServiceAddImagePointTimeResult) IsSetSuccess() bool { - return p.Success != nil +func (p *PaperServiceListDirFilesArgs) IsSetReq() bool { + return p.Req != nil } -func (p *LaunchScreenServiceAddImagePointTimeResult) Read(iprot thrift.TProtocol) (err error) { +func (p *PaperServiceListDirFilesArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -21163,9 +22670,9 @@ func (p *LaunchScreenServiceAddImagePointTimeResult) 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 { @@ -21190,7 +22697,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_PaperServiceListDirFilesArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -21200,23 +22707,24 @@ 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 *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 *LaunchScreenServiceAddImagePointTimeResult) Write(oprot thrift.TProtocol) (err error) { +func (p *PaperServiceListDirFilesArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("AddImagePointTime_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 } } @@ -21237,298 +22745,209 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *LaunchScreenServiceAddImagePointTimeResult) 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 *LaunchScreenServiceAddImagePointTimeResult) String() string { +func (p *PaperServiceListDirFilesArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceAddImagePointTimeResult(%+v)", *p) - -} - -type PaperServiceProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler PaperService -} - -func (p *PaperServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor -} - -func (p *PaperServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok -} - -func (p *PaperServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap -} + return fmt.Sprintf("PaperServiceListDirFilesArgs(%+v)", *p) -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) - } - 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 paperServiceProcessorListDirFiles struct { - handler PaperService +type PaperServiceListDirFilesResult struct { + Success *ListDirFilesResponse `thrift:"success,0,optional"` } -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 NewPaperServiceListDirFilesResult() *PaperServiceListDirFilesResult { + return &PaperServiceListDirFilesResult{} } -type paperServiceProcessorGetDownloadUrl struct { - handler PaperService +func (p *PaperServiceListDirFilesResult) InitDefault() { } -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 PaperServiceListDirFilesResult_Success_DEFAULT *ListDirFilesResponse - 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 +func (p *PaperServiceListDirFilesResult) GetSuccess() (v *ListDirFilesResponse) { + if !p.IsSetSuccess() { + return PaperServiceListDirFilesResult_Success_DEFAULT } - return true, err + return p.Success } -type paperServiceProcessorListDirFilesForAndroid struct { - handler PaperService +var fieldIDToName_PaperServiceListDirFilesResult = map[int16]string{ + 0: "success", } -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 - } +func (p *PaperServiceListDirFilesResult) IsSetSuccess() bool { + return p.Success != nil +} - 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 +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 paperServiceProcessorGetDownloadUrlForAndroid struct { - handler PaperService + 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 *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 +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 := 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 +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("GetDownloadUrlForAndroid", 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 PaperServiceListDirFilesArgs struct { - Req *ListDirFilesRequest `thrift:"req,1"` +type PaperServiceGetDownloadUrlArgs struct { + Req *GetDownloadUrlRequest `thrift:"req,1"` } -func NewPaperServiceListDirFilesArgs() *PaperServiceListDirFilesArgs { - return &PaperServiceListDirFilesArgs{} +func NewPaperServiceGetDownloadUrlArgs() *PaperServiceGetDownloadUrlArgs { + return &PaperServiceGetDownloadUrlArgs{} } -func (p *PaperServiceListDirFilesArgs) InitDefault() { +func (p *PaperServiceGetDownloadUrlArgs) InitDefault() { } -var PaperServiceListDirFilesArgs_Req_DEFAULT *ListDirFilesRequest +var PaperServiceGetDownloadUrlArgs_Req_DEFAULT *GetDownloadUrlRequest -func (p *PaperServiceListDirFilesArgs) GetReq() (v *ListDirFilesRequest) { +func (p *PaperServiceGetDownloadUrlArgs) GetReq() (v *GetDownloadUrlRequest) { if !p.IsSetReq() { - return PaperServiceListDirFilesArgs_Req_DEFAULT + return PaperServiceGetDownloadUrlArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_PaperServiceListDirFilesArgs = map[int16]string{ +var fieldIDToName_PaperServiceGetDownloadUrlArgs = map[int16]string{ 1: "req", } -func (p *PaperServiceListDirFilesArgs) IsSetReq() bool { +func (p *PaperServiceGetDownloadUrlArgs) IsSetReq() bool { return p.Req != nil } -func (p *PaperServiceListDirFilesArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *PaperServiceGetDownloadUrlArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -21574,7 +22993,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_PaperServiceGetDownloadUrlArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -21584,8 +23003,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 *PaperServiceGetDownloadUrlArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetDownloadUrlRequest() if err := _field.Read(iprot); err != nil { return err } @@ -21593,9 +23012,10 @@ func (p *PaperServiceListDirFilesArgs) ReadField1(iprot thrift.TProtocol) error return nil } -func (p *PaperServiceListDirFilesArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *PaperServiceGetDownloadUrlArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("ListDirFiles_args"); err != nil { + if err = oprot.WriteStructBegin("GetDownloadUrl_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -21621,7 +23041,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 *PaperServiceGetDownloadUrlArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -21638,43 +23058,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *PaperServiceListDirFilesArgs) String() string { +func (p *PaperServiceGetDownloadUrlArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("PaperServiceListDirFilesArgs(%+v)", *p) + return fmt.Sprintf("PaperServiceGetDownloadUrlArgs(%+v)", *p) } -type PaperServiceListDirFilesResult struct { - Success *ListDirFilesResponse `thrift:"success,0,optional"` +type PaperServiceGetDownloadUrlResult struct { + Success *GetDownloadUrlResponse `thrift:"success,0,optional"` } -func NewPaperServiceListDirFilesResult() *PaperServiceListDirFilesResult { - return &PaperServiceListDirFilesResult{} +func NewPaperServiceGetDownloadUrlResult() *PaperServiceGetDownloadUrlResult { + return &PaperServiceGetDownloadUrlResult{} } -func (p *PaperServiceListDirFilesResult) InitDefault() { +func (p *PaperServiceGetDownloadUrlResult) InitDefault() { } -var PaperServiceListDirFilesResult_Success_DEFAULT *ListDirFilesResponse +var PaperServiceGetDownloadUrlResult_Success_DEFAULT *GetDownloadUrlResponse -func (p *PaperServiceListDirFilesResult) GetSuccess() (v *ListDirFilesResponse) { +func (p *PaperServiceGetDownloadUrlResult) GetSuccess() (v *GetDownloadUrlResponse) { if !p.IsSetSuccess() { - return PaperServiceListDirFilesResult_Success_DEFAULT + return PaperServiceGetDownloadUrlResult_Success_DEFAULT } return p.Success } -var fieldIDToName_PaperServiceListDirFilesResult = map[int16]string{ +var fieldIDToName_PaperServiceGetDownloadUrlResult = map[int16]string{ 0: "success", } -func (p *PaperServiceListDirFilesResult) IsSetSuccess() bool { +func (p *PaperServiceGetDownloadUrlResult) IsSetSuccess() bool { return p.Success != nil } -func (p *PaperServiceListDirFilesResult) Read(iprot thrift.TProtocol) (err error) { +func (p *PaperServiceGetDownloadUrlResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -21720,7 +23140,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_PaperServiceGetDownloadUrlResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -21730,8 +23150,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 *PaperServiceGetDownloadUrlResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetDownloadUrlResponse() if err := _field.Read(iprot); err != nil { return err } @@ -21739,9 +23159,10 @@ func (p *PaperServiceListDirFilesResult) ReadField0(iprot thrift.TProtocol) erro return nil } -func (p *PaperServiceListDirFilesResult) Write(oprot thrift.TProtocol) (err error) { +func (p *PaperServiceGetDownloadUrlResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("ListDirFiles_result"); err != nil { + if err = oprot.WriteStructBegin("GetDownloadUrl_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -21767,7 +23188,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 *PaperServiceGetDownloadUrlResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -21786,43 +23207,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *PaperServiceListDirFilesResult) String() string { +func (p *PaperServiceGetDownloadUrlResult) String() string { if p == nil { return "" } - return fmt.Sprintf("PaperServiceListDirFilesResult(%+v)", *p) + return fmt.Sprintf("PaperServiceGetDownloadUrlResult(%+v)", *p) } -type PaperServiceGetDownloadUrlArgs struct { - Req *GetDownloadUrlRequest `thrift:"req,1"` +type PaperServiceListDirFilesForAndroidArgs struct { + Req *ListDirFilesForAndroidRequest `thrift:"req,1"` } -func NewPaperServiceGetDownloadUrlArgs() *PaperServiceGetDownloadUrlArgs { - return &PaperServiceGetDownloadUrlArgs{} +func NewPaperServiceListDirFilesForAndroidArgs() *PaperServiceListDirFilesForAndroidArgs { + return &PaperServiceListDirFilesForAndroidArgs{} } -func (p *PaperServiceGetDownloadUrlArgs) InitDefault() { +func (p *PaperServiceListDirFilesForAndroidArgs) InitDefault() { } -var PaperServiceGetDownloadUrlArgs_Req_DEFAULT *GetDownloadUrlRequest +var PaperServiceListDirFilesForAndroidArgs_Req_DEFAULT *ListDirFilesForAndroidRequest -func (p *PaperServiceGetDownloadUrlArgs) GetReq() (v *GetDownloadUrlRequest) { +func (p *PaperServiceListDirFilesForAndroidArgs) GetReq() (v *ListDirFilesForAndroidRequest) { if !p.IsSetReq() { - return PaperServiceGetDownloadUrlArgs_Req_DEFAULT + return PaperServiceListDirFilesForAndroidArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_PaperServiceGetDownloadUrlArgs = map[int16]string{ +var fieldIDToName_PaperServiceListDirFilesForAndroidArgs = map[int16]string{ 1: "req", } -func (p *PaperServiceGetDownloadUrlArgs) IsSetReq() bool { +func (p *PaperServiceListDirFilesForAndroidArgs) IsSetReq() bool { return p.Req != nil } -func (p *PaperServiceGetDownloadUrlArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *PaperServiceListDirFilesForAndroidArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -21868,7 +23289,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_PaperServiceListDirFilesForAndroidArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -21878,8 +23299,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 *PaperServiceListDirFilesForAndroidArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewListDirFilesForAndroidRequest() if err := _field.Read(iprot); err != nil { return err } @@ -21887,9 +23308,10 @@ func (p *PaperServiceGetDownloadUrlArgs) ReadField1(iprot thrift.TProtocol) erro return nil } -func (p *PaperServiceGetDownloadUrlArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *PaperServiceListDirFilesForAndroidArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetDownloadUrl_args"); err != nil { + if err = oprot.WriteStructBegin("ListDirFilesForAndroid_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -21915,7 +23337,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 *PaperServiceListDirFilesForAndroidArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -21932,43 +23354,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *PaperServiceGetDownloadUrlArgs) String() string { +func (p *PaperServiceListDirFilesForAndroidArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("PaperServiceGetDownloadUrlArgs(%+v)", *p) + return fmt.Sprintf("PaperServiceListDirFilesForAndroidArgs(%+v)", *p) } -type PaperServiceGetDownloadUrlResult struct { - Success *GetDownloadUrlResponse `thrift:"success,0,optional"` +type PaperServiceListDirFilesForAndroidResult struct { + Success *ListDirFilesForAndroidResponse `thrift:"success,0,optional"` } -func NewPaperServiceGetDownloadUrlResult() *PaperServiceGetDownloadUrlResult { - return &PaperServiceGetDownloadUrlResult{} +func NewPaperServiceListDirFilesForAndroidResult() *PaperServiceListDirFilesForAndroidResult { + return &PaperServiceListDirFilesForAndroidResult{} } -func (p *PaperServiceGetDownloadUrlResult) InitDefault() { +func (p *PaperServiceListDirFilesForAndroidResult) InitDefault() { } -var PaperServiceGetDownloadUrlResult_Success_DEFAULT *GetDownloadUrlResponse +var PaperServiceListDirFilesForAndroidResult_Success_DEFAULT *ListDirFilesForAndroidResponse -func (p *PaperServiceGetDownloadUrlResult) GetSuccess() (v *GetDownloadUrlResponse) { +func (p *PaperServiceListDirFilesForAndroidResult) GetSuccess() (v *ListDirFilesForAndroidResponse) { if !p.IsSetSuccess() { - return PaperServiceGetDownloadUrlResult_Success_DEFAULT + return PaperServiceListDirFilesForAndroidResult_Success_DEFAULT } return p.Success } -var fieldIDToName_PaperServiceGetDownloadUrlResult = map[int16]string{ +var fieldIDToName_PaperServiceListDirFilesForAndroidResult = map[int16]string{ 0: "success", } -func (p *PaperServiceGetDownloadUrlResult) IsSetSuccess() bool { +func (p *PaperServiceListDirFilesForAndroidResult) IsSetSuccess() bool { return p.Success != nil } -func (p *PaperServiceGetDownloadUrlResult) Read(iprot thrift.TProtocol) (err error) { +func (p *PaperServiceListDirFilesForAndroidResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -22014,7 +23436,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_PaperServiceListDirFilesForAndroidResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -22024,8 +23446,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 *PaperServiceListDirFilesForAndroidResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewListDirFilesForAndroidResponse() if err := _field.Read(iprot); err != nil { return err } @@ -22033,9 +23455,10 @@ func (p *PaperServiceGetDownloadUrlResult) ReadField0(iprot thrift.TProtocol) er return nil } -func (p *PaperServiceGetDownloadUrlResult) Write(oprot thrift.TProtocol) (err error) { +func (p *PaperServiceListDirFilesForAndroidResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetDownloadUrl_result"); err != nil { + if err = oprot.WriteStructBegin("ListDirFilesForAndroid_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -22061,7 +23484,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 *PaperServiceListDirFilesForAndroidResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -22080,43 +23503,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *PaperServiceGetDownloadUrlResult) String() string { +func (p *PaperServiceListDirFilesForAndroidResult) String() string { if p == nil { return "" } - return fmt.Sprintf("PaperServiceGetDownloadUrlResult(%+v)", *p) + return fmt.Sprintf("PaperServiceListDirFilesForAndroidResult(%+v)", *p) } -type PaperServiceListDirFilesForAndroidArgs struct { - Req *ListDirFilesForAndroidRequest `thrift:"req,1"` +type PaperServiceGetDownloadUrlForAndroidArgs struct { + Req *GetDownloadUrlForAndroidRequest `thrift:"req,1"` } -func NewPaperServiceListDirFilesForAndroidArgs() *PaperServiceListDirFilesForAndroidArgs { - return &PaperServiceListDirFilesForAndroidArgs{} +func NewPaperServiceGetDownloadUrlForAndroidArgs() *PaperServiceGetDownloadUrlForAndroidArgs { + return &PaperServiceGetDownloadUrlForAndroidArgs{} } -func (p *PaperServiceListDirFilesForAndroidArgs) InitDefault() { +func (p *PaperServiceGetDownloadUrlForAndroidArgs) InitDefault() { } -var PaperServiceListDirFilesForAndroidArgs_Req_DEFAULT *ListDirFilesForAndroidRequest +var PaperServiceGetDownloadUrlForAndroidArgs_Req_DEFAULT *GetDownloadUrlForAndroidRequest -func (p *PaperServiceListDirFilesForAndroidArgs) GetReq() (v *ListDirFilesForAndroidRequest) { +func (p *PaperServiceGetDownloadUrlForAndroidArgs) GetReq() (v *GetDownloadUrlForAndroidRequest) { if !p.IsSetReq() { - return PaperServiceListDirFilesForAndroidArgs_Req_DEFAULT + return PaperServiceGetDownloadUrlForAndroidArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_PaperServiceListDirFilesForAndroidArgs = map[int16]string{ +var fieldIDToName_PaperServiceGetDownloadUrlForAndroidArgs = map[int16]string{ 1: "req", } -func (p *PaperServiceListDirFilesForAndroidArgs) IsSetReq() bool { +func (p *PaperServiceGetDownloadUrlForAndroidArgs) IsSetReq() bool { return p.Req != nil } -func (p *PaperServiceListDirFilesForAndroidArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *PaperServiceGetDownloadUrlForAndroidArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -22162,7 +23585,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_PaperServiceGetDownloadUrlForAndroidArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -22172,8 +23595,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 *PaperServiceGetDownloadUrlForAndroidArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetDownloadUrlForAndroidRequest() if err := _field.Read(iprot); err != nil { return err } @@ -22181,9 +23604,10 @@ func (p *PaperServiceListDirFilesForAndroidArgs) ReadField1(iprot thrift.TProtoc return nil } -func (p *PaperServiceListDirFilesForAndroidArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *PaperServiceGetDownloadUrlForAndroidArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("ListDirFilesForAndroid_args"); err != nil { + if err = oprot.WriteStructBegin("GetDownloadUrlForAndroid_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -22209,7 +23633,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 *PaperServiceGetDownloadUrlForAndroidArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -22226,43 +23650,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *PaperServiceListDirFilesForAndroidArgs) String() string { +func (p *PaperServiceGetDownloadUrlForAndroidArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("PaperServiceListDirFilesForAndroidArgs(%+v)", *p) + return fmt.Sprintf("PaperServiceGetDownloadUrlForAndroidArgs(%+v)", *p) } -type PaperServiceListDirFilesForAndroidResult struct { - Success *ListDirFilesForAndroidResponse `thrift:"success,0,optional"` +type PaperServiceGetDownloadUrlForAndroidResult struct { + Success *GetDownloadUrlForAndroidResponse `thrift:"success,0,optional"` } -func NewPaperServiceListDirFilesForAndroidResult() *PaperServiceListDirFilesForAndroidResult { - return &PaperServiceListDirFilesForAndroidResult{} +func NewPaperServiceGetDownloadUrlForAndroidResult() *PaperServiceGetDownloadUrlForAndroidResult { + return &PaperServiceGetDownloadUrlForAndroidResult{} } -func (p *PaperServiceListDirFilesForAndroidResult) InitDefault() { +func (p *PaperServiceGetDownloadUrlForAndroidResult) InitDefault() { } -var PaperServiceListDirFilesForAndroidResult_Success_DEFAULT *ListDirFilesForAndroidResponse +var PaperServiceGetDownloadUrlForAndroidResult_Success_DEFAULT *GetDownloadUrlForAndroidResponse -func (p *PaperServiceListDirFilesForAndroidResult) GetSuccess() (v *ListDirFilesForAndroidResponse) { +func (p *PaperServiceGetDownloadUrlForAndroidResult) GetSuccess() (v *GetDownloadUrlForAndroidResponse) { if !p.IsSetSuccess() { - return PaperServiceListDirFilesForAndroidResult_Success_DEFAULT + return PaperServiceGetDownloadUrlForAndroidResult_Success_DEFAULT } return p.Success } -var fieldIDToName_PaperServiceListDirFilesForAndroidResult = map[int16]string{ +var fieldIDToName_PaperServiceGetDownloadUrlForAndroidResult = map[int16]string{ 0: "success", } -func (p *PaperServiceListDirFilesForAndroidResult) IsSetSuccess() bool { +func (p *PaperServiceGetDownloadUrlForAndroidResult) IsSetSuccess() bool { return p.Success != nil } -func (p *PaperServiceListDirFilesForAndroidResult) Read(iprot thrift.TProtocol) (err error) { +func (p *PaperServiceGetDownloadUrlForAndroidResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -22308,7 +23732,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_PaperServiceGetDownloadUrlForAndroidResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -22318,8 +23742,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 *PaperServiceGetDownloadUrlForAndroidResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetDownloadUrlForAndroidResponse() if err := _field.Read(iprot); err != nil { return err } @@ -22327,9 +23751,10 @@ func (p *PaperServiceListDirFilesForAndroidResult) ReadField0(iprot thrift.TProt return nil } -func (p *PaperServiceListDirFilesForAndroidResult) Write(oprot thrift.TProtocol) (err error) { +func (p *PaperServiceGetDownloadUrlForAndroidResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("ListDirFilesForAndroid_result"); err != nil { + if err = oprot.WriteStructBegin("GetDownloadUrlForAndroid_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -22355,7 +23780,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 *PaperServiceGetDownloadUrlForAndroidResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -22367,196 +23792,335 @@ func (p *PaperServiceListDirFilesForAndroidResult) writeField0(oprot thrift.TPro 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 *PaperServiceListDirFilesForAndroidResult) String() string { - if p == 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 *PaperServiceGetDownloadUrlForAndroidResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PaperServiceGetDownloadUrlForAndroidResult(%+v)", *p) + +} + +type AcademicServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler AcademicService +} + +func (p *AcademicServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *AcademicServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *AcademicServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +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}) + self.AddToProcessorMap("GetPlan", &academicServiceProcessorGetPlan{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) + } + 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 academicServiceProcessorGetScores struct { + handler AcademicService +} + +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 + } + + 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 } - return fmt.Sprintf("PaperServiceListDirFilesForAndroidResult(%+v)", *p) - -} - -type PaperServiceGetDownloadUrlForAndroidArgs struct { - Req *GetDownloadUrlForAndroidRequest `thrift:"req,1"` -} - -func NewPaperServiceGetDownloadUrlForAndroidArgs() *PaperServiceGetDownloadUrlForAndroidArgs { - return &PaperServiceGetDownloadUrlForAndroidArgs{} + 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) InitDefault() { +type academicServiceProcessorGetGPA struct { + handler AcademicService } -var PaperServiceGetDownloadUrlForAndroidArgs_Req_DEFAULT *GetDownloadUrlForAndroidRequest - -func (p *PaperServiceGetDownloadUrlForAndroidArgs) GetReq() (v *GetDownloadUrlForAndroidRequest) { - if !p.IsSetReq() { - return PaperServiceGetDownloadUrlForAndroidArgs_Req_DEFAULT +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 } - return p.Req -} -var fieldIDToName_PaperServiceGetDownloadUrlForAndroidArgs = map[int16]string{ - 1: "req", + 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 + } + 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 } -func (p *PaperServiceGetDownloadUrlForAndroidArgs) IsSetReq() bool { - return p.Req != nil +type academicServiceProcessorGetCredit struct { + handler AcademicService } -func (p *PaperServiceGetDownloadUrlForAndroidArgs) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError +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 } - 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 := 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 err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError + if err2 = oprot.WriteMessageBegin("GetCredit", 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_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) + 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) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetDownloadUrlForAndroidRequest() - if err := _field.Read(iprot); err != nil { - return err - } - p.Req = _field - return nil +type academicServiceProcessorGetUnifiedExam struct { + handler AcademicService } -func (p *PaperServiceGetDownloadUrlForAndroidArgs) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("GetDownloadUrlForAndroid_args"); err != nil { - goto WriteStructBeginError +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 } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } + + 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 err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError + if err2 = oprot.WriteMessageBegin("GetUnifiedExam", 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 *PaperServiceGetDownloadUrlForAndroidArgs) 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 *PaperServiceGetDownloadUrlForAndroidArgs) String() string { - if p == nil { - return "" +type academicServiceProcessorGetPlan struct { + handler AcademicService +} + +func (p *academicServiceProcessorGetPlan) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AcademicServiceGetPlanArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetPlan", 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 := AcademicServiceGetPlanResult{} + var retval *GetPlanResponse + if retval, err2 = p.handler.GetPlan(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetPlan: "+err2.Error()) + oprot.WriteMessageBegin("GetPlan", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetPlan", 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 AcademicServiceGetScoresArgs struct { + Req *GetScoresRequest `thrift:"req,1"` } -func NewPaperServiceGetDownloadUrlForAndroidResult() *PaperServiceGetDownloadUrlForAndroidResult { - return &PaperServiceGetDownloadUrlForAndroidResult{} +func NewAcademicServiceGetScoresArgs() *AcademicServiceGetScoresArgs { + return &AcademicServiceGetScoresArgs{} } -func (p *PaperServiceGetDownloadUrlForAndroidResult) InitDefault() { +func (p *AcademicServiceGetScoresArgs) InitDefault() { } -var PaperServiceGetDownloadUrlForAndroidResult_Success_DEFAULT *GetDownloadUrlForAndroidResponse +var AcademicServiceGetScoresArgs_Req_DEFAULT *GetScoresRequest -func (p *PaperServiceGetDownloadUrlForAndroidResult) GetSuccess() (v *GetDownloadUrlForAndroidResponse) { - if !p.IsSetSuccess() { - return PaperServiceGetDownloadUrlForAndroidResult_Success_DEFAULT +func (p *AcademicServiceGetScoresArgs) GetReq() (v *GetScoresRequest) { + if !p.IsSetReq() { + return AcademicServiceGetScoresArgs_Req_DEFAULT } - return p.Success + return p.Req } -var fieldIDToName_PaperServiceGetDownloadUrlForAndroidResult = map[int16]string{ - 0: "success", +var fieldIDToName_AcademicServiceGetScoresArgs = map[int16]string{ + 1: "req", } -func (p *PaperServiceGetDownloadUrlForAndroidResult) IsSetSuccess() bool { - return p.Success != nil +func (p *AcademicServiceGetScoresArgs) IsSetReq() bool { + return p.Req != nil } -func (p *PaperServiceGetDownloadUrlForAndroidResult) Read(iprot thrift.TProtocol) (err error) { +func (p *AcademicServiceGetScoresArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -22575,9 +24139,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 { @@ -22602,7 +24166,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_AcademicServiceGetScoresArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -22612,23 +24176,24 @@ 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 *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 *PaperServiceGetDownloadUrlForAndroidResult) Write(oprot thrift.TProtocol) (err error) { +func (p *AcademicServiceGetScoresArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetDownloadUrlForAndroid_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 } } @@ -22649,298 +24214,209 @@ 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 *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 *PaperServiceGetDownloadUrlForAndroidResult) String() string { +func (p *AcademicServiceGetScoresArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("PaperServiceGetDownloadUrlForAndroidResult(%+v)", *p) - -} - -type AcademicServiceProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler AcademicService -} - -func (p *AcademicServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor -} - -func (p *AcademicServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok -} - -func (p *AcademicServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap -} - -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) - } - 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 academicServiceProcessorGetScores struct { - handler AcademicService -} - -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 - } - - 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 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} + return fmt.Sprintf("AcademicServiceGetScoresArgs(%+v)", *p) -type academicServiceProcessorGetGPA struct { - handler AcademicService } - -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 - } - - 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 - } - 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 + +type AcademicServiceGetScoresResult struct { + Success *GetScoresResponse `thrift:"success,0,optional"` } -type academicServiceProcessorGetCredit struct { - handler AcademicService +func NewAcademicServiceGetScoresResult() *AcademicServiceGetScoresResult { + return &AcademicServiceGetScoresResult{} } -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 (p *AcademicServiceGetScoresResult) InitDefault() { +} - 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 +var AcademicServiceGetScoresResult_Success_DEFAULT *GetScoresResponse + +func (p *AcademicServiceGetScoresResult) GetSuccess() (v *GetScoresResponse) { + if !p.IsSetSuccess() { + return AcademicServiceGetScoresResult_Success_DEFAULT } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + return p.Success +} + +var fieldIDToName_AcademicServiceGetScoresResult = map[int16]string{ + 0: "success", +} + +func (p *AcademicServiceGetScoresResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AcademicServiceGetScoresResult) 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 academicServiceProcessorGetUnifiedExam 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_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 *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 +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 := 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 +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.WriteMessageBegin("GetUnifiedExam", 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 *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 + } } - 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 *AcademicServiceGetScoresResult) String() string { + if p == nil { + return "" } - return true, err + return fmt.Sprintf("AcademicServiceGetScoresResult(%+v)", *p) + } -type AcademicServiceGetScoresArgs struct { - Req *GetScoresRequest `thrift:"req,1"` +type AcademicServiceGetGPAArgs struct { + Req *GetGPARequest `thrift:"req,1"` } -func NewAcademicServiceGetScoresArgs() *AcademicServiceGetScoresArgs { - return &AcademicServiceGetScoresArgs{} +func NewAcademicServiceGetGPAArgs() *AcademicServiceGetGPAArgs { + return &AcademicServiceGetGPAArgs{} } -func (p *AcademicServiceGetScoresArgs) InitDefault() { +func (p *AcademicServiceGetGPAArgs) InitDefault() { } -var AcademicServiceGetScoresArgs_Req_DEFAULT *GetScoresRequest +var AcademicServiceGetGPAArgs_Req_DEFAULT *GetGPARequest -func (p *AcademicServiceGetScoresArgs) GetReq() (v *GetScoresRequest) { +func (p *AcademicServiceGetGPAArgs) GetReq() (v *GetGPARequest) { if !p.IsSetReq() { - return AcademicServiceGetScoresArgs_Req_DEFAULT + return AcademicServiceGetGPAArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_AcademicServiceGetScoresArgs = map[int16]string{ +var fieldIDToName_AcademicServiceGetGPAArgs = map[int16]string{ 1: "req", } -func (p *AcademicServiceGetScoresArgs) IsSetReq() bool { +func (p *AcademicServiceGetGPAArgs) IsSetReq() bool { return p.Req != nil } -func (p *AcademicServiceGetScoresArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *AcademicServiceGetGPAArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -22986,7 +24462,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_AcademicServiceGetGPAArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -22996,8 +24472,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 *AcademicServiceGetGPAArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetGPARequest() if err := _field.Read(iprot); err != nil { return err } @@ -23005,9 +24481,10 @@ func (p *AcademicServiceGetScoresArgs) ReadField1(iprot thrift.TProtocol) error return nil } -func (p *AcademicServiceGetScoresArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *AcademicServiceGetGPAArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetScores_args"); err != nil { + if err = oprot.WriteStructBegin("GetGPA_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -23033,7 +24510,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 *AcademicServiceGetGPAArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -23050,43 +24527,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *AcademicServiceGetScoresArgs) String() string { +func (p *AcademicServiceGetGPAArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("AcademicServiceGetScoresArgs(%+v)", *p) + return fmt.Sprintf("AcademicServiceGetGPAArgs(%+v)", *p) } -type AcademicServiceGetScoresResult struct { - Success *GetScoresResponse `thrift:"success,0,optional"` +type AcademicServiceGetGPAResult struct { + Success *GetGPAResponse `thrift:"success,0,optional"` } -func NewAcademicServiceGetScoresResult() *AcademicServiceGetScoresResult { - return &AcademicServiceGetScoresResult{} +func NewAcademicServiceGetGPAResult() *AcademicServiceGetGPAResult { + return &AcademicServiceGetGPAResult{} } -func (p *AcademicServiceGetScoresResult) InitDefault() { +func (p *AcademicServiceGetGPAResult) InitDefault() { } -var AcademicServiceGetScoresResult_Success_DEFAULT *GetScoresResponse +var AcademicServiceGetGPAResult_Success_DEFAULT *GetGPAResponse -func (p *AcademicServiceGetScoresResult) GetSuccess() (v *GetScoresResponse) { +func (p *AcademicServiceGetGPAResult) GetSuccess() (v *GetGPAResponse) { if !p.IsSetSuccess() { - return AcademicServiceGetScoresResult_Success_DEFAULT + return AcademicServiceGetGPAResult_Success_DEFAULT } return p.Success } -var fieldIDToName_AcademicServiceGetScoresResult = map[int16]string{ +var fieldIDToName_AcademicServiceGetGPAResult = map[int16]string{ 0: "success", } -func (p *AcademicServiceGetScoresResult) IsSetSuccess() bool { +func (p *AcademicServiceGetGPAResult) IsSetSuccess() bool { return p.Success != nil } -func (p *AcademicServiceGetScoresResult) Read(iprot thrift.TProtocol) (err error) { +func (p *AcademicServiceGetGPAResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -23132,7 +24609,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_AcademicServiceGetGPAResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -23142,8 +24619,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 *AcademicServiceGetGPAResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetGPAResponse() if err := _field.Read(iprot); err != nil { return err } @@ -23151,9 +24628,10 @@ func (p *AcademicServiceGetScoresResult) ReadField0(iprot thrift.TProtocol) erro return nil } -func (p *AcademicServiceGetScoresResult) Write(oprot thrift.TProtocol) (err error) { +func (p *AcademicServiceGetGPAResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetScores_result"); err != nil { + if err = oprot.WriteStructBegin("GetGPA_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -23179,7 +24657,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 *AcademicServiceGetGPAResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -23198,43 +24676,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *AcademicServiceGetScoresResult) String() string { +func (p *AcademicServiceGetGPAResult) String() string { if p == nil { return "" } - return fmt.Sprintf("AcademicServiceGetScoresResult(%+v)", *p) + return fmt.Sprintf("AcademicServiceGetGPAResult(%+v)", *p) } -type AcademicServiceGetGPAArgs struct { - Req *GetGPARequest `thrift:"req,1"` +type AcademicServiceGetCreditArgs struct { + Req *GetCreditRequest `thrift:"req,1"` } -func NewAcademicServiceGetGPAArgs() *AcademicServiceGetGPAArgs { - return &AcademicServiceGetGPAArgs{} +func NewAcademicServiceGetCreditArgs() *AcademicServiceGetCreditArgs { + return &AcademicServiceGetCreditArgs{} } -func (p *AcademicServiceGetGPAArgs) InitDefault() { +func (p *AcademicServiceGetCreditArgs) InitDefault() { } -var AcademicServiceGetGPAArgs_Req_DEFAULT *GetGPARequest +var AcademicServiceGetCreditArgs_Req_DEFAULT *GetCreditRequest -func (p *AcademicServiceGetGPAArgs) GetReq() (v *GetGPARequest) { +func (p *AcademicServiceGetCreditArgs) GetReq() (v *GetCreditRequest) { if !p.IsSetReq() { - return AcademicServiceGetGPAArgs_Req_DEFAULT + return AcademicServiceGetCreditArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_AcademicServiceGetGPAArgs = map[int16]string{ +var fieldIDToName_AcademicServiceGetCreditArgs = map[int16]string{ 1: "req", } -func (p *AcademicServiceGetGPAArgs) IsSetReq() bool { +func (p *AcademicServiceGetCreditArgs) IsSetReq() bool { return p.Req != nil } -func (p *AcademicServiceGetGPAArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *AcademicServiceGetCreditArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -23280,7 +24758,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_AcademicServiceGetCreditArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -23290,8 +24768,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 *AcademicServiceGetCreditArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetCreditRequest() if err := _field.Read(iprot); err != nil { return err } @@ -23299,9 +24777,10 @@ func (p *AcademicServiceGetGPAArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *AcademicServiceGetGPAArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *AcademicServiceGetCreditArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetGPA_args"); err != nil { + if err = oprot.WriteStructBegin("GetCredit_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -23327,7 +24806,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 *AcademicServiceGetCreditArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -23344,43 +24823,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *AcademicServiceGetGPAArgs) String() string { +func (p *AcademicServiceGetCreditArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("AcademicServiceGetGPAArgs(%+v)", *p) + return fmt.Sprintf("AcademicServiceGetCreditArgs(%+v)", *p) } -type AcademicServiceGetGPAResult struct { - Success *GetGPAResponse `thrift:"success,0,optional"` +type AcademicServiceGetCreditResult struct { + Success *GetCreditResponse `thrift:"success,0,optional"` } -func NewAcademicServiceGetGPAResult() *AcademicServiceGetGPAResult { - return &AcademicServiceGetGPAResult{} +func NewAcademicServiceGetCreditResult() *AcademicServiceGetCreditResult { + return &AcademicServiceGetCreditResult{} } -func (p *AcademicServiceGetGPAResult) InitDefault() { +func (p *AcademicServiceGetCreditResult) InitDefault() { } -var AcademicServiceGetGPAResult_Success_DEFAULT *GetGPAResponse +var AcademicServiceGetCreditResult_Success_DEFAULT *GetCreditResponse -func (p *AcademicServiceGetGPAResult) GetSuccess() (v *GetGPAResponse) { +func (p *AcademicServiceGetCreditResult) GetSuccess() (v *GetCreditResponse) { if !p.IsSetSuccess() { - return AcademicServiceGetGPAResult_Success_DEFAULT + return AcademicServiceGetCreditResult_Success_DEFAULT } return p.Success } -var fieldIDToName_AcademicServiceGetGPAResult = map[int16]string{ +var fieldIDToName_AcademicServiceGetCreditResult = map[int16]string{ 0: "success", } -func (p *AcademicServiceGetGPAResult) IsSetSuccess() bool { +func (p *AcademicServiceGetCreditResult) IsSetSuccess() bool { return p.Success != nil } -func (p *AcademicServiceGetGPAResult) Read(iprot thrift.TProtocol) (err error) { +func (p *AcademicServiceGetCreditResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -23426,7 +24905,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_AcademicServiceGetCreditResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -23436,8 +24915,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 *AcademicServiceGetCreditResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetCreditResponse() if err := _field.Read(iprot); err != nil { return err } @@ -23445,9 +24924,10 @@ func (p *AcademicServiceGetGPAResult) ReadField0(iprot thrift.TProtocol) error { return nil } -func (p *AcademicServiceGetGPAResult) Write(oprot thrift.TProtocol) (err error) { +func (p *AcademicServiceGetCreditResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetGPA_result"); err != nil { + if err = oprot.WriteStructBegin("GetCredit_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -23473,7 +24953,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 *AcademicServiceGetCreditResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -23492,43 +24972,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *AcademicServiceGetGPAResult) String() string { +func (p *AcademicServiceGetCreditResult) String() string { if p == nil { return "" } - return fmt.Sprintf("AcademicServiceGetGPAResult(%+v)", *p) + return fmt.Sprintf("AcademicServiceGetCreditResult(%+v)", *p) } -type AcademicServiceGetCreditArgs struct { - Req *GetCreditRequest `thrift:"req,1"` +type AcademicServiceGetUnifiedExamArgs struct { + Req *GetUnifiedExamRequest `thrift:"req,1"` } -func NewAcademicServiceGetCreditArgs() *AcademicServiceGetCreditArgs { - return &AcademicServiceGetCreditArgs{} +func NewAcademicServiceGetUnifiedExamArgs() *AcademicServiceGetUnifiedExamArgs { + return &AcademicServiceGetUnifiedExamArgs{} } -func (p *AcademicServiceGetCreditArgs) InitDefault() { +func (p *AcademicServiceGetUnifiedExamArgs) InitDefault() { } -var AcademicServiceGetCreditArgs_Req_DEFAULT *GetCreditRequest +var AcademicServiceGetUnifiedExamArgs_Req_DEFAULT *GetUnifiedExamRequest -func (p *AcademicServiceGetCreditArgs) GetReq() (v *GetCreditRequest) { +func (p *AcademicServiceGetUnifiedExamArgs) GetReq() (v *GetUnifiedExamRequest) { if !p.IsSetReq() { - return AcademicServiceGetCreditArgs_Req_DEFAULT + return AcademicServiceGetUnifiedExamArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_AcademicServiceGetCreditArgs = map[int16]string{ +var fieldIDToName_AcademicServiceGetUnifiedExamArgs = map[int16]string{ 1: "req", } -func (p *AcademicServiceGetCreditArgs) IsSetReq() bool { +func (p *AcademicServiceGetUnifiedExamArgs) IsSetReq() bool { return p.Req != nil } -func (p *AcademicServiceGetCreditArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *AcademicServiceGetUnifiedExamArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -23574,7 +25054,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_AcademicServiceGetUnifiedExamArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -23584,8 +25064,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 *AcademicServiceGetUnifiedExamArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetUnifiedExamRequest() if err := _field.Read(iprot); err != nil { return err } @@ -23593,9 +25073,10 @@ func (p *AcademicServiceGetCreditArgs) ReadField1(iprot thrift.TProtocol) error return nil } -func (p *AcademicServiceGetCreditArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *AcademicServiceGetUnifiedExamArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetCredit_args"); err != nil { + if err = oprot.WriteStructBegin("GetUnifiedExam_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -23621,7 +25102,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 *AcademicServiceGetUnifiedExamArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -23638,43 +25119,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *AcademicServiceGetCreditArgs) String() string { +func (p *AcademicServiceGetUnifiedExamArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("AcademicServiceGetCreditArgs(%+v)", *p) + return fmt.Sprintf("AcademicServiceGetUnifiedExamArgs(%+v)", *p) } -type AcademicServiceGetCreditResult struct { - Success *GetCreditResponse `thrift:"success,0,optional"` +type AcademicServiceGetUnifiedExamResult struct { + Success *GetUnifiedExamResponse `thrift:"success,0,optional"` } -func NewAcademicServiceGetCreditResult() *AcademicServiceGetCreditResult { - return &AcademicServiceGetCreditResult{} +func NewAcademicServiceGetUnifiedExamResult() *AcademicServiceGetUnifiedExamResult { + return &AcademicServiceGetUnifiedExamResult{} } -func (p *AcademicServiceGetCreditResult) InitDefault() { +func (p *AcademicServiceGetUnifiedExamResult) InitDefault() { } -var AcademicServiceGetCreditResult_Success_DEFAULT *GetCreditResponse +var AcademicServiceGetUnifiedExamResult_Success_DEFAULT *GetUnifiedExamResponse -func (p *AcademicServiceGetCreditResult) GetSuccess() (v *GetCreditResponse) { +func (p *AcademicServiceGetUnifiedExamResult) GetSuccess() (v *GetUnifiedExamResponse) { if !p.IsSetSuccess() { - return AcademicServiceGetCreditResult_Success_DEFAULT + return AcademicServiceGetUnifiedExamResult_Success_DEFAULT } return p.Success } -var fieldIDToName_AcademicServiceGetCreditResult = map[int16]string{ +var fieldIDToName_AcademicServiceGetUnifiedExamResult = map[int16]string{ 0: "success", } -func (p *AcademicServiceGetCreditResult) IsSetSuccess() bool { +func (p *AcademicServiceGetUnifiedExamResult) IsSetSuccess() bool { return p.Success != nil } -func (p *AcademicServiceGetCreditResult) Read(iprot thrift.TProtocol) (err error) { +func (p *AcademicServiceGetUnifiedExamResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -23720,7 +25201,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_AcademicServiceGetUnifiedExamResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -23730,8 +25211,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 *AcademicServiceGetUnifiedExamResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetUnifiedExamResponse() if err := _field.Read(iprot); err != nil { return err } @@ -23739,9 +25220,10 @@ func (p *AcademicServiceGetCreditResult) ReadField0(iprot thrift.TProtocol) erro return nil } -func (p *AcademicServiceGetCreditResult) Write(oprot thrift.TProtocol) (err error) { +func (p *AcademicServiceGetUnifiedExamResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetCredit_result"); err != nil { + if err = oprot.WriteStructBegin("GetUnifiedExam_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -23767,7 +25249,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 *AcademicServiceGetUnifiedExamResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -23786,43 +25268,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *AcademicServiceGetCreditResult) String() string { +func (p *AcademicServiceGetUnifiedExamResult) String() string { if p == nil { return "" } - return fmt.Sprintf("AcademicServiceGetCreditResult(%+v)", *p) + return fmt.Sprintf("AcademicServiceGetUnifiedExamResult(%+v)", *p) } -type AcademicServiceGetUnifiedExamArgs struct { - Req *GetUnifiedExamRequest `thrift:"req,1"` +type AcademicServiceGetPlanArgs struct { + Req *GetPlanRequest `thrift:"req,1"` } -func NewAcademicServiceGetUnifiedExamArgs() *AcademicServiceGetUnifiedExamArgs { - return &AcademicServiceGetUnifiedExamArgs{} +func NewAcademicServiceGetPlanArgs() *AcademicServiceGetPlanArgs { + return &AcademicServiceGetPlanArgs{} } -func (p *AcademicServiceGetUnifiedExamArgs) InitDefault() { +func (p *AcademicServiceGetPlanArgs) InitDefault() { } -var AcademicServiceGetUnifiedExamArgs_Req_DEFAULT *GetUnifiedExamRequest +var AcademicServiceGetPlanArgs_Req_DEFAULT *GetPlanRequest -func (p *AcademicServiceGetUnifiedExamArgs) GetReq() (v *GetUnifiedExamRequest) { +func (p *AcademicServiceGetPlanArgs) GetReq() (v *GetPlanRequest) { if !p.IsSetReq() { - return AcademicServiceGetUnifiedExamArgs_Req_DEFAULT + return AcademicServiceGetPlanArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_AcademicServiceGetUnifiedExamArgs = map[int16]string{ +var fieldIDToName_AcademicServiceGetPlanArgs = map[int16]string{ 1: "req", } -func (p *AcademicServiceGetUnifiedExamArgs) IsSetReq() bool { +func (p *AcademicServiceGetPlanArgs) IsSetReq() bool { return p.Req != nil } -func (p *AcademicServiceGetUnifiedExamArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *AcademicServiceGetPlanArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -23868,7 +25350,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_AcademicServiceGetUnifiedExamArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AcademicServiceGetPlanArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -23878,8 +25360,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *AcademicServiceGetUnifiedExamArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetUnifiedExamRequest() +func (p *AcademicServiceGetPlanArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetPlanRequest() if err := _field.Read(iprot); err != nil { return err } @@ -23887,9 +25369,10 @@ func (p *AcademicServiceGetUnifiedExamArgs) ReadField1(iprot thrift.TProtocol) e return nil } -func (p *AcademicServiceGetUnifiedExamArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *AcademicServiceGetPlanArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetUnifiedExam_args"); err != nil { + if err = oprot.WriteStructBegin("GetPlan_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -23915,7 +25398,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *AcademicServiceGetUnifiedExamArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *AcademicServiceGetPlanArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -23932,43 +25415,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *AcademicServiceGetUnifiedExamArgs) String() string { +func (p *AcademicServiceGetPlanArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("AcademicServiceGetUnifiedExamArgs(%+v)", *p) + return fmt.Sprintf("AcademicServiceGetPlanArgs(%+v)", *p) } -type AcademicServiceGetUnifiedExamResult struct { - Success *GetUnifiedExamResponse `thrift:"success,0,optional"` +type AcademicServiceGetPlanResult struct { + Success *GetPlanResponse `thrift:"success,0,optional"` } -func NewAcademicServiceGetUnifiedExamResult() *AcademicServiceGetUnifiedExamResult { - return &AcademicServiceGetUnifiedExamResult{} +func NewAcademicServiceGetPlanResult() *AcademicServiceGetPlanResult { + return &AcademicServiceGetPlanResult{} } -func (p *AcademicServiceGetUnifiedExamResult) InitDefault() { +func (p *AcademicServiceGetPlanResult) InitDefault() { } -var AcademicServiceGetUnifiedExamResult_Success_DEFAULT *GetUnifiedExamResponse +var AcademicServiceGetPlanResult_Success_DEFAULT *GetPlanResponse -func (p *AcademicServiceGetUnifiedExamResult) GetSuccess() (v *GetUnifiedExamResponse) { +func (p *AcademicServiceGetPlanResult) GetSuccess() (v *GetPlanResponse) { if !p.IsSetSuccess() { - return AcademicServiceGetUnifiedExamResult_Success_DEFAULT + return AcademicServiceGetPlanResult_Success_DEFAULT } return p.Success } -var fieldIDToName_AcademicServiceGetUnifiedExamResult = map[int16]string{ +var fieldIDToName_AcademicServiceGetPlanResult = map[int16]string{ 0: "success", } -func (p *AcademicServiceGetUnifiedExamResult) IsSetSuccess() bool { +func (p *AcademicServiceGetPlanResult) IsSetSuccess() bool { return p.Success != nil } -func (p *AcademicServiceGetUnifiedExamResult) Read(iprot thrift.TProtocol) (err error) { +func (p *AcademicServiceGetPlanResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -24014,7 +25497,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_AcademicServiceGetPlanResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -24024,8 +25507,8 @@ 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 *AcademicServiceGetPlanResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetPlanResponse() if err := _field.Read(iprot); err != nil { return err } @@ -24033,9 +25516,10 @@ func (p *AcademicServiceGetUnifiedExamResult) ReadField0(iprot thrift.TProtocol) return nil } -func (p *AcademicServiceGetUnifiedExamResult) Write(oprot thrift.TProtocol) (err error) { +func (p *AcademicServiceGetPlanResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetUnifiedExam_result"); err != nil { + if err = oprot.WriteStructBegin("GetPlan_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -24061,7 +25545,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *AcademicServiceGetUnifiedExamResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *AcademicServiceGetPlanResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -24080,11 +25564,11 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *AcademicServiceGetUnifiedExamResult) String() string { +func (p *AcademicServiceGetPlanResult) String() string { if p == nil { return "" } - return fmt.Sprintf("AcademicServiceGetUnifiedExamResult(%+v)", *p) + return fmt.Sprintf("AcademicServiceGetPlanResult(%+v)", *p) } @@ -24810,6 +26294,7 @@ func (p *VersionServiceLoginArgs) ReadField1(iprot thrift.TProtocol) error { } func (p *VersionServiceLoginArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("Login_args"); err != nil { goto WriteStructBeginError @@ -24956,6 +26441,7 @@ func (p *VersionServiceLoginResult) ReadField0(iprot thrift.TProtocol) error { } func (p *VersionServiceLoginResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("Login_result"); err != nil { goto WriteStructBeginError @@ -25104,6 +26590,7 @@ func (p *VersionServiceUploadVersionArgs) ReadField1(iprot thrift.TProtocol) err } func (p *VersionServiceUploadVersionArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("UploadVersion_args"); err != nil { goto WriteStructBeginError @@ -25250,6 +26737,7 @@ func (p *VersionServiceUploadVersionResult) ReadField0(iprot thrift.TProtocol) e } func (p *VersionServiceUploadVersionResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("UploadVersion_result"); err != nil { goto WriteStructBeginError @@ -25398,6 +26886,7 @@ func (p *VersionServiceUploadParamsArgs) ReadField1(iprot thrift.TProtocol) erro } func (p *VersionServiceUploadParamsArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("UploadParams_args"); err != nil { goto WriteStructBeginError @@ -25544,6 +27033,7 @@ func (p *VersionServiceUploadParamsResult) ReadField0(iprot thrift.TProtocol) er } func (p *VersionServiceUploadParamsResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("UploadParams_result"); err != nil { goto WriteStructBeginError @@ -25692,6 +27182,7 @@ func (p *VersionServiceDownloadReleaseApkArgs) ReadField1(iprot thrift.TProtocol } func (p *VersionServiceDownloadReleaseApkArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("DownloadReleaseApk_args"); err != nil { goto WriteStructBeginError @@ -25838,6 +27329,7 @@ func (p *VersionServiceDownloadReleaseApkResult) ReadField0(iprot thrift.TProtoc } func (p *VersionServiceDownloadReleaseApkResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("DownloadReleaseApk_result"); err != nil { goto WriteStructBeginError @@ -25986,6 +27478,7 @@ func (p *VersionServiceDownloadBetaApkArgs) ReadField1(iprot thrift.TProtocol) e } func (p *VersionServiceDownloadBetaApkArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("DownloadBetaApk_args"); err != nil { goto WriteStructBeginError @@ -26132,6 +27625,7 @@ func (p *VersionServiceDownloadBetaApkResult) ReadField0(iprot thrift.TProtocol) } func (p *VersionServiceDownloadBetaApkResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("DownloadBetaApk_result"); err != nil { goto WriteStructBeginError @@ -26280,6 +27774,7 @@ func (p *VersionServiceGetReleaseVersionArgs) ReadField1(iprot thrift.TProtocol) } func (p *VersionServiceGetReleaseVersionArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetReleaseVersion_args"); err != nil { goto WriteStructBeginError @@ -26426,6 +27921,7 @@ func (p *VersionServiceGetReleaseVersionResult) ReadField0(iprot thrift.TProtoco } func (p *VersionServiceGetReleaseVersionResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetReleaseVersion_result"); err != nil { goto WriteStructBeginError @@ -26574,6 +28070,7 @@ func (p *VersionServiceGetBetaVersionArgs) ReadField1(iprot thrift.TProtocol) er } func (p *VersionServiceGetBetaVersionArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetBetaVersion_args"); err != nil { goto WriteStructBeginError @@ -26720,6 +28217,7 @@ func (p *VersionServiceGetBetaVersionResult) ReadField0(iprot thrift.TProtocol) } func (p *VersionServiceGetBetaVersionResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetBetaVersion_result"); err != nil { goto WriteStructBeginError @@ -26868,6 +28366,7 @@ func (p *VersionServiceGetSettingArgs) ReadField1(iprot thrift.TProtocol) error } func (p *VersionServiceGetSettingArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetSetting_args"); err != nil { goto WriteStructBeginError @@ -27014,6 +28513,7 @@ func (p *VersionServiceGetSettingResult) ReadField0(iprot thrift.TProtocol) erro } func (p *VersionServiceGetSettingResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetSetting_result"); err != nil { goto WriteStructBeginError @@ -27162,6 +28662,7 @@ func (p *VersionServiceGetTestArgs) ReadField1(iprot thrift.TProtocol) error { } func (p *VersionServiceGetTestArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetTest_args"); err != nil { goto WriteStructBeginError @@ -27308,6 +28809,7 @@ func (p *VersionServiceGetTestResult) ReadField0(iprot thrift.TProtocol) error { } func (p *VersionServiceGetTestResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetTest_result"); err != nil { goto WriteStructBeginError @@ -27456,6 +28958,7 @@ func (p *VersionServiceGetCloudArgs) ReadField1(iprot thrift.TProtocol) error { } func (p *VersionServiceGetCloudArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetCloud_args"); err != nil { goto WriteStructBeginError @@ -27602,6 +29105,7 @@ func (p *VersionServiceGetCloudResult) ReadField0(iprot thrift.TProtocol) error } func (p *VersionServiceGetCloudResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetCloud_result"); err != nil { goto WriteStructBeginError @@ -27750,6 +29254,7 @@ func (p *VersionServiceSetCloudArgs) ReadField1(iprot thrift.TProtocol) error { } func (p *VersionServiceSetCloudArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("SetCloud_args"); err != nil { goto WriteStructBeginError @@ -27896,6 +29401,7 @@ func (p *VersionServiceSetCloudResult) ReadField0(iprot thrift.TProtocol) error } func (p *VersionServiceSetCloudResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("SetCloud_result"); err != nil { goto WriteStructBeginError @@ -28044,6 +29550,7 @@ func (p *VersionServiceGetDumpArgs) ReadField1(iprot thrift.TProtocol) error { } func (p *VersionServiceGetDumpArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetDump_args"); err != nil { goto WriteStructBeginError @@ -28190,6 +29697,7 @@ func (p *VersionServiceGetDumpResult) ReadField0(iprot thrift.TProtocol) error { } func (p *VersionServiceGetDumpResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetDump_result"); err != nil { goto WriteStructBeginError @@ -28623,6 +30131,7 @@ func (p *CommonServiceGetCSSArgs) ReadField1(iprot thrift.TProtocol) error { } func (p *CommonServiceGetCSSArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetCSS_args"); err != nil { goto WriteStructBeginError @@ -28769,6 +30278,7 @@ func (p *CommonServiceGetCSSResult) ReadField0(iprot thrift.TProtocol) error { } func (p *CommonServiceGetCSSResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetCSS_result"); err != nil { goto WriteStructBeginError @@ -28917,6 +30427,7 @@ func (p *CommonServiceGetHtmlArgs) ReadField1(iprot thrift.TProtocol) error { } func (p *CommonServiceGetHtmlArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetHtml_args"); err != nil { goto WriteStructBeginError @@ -29063,6 +30574,7 @@ func (p *CommonServiceGetHtmlResult) ReadField0(iprot thrift.TProtocol) error { } func (p *CommonServiceGetHtmlResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetHtml_result"); err != nil { goto WriteStructBeginError @@ -29211,6 +30723,7 @@ func (p *CommonServiceGetUserAgreementArgs) ReadField1(iprot thrift.TProtocol) e } func (p *CommonServiceGetUserAgreementArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetUserAgreement_args"); err != nil { goto WriteStructBeginError @@ -29357,6 +30870,7 @@ func (p *CommonServiceGetUserAgreementResult) ReadField0(iprot thrift.TProtocol) } func (p *CommonServiceGetUserAgreementResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetUserAgreement_result"); err != nil { goto WriteStructBeginError @@ -29505,6 +31019,7 @@ func (p *CommonServiceGetTermsListArgs) ReadField1(iprot thrift.TProtocol) error } func (p *CommonServiceGetTermsListArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetTermsList_args"); err != nil { goto WriteStructBeginError @@ -29651,6 +31166,7 @@ func (p *CommonServiceGetTermsListResult) ReadField0(iprot thrift.TProtocol) err } func (p *CommonServiceGetTermsListResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetTermsList_result"); err != nil { goto WriteStructBeginError @@ -29799,6 +31315,7 @@ func (p *CommonServiceGetTermArgs) ReadField1(iprot thrift.TProtocol) error { } func (p *CommonServiceGetTermArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetTerm_args"); err != nil { goto WriteStructBeginError @@ -29945,6 +31462,7 @@ func (p *CommonServiceGetTermResult) ReadField0(iprot thrift.TProtocol) error { } func (p *CommonServiceGetTermResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetTerm_result"); err != nil { goto WriteStructBeginError diff --git a/api/model/model/model.go b/api/model/model/model.go index 6125a09f..06852f3b 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.17). DO NOT EDIT. +// Code generated by thriftgo (0.3.18). DO NOT EDIT. package model @@ -137,6 +137,7 @@ 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 @@ -215,7 +216,7 @@ type LoginData struct { // 教务处给出的标识,它的组成是时间+学号 ID string `thrift:"id,1,required" form:"id,required" json:"id,required" query:"id,required"` // 登录凭证,访问资源的时候应该必须携带cookies - Cookies []string `thrift:"cookies,2,required" form:"cookies,required" json:"cookies,required" query:"cookies,required"` + Cookies string `thrift:"cookies,2,required" form:"cookies,required" json:"cookies,required" query:"cookies,required"` } func NewLoginData() *LoginData { @@ -229,7 +230,7 @@ func (p *LoginData) GetID() (v string) { return p.ID } -func (p *LoginData) GetCookies() (v []string) { +func (p *LoginData) GetCookies() (v string) { return p.Cookies } @@ -269,7 +270,7 @@ func (p *LoginData) Read(iprot thrift.TProtocol) (err error) { goto SkipFieldError } case 2: - if fieldTypeId == thrift.LIST { + if fieldTypeId == thrift.STRING { if err = p.ReadField2(iprot); err != nil { goto ReadFieldError } @@ -329,30 +330,19 @@ func (p *LoginData) ReadField1(iprot thrift.TProtocol) error { return nil } func (p *LoginData) ReadField2(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 _elem string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _elem = v - } - _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.Cookies = _field return nil } func (p *LoginData) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("LoginData"); err != nil { goto WriteStructBeginError @@ -402,18 +392,10 @@ WriteFieldEndError: } func (p *LoginData) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("cookies", thrift.LIST, 2); err != nil { + if err = oprot.WriteFieldBegin("cookies", thrift.STRING, 2); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteListBegin(thrift.STRING, len(p.Cookies)); err != nil { - return err - } - for _, v := range p.Cookies { - if err := oprot.WriteString(v); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { + if err := oprot.WriteString(p.Cookies); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -434,6 +416,420 @@ func (p *LoginData) String() string { } +type UserInfo struct { + StuID string `thrift:"stu_id,1,required" form:"stu_id,required" json:"stu_id,required" query:"stu_id,required"` + Birthday string `thrift:"birthday,3,required" form:"birthday,required" json:"birthday,required" query:"birthday,required"` + Sex string `thrift:"sex,4,required" form:"sex,required" json:"sex,required" query:"sex,required"` + College string `thrift:"college,5,required" form:"college,required" json:"college,required" query:"college,required"` + Grade string `thrift:"grade,6,required" form:"grade,required" json:"grade,required" query:"grade,required"` + Major string `thrift:"major,7,required" form:"major,required" json:"major,required" query:"major,required"` +} + +func NewUserInfo() *UserInfo { + return &UserInfo{} +} + +func (p *UserInfo) InitDefault() { +} + +func (p *UserInfo) GetStuID() (v string) { + return p.StuID +} + +func (p *UserInfo) GetBirthday() (v string) { + return p.Birthday +} + +func (p *UserInfo) GetSex() (v string) { + return p.Sex +} + +func (p *UserInfo) GetCollege() (v string) { + return p.College +} + +func (p *UserInfo) GetGrade() (v string) { + return p.Grade +} + +func (p *UserInfo) GetMajor() (v string) { + return p.Major +} + +var fieldIDToName_UserInfo = map[int16]string{ + 1: "stu_id", + 3: "birthday", + 4: "sex", + 5: "college", + 6: "grade", + 7: "major", +} + +func (p *UserInfo) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetStuID bool = false + var issetBirthday bool = false + var issetSex bool = false + var issetCollege bool = false + var issetGrade bool = false + var issetMajor 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.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetStuID = 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 + } + issetBirthday = 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 + } + issetSex = 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 + } + issetCollege = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.STRING { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + issetGrade = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.STRING { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + issetMajor = 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 !issetStuID { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetBirthday { + fieldId = 3 + goto RequiredFieldNotSetError + } + + if !issetSex { + fieldId = 4 + goto RequiredFieldNotSetError + } + + if !issetCollege { + fieldId = 5 + goto RequiredFieldNotSetError + } + + if !issetGrade { + fieldId = 6 + goto RequiredFieldNotSetError + } + + if !issetMajor { + fieldId = 7 + 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_UserInfo[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_UserInfo[fieldId])) +} + +func (p *UserInfo) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.StuID = _field + return nil +} +func (p *UserInfo) ReadField3(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Birthday = _field + return nil +} +func (p *UserInfo) ReadField4(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Sex = _field + return nil +} +func (p *UserInfo) ReadField5(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.College = _field + return nil +} +func (p *UserInfo) ReadField6(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Grade = _field + return nil +} +func (p *UserInfo) ReadField7(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Major = _field + return nil +} + +func (p *UserInfo) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("UserInfo"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *UserInfo) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("stu_id", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.StuID); 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 *UserInfo) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("birthday", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Birthday); 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 *UserInfo) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("sex", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Sex); 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 *UserInfo) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("college", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.College); 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 *UserInfo) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("grade", thrift.STRING, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Grade); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *UserInfo) writeField7(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("major", thrift.STRING, 7); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Major); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} + +func (p *UserInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UserInfo(%+v)", *p) + +} + // 空教室 type Classroom struct { // 空教室所在楼,例 西三 @@ -631,6 +1027,7 @@ 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 @@ -1009,6 +1406,7 @@ 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 @@ -1168,15 +1566,24 @@ func (p *ExamRoomInfo) String() string { // 课程安排 type CourseScheduleRule struct { - Location string `thrift:"location,1,required" form:"location,required" json:"location,required" query:"location,required"` - StartClass int64 `thrift:"startClass,2,required" form:"startClass,required" json:"startClass,required" query:"startClass,required"` - EndClass int64 `thrift:"endClass,3,required" form:"endClass,required" json:"endClass,required" query:"endClass,required"` - StartWeek int64 `thrift:"startWeek,4,required" form:"startWeek,required" json:"startWeek,required" query:"startWeek,required"` - EndWeek int64 `thrift:"endWeek,5,required" form:"endWeek,required" json:"endWeek,required" query:"endWeek,required"` - Weekday int64 `thrift:"weekday,6,required" form:"weekday,required" json:"weekday,required" query:"weekday,required"` - Single bool `thrift:"single,7,required" form:"single,required" json:"single,required" query:"single,required"` - Double bool `thrift:"double,8,required" form:"double,required" json:"double,required" query:"double,required"` - Adjust bool `thrift:"adjust,9,required" form:"adjust,required" json:"adjust,required" query:"adjust,required"` + // 定制 + Location string `thrift:"location,1,required" form:"location,required" json:"location,required" query:"location,required"` + // 开始节数 + StartClass int64 `thrift:"startClass,2,required" form:"startClass,required" json:"startClass,required" query:"startClass,required"` + // 结束节数 + EndClass int64 `thrift:"endClass,3,required" form:"endClass,required" json:"endClass,required" query:"endClass,required"` + // 起始周 + StartWeek int64 `thrift:"startWeek,4,required" form:"startWeek,required" json:"startWeek,required" query:"startWeek,required"` + // 结束周 + EndWeek int64 `thrift:"endWeek,5,required" form:"endWeek,required" json:"endWeek,required" query:"endWeek,required"` + // 星期几 + Weekday int64 `thrift:"weekday,6,required" form:"weekday,required" json:"weekday,required" query:"weekday,required"` + // 单周 + Single bool `thrift:"single,7,required" form:"single,required" json:"single,required" query:"single,required"` + // 双周 + Double bool `thrift:"double,8,required" form:"double,required" json:"double,required" query:"double,required"` + // 是否是调课 + Adjust bool `thrift:"adjust,9,required" form:"adjust,required" json:"adjust,required" query:"adjust,required"` } func NewCourseScheduleRule() *CourseScheduleRule { @@ -1519,6 +1926,7 @@ 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 @@ -1741,14 +2149,22 @@ func (p *CourseScheduleRule) String() string { // 课程信息 type Course struct { - Name string `thrift:"name,1,required" form:"name,required" json:"name,required" query:"name,required"` - Teacher string `thrift:"teacher,2,required" form:"teacher,required" json:"teacher,required" query:"teacher,required"` - ScheduleRules []*CourseScheduleRule `thrift:"scheduleRules,3,required" form:"scheduleRules,required" json:"scheduleRules,required" query:"scheduleRules,required"` - Remark string `thrift:"remark,4,required" form:"remark,required" json:"remark,required" query:"remark,required"` - Lessonplan string `thrift:"lessonplan,5,required" form:"lessonplan,required" json:"lessonplan,required" query:"lessonplan,required"` - Syllabus string `thrift:"syllabus,6,required" form:"syllabus,required" json:"syllabus,required" query:"syllabus,required"` - RawScheduleRules string `thrift:"rawScheduleRules,7,required" form:"rawScheduleRules,required" json:"rawScheduleRules,required" query:"rawScheduleRules,required"` - RawAdjust string `thrift:"rawAdjust,8,required" form:"rawAdjust,required" json:"rawAdjust,required" query:"rawAdjust,required"` + // 课程名称 + Name string `thrift:"name,1,required" form:"name,required" json:"name,required" query:"name,required"` + // 教师 + Teacher string `thrift:"teacher,2,required" form:"teacher,required" json:"teacher,required" query:"teacher,required"` + // 排课规则 + ScheduleRules []*CourseScheduleRule `thrift:"scheduleRules,3,required" form:"scheduleRules,required" json:"scheduleRules,required" query:"scheduleRules,required"` + // 备注 + Remark string `thrift:"remark,4,required" form:"remark,required" json:"remark,required" query:"remark,required"` + // 授课计划 + Lessonplan string `thrift:"lessonplan,5,required" form:"lessonplan,required" json:"lessonplan,required" query:"lessonplan,required"` + // 教学大纲 + Syllabus string `thrift:"syllabus,6,required" form:"syllabus,required" json:"syllabus,required" query:"syllabus,required"` + // (原始数据) 排课规则 + RawScheduleRules string `thrift:"rawScheduleRules,7,required" form:"rawScheduleRules,required" json:"rawScheduleRules,required" query:"rawScheduleRules,required"` + // (原始数据) 调课规则 + RawAdjust string `thrift:"rawAdjust,8,required" form:"rawAdjust,required" json:"rawAdjust,required" query:"rawAdjust,required"` } func NewCourse() *Course { @@ -2072,6 +2488,7 @@ 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 @@ -2760,6 +3177,7 @@ 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 @@ -3112,16 +3530,14 @@ func (p *Picture) String() string { } -/* -* @Description 又拍云文件目录结构 -* @Param basePath 当前所在路径 -* @Param files 当前所在目录文件 -* @Param folders 当前所在目录下的文件夹 - */ +// 又拍云文件目录结构 type UpYunFileDir struct { - BasePath *string `thrift:"basePath,1,optional" form:"basePath" json:"basePath,omitempty" query:"basePath"` - 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,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"` } func NewUpYunFileDir() *UpYunFileDir { @@ -3304,6 +3720,7 @@ 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 @@ -3418,13 +3835,20 @@ func (p *UpYunFileDir) String() string { // 课程成绩 type Score struct { - Credit string `thrift:"credit,1,required" form:"credit,required" json:"credit,required" query:"credit,required"` - Gpa string `thrift:"gpa,2,required" form:"gpa,required" json:"gpa,required" query:"gpa,required"` - Name string `thrift:"name,3,required" form:"name,required" json:"name,required" query:"name,required"` - Score string `thrift:"score,4,required" form:"score,required" json:"score,required" query:"score,required"` + // 学分 + Credit string `thrift:"credit,1,required" form:"credit,required" json:"credit,required" query:"credit,required"` + // 绩点 + Gpa string `thrift:"gpa,2,required" form:"gpa,required" json:"gpa,required" query:"gpa,required"` + // 课程名 + Name string `thrift:"name,3,required" form:"name,required" json:"name,required" query:"name,required"` + // 得分 + Score string `thrift:"score,4,required" form:"score,required" json:"score,required" query:"score,required"` + // 授课教师 Teacher string `thrift:"teacher,5,required" form:"teacher,required" json:"teacher,required" query:"teacher,required"` - Term string `thrift:"term,6,required" form:"term,required" json:"term,required" query:"term,required"` - Year string `thrift:"year,7,required" form:"year,required" json:"year,required" query:"year,required"` + // 学期 + Term string `thrift:"term,6,required" form:"term,required" json:"term,required" query:"term,required"` + // 开课年份 + Year string `thrift:"year,7,required" form:"year,required" json:"year,required" query:"year,required"` } func NewScore() *Score { @@ -3705,6 +4129,7 @@ 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 @@ -3885,7 +4310,9 @@ func (p *Score) String() string { // 绩点排名 type GPABean struct { - Time string `thrift:"time,1,required" form:"time,required" json:"time,required" query:"time,required"` + // 更新时间 + Time string `thrift:"time,1,required" form:"time,required" json:"time,required" query:"time,required"` + // 数据 Data []*GPAData `thrift:"data,2,required" form:"data,required" json:"data,required" query:"data,required"` } @@ -4024,6 +4451,7 @@ 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 @@ -4107,7 +4535,9 @@ func (p *GPABean) String() string { // 绩点信息 type GPAData struct { - Type string `thrift:"type,1,required" form:"type,required" json:"type,required" query:"type,required"` + // 类型(如修读类别或总学分) + Type string `thrift:"type,1,required" form:"type,required" json:"type,required" query:"type,required"` + // 信息(对应的信息) Value string `thrift:"value,2,required" form:"value,required" json:"value,required" query:"value,required"` } @@ -4234,6 +4664,7 @@ 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 @@ -4468,6 +4899,7 @@ 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 @@ -4723,6 +5155,7 @@ 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 @@ -4817,16 +5250,14 @@ func (p *UnifiedExam) String() string { } -/* -* @Description 又拍云文件目录结构,兼容旧版安卓 -* @Param base_path 当前所在路径 -* @Param files 当前所在目录文件,使用required保证files不为nil -* @Param folders 当前所在目录下的文件夹,使用required保证folders不为nil - */ +// 又拍云文件目录结构,兼容旧版安卓 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,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:"base_path,1,optional" form:"base_path" json:"base_path,omitempty" query:"base_path"` + // 当前所在目录文件,使用required保证files不为nil + Files []string `thrift:"files,2,required" form:"files,required" json:"files,required" query:"files,required"` + // 当前所在目录下的文件夹,使用required保证folders不为nil + Folders []string `thrift:"folders,3,required" form:"folders,required" json:"folders,required" query:"folders,required"` } func NewPaperData() *PaperData { @@ -5009,6 +5440,7 @@ func (p *PaperData) ReadField3(iprot thrift.TProtocol) error { } func (p *PaperData) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("PaperData"); err != nil { goto WriteStructBeginError @@ -5217,6 +5649,7 @@ func (p *PaperUrlData) ReadField1(iprot thrift.TProtocol) error { } func (p *PaperUrlData) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("PaperUrlData"); err != nil { goto WriteStructBeginError @@ -5504,6 +5937,7 @@ func (p *Term) ReadField5(iprot thrift.TProtocol) error { } func (p *Term) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("Term"); err != nil { goto WriteStructBeginError @@ -5815,6 +6249,7 @@ func (p *TermEvent) ReadField3(iprot thrift.TProtocol) error { } func (p *TermEvent) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("TermEvent"); err != nil { goto WriteStructBeginError @@ -6058,6 +6493,7 @@ func (p *TermList) ReadField2(iprot thrift.TProtocol) error { } func (p *TermList) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("TermList"); err != nil { goto WriteStructBeginError @@ -6354,6 +6790,7 @@ func (p *TermInfo) ReadField4(iprot thrift.TProtocol) error { } func (p *TermInfo) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("TermInfo"); err != nil { goto WriteStructBeginError diff --git a/api/mw/get_header.go b/api/mw/get_header.go index 2ad79114..ce53bf44 100644 --- a/api/mw/get_header.go +++ b/api/mw/get_header.go @@ -23,6 +23,7 @@ import ( "github.com/west2-online/fzuhelper-server/api/pack" "github.com/west2-online/fzuhelper-server/kitex_gen/model" + metainfoContext "github.com/west2-online/fzuhelper-server/pkg/base/context" "github.com/west2-online/fzuhelper-server/pkg/base/login_data" "github.com/west2-online/fzuhelper-server/pkg/errno" ) @@ -41,6 +42,12 @@ func GetHeaderParams() app.HandlerFunc { Id: id, Cookies: cookies, }) + + // 实现规范化服务透传,不需要中间进行编解码 + ctx = metainfoContext.WithLoginData(ctx, &model.LoginData{ + Id: id, + Cookies: cookies, + }) c.Next(ctx) } } diff --git a/api/router/api/api.go b/api/router/api/api.go index cd8901ad..484d631f 100644 --- a/api/router/api/api.go +++ b/api/router/api/api.go @@ -65,6 +65,7 @@ func Register(r *server.Hertz) { _academic := _jwch.Group("/academic", _academicMw()...) _academic.GET("/credit", append(_getcreditMw(), api.GetCredit)...) _academic.GET("/gpa", append(_getgpaMw(), api.GetGPA)...) + _academic.GET("/plan", append(_getplanMw(), api.GetPlan)...) _academic.GET("/scores", append(_getscoresMw(), api.GetScores)...) _academic.GET("/unified-exam", append(_getunifiedexamMw(), api.GetUnifiedExam)...) } @@ -76,6 +77,10 @@ func Register(r *server.Hertz) { _course := _jwch.Group("/course", _courseMw()...) _course.GET("/list", append(_getcourselistMw(), api.GetCourseList)...) } + { + _user0 := _jwch.Group("/user", _user0Mw()...) + _user0.GET("/info", append(_getuserinfoMw(), api.GetUserInfo)...) + } } { _launch_screen := _v1.Group("/launch-screen", _launch_screenMw()...) @@ -105,8 +110,8 @@ func Register(r *server.Hertz) { _terms.GET("/list", append(_gettermslistMw(), api.GetTermsList)...) } { - _user0 := _v1.Group("/user", _user0Mw()...) - _user0.POST("/validate-code", append(_validatecodeMw(), api.ValidateCode)...) + _user1 := _v1.Group("/user", _user1Mw()...) + _user1.POST("/validate-code", append(_validatecodeMw(), api.ValidateCode)...) } } { diff --git a/api/router/api/middleware.go b/api/router/api/middleware.go index 2facd904..a25ea2cf 100644 --- a/api/router/api/middleware.go +++ b/api/router/api/middleware.go @@ -418,3 +418,18 @@ func _gettermslistMw() []app.HandlerFunc { // your code... return nil } + +func _getuserinfoMw() []app.HandlerFunc { + // your code... + return nil +} + +func _user1Mw() []app.HandlerFunc { + // your code... + return nil +} + +func _getplanMw() []app.HandlerFunc { + // your code... + return nil +} diff --git a/api/rpc/academic.go b/api/rpc/academic.go index 85b6a789..369ecdd5 100644 --- a/api/rpc/academic.go +++ b/api/rpc/academic.go @@ -84,3 +84,16 @@ func GetUnifiedExamRPC(ctx context.Context, req *academic.GetUnifiedExamRequest) return resp.UnifiedExam, nil } + +func GetCultivatePlanRPC(ctx context.Context, req *academic.GetPlanRequest) (*[]byte, error) { + resp, err := academicClient.GetPlan(ctx, req) + if err != nil { + logger.Errorf("GetCultivatePlanRPC: RPC called failed: %v", err.Error()) + return nil, errno.InternalServiceError.WithMessage(err.Error()) + } + if len(resp.Html) < 1 { + return nil, errno.InternalServiceError + } + + return &resp.Html, nil +} diff --git a/api/rpc/common.go b/api/rpc/common.go index ef65f97b..b2e96a47 100644 --- a/api/rpc/common.go +++ b/api/rpc/common.go @@ -41,6 +41,9 @@ func GetCSSRPC(ctx context.Context, req *common.GetCSSRequest) (*[]byte, error) logger.Errorf("GetCSSRPC: RPC called failed: %v", err.Error()) return nil, errno.InternalServiceError.WithMessage(err.Error()) } + if len(resp.Css) < 1 { + return nil, errno.InternalServiceError + } return &resp.Css, nil } @@ -50,6 +53,9 @@ func GetHtmlRPC(ctx context.Context, req *common.GetHtmlRequest) (*[]byte, error logger.Errorf("GetHtmlRPC: RPC called failed: %v", err.Error()) return nil, errno.InternalServiceError.WithMessage(err.Error()) } + if len(resp.Html) < 1 { + return nil, errno.InternalServiceError + } return &resp.Html, nil } @@ -59,6 +65,9 @@ func GetUserAgreementRPC(ctx context.Context, req *common.GetUserAgreementReques logger.Errorf("GetUserAgreementRPC: RPC called failed: %v", err.Error()) return nil, errno.InternalServiceError.WithMessage(err.Error()) } + if len(resp.UserAgreement) < 1 { + return nil, errno.InternalServiceError + } return &resp.UserAgreement, nil } diff --git a/api/rpc/user.go b/api/rpc/user.go index 648e4303..190e16a6 100644 --- a/api/rpc/user.go +++ b/api/rpc/user.go @@ -19,6 +19,7 @@ package rpc import ( "context" + "github.com/west2-online/fzuhelper-server/kitex_gen/model" "github.com/west2-online/fzuhelper-server/kitex_gen/user" "github.com/west2-online/fzuhelper-server/pkg/base/client" "github.com/west2-online/fzuhelper-server/pkg/errno" @@ -45,3 +46,15 @@ func GetLoginDataRPC(ctx context.Context, req *user.GetLoginDataRequest) (string } return resp.Id, resp.Cookies, nil } + +func GetUserInfoRPC(ctx context.Context, req *user.GetUserInfoRequest) (*model.UserInfo, error) { + resp, err := userClient.GetUserInfo(ctx, req) + if err != nil { + logger.Errorf("GetUserInfoRPC: RPC called failed: %v", err.Error()) + return nil, errno.InternalServiceError.WithError(err) + } + if !utils.IsSuccess(resp.Base) { + return nil, errno.BizError.WithMessage(resp.Base.Msg) + } + return resp.Data, nil +} diff --git a/cmd/user/main.go b/cmd/user/main.go index a8bc7d1f..01a530be 100644 --- a/cmd/user/main.go +++ b/cmd/user/main.go @@ -27,17 +27,24 @@ import ( "github.com/west2-online/fzuhelper-server/config" "github.com/west2-online/fzuhelper-server/internal/user" "github.com/west2-online/fzuhelper-server/kitex_gen/user/userservice" + "github.com/west2-online/fzuhelper-server/pkg/base" "github.com/west2-online/fzuhelper-server/pkg/constants" "github.com/west2-online/fzuhelper-server/pkg/logger" "github.com/west2-online/fzuhelper-server/pkg/utils" ) -var serviceName = constants.UserServiceName +var ( + serviceName = constants.UserServiceName + clientSet *base.ClientSet +) func init() { config.Init(serviceName) logger.Init(serviceName, config.GetLoggerLevel()) // eshook.InitLoggerWithHook(serviceName) + clientSet = base.NewClientSet( + base.WithDBClient(constants.UserTableName), + ) } func main() { @@ -55,7 +62,7 @@ func main() { } svr := userservice.NewServer( - new(user.UserServiceImpl), + user.NewUserService(clientSet), server.WithServerBasicInfo(&rpcinfo.EndpointBasicInfo{ ServiceName: serviceName, }), diff --git a/config/sql/init.sql b/config/sql/init.sql index 96eff71d..81bbe55f 100644 --- a/config/sql/init.sql +++ b/config/sql/init.sql @@ -1,27 +1,17 @@ create table `fzu-helper`.`student` ( - `id` bigint not null comment '学生ID', - `number` varchar(255) not null comment '学号', - `password` varchar(255) not null comment '密码', - `sex` varchar(255) not null comment '性别', - `birthday` varchar(255) not null comment '出生日期', - `phone` varchar(255) not null comment '手机号', - `email` varchar(255) comment '邮箱', - `college` varchar(255) not null comment '学院', - `grade` bigint not null comment '年级', - `status_change` varchar(255) comment '学籍异动与奖励', - `major` varchar(255) not null comment '专业', - `counselor` varchar(255) not null comment '辅导员', - `examinee_category` varchar(255) not null comment '考生类别', - `nationality` varchar(255) not null comment '民族', - `country` varchar(255) not null comment '国别', - `political_status` varchar(255) not null comment '政治面貌', - `source` varchar(255) not null comment '生源地', - `created_at` timestamp default current_timestamp not null, - `updated_at` timestamp default current_timestamp not null on update current_timestamp comment 'update profile time', + `stu_id` varchar(16) not null comment '学号', + `birthday` varchar(12) not null comment '生日', + `sex` varchar(8) not null comment '性别', + `college` varchar(255) not null comment '学院', + `grade` bigint not null comment '年级', + `major` varchar(255) not null comment '专业', + `created_at` timestamp not null default current_timestamp, + `updated_at` timestamp not null default current_timestamp on update current_timestamp comment 'update profile time', `deleted_at` timestamp default null null, constraint `id` - primary key (`id`) + primary key (`stu_id`), + index `stu_birth`(`birthday`(10)) )engine=InnoDB default charset=utf8mb4; create table `fzu-helper`.`term` @@ -36,7 +26,7 @@ create table `fzu-helper`.`term` primary key (`id`), constraint `term_student` foreign key (`stu_id`) - references `fzu-helper`.`student` (`id`) + references `fzu-helper`.`student` (`stu_id`) on delete cascade )engine=InnoDB default charset=utf8mb4; @@ -65,7 +55,7 @@ create table `fzu-helper`.`mark` primary key (`id`), constraint `mark_student` foreign key (`stu_id`) - references `fzu-helper`.`student` (`id`) + references `fzu-helper`.`student` (`stu_id`) on delete cascade )engine=InnoDB default charset=utf8mb4; diff --git a/go.mod b/go.mod index bc9abb77..761933fb 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( github.com/segmentio/kafka-go v0.4.47 github.com/spf13/viper v1.19.0 github.com/upyun/go-sdk/v3 v3.0.4 - github.com/west2-online/jwch v0.2.0 + github.com/west2-online/jwch v0.2.2 gorm.io/driver/mysql v1.5.7 gorm.io/gorm v1.25.12 k8s.io/client-go v0.32.0 @@ -41,7 +41,7 @@ require ( github.com/armon/go-metrics v0.4.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bufbuild/protocompile v0.14.1 // indirect - github.com/bytedance/gopkg v0.1.1 // indirect + github.com/bytedance/gopkg v0.1.1 github.com/bytedance/sonic v1.12.6 github.com/bytedance/sonic/loader v0.2.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect diff --git a/go.sum b/go.sum index 7e40c323..ff40f123 100644 --- a/go.sum +++ b/go.sum @@ -653,8 +653,8 @@ github.com/upyun/go-sdk/v3 v3.0.4 h1:2DCJa/Yi7/3ZybT9UCPATSzvU3wpPPxhXinNlb1Hi8Q github.com/upyun/go-sdk/v3 v3.0.4/go.mod h1:P/SnuuwhrIgAVRd/ZpzDWqCsBAf/oHg7UggbAxyZa0E= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/west2-online/jwch v0.2.0 h1:TQOThDZOJ5r8tEdcHJY0sRxtVidQuB5M0IDblmRaPCA= -github.com/west2-online/jwch v0.2.0/go.mod h1:0gfO+djdY0BmmFtjb45uDzxDLNWCbT0f9wVzw5OQBXI= +github.com/west2-online/jwch v0.2.2 h1:xY5p+ULZO4Mpdm9u9iWaNRqVfWzieC+K9/WKwyWw1n8= +github.com/west2-online/jwch v0.2.2/go.mod h1:WI6YUgXuLMt+5A1X4HKuxhZRzhxRvxNyXT4BQzeAr9s= github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY= diff --git a/idl/academic.thrift b/idl/academic.thrift index 61b7f8df..317e617d 100644 --- a/idl/academic.thrift +++ b/idl/academic.thrift @@ -41,9 +41,17 @@ struct GetUnifiedExamResponse { 2: optional list unifiedExam } +struct GetPlanRequest{ +} + +struct GetPlanResponse{ + 1: binary html, +} + service AcademicService { GetScoresResponse GetScores(1:GetScoresRequest req) GetGPAResponse GetGPA(1:GetGPARequest req) GetCreditResponse GetCredit(1:GetCreditRequest req) GetUnifiedExamResponse GetUnifiedExam(1:GetUnifiedExamRequest req) + GetPlanResponse GetPlan(1:GetPlanRequest req) } diff --git a/idl/api.thrift b/idl/api.thrift index 5fd34c3f..69e50c19 100644 --- a/idl/api.thrift +++ b/idl/api.thrift @@ -29,6 +29,7 @@ service ClassRoomService { } // user + struct GetLoginDataRequest { 1: required string id 2: required string password @@ -76,6 +77,13 @@ struct TestAuthResponse{ 1: string message } +struct GetUserInfoRequest{ +} + +struct GetUserInfoResponse{ + 1: required model.BaseResp base, + 2: optional model.UserInfo data, +} service UserService { GetLoginDataResponse GetLoginData(1: GetLoginDataRequest request)(api.get="/api/v1/internal/user/login"), # 后端内部测试接口使用,使用 internal 前缀做区别 @@ -84,6 +92,7 @@ service UserService { GetAccessTokenResponse GetToken(1: GetAccessTokenRequest request)(api.get="/api/v1/login/access-token"), RefreshTokenResponse RefreshToken(1: RefreshTokenRequest request)(api.get="/api/v1/login/refresh-token"), TestAuthResponse TestAuth(1: TestAuthRequest request)(api.get="/api/v1/jwch/ping") + GetUserInfoResponse GetUserInfo(1: GetUserInfoRequest request)(api.get="/api/v1/jwch/user/info") } // course @@ -274,11 +283,21 @@ struct GetUnifiedExamResponse { 1: required list unifiedExam } +struct GetPlanRequest{ + 1: required string id + 2: required string cookies +} + +struct GetPlanResponse{ + 1: model.BaseResp base +} + service AcademicService { GetScoresResponse GetScores(1:GetScoresRequest req)(api.get="/api/v1/jwch/academic/scores") GetGPAResponse GetGPA(1:GetGPARequest req)(api.get="/api/v1/jwch/academic/gpa") GetCreditResponse GetCredit(1:GetCreditRequest req)(api.get="/api/v1/jwch/academic/credit") GetUnifiedExamResponse GetUnifiedExam(1:GetUnifiedExamRequest req)(api.get="/api/v1/jwch/academic/unified-exam") + GetPlanResponse GetPlan(1:GetPlanRequest req)(api.get="/api/v1/jwch/academic/plan") } // url_refactor->version diff --git a/idl/model.thrift b/idl/model.thrift index f7573c30..4030c704 100644 --- a/idl/model.thrift +++ b/idl/model.thrift @@ -11,6 +11,15 @@ struct LoginData { 2: required string cookies // 登录凭证,访问资源的时候应该必须携带cookies } +struct UserInfo{ + 1: required string stu_id, + 3: required string birthday, + 4: required string sex, + 5: required string college, + 6: required string grade, + 7: required string major, +} + // 空教室 struct Classroom { 1: required string build // 空教室所在楼,例 西三 diff --git a/idl/user.thrift b/idl/user.thrift index 182439e7..a04e4d67 100644 --- a/idl/user.thrift +++ b/idl/user.thrift @@ -14,6 +14,15 @@ struct GetLoginDataResponse { 3: required list cookies } +struct GetUserInfoRequest{ +} + +struct GetUserInfoResponse{ + 1: required model.BaseResp base, + 2: optional model.UserInfo data, +} + service UserService { GetLoginDataResponse GetLoginData(1: GetLoginDataRequest req), + GetUserInfoResponse GetUserInfo(1: GetUserInfoRequest request), } diff --git a/internal/academic/handler.go b/internal/academic/handler.go index c0402581..66075cef 100644 --- a/internal/academic/handler.go +++ b/internal/academic/handler.go @@ -100,3 +100,15 @@ func (s *AcademicServiceImpl) GetUnifiedExam(ctx context.Context, req *academic. resp.UnifiedExam = pack.BuildUnifiedExam(unifiedExam) return resp, nil } + +// GetPlan implements the AcademicServiceImpl interface. +func (s *AcademicServiceImpl) GetPlan(ctx context.Context, req *academic.GetPlanRequest) (resp *academic.GetPlanResponse, err error) { + resp = new(academic.GetPlanResponse) + plan, err := service.NewAcademicService(ctx).GetPlan() + if err != nil { + logger.Infof("Academic.GetPlan: GetPlan failed, err: %v", err) + return resp, nil + } + resp.Html = *plan + return resp, nil +} diff --git a/internal/academic/service/get_plan.go b/internal/academic/service/get_plan.go new file mode 100644 index 00000000..b574773c --- /dev/null +++ b/internal/academic/service/get_plan.go @@ -0,0 +1,71 @@ +/* +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 ( + "bytes" + "net/http" + + "github.com/west2-online/fzuhelper-server/pkg/base/context" + "github.com/west2-online/fzuhelper-server/pkg/constants" + "github.com/west2-online/fzuhelper-server/pkg/errno" + "github.com/west2-online/fzuhelper-server/pkg/utils" + "github.com/west2-online/jwch" +) + +func (s *AcademicService) GetPlan() (*[]byte, error) { + userHeader, err := context.GetLoginData(s.ctx) + if err != nil { + return nil, err + } + stu := jwch.NewStudent().WithLoginData(userHeader.Id, utils.ParseCookies(userHeader.Cookies)) + url, err := stu.GetCultivatePlan() + if err != nil { + return nil, errno.Errorf(errno.InternalServiceErrorCode, "AcademicService.GetPlan error:%v", err) + } + + urlReq, err := http.NewRequest(constants.GetPlanMethod, url, nil) + if err != nil { + return nil, errno.Errorf(errno.InternalServiceErrorCode, "AcademicService.GetPlan request error:%v", err) + } + urlReq.Header.Set("Cookie", userHeader.Cookies) + htmlSource, err := getHtmlSource(urlReq) + if err != nil { + return nil, errno.Errorf(errno.InternalServiceErrorCode, "AcademicService.GetPlan getHtmlSource error:%v", err) + } + + return htmlSource, nil +} + +func getHtmlSource(r *http.Request) (*[]byte, error) { + client := &http.Client{} + resp, err := client.Do(r) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if resp.StatusCode != http.StatusOK { + return nil, err + } + var buf bytes.Buffer + _, err = buf.ReadFrom(resp.Body) + if err != nil { + return nil, err + } + htmlSource := buf.Bytes() + return &htmlSource, nil +} diff --git a/internal/academic/service/get_plan_test.go b/internal/academic/service/get_plan_test.go new file mode 100644 index 00000000..444df694 --- /dev/null +++ b/internal/academic/service/get_plan_test.go @@ -0,0 +1,96 @@ +/* +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" + "fmt" + "net/http" + "strings" + "testing" + + "github.com/bytedance/mockey" + "github.com/stretchr/testify/assert" + + "github.com/west2-online/fzuhelper-server/kitex_gen/model" + meta "github.com/west2-online/fzuhelper-server/pkg/base/context" + "github.com/west2-online/jwch" +) + +func TestGetPlan(t *testing.T) { + type testCase struct { + name string + mockFileResult *[]byte + mockUrl string + mockFileError error + expectedResult *[]byte + expectedError error + } + mockUrl := "https://www.example.com" + mockHtml := []byte(`body { background-color: #fff; }`) + testCases := []testCase{ + { + name: "SuccessCase", + mockFileResult: &mockHtml, + mockUrl: mockUrl, + mockFileError: nil, + expectedResult: &mockHtml, + expectedError: nil, + }, + { + name: "NotFound", + mockFileResult: nil, + mockUrl: "", + mockFileError: fmt.Errorf("%s", "cultivate plan not found"), + expectedResult: nil, + expectedError: fmt.Errorf("%s", strings.Join([]string{ + "AcademicService.GetPlan", + }, "")), + }, + } + defer mockey.UnPatchAll() + + for _, tc := range testCases { + mockey.PatchConvey(tc.name, t, func() { + mockey.Mock((*jwch.Student).WithLoginData).To(func(identifier string, cookies []*http.Cookie) *jwch.Student { + return jwch.NewStudent() + }).Build() + mockey.Mock(meta.GetLoginData).To(func(ctx context.Context) (*model.LoginData, error) { + return &model.LoginData{ + Id: "1111111111111111111111111111111111", + Cookies: "", + }, nil + }).Build() + mockey.Mock((*jwch.Student).GetCultivatePlan).To(func() (string, error) { + return tc.mockUrl, tc.mockFileError + }).Build() + mockey.Mock(getHtmlSource).To(func() (*[]byte, error) { + return tc.mockFileResult, tc.mockFileError + }).Build() + academicService := AcademicService{} + result, err := academicService.GetPlan() + if tc.expectedError != nil { + assert.Nil(t, result) + assert.Contains(t, err.Error(), tc.expectedError.Error()) + } else { + // fmt.Println(string(*result)) + assert.Nil(t, err) + assert.Equal(t, tc.expectedResult, result) + } + }) + } +} diff --git a/internal/user/handler.go b/internal/user/handler.go index 7bc0ec15..4fddb586 100644 --- a/internal/user/handler.go +++ b/internal/user/handler.go @@ -19,18 +19,29 @@ package user import ( "context" + "github.com/west2-online/fzuhelper-server/internal/user/pack" "github.com/west2-online/fzuhelper-server/internal/user/service" "github.com/west2-online/fzuhelper-server/kitex_gen/user" "github.com/west2-online/fzuhelper-server/pkg/base" + metainfoContext "github.com/west2-online/fzuhelper-server/pkg/base/context" + "github.com/west2-online/fzuhelper-server/pkg/utils" ) // UserServiceImpl implements the last service interface defined in the IDL. -type UserServiceImpl struct{} +type UserServiceImpl struct { + ClientSet *base.ClientSet +} + +func NewUserService(clientSet *base.ClientSet) *UserServiceImpl { + return &UserServiceImpl{ + ClientSet: clientSet, + } +} // GetLoginData implements the UserServiceImpl interface. func (s *UserServiceImpl) GetLoginData(ctx context.Context, req *user.GetLoginDataRequest) (resp *user.GetLoginDataResponse, err error) { resp = new(user.GetLoginDataResponse) - l := service.NewUserService(ctx, "", nil) + l := service.NewUserService(ctx, "", nil, s.ClientSet) id, cookies, err := l.GetLoginData(req) if err != nil { resp.Base = base.BuildBaseResp(err) @@ -41,3 +52,22 @@ func (s *UserServiceImpl) GetLoginData(ctx context.Context, req *user.GetLoginDa resp.Cookies = cookies return } + +// GetUserInfo implements the UserServiceImpl interface. +func (s *UserServiceImpl) GetUserInfo(ctx context.Context, request *user.GetUserInfoRequest) (resp *user.GetUserInfoResponse, err error) { + resp = new(user.GetUserInfoResponse) + userHeader, err := metainfoContext.GetLoginData(ctx) + if err != nil { + resp.Base = base.BuildBaseResp(err) + return resp, nil + } + l := service.NewUserService(ctx, userHeader.Id, utils.ParseCookies(userHeader.Cookies), s.ClientSet) + info, err := l.GetUserInfo(userHeader.Id[len(userHeader.Id)-9:]) + if err != nil { + resp.Base = base.BuildBaseResp(err) + return resp, nil + } + resp.Base = base.BuildSuccessResp() + resp.Data = pack.BuildInfoResp(info) + return +} diff --git a/internal/user/pack/info.go b/internal/user/pack/info.go new file mode 100644 index 00000000..1b4281f7 --- /dev/null +++ b/internal/user/pack/info.go @@ -0,0 +1,35 @@ +/* +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 ( + "strconv" + + "github.com/west2-online/fzuhelper-server/kitex_gen/model" + db "github.com/west2-online/fzuhelper-server/pkg/db/model" +) + +func BuildInfoResp(student *db.Student) *model.UserInfo { + return &model.UserInfo{ + StuId: student.StuId, + Birthday: student.Birthday, + Sex: student.Sex, + College: student.College, + Grade: strconv.FormatInt(student.Grade, 10), + Major: student.Major, + } +} diff --git a/internal/user/service/get_info.go b/internal/user/service/get_info.go new file mode 100644 index 00000000..5cb14530 --- /dev/null +++ b/internal/user/service/get_info.go @@ -0,0 +1,58 @@ +/* +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" + "strconv" + + db "github.com/west2-online/fzuhelper-server/pkg/db/model" + "github.com/west2-online/fzuhelper-server/pkg/errno" + "github.com/west2-online/jwch" +) + +func (s *UserService) GetUserInfo(stuId string) (*db.Student, error) { + // 查询数据库是否存入此学生信息 + exist, stuInfo, err := s.db.User.GetStudentById(s.ctx, stuId) + if err != nil { + return nil, fmt.Errorf("service.GetUserInfo: %w", err) + } + if exist { + return stuInfo, nil + } + + // 若未查询则将学生信息插入 + stu := jwch.NewStudent().WithLoginData(s.Identifier, s.cookies) + resp, err := stu.GetInfo() + if err != nil { + return nil, errno.Errorf(errno.InternalServiceErrorCode, "service.GetUserInfo: jwch failed: %v", err) + } + grade, _ := strconv.Atoi(resp.Grade) + userModel := &db.Student{ + StuId: stuId, + Sex: resp.Sex, + Birthday: resp.Birthday, + College: resp.College, + Grade: int64(grade), + Major: resp.Major, + } + err = s.db.User.CreateStudent(s.ctx, userModel) + if err != nil { + return nil, fmt.Errorf("service.GetUserInfo: %w", err) + } + return userModel, nil +} diff --git a/internal/user/service/get_info_test.go b/internal/user/service/get_info_test.go new file mode 100644 index 00000000..c364588a --- /dev/null +++ b/internal/user/service/get_info_test.go @@ -0,0 +1,147 @@ +/* +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" + "net/http" + "strconv" + "testing" + + "github.com/bytedance/mockey" + "github.com/stretchr/testify/assert" + "gorm.io/gorm" + + "github.com/west2-online/fzuhelper-server/kitex_gen/model" + "github.com/west2-online/fzuhelper-server/pkg/base" + meta "github.com/west2-online/fzuhelper-server/pkg/base/context" + "github.com/west2-online/fzuhelper-server/pkg/db" + dbmodel "github.com/west2-online/fzuhelper-server/pkg/db/model" + userDB "github.com/west2-online/fzuhelper-server/pkg/db/user" + "github.com/west2-online/fzuhelper-server/pkg/errno" + "github.com/west2-online/fzuhelper-server/pkg/utils" + "github.com/west2-online/jwch" +) + +func TestUserService_GetUserInfo(t *testing.T) { + type testCase struct { + name string + expectedInfo *dbmodel.Student + expectedJwch *jwch.StudentDetail + expectedExist bool + mockError error + mockDBCreateError error + mockJwchError error + expectingError bool + expectingErrorMsg string + } + info := &dbmodel.Student{ + StuId: "102301000", + Sex: "sex", + Birthday: "1970-01-01", + College: "计算机与大数据学院", + Grade: 2023, + Major: "计算机类", + } + stuDetail := &jwch.StudentDetail{ + Sex: info.Sex, + Birthday: info.Birthday, + College: info.College, + Grade: strconv.FormatInt(info.Grade, 10), + Major: info.Major, + } + testCases := []testCase{ + { + name: "exist success", + expectedExist: true, + expectingError: false, + expectedInfo: info, + mockError: nil, + }, + { + name: "not exist success", + expectedExist: false, + expectingError: false, + expectedInfo: info, + expectedJwch: stuDetail, + mockError: nil, + }, + { + name: "jwch error", + expectedExist: false, + expectingError: true, + expectedInfo: info, + expectedJwch: stuDetail, + mockJwchError: errno.InternalServiceError, + expectingErrorMsg: errno.InternalServiceError.ErrorMsg, + }, + { + name: "db create error", + expectedExist: false, + expectingError: true, + expectedInfo: info, + expectedJwch: stuDetail, + mockDBCreateError: gorm.ErrInvalidData, + expectingErrorMsg: "service.GetUserInfo:", + }, + { + name: "db error", + expectedExist: false, + expectingError: true, + expectedInfo: info, + expectedJwch: stuDetail, + mockError: gorm.ErrInvalidData, + expectingErrorMsg: "service.GetUserInfo:", + }, + } + defer mockey.UnPatchAll() + for _, tc := range testCases { + mockey.PatchConvey(tc.name, t, func() { + mockClientSet := new(base.ClientSet) + mockClientSet.SFClient = new(utils.Snowflake) + mockClientSet.DBClient = new(db.Database) + userService := NewUserService(context.Background(), "", nil, mockClientSet) + mockey.Mock((*userDB.DBUser).GetStudentById).To(func(ctx context.Context, stuId string) (bool, *dbmodel.Student, error) { + return tc.expectedExist, tc.expectedInfo, tc.mockError + }).Build() + mockey.Mock((*jwch.Student).WithLoginData).To(func(identifier string, cookies []*http.Cookie) *jwch.Student { + return jwch.NewStudent() + }).Build() + mockey.Mock(meta.GetLoginData).To(func(ctx context.Context) (*model.LoginData, error) { + return &model.LoginData{ + Id: "1111111111111111111111111111111111", + Cookies: "", + }, nil + }).Build() + mockey.Mock((*jwch.Student).GetInfo).To(func() (resp *jwch.StudentDetail, err error) { + return tc.expectedJwch, tc.mockJwchError + }).Build() + mockey.Mock((*userDB.DBUser).CreateStudent).To(func(ctx context.Context, userModel *dbmodel.Student) error { + return tc.mockDBCreateError + }).Build() + + stuInfo, err := userService.GetUserInfo(info.StuId) + if tc.expectingError { + assert.Nil(t, stuInfo) + assert.Contains(t, err.Error(), tc.expectingErrorMsg) + } else { + assert.NoError(t, err) + assert.Equal(t, tc.expectedInfo, stuInfo) + } + }) + } +} diff --git a/internal/user/service/get_logindata.go b/internal/user/service/get_logindata.go index 7d59b46b..2d7cada9 100644 --- a/internal/user/service/get_logindata.go +++ b/internal/user/service/get_logindata.go @@ -23,7 +23,8 @@ import ( ) func (s *UserService) GetLoginData(req *user.GetLoginDataRequest) (string, []string, error) { - id, rawCookies, err := jwch.NewStudent().WithUser(req.Id, req.Password).GetIdentifierAndCookies() + stu := jwch.NewStudent().WithUser(req.Id, req.Password) + id, rawCookies, err := stu.GetIdentifierAndCookies() if err != nil { return "", nil, err } diff --git a/internal/user/service/get_logindata_test.go b/internal/user/service/get_logindata_test.go index b839aeca..e622146d 100644 --- a/internal/user/service/get_logindata_test.go +++ b/internal/user/service/get_logindata_test.go @@ -15,3 +15,74 @@ limitations under the License. */ package service + +import ( + "context" + "net/http" + "testing" + + "github.com/bytedance/mockey" + "github.com/stretchr/testify/assert" + + "github.com/west2-online/fzuhelper-server/kitex_gen/user" + "github.com/west2-online/fzuhelper-server/pkg/base" + "github.com/west2-online/fzuhelper-server/pkg/db" + "github.com/west2-online/fzuhelper-server/pkg/errno" + "github.com/west2-online/fzuhelper-server/pkg/utils" + "github.com/west2-online/jwch" +) + +func TestUserService_GetLoginData(t *testing.T) { + type testCase struct { + name string + expectedId string + expectedCookie []*http.Cookie + mockError error + expectingError bool + } + testCases := []testCase{ + { + name: "success", + expectedId: "2024102301000", + expectedCookie: []*http.Cookie{ + { + Name: "test", + }, + }, + }, + { + name: "jwch error", + mockError: errno.InternalServiceError, + expectingError: true, + }, + } + req := &user.GetLoginDataRequest{ + Id: "102301000", + Password: "102301000", + } + defer mockey.UnPatchAll() + for _, tc := range testCases { + mockey.PatchConvey(tc.name, t, func() { + mockClientSet := new(base.ClientSet) + mockClientSet.SFClient = new(utils.Snowflake) + mockClientSet.DBClient = new(db.Database) + userService := NewUserService(context.Background(), "", nil, mockClientSet) + mockey.Mock((*jwch.Student).GetIdentifierAndCookies).To(func() (string, []*http.Cookie, error) { + if tc.expectingError { + return "", nil, tc.mockError + } + return tc.expectedId, tc.expectedCookie, nil + }).Build() + + id, cookie, err := userService.GetLoginData(req) + if tc.expectingError { + assert.Nil(t, cookie) + assert.Contains(t, err.Error(), errno.InternalServiceError.ErrorMsg) + } else { + assert.NoError(t, err) + assert.Equal(t, tc.expectedId, id) + assert.Equal(t, utils.ParseCookiesToString(tc.expectedCookie), cookie) + } + }) + } +} diff --git a/internal/user/service/service.go b/internal/user/service/service.go index 33b196d7..a6b2abf3 100644 --- a/internal/user/service/service.go +++ b/internal/user/service/service.go @@ -19,18 +19,23 @@ package service import ( "context" "net/http" + + "github.com/west2-online/fzuhelper-server/pkg/base" + "github.com/west2-online/fzuhelper-server/pkg/db" ) type UserService struct { ctx context.Context Identifier string cookies []*http.Cookie + db *db.Database } -func NewUserService(ctx context.Context, identifier string, cookies []*http.Cookie) *UserService { +func NewUserService(ctx context.Context, identifier string, cookies []*http.Cookie, clientset *base.ClientSet) *UserService { return &UserService{ ctx: ctx, Identifier: identifier, cookies: cookies, + db: clientset.DBClient, } } diff --git a/kitex_gen/academic/academic.go b/kitex_gen/academic/academic.go index 0ed4b9b3..0407aab0 100644 --- a/kitex_gen/academic/academic.go +++ b/kitex_gen/academic/academic.go @@ -19,6 +19,7 @@ limitations under the License. package academic import ( + "bytes" "context" "fmt" "strings" @@ -2047,6 +2048,263 @@ func (p *GetUnifiedExamResponse) Field2DeepEqual(src []*model.UnifiedExam) bool return true } +type GetPlanRequest struct { +} + +func NewGetPlanRequest() *GetPlanRequest { + return &GetPlanRequest{} +} + +func (p *GetPlanRequest) InitDefault() { +} + +var fieldIDToName_GetPlanRequest = map[int16]string{} + +func (p *GetPlanRequest) 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 + } + 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 + } + + 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 *GetPlanRequest) Write(oprot thrift.TProtocol) (err error) { + + if err = oprot.WriteStructBegin("GetPlanRequest"); err != nil { + goto WriteStructBeginError + } + if p != 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) +} + +func (p *GetPlanRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetPlanRequest(%+v)", *p) + +} + +func (p *GetPlanRequest) DeepEqual(ano *GetPlanRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + return true +} + +type GetPlanResponse struct { + Html []byte `thrift:"html,1" frugal:"1,default,binary" json:"html"` +} + +func NewGetPlanResponse() *GetPlanResponse { + return &GetPlanResponse{} +} + +func (p *GetPlanResponse) InitDefault() { +} + +func (p *GetPlanResponse) GetHtml() (v []byte) { + return p.Html +} +func (p *GetPlanResponse) SetHtml(val []byte) { + p.Html = val +} + +var fieldIDToName_GetPlanResponse = map[int16]string{ + 1: "html", +} + +func (p *GetPlanResponse) 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 + } + 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_GetPlanResponse[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 *GetPlanResponse) ReadField1(iprot thrift.TProtocol) error { + + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { + return err + } else { + _field = []byte(v) + } + p.Html = _field + return nil +} + +func (p *GetPlanResponse) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetPlanResponse"); 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 *GetPlanResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("html", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBinary([]byte(p.Html)); 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 *GetPlanResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetPlanResponse(%+v)", *p) + +} + +func (p *GetPlanResponse) DeepEqual(ano *GetPlanResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Html) { + return false + } + return true +} + +func (p *GetPlanResponse) Field1DeepEqual(src []byte) bool { + + if bytes.Compare(p.Html, src) != 0 { + return false + } + return true +} + type AcademicService interface { GetScores(ctx context.Context, req *GetScoresRequest) (r *GetScoresResponse, err error) @@ -2055,6 +2313,8 @@ type AcademicService interface { GetCredit(ctx context.Context, req *GetCreditRequest) (r *GetCreditResponse, err error) GetUnifiedExam(ctx context.Context, req *GetUnifiedExamRequest) (r *GetUnifiedExamResponse, err error) + + GetPlan(ctx context.Context, req *GetPlanRequest) (r *GetPlanResponse, err error) } type AcademicServiceGetScoresArgs struct { @@ -3424,3 +3684,345 @@ func (p *AcademicServiceGetUnifiedExamResult) Field0DeepEqual(src *GetUnifiedExa } return true } + +type AcademicServiceGetPlanArgs struct { + Req *GetPlanRequest `thrift:"req,1" frugal:"1,default,GetPlanRequest" json:"req"` +} + +func NewAcademicServiceGetPlanArgs() *AcademicServiceGetPlanArgs { + return &AcademicServiceGetPlanArgs{} +} + +func (p *AcademicServiceGetPlanArgs) InitDefault() { +} + +var AcademicServiceGetPlanArgs_Req_DEFAULT *GetPlanRequest + +func (p *AcademicServiceGetPlanArgs) GetReq() (v *GetPlanRequest) { + if !p.IsSetReq() { + return AcademicServiceGetPlanArgs_Req_DEFAULT + } + return p.Req +} +func (p *AcademicServiceGetPlanArgs) SetReq(val *GetPlanRequest) { + p.Req = val +} + +var fieldIDToName_AcademicServiceGetPlanArgs = map[int16]string{ + 1: "req", +} + +func (p *AcademicServiceGetPlanArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *AcademicServiceGetPlanArgs) 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_AcademicServiceGetPlanArgs[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 *AcademicServiceGetPlanArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetPlanRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *AcademicServiceGetPlanArgs) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetPlan_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 *AcademicServiceGetPlanArgs) 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 *AcademicServiceGetPlanArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AcademicServiceGetPlanArgs(%+v)", *p) + +} + +func (p *AcademicServiceGetPlanArgs) DeepEqual(ano *AcademicServiceGetPlanArgs) 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 *AcademicServiceGetPlanArgs) Field1DeepEqual(src *GetPlanRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type AcademicServiceGetPlanResult struct { + Success *GetPlanResponse `thrift:"success,0,optional" frugal:"0,optional,GetPlanResponse" json:"success,omitempty"` +} + +func NewAcademicServiceGetPlanResult() *AcademicServiceGetPlanResult { + return &AcademicServiceGetPlanResult{} +} + +func (p *AcademicServiceGetPlanResult) InitDefault() { +} + +var AcademicServiceGetPlanResult_Success_DEFAULT *GetPlanResponse + +func (p *AcademicServiceGetPlanResult) GetSuccess() (v *GetPlanResponse) { + if !p.IsSetSuccess() { + return AcademicServiceGetPlanResult_Success_DEFAULT + } + return p.Success +} +func (p *AcademicServiceGetPlanResult) SetSuccess(x interface{}) { + p.Success = x.(*GetPlanResponse) +} + +var fieldIDToName_AcademicServiceGetPlanResult = map[int16]string{ + 0: "success", +} + +func (p *AcademicServiceGetPlanResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AcademicServiceGetPlanResult) 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_AcademicServiceGetPlanResult[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 *AcademicServiceGetPlanResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetPlanResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *AcademicServiceGetPlanResult) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetPlan_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 *AcademicServiceGetPlanResult) 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 *AcademicServiceGetPlanResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AcademicServiceGetPlanResult(%+v)", *p) + +} + +func (p *AcademicServiceGetPlanResult) DeepEqual(ano *AcademicServiceGetPlanResult) 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 *AcademicServiceGetPlanResult) Field0DeepEqual(src *GetPlanResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} diff --git a/kitex_gen/academic/academicservice/academicservice.go b/kitex_gen/academic/academicservice/academicservice.go index 1072a4ad..3f16cd59 100644 --- a/kitex_gen/academic/academicservice/academicservice.go +++ b/kitex_gen/academic/academicservice/academicservice.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by Kitex v0.12.1. DO NOT EDIT. +// Code generated by Kitex v0.12.0. DO NOT EDIT. package academicservice @@ -59,6 +59,13 @@ var serviceMethods = map[string]kitex.MethodInfo{ false, kitex.WithStreamingMode(kitex.StreamingNone), ), + "GetPlan": kitex.NewMethodInfo( + getPlanHandler, + newAcademicServiceGetPlanArgs, + newAcademicServiceGetPlanResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), } var ( @@ -119,7 +126,7 @@ func newServiceInfo(hasStreaming bool, keepStreamingMethods bool, keepNonStreami HandlerType: handlerType, Methods: methods, PayloadCodec: kitex.Thrift, - KiteXGenVersion: "v0.12.1", + KiteXGenVersion: "v0.12.0", Extra: extra, } return svcInfo @@ -197,6 +204,24 @@ func newAcademicServiceGetUnifiedExamResult() interface{} { return academic.NewAcademicServiceGetUnifiedExamResult() } +func getPlanHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*academic.AcademicServiceGetPlanArgs) + realResult := result.(*academic.AcademicServiceGetPlanResult) + success, err := handler.(academic.AcademicService).GetPlan(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newAcademicServiceGetPlanArgs() interface{} { + return academic.NewAcademicServiceGetPlanArgs() +} + +func newAcademicServiceGetPlanResult() interface{} { + return academic.NewAcademicServiceGetPlanResult() +} + type kClient struct { c client.Client } @@ -246,3 +271,13 @@ func (p *kClient) GetUnifiedExam(ctx context.Context, req *academic.GetUnifiedEx } return _result.GetSuccess(), nil } + +func (p *kClient) GetPlan(ctx context.Context, req *academic.GetPlanRequest) (r *academic.GetPlanResponse, err error) { + var _args academic.AcademicServiceGetPlanArgs + _args.Req = req + var _result academic.AcademicServiceGetPlanResult + if err = p.c.Call(ctx, "GetPlan", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} diff --git a/kitex_gen/academic/academicservice/client.go b/kitex_gen/academic/academicservice/client.go index f1dc2185..fa9be089 100644 --- a/kitex_gen/academic/academicservice/client.go +++ b/kitex_gen/academic/academicservice/client.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by Kitex v0.12.1. DO NOT EDIT. +// Code generated by Kitex v0.12.0. DO NOT EDIT. package academicservice @@ -33,6 +33,7 @@ type Client interface { GetGPA(ctx context.Context, req *academic.GetGPARequest, callOptions ...callopt.Option) (r *academic.GetGPAResponse, err error) GetCredit(ctx context.Context, req *academic.GetCreditRequest, callOptions ...callopt.Option) (r *academic.GetCreditResponse, err error) GetUnifiedExam(ctx context.Context, req *academic.GetUnifiedExamRequest, callOptions ...callopt.Option) (r *academic.GetUnifiedExamResponse, err error) + GetPlan(ctx context.Context, req *academic.GetPlanRequest, callOptions ...callopt.Option) (r *academic.GetPlanResponse, err error) } // NewClient creates a client for the service defined in IDL. @@ -83,3 +84,8 @@ func (p *kAcademicServiceClient) GetUnifiedExam(ctx context.Context, req *academ ctx = client.NewCtxWithCallOptions(ctx, callOptions) return p.kClient.GetUnifiedExam(ctx, req) } + +func (p *kAcademicServiceClient) GetPlan(ctx context.Context, req *academic.GetPlanRequest, callOptions ...callopt.Option) (r *academic.GetPlanResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.GetPlan(ctx, req) +} diff --git a/kitex_gen/academic/academicservice/server.go b/kitex_gen/academic/academicservice/server.go index 71122199..e1ae7a61 100644 --- a/kitex_gen/academic/academicservice/server.go +++ b/kitex_gen/academic/academicservice/server.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by Kitex v0.12.1. DO NOT EDIT. +// Code generated by Kitex v0.12.0. DO NOT EDIT. package academicservice import ( diff --git a/kitex_gen/academic/k-academic.go b/kitex_gen/academic/k-academic.go index 0b7deecd..d9c4732b 100644 --- a/kitex_gen/academic/k-academic.go +++ b/kitex_gen/academic/k-academic.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by Kitex v0.12.1. DO NOT EDIT. +// Code generated by Kitex v0.12.0. DO NOT EDIT. package academic @@ -1350,6 +1350,156 @@ func (p *GetUnifiedExamResponse) field2Length() int { return l } +func (p *GetPlanRequest) 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) +} + +func (p *GetPlanRequest) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *GetPlanRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *GetPlanRequest) BLength() int { + l := 0 + if p != nil { + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *GetPlanResponse) 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 + } + } + 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_GetPlanResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *GetPlanResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field []byte + if v, l, err := thrift.Binary.ReadBinary(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + _field = []byte(v) + } + p.Html = _field + return offset, nil +} + +func (p *GetPlanResponse) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *GetPlanResponse) 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 *GetPlanResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *GetPlanResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteBinaryNocopy(buf[offset:], w, []byte(p.Html)) + return offset +} + +func (p *GetPlanResponse) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.BinaryLengthNocopy([]byte(p.Html)) + return l +} + func (p *AcademicServiceGetScoresArgs) FastRead(buf []byte) (int, error) { var err error @@ -2142,6 +2292,204 @@ func (p *AcademicServiceGetUnifiedExamResult) field0Length() int { return l } +func (p *AcademicServiceGetPlanArgs) 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_AcademicServiceGetPlanArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *AcademicServiceGetPlanArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewGetPlanRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = _field + return offset, nil +} + +func (p *AcademicServiceGetPlanArgs) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *AcademicServiceGetPlanArgs) 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 *AcademicServiceGetPlanArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *AcademicServiceGetPlanArgs) 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 *AcademicServiceGetPlanArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Req.BLength() + return l +} + +func (p *AcademicServiceGetPlanResult) 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_AcademicServiceGetPlanResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *AcademicServiceGetPlanResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewGetPlanResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +func (p *AcademicServiceGetPlanResult) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *AcademicServiceGetPlanResult) 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 *AcademicServiceGetPlanResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *AcademicServiceGetPlanResult) 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 *AcademicServiceGetPlanResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + func (p *AcademicServiceGetScoresArgs) GetFirstArgument() interface{} { return p.Req } @@ -2173,3 +2521,11 @@ func (p *AcademicServiceGetUnifiedExamArgs) GetFirstArgument() interface{} { func (p *AcademicServiceGetUnifiedExamResult) GetResult() interface{} { return p.Success } + +func (p *AcademicServiceGetPlanArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *AcademicServiceGetPlanResult) GetResult() interface{} { + return p.Success +} diff --git a/kitex_gen/model/k-model.go b/kitex_gen/model/k-model.go index 048cf17b..bae8bce8 100644 --- a/kitex_gen/model/k-model.go +++ b/kitex_gen/model/k-model.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by Kitex v0.12.1. DO NOT EDIT. +// Code generated by Kitex v0.12.0. DO NOT EDIT. package model @@ -337,6 +337,368 @@ func (p *LoginData) field2Length() int { return l } +func (p *UserInfo) FastRead(buf []byte) (int, error) { + + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + var issetStuId bool = false + var issetBirthday bool = false + var issetSex bool = false + var issetCollege bool = false + var issetGrade bool = false + var issetMajor 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 + } + issetStuId = true + } 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 + } + issetBirthday = 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 + } + issetSex = 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 + } + issetCollege = true + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 6: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField6(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetGrade = true + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 7: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField7(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetMajor = 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 !issetStuId { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetBirthday { + fieldId = 3 + goto RequiredFieldNotSetError + } + + if !issetSex { + fieldId = 4 + goto RequiredFieldNotSetError + } + + if !issetCollege { + fieldId = 5 + goto RequiredFieldNotSetError + } + + if !issetGrade { + fieldId = 6 + goto RequiredFieldNotSetError + } + + if !issetMajor { + fieldId = 7 + 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_UserInfo[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_UserInfo[fieldId])) +} + +func (p *UserInfo) 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.StuId = _field + return offset, nil +} + +func (p *UserInfo) 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.Birthday = _field + return offset, nil +} + +func (p *UserInfo) 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.Sex = _field + return offset, nil +} + +func (p *UserInfo) 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.College = _field + return offset, nil +} + +func (p *UserInfo) FastReadField6(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.Grade = _field + return offset, nil +} + +func (p *UserInfo) FastReadField7(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.Major = _field + return offset, nil +} + +func (p *UserInfo) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *UserInfo) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField3(buf[offset:], w) + offset += p.fastWriteField4(buf[offset:], w) + offset += p.fastWriteField5(buf[offset:], w) + offset += p.fastWriteField6(buf[offset:], w) + offset += p.fastWriteField7(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *UserInfo) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field3Length() + l += p.field4Length() + l += p.field5Length() + l += p.field6Length() + l += p.field7Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *UserInfo) 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.StuId) + return offset +} + +func (p *UserInfo) fastWriteField3(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.Birthday) + return offset +} + +func (p *UserInfo) fastWriteField4(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.Sex) + return offset +} + +func (p *UserInfo) fastWriteField5(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.College) + return offset +} + +func (p *UserInfo) fastWriteField6(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 6) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.Grade) + return offset +} + +func (p *UserInfo) fastWriteField7(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 7) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.Major) + return offset +} + +func (p *UserInfo) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.StuId) + return l +} + +func (p *UserInfo) field3Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.Birthday) + return l +} + +func (p *UserInfo) field4Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.Sex) + return l +} + +func (p *UserInfo) field5Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.College) + return l +} + +func (p *UserInfo) field6Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.Grade) + return l +} + +func (p *UserInfo) field7Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.Major) + return l +} + func (p *Classroom) FastRead(buf []byte) (int, error) { var err error diff --git a/kitex_gen/model/model.go b/kitex_gen/model/model.go index 47e1aac6..185b000c 100644 --- a/kitex_gen/model/model.go +++ b/kitex_gen/model/model.go @@ -486,6 +486,508 @@ func (p *LoginData) Field2DeepEqual(src string) bool { return true } +type UserInfo struct { + StuId string `thrift:"stu_id,1,required" frugal:"1,required,string" json:"stu_id"` + Birthday string `thrift:"birthday,3,required" frugal:"3,required,string" json:"birthday"` + Sex string `thrift:"sex,4,required" frugal:"4,required,string" json:"sex"` + College string `thrift:"college,5,required" frugal:"5,required,string" json:"college"` + Grade string `thrift:"grade,6,required" frugal:"6,required,string" json:"grade"` + Major string `thrift:"major,7,required" frugal:"7,required,string" json:"major"` +} + +func NewUserInfo() *UserInfo { + return &UserInfo{} +} + +func (p *UserInfo) InitDefault() { +} + +func (p *UserInfo) GetStuId() (v string) { + return p.StuId +} + +func (p *UserInfo) GetBirthday() (v string) { + return p.Birthday +} + +func (p *UserInfo) GetSex() (v string) { + return p.Sex +} + +func (p *UserInfo) GetCollege() (v string) { + return p.College +} + +func (p *UserInfo) GetGrade() (v string) { + return p.Grade +} + +func (p *UserInfo) GetMajor() (v string) { + return p.Major +} +func (p *UserInfo) SetStuId(val string) { + p.StuId = val +} +func (p *UserInfo) SetBirthday(val string) { + p.Birthday = val +} +func (p *UserInfo) SetSex(val string) { + p.Sex = val +} +func (p *UserInfo) SetCollege(val string) { + p.College = val +} +func (p *UserInfo) SetGrade(val string) { + p.Grade = val +} +func (p *UserInfo) SetMajor(val string) { + p.Major = val +} + +var fieldIDToName_UserInfo = map[int16]string{ + 1: "stu_id", + 3: "birthday", + 4: "sex", + 5: "college", + 6: "grade", + 7: "major", +} + +func (p *UserInfo) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetStuId bool = false + var issetBirthday bool = false + var issetSex bool = false + var issetCollege bool = false + var issetGrade bool = false + var issetMajor 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.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetStuId = 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 + } + issetBirthday = 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 + } + issetSex = 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 + } + issetCollege = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.STRING { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + issetGrade = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.STRING { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + issetMajor = 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 !issetStuId { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetBirthday { + fieldId = 3 + goto RequiredFieldNotSetError + } + + if !issetSex { + fieldId = 4 + goto RequiredFieldNotSetError + } + + if !issetCollege { + fieldId = 5 + goto RequiredFieldNotSetError + } + + if !issetGrade { + fieldId = 6 + goto RequiredFieldNotSetError + } + + if !issetMajor { + fieldId = 7 + 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_UserInfo[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_UserInfo[fieldId])) +} + +func (p *UserInfo) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.StuId = _field + return nil +} +func (p *UserInfo) ReadField3(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Birthday = _field + return nil +} +func (p *UserInfo) ReadField4(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Sex = _field + return nil +} +func (p *UserInfo) ReadField5(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.College = _field + return nil +} +func (p *UserInfo) ReadField6(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Grade = _field + return nil +} +func (p *UserInfo) ReadField7(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Major = _field + return nil +} + +func (p *UserInfo) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("UserInfo"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *UserInfo) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("stu_id", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.StuId); 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 *UserInfo) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("birthday", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Birthday); 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 *UserInfo) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("sex", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Sex); 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 *UserInfo) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("college", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.College); 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 *UserInfo) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("grade", thrift.STRING, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Grade); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *UserInfo) writeField7(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("major", thrift.STRING, 7); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Major); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} + +func (p *UserInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UserInfo(%+v)", *p) + +} + +func (p *UserInfo) DeepEqual(ano *UserInfo) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.StuId) { + return false + } + if !p.Field3DeepEqual(ano.Birthday) { + return false + } + if !p.Field4DeepEqual(ano.Sex) { + return false + } + if !p.Field5DeepEqual(ano.College) { + return false + } + if !p.Field6DeepEqual(ano.Grade) { + return false + } + if !p.Field7DeepEqual(ano.Major) { + return false + } + return true +} + +func (p *UserInfo) Field1DeepEqual(src string) bool { + + if strings.Compare(p.StuId, src) != 0 { + return false + } + return true +} +func (p *UserInfo) Field3DeepEqual(src string) bool { + + if strings.Compare(p.Birthday, src) != 0 { + return false + } + return true +} +func (p *UserInfo) Field4DeepEqual(src string) bool { + + if strings.Compare(p.Sex, src) != 0 { + return false + } + return true +} +func (p *UserInfo) Field5DeepEqual(src string) bool { + + if strings.Compare(p.College, src) != 0 { + return false + } + return true +} +func (p *UserInfo) Field6DeepEqual(src string) bool { + + if strings.Compare(p.Grade, src) != 0 { + return false + } + return true +} +func (p *UserInfo) Field7DeepEqual(src string) bool { + + if strings.Compare(p.Major, src) != 0 { + return false + } + return true +} + type Classroom struct { Build string `thrift:"build,1,required" frugal:"1,required,string" json:"build"` Location string `thrift:"location,2,required" frugal:"2,required,string" json:"location"` diff --git a/kitex_gen/user/k-user.go b/kitex_gen/user/k-user.go index 39035447..4382a0af 100644 --- a/kitex_gen/user/k-user.go +++ b/kitex_gen/user/k-user.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by Kitex v0.11.3. DO NOT EDIT. +// Code generated by Kitex v0.12.0. DO NOT EDIT. package user @@ -43,6 +43,7 @@ var ( ) func (p *GetLoginDataRequest) FastRead(buf []byte) (int, error) { + var err error var offset int var l int @@ -147,9 +148,8 @@ func (p *GetLoginDataRequest) FastReadField2(buf []byte) (int, error) { return offset, nil } -// for compatibility func (p *GetLoginDataRequest) FastWrite(buf []byte) int { - return 0 + return p.FastWriteNocopy(buf, nil) } func (p *GetLoginDataRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { @@ -201,6 +201,7 @@ func (p *GetLoginDataRequest) field2Length() int { } func (p *GetLoginDataResponse) FastRead(buf []byte) (int, error) { + var err error var offset int var l int @@ -348,9 +349,8 @@ func (p *GetLoginDataResponse) FastReadField3(buf []byte) (int, error) { return offset, nil } -// for compatibility func (p *GetLoginDataResponse) FastWrite(buf []byte) int { - return 0 + return p.FastWriteNocopy(buf, nil) } func (p *GetLoginDataResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { @@ -428,7 +428,209 @@ func (p *GetLoginDataResponse) field3Length() int { return l } +func (p *GetUserInfoRequest) 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) +} + +func (p *GetUserInfoRequest) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *GetUserInfoRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *GetUserInfoRequest) BLength() int { + l := 0 + if p != nil { + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *GetUserInfoResponse) 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 + 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 + } + } 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 + } + 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_GetUserInfoResponse[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_GetUserInfoResponse[fieldId])) +} + +func (p *GetUserInfoResponse) 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 *GetUserInfoResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 + _field := model.NewUserInfo() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Data = _field + return offset, nil +} + +func (p *GetUserInfoResponse) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *GetUserInfoResponse) 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 *GetUserInfoResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *GetUserInfoResponse) 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 *GetUserInfoResponse) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetData() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 2) + offset += p.Data.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *GetUserInfoResponse) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Base.BLength() + return l +} + +func (p *GetUserInfoResponse) field2Length() int { + l := 0 + if p.IsSetData() { + l += thrift.Binary.FieldBeginLength() + l += p.Data.BLength() + } + return l +} + func (p *UserServiceGetLoginDataArgs) FastRead(buf []byte) (int, error) { + var err error var offset int var l int @@ -488,9 +690,8 @@ func (p *UserServiceGetLoginDataArgs) FastReadField1(buf []byte) (int, error) { return offset, nil } -// for compatibility func (p *UserServiceGetLoginDataArgs) FastWrite(buf []byte) int { - return 0 + return p.FastWriteNocopy(buf, nil) } func (p *UserServiceGetLoginDataArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { @@ -526,6 +727,7 @@ func (p *UserServiceGetLoginDataArgs) field1Length() int { } func (p *UserServiceGetLoginDataResult) FastRead(buf []byte) (int, error) { + var err error var offset int var l int @@ -585,9 +787,8 @@ func (p *UserServiceGetLoginDataResult) FastReadField0(buf []byte) (int, error) return offset, nil } -// for compatibility func (p *UserServiceGetLoginDataResult) FastWrite(buf []byte) int { - return 0 + return p.FastWriteNocopy(buf, nil) } func (p *UserServiceGetLoginDataResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { @@ -626,6 +827,204 @@ func (p *UserServiceGetLoginDataResult) field0Length() int { return l } +func (p *UserServiceGetUserInfoArgs) 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_UserServiceGetUserInfoArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *UserServiceGetUserInfoArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewGetUserInfoRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Request = _field + return offset, nil +} + +func (p *UserServiceGetUserInfoArgs) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *UserServiceGetUserInfoArgs) 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 *UserServiceGetUserInfoArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *UserServiceGetUserInfoArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Request.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *UserServiceGetUserInfoArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Request.BLength() + return l +} + +func (p *UserServiceGetUserInfoResult) 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_UserServiceGetUserInfoResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *UserServiceGetUserInfoResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewGetUserInfoResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +func (p *UserServiceGetUserInfoResult) FastWrite(buf []byte) int { + return p.FastWriteNocopy(buf, nil) +} + +func (p *UserServiceGetUserInfoResult) 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 *UserServiceGetUserInfoResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *UserServiceGetUserInfoResult) 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 *UserServiceGetUserInfoResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + func (p *UserServiceGetLoginDataArgs) GetFirstArgument() interface{} { return p.Req } @@ -633,3 +1032,11 @@ func (p *UserServiceGetLoginDataArgs) GetFirstArgument() interface{} { func (p *UserServiceGetLoginDataResult) GetResult() interface{} { return p.Success } + +func (p *UserServiceGetUserInfoArgs) GetFirstArgument() interface{} { + return p.Request +} + +func (p *UserServiceGetUserInfoResult) GetResult() interface{} { + return p.Success +} diff --git a/kitex_gen/user/user.go b/kitex_gen/user/user.go index 8f60c436..df09153c 100644 --- a/kitex_gen/user/user.go +++ b/kitex_gen/user/user.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.17). DO NOT EDIT. +// Code generated by thriftgo (0.3.18). DO NOT EDIT. package user @@ -162,6 +162,7 @@ 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 @@ -452,6 +453,7 @@ func (p *GetLoginDataResponse) ReadField3(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 @@ -600,45 +602,153 @@ func (p *GetLoginDataResponse) Field3DeepEqual(src []string) bool { return true } -type UserService interface { - GetLoginData(ctx context.Context, req *GetLoginDataRequest) (r *GetLoginDataResponse, err error) +type GetUserInfoRequest struct { } -type UserServiceGetLoginDataArgs struct { - Req *GetLoginDataRequest `thrift:"req,1" frugal:"1,default,GetLoginDataRequest" json:"req"` +func NewGetUserInfoRequest() *GetUserInfoRequest { + return &GetUserInfoRequest{} } -func NewUserServiceGetLoginDataArgs() *UserServiceGetLoginDataArgs { - return &UserServiceGetLoginDataArgs{} +func (p *GetUserInfoRequest) InitDefault() { } -func (p *UserServiceGetLoginDataArgs) InitDefault() { +var fieldIDToName_GetUserInfoRequest = map[int16]string{} + +func (p *GetUserInfoRequest) 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 + } + 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 + } + + 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) } -var UserServiceGetLoginDataArgs_Req_DEFAULT *GetLoginDataRequest +func (p *GetUserInfoRequest) Write(oprot thrift.TProtocol) (err error) { -func (p *UserServiceGetLoginDataArgs) GetReq() (v *GetLoginDataRequest) { - if !p.IsSetReq() { - return UserServiceGetLoginDataArgs_Req_DEFAULT + if err = oprot.WriteStructBegin("GetUserInfoRequest"); err != nil { + goto WriteStructBeginError } - return p.Req + if p != 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) } -func (p *UserServiceGetLoginDataArgs) SetReq(val *GetLoginDataRequest) { - p.Req = val + +func (p *GetUserInfoRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetUserInfoRequest(%+v)", *p) + } -var fieldIDToName_UserServiceGetLoginDataArgs = map[int16]string{ - 1: "req", +func (p *GetUserInfoRequest) DeepEqual(ano *GetUserInfoRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + return true } -func (p *UserServiceGetLoginDataArgs) IsSetReq() bool { - return p.Req != nil +type GetUserInfoResponse struct { + Base *model.BaseResp `thrift:"base,1,required" frugal:"1,required,model.BaseResp" json:"base"` + Data *model.UserInfo `thrift:"data,2,optional" frugal:"2,optional,model.UserInfo" json:"data,omitempty"` } -func (p *UserServiceGetLoginDataArgs) Read(iprot thrift.TProtocol) (err error) { +func NewGetUserInfoResponse() *GetUserInfoResponse { + return &GetUserInfoResponse{} +} + +func (p *GetUserInfoResponse) InitDefault() { +} + +var GetUserInfoResponse_Base_DEFAULT *model.BaseResp + +func (p *GetUserInfoResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return GetUserInfoResponse_Base_DEFAULT + } + return p.Base +} + +var GetUserInfoResponse_Data_DEFAULT *model.UserInfo + +func (p *GetUserInfoResponse) GetData() (v *model.UserInfo) { + if !p.IsSetData() { + return GetUserInfoResponse_Data_DEFAULT + } + return p.Data +} +func (p *GetUserInfoResponse) SetBase(val *model.BaseResp) { + p.Base = val +} +func (p *GetUserInfoResponse) SetData(val *model.UserInfo) { + p.Data = val +} + +var fieldIDToName_GetUserInfoResponse = map[int16]string{ + 1: "base", + 2: "data", +} + +func (p *GetUserInfoResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *GetUserInfoResponse) IsSetData() bool { + return p.Data != nil +} + +func (p *GetUserInfoResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 + var issetBase bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -659,6 +769,15 @@ func (p *UserServiceGetLoginDataArgs) Read(iprot thrift.TProtocol) (err error) { 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 + } } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -675,13 +794,17 @@ func (p *UserServiceGetLoginDataArgs) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } + if !issetBase { + 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_UserServiceGetLoginDataArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetUserInfoResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -689,20 +812,31 @@ 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_GetUserInfoResponse[fieldId])) } -func (p *UserServiceGetLoginDataArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetLoginDataRequest() +func (p *GetUserInfoResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() if err := _field.Read(iprot); err != nil { return err } - p.Req = _field + p.Base = _field + return nil +} +func (p *GetUserInfoResponse) ReadField2(iprot thrift.TProtocol) error { + _field := model.NewUserInfo() + if err := _field.Read(iprot); err != nil { + return err + } + p.Data = _field return nil } -func (p *UserServiceGetLoginDataArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *GetUserInfoResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetLoginData_args"); err != nil { + if err = oprot.WriteStructBegin("GetUserInfoResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -710,6 +844,10 @@ func (p *UserServiceGetLoginDataArgs) Write(oprot thrift.TProtocol) (err error) fieldId = 1 goto WriteFieldError } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -728,11 +866,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UserServiceGetLoginDataArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { +func (p *GetUserInfoResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } - if err := p.Req.Write(oprot); err != nil { + if err := p.Base.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -745,66 +883,101 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UserServiceGetLoginDataArgs) String() string { +func (p *GetUserInfoResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetData() { + if err = oprot.WriteFieldBegin("data", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Data.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *GetUserInfoResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceGetLoginDataArgs(%+v)", *p) + return fmt.Sprintf("GetUserInfoResponse(%+v)", *p) } -func (p *UserServiceGetLoginDataArgs) DeepEqual(ano *UserServiceGetLoginDataArgs) bool { +func (p *GetUserInfoResponse) DeepEqual(ano *GetUserInfoResponse) bool { if p == ano { return true } else if p == nil || ano == nil { return false } - if !p.Field1DeepEqual(ano.Req) { + if !p.Field1DeepEqual(ano.Base) { + return false + } + if !p.Field2DeepEqual(ano.Data) { return false } return true } -func (p *UserServiceGetLoginDataArgs) Field1DeepEqual(src *GetLoginDataRequest) bool { +func (p *GetUserInfoResponse) Field1DeepEqual(src *model.BaseResp) bool { - if !p.Req.DeepEqual(src) { + if !p.Base.DeepEqual(src) { return false } return true } +func (p *GetUserInfoResponse) Field2DeepEqual(src *model.UserInfo) bool { -type UserServiceGetLoginDataResult struct { - Success *GetLoginDataResponse `thrift:"success,0,optional" frugal:"0,optional,GetLoginDataResponse" json:"success,omitempty"` + if !p.Data.DeepEqual(src) { + return false + } + return true } -func NewUserServiceGetLoginDataResult() *UserServiceGetLoginDataResult { - return &UserServiceGetLoginDataResult{} +type UserService interface { + GetLoginData(ctx context.Context, req *GetLoginDataRequest) (r *GetLoginDataResponse, err error) + + GetUserInfo(ctx context.Context, request *GetUserInfoRequest) (r *GetUserInfoResponse, err error) } -func (p *UserServiceGetLoginDataResult) InitDefault() { +type UserServiceGetLoginDataArgs struct { + Req *GetLoginDataRequest `thrift:"req,1" frugal:"1,default,GetLoginDataRequest" json:"req"` } -var UserServiceGetLoginDataResult_Success_DEFAULT *GetLoginDataResponse +func NewUserServiceGetLoginDataArgs() *UserServiceGetLoginDataArgs { + return &UserServiceGetLoginDataArgs{} +} -func (p *UserServiceGetLoginDataResult) GetSuccess() (v *GetLoginDataResponse) { - if !p.IsSetSuccess() { - return UserServiceGetLoginDataResult_Success_DEFAULT +func (p *UserServiceGetLoginDataArgs) InitDefault() { +} + +var UserServiceGetLoginDataArgs_Req_DEFAULT *GetLoginDataRequest + +func (p *UserServiceGetLoginDataArgs) GetReq() (v *GetLoginDataRequest) { + if !p.IsSetReq() { + return UserServiceGetLoginDataArgs_Req_DEFAULT } - return p.Success + return p.Req } -func (p *UserServiceGetLoginDataResult) SetSuccess(x interface{}) { - p.Success = x.(*GetLoginDataResponse) +func (p *UserServiceGetLoginDataArgs) SetReq(val *GetLoginDataRequest) { + p.Req = val } -var fieldIDToName_UserServiceGetLoginDataResult = map[int16]string{ - 0: "success", +var fieldIDToName_UserServiceGetLoginDataArgs = map[int16]string{ + 1: "req", } -func (p *UserServiceGetLoginDataResult) IsSetSuccess() bool { - return p.Success != nil +func (p *UserServiceGetLoginDataArgs) IsSetReq() bool { + return p.Req != nil } -func (p *UserServiceGetLoginDataResult) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceGetLoginDataArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -823,9 +996,9 @@ func (p *UserServiceGetLoginDataResult) 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 } } else if err = iprot.Skip(fieldTypeId); err != nil { @@ -850,7 +1023,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_UserServiceGetLoginDataArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -860,23 +1033,24 @@ 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 *UserServiceGetLoginDataArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetLoginDataRequest() if err := _field.Read(iprot); err != nil { return err } - p.Success = _field + p.Req = _field return nil } -func (p *UserServiceGetLoginDataResult) Write(oprot thrift.TProtocol) (err error) { +func (p *UserServiceGetLoginDataArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 - if err = oprot.WriteStructBegin("GetLoginData_result"); err != nil { + if err = oprot.WriteStructBegin("GetLoginData_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 } } @@ -897,23 +1071,193 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UserServiceGetLoginDataResult) 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 *UserServiceGetLoginDataArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError } - 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) + 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 *UserServiceGetLoginDataArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UserServiceGetLoginDataArgs(%+v)", *p) + +} + +func (p *UserServiceGetLoginDataArgs) DeepEqual(ano *UserServiceGetLoginDataArgs) 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 *UserServiceGetLoginDataArgs) Field1DeepEqual(src *GetLoginDataRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type UserServiceGetLoginDataResult struct { + Success *GetLoginDataResponse `thrift:"success,0,optional" frugal:"0,optional,GetLoginDataResponse" json:"success,omitempty"` +} + +func NewUserServiceGetLoginDataResult() *UserServiceGetLoginDataResult { + return &UserServiceGetLoginDataResult{} +} + +func (p *UserServiceGetLoginDataResult) InitDefault() { +} + +var UserServiceGetLoginDataResult_Success_DEFAULT *GetLoginDataResponse + +func (p *UserServiceGetLoginDataResult) GetSuccess() (v *GetLoginDataResponse) { + if !p.IsSetSuccess() { + return UserServiceGetLoginDataResult_Success_DEFAULT + } + return p.Success +} +func (p *UserServiceGetLoginDataResult) SetSuccess(x interface{}) { + p.Success = x.(*GetLoginDataResponse) +} + +var fieldIDToName_UserServiceGetLoginDataResult = map[int16]string{ + 0: "success", +} + +func (p *UserServiceGetLoginDataResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *UserServiceGetLoginDataResult) 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_UserServiceGetLoginDataResult[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 *UserServiceGetLoginDataResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetLoginDataResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *UserServiceGetLoginDataResult) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetLoginData_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 *UserServiceGetLoginDataResult) 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 *UserServiceGetLoginDataResult) String() string { @@ -943,3 +1287,345 @@ func (p *UserServiceGetLoginDataResult) Field0DeepEqual(src *GetLoginDataRespons } return true } + +type UserServiceGetUserInfoArgs struct { + Request *GetUserInfoRequest `thrift:"request,1" frugal:"1,default,GetUserInfoRequest" json:"request"` +} + +func NewUserServiceGetUserInfoArgs() *UserServiceGetUserInfoArgs { + return &UserServiceGetUserInfoArgs{} +} + +func (p *UserServiceGetUserInfoArgs) InitDefault() { +} + +var UserServiceGetUserInfoArgs_Request_DEFAULT *GetUserInfoRequest + +func (p *UserServiceGetUserInfoArgs) GetRequest() (v *GetUserInfoRequest) { + if !p.IsSetRequest() { + return UserServiceGetUserInfoArgs_Request_DEFAULT + } + return p.Request +} +func (p *UserServiceGetUserInfoArgs) SetRequest(val *GetUserInfoRequest) { + p.Request = val +} + +var fieldIDToName_UserServiceGetUserInfoArgs = map[int16]string{ + 1: "request", +} + +func (p *UserServiceGetUserInfoArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *UserServiceGetUserInfoArgs) 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_UserServiceGetUserInfoArgs[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 *UserServiceGetUserInfoArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetUserInfoRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Request = _field + return nil +} + +func (p *UserServiceGetUserInfoArgs) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetUserInfo_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 *UserServiceGetUserInfoArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Request.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *UserServiceGetUserInfoArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UserServiceGetUserInfoArgs(%+v)", *p) + +} + +func (p *UserServiceGetUserInfoArgs) DeepEqual(ano *UserServiceGetUserInfoArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Request) { + return false + } + return true +} + +func (p *UserServiceGetUserInfoArgs) Field1DeepEqual(src *GetUserInfoRequest) bool { + + if !p.Request.DeepEqual(src) { + return false + } + return true +} + +type UserServiceGetUserInfoResult struct { + Success *GetUserInfoResponse `thrift:"success,0,optional" frugal:"0,optional,GetUserInfoResponse" json:"success,omitempty"` +} + +func NewUserServiceGetUserInfoResult() *UserServiceGetUserInfoResult { + return &UserServiceGetUserInfoResult{} +} + +func (p *UserServiceGetUserInfoResult) InitDefault() { +} + +var UserServiceGetUserInfoResult_Success_DEFAULT *GetUserInfoResponse + +func (p *UserServiceGetUserInfoResult) GetSuccess() (v *GetUserInfoResponse) { + if !p.IsSetSuccess() { + return UserServiceGetUserInfoResult_Success_DEFAULT + } + return p.Success +} +func (p *UserServiceGetUserInfoResult) SetSuccess(x interface{}) { + p.Success = x.(*GetUserInfoResponse) +} + +var fieldIDToName_UserServiceGetUserInfoResult = map[int16]string{ + 0: "success", +} + +func (p *UserServiceGetUserInfoResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *UserServiceGetUserInfoResult) 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_UserServiceGetUserInfoResult[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 *UserServiceGetUserInfoResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetUserInfoResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *UserServiceGetUserInfoResult) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetUserInfo_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 *UserServiceGetUserInfoResult) 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 *UserServiceGetUserInfoResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UserServiceGetUserInfoResult(%+v)", *p) + +} + +func (p *UserServiceGetUserInfoResult) DeepEqual(ano *UserServiceGetUserInfoResult) 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 *UserServiceGetUserInfoResult) Field0DeepEqual(src *GetUserInfoResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} diff --git a/kitex_gen/user/userservice/client.go b/kitex_gen/user/userservice/client.go index 8af163a2..5d400cbd 100644 --- a/kitex_gen/user/userservice/client.go +++ b/kitex_gen/user/userservice/client.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by Kitex v0.11.3. DO NOT EDIT. +// Code generated by Kitex v0.12.0. DO NOT EDIT. package userservice @@ -30,6 +30,7 @@ import ( // Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework. type Client interface { GetLoginData(ctx context.Context, req *user.GetLoginDataRequest, callOptions ...callopt.Option) (r *user.GetLoginDataResponse, err error) + GetUserInfo(ctx context.Context, request *user.GetUserInfoRequest, callOptions ...callopt.Option) (r *user.GetUserInfoResponse, err error) } // NewClient creates a client for the service defined in IDL. @@ -65,3 +66,8 @@ func (p *kUserServiceClient) GetLoginData(ctx context.Context, req *user.GetLogi ctx = client.NewCtxWithCallOptions(ctx, callOptions) return p.kClient.GetLoginData(ctx, req) } + +func (p *kUserServiceClient) GetUserInfo(ctx context.Context, request *user.GetUserInfoRequest, callOptions ...callopt.Option) (r *user.GetUserInfoResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.GetUserInfo(ctx, request) +} diff --git a/kitex_gen/user/userservice/server.go b/kitex_gen/user/userservice/server.go index 715d3586..d858ab87 100644 --- a/kitex_gen/user/userservice/server.go +++ b/kitex_gen/user/userservice/server.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by Kitex v0.11.3. DO NOT EDIT. +// Code generated by Kitex v0.12.0. DO NOT EDIT. package userservice import ( diff --git a/kitex_gen/user/userservice/userservice.go b/kitex_gen/user/userservice/userservice.go index 220fb251..3e461b25 100644 --- a/kitex_gen/user/userservice/userservice.go +++ b/kitex_gen/user/userservice/userservice.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by Kitex v0.11.3. DO NOT EDIT. +// Code generated by Kitex v0.12.0. DO NOT EDIT. package userservice @@ -38,6 +38,13 @@ var serviceMethods = map[string]kitex.MethodInfo{ false, kitex.WithStreamingMode(kitex.StreamingNone), ), + "GetUserInfo": kitex.NewMethodInfo( + getUserInfoHandler, + newUserServiceGetUserInfoArgs, + newUserServiceGetUserInfoResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), } var ( @@ -98,7 +105,7 @@ func newServiceInfo(hasStreaming bool, keepStreamingMethods bool, keepNonStreami HandlerType: handlerType, Methods: methods, PayloadCodec: kitex.Thrift, - KiteXGenVersion: "v0.11.3", + KiteXGenVersion: "v0.12.0", Extra: extra, } return svcInfo @@ -122,6 +129,24 @@ func newUserServiceGetLoginDataResult() interface{} { return user.NewUserServiceGetLoginDataResult() } +func getUserInfoHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*user.UserServiceGetUserInfoArgs) + realResult := result.(*user.UserServiceGetUserInfoResult) + success, err := handler.(user.UserService).GetUserInfo(ctx, realArg.Request) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newUserServiceGetUserInfoArgs() interface{} { + return user.NewUserServiceGetUserInfoArgs() +} + +func newUserServiceGetUserInfoResult() interface{} { + return user.NewUserServiceGetUserInfoResult() +} + type kClient struct { c client.Client } @@ -141,3 +166,13 @@ func (p *kClient) GetLoginData(ctx context.Context, req *user.GetLoginDataReques } return _result.GetSuccess(), nil } + +func (p *kClient) GetUserInfo(ctx context.Context, request *user.GetUserInfoRequest) (r *user.GetUserInfoResponse, err error) { + var _args user.UserServiceGetUserInfoArgs + _args.Request = request + var _result user.UserServiceGetUserInfoResult + if err = p.c.Call(ctx, "GetUserInfo", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} diff --git a/pkg/base/context/context.go b/pkg/base/context/context.go new file mode 100644 index 00000000..e6e3e4bb --- /dev/null +++ b/pkg/base/context/context.go @@ -0,0 +1,31 @@ +/* +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 context + +import ( + "context" + + "github.com/bytedance/gopkg/cloud/metainfo" +) + +func newContext(ctx context.Context, key string, value string) context.Context { + return metainfo.WithPersistentValue(ctx, key, value) +} + +func fromContext(ctx context.Context, key string) (string, bool) { + return metainfo.GetPersistentValue(ctx, key) +} diff --git a/pkg/base/context/login_data.go b/pkg/base/context/login_data.go new file mode 100644 index 00000000..c9c25f8a --- /dev/null +++ b/pkg/base/context/login_data.go @@ -0,0 +1,52 @@ +/* +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 context + +import ( + "context" + + "github.com/bytedance/sonic" + + "github.com/west2-online/fzuhelper-server/kitex_gen/model" + "github.com/west2-online/fzuhelper-server/pkg/errno" + "github.com/west2-online/fzuhelper-server/pkg/logger" +) + +const loginDataKey string = "loginData" + +// WithLoginData 将LoginData加入到context中,通过metainfo传递到RPC server +func WithLoginData(ctx context.Context, loginData *model.LoginData) context.Context { + value, err := sonic.MarshalString(*loginData) + if err != nil { + logger.Infof("Failed to marshal LoginData: %v", err) + } + return newContext(ctx, loginDataKey, value) +} + +// GetLoginData 从context中取出LoginData +func GetLoginData(ctx context.Context) (*model.LoginData, error) { + user, ok := fromContext(ctx, loginDataKey) + if !ok { + return nil, errno.ParamMissingHeader.WithMessage("Failed to get header in context") + } + value := new(model.LoginData) + err := sonic.UnmarshalString(user, value) + if err != nil { + return nil, errno.InternalServiceError.WithMessage("Failed to get header in context when unmarshalling loginData") + } + return value, nil +} diff --git a/pkg/constants/db.go b/pkg/constants/db.go index cc4d5b28..c9452772 100644 --- a/pkg/constants/db.go +++ b/pkg/constants/db.go @@ -26,6 +26,7 @@ const ( ) const ( - UserTableName = "user" - CourseTableName = "course" + UserTableName = "student" + CourseTableName = "course" + LaunchScreenTableName = "launch_screen" ) diff --git a/pkg/constants/jwch.go b/pkg/constants/jwch.go index 422d52c6..46fa5421 100644 --- a/pkg/constants/jwch.go +++ b/pkg/constants/jwch.go @@ -16,9 +16,15 @@ limitations under the License. package constants -import "time" +import ( + "net/http" + "time" +) const ( MaxRetries = 5 // 最大重试次数 InitialDelay = 1 * time.Second // 初始等待时间 + + // GetPlanMethod GetPlan接口在得到url后的请求方法 + GetPlanMethod = http.MethodGet ) diff --git a/pkg/constants/service.go b/pkg/constants/service.go index dbf896bd..f3602420 100644 --- a/pkg/constants/service.go +++ b/pkg/constants/service.go @@ -26,6 +26,5 @@ const ( PaperServiceName = "paper" VersionServiceName = "version" AcademicServiceName = "academic" - LaunchScreenTableName = "launch_screen" CommonServiceName = "common" ) diff --git a/pkg/db/db.go b/pkg/db/db.go index 2d8a8a19..bb07d280 100644 --- a/pkg/db/db.go +++ b/pkg/db/db.go @@ -21,6 +21,7 @@ import ( "github.com/west2-online/fzuhelper-server/pkg/db/course" "github.com/west2-online/fzuhelper-server/pkg/db/launch_screen" + "github.com/west2-online/fzuhelper-server/pkg/db/user" "github.com/west2-online/fzuhelper-server/pkg/utils" ) @@ -29,6 +30,7 @@ type Database struct { sf *utils.Snowflake Course *course.DBCourse LaunchScreen *launch_screen.DBLaunchScreen + User *user.DBUser } func NewDatabase(client *gorm.DB, sf *utils.Snowflake) *Database { @@ -37,5 +39,6 @@ func NewDatabase(client *gorm.DB, sf *utils.Snowflake) *Database { sf: sf, Course: course.NewDBCourse(client, sf), LaunchScreen: launch_screen.NewDBLaunchScreen(client, sf), + User: user.NewDBUser(client, sf), } } diff --git a/pkg/db/model/user.go b/pkg/db/model/user.go new file mode 100644 index 00000000..9968feca --- /dev/null +++ b/pkg/db/model/user.go @@ -0,0 +1,35 @@ +/* +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 model + +import ( + "time" + + "gorm.io/gorm" +) + +type Student struct { + StuId string + Sex string + Birthday string + College string + Grade int64 + Major string + CreatedAt time.Time + UpdatedAt time.Time + DeletedAt gorm.DeletedAt `sql:"index"` +} diff --git a/pkg/db/user/create_student.go b/pkg/db/user/create_student.go new file mode 100644 index 00000000..81d38231 --- /dev/null +++ b/pkg/db/user/create_student.go @@ -0,0 +1,33 @@ +/* +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 user + +import ( + "context" + + "github.com/west2-online/fzuhelper-server/pkg/db/model" + "github.com/west2-online/fzuhelper-server/pkg/errno" + "github.com/west2-online/fzuhelper-server/pkg/logger" +) + +func (c *DBUser) CreateStudent(ctx context.Context, userModel *model.Student) error { + if err := c.client.WithContext(ctx).Create(&userModel).Error; err != nil { + logger.Errorf("dal.CreateStudent error: %v", err) + return errno.Errorf(errno.InternalDatabaseErrorCode, "dal.CreateStudent error: %v", err) + } + return nil +} diff --git a/pkg/db/user/create_student_test.go b/pkg/db/user/create_student_test.go new file mode 100644 index 00000000..2c328801 --- /dev/null +++ b/pkg/db/user/create_student_test.go @@ -0,0 +1,89 @@ +/* +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 user + +import ( + "context" + "testing" + + "github.com/bytedance/mockey" + "github.com/stretchr/testify/assert" + "gorm.io/gorm" + + "github.com/west2-online/fzuhelper-server/pkg/db/model" + "github.com/west2-online/fzuhelper-server/pkg/utils" +) + +func TestDBUser_CreateStudent(t *testing.T) { + type testCase struct { + name string + inPutStudent *model.Student + mockError error + expectingError bool + ErrorMsg string + } + stu := &model.Student{ + StuId: "102301000", + Sex: "男", + College: "计算机与大数据学院", + Grade: 2023, + Major: "计算机科学与技术", + } + testCases := []testCase{ + { + name: "success", + inPutStudent: stu, + mockError: nil, + expectingError: false, + }, + { + name: "error", + inPutStudent: nil, + mockError: gorm.ErrInvalidValue, + expectingError: true, + ErrorMsg: "dal.CreateStudent error", + }, + } + defer mockey.UnPatchAll() + for _, tc := range testCases { + mockey.PatchConvey(tc.name, t, func() { + mockGormDB := new(gorm.DB) + mockSnowflake := new(utils.Snowflake) + mockDBUser := NewDBUser(mockGormDB, mockSnowflake) + + mockey.Mock((*gorm.DB).WithContext).To(func(ctx context.Context) *gorm.DB { + return mockGormDB + }).Build() + + mockey.Mock((*gorm.DB).Create).To(func(value interface{}) *gorm.DB { + if tc.mockError != nil { + mockGormDB.Error = tc.mockError + return mockGormDB + } + return mockGormDB + }).Build() + + err := mockDBUser.CreateStudent(context.Background(), tc.inPutStudent) + if tc.expectingError { + assert.Error(t, err) + assert.Contains(t, err.Error(), tc.ErrorMsg) + } else { + assert.NoError(t, err) + } + }) + } +} diff --git a/pkg/db/user/get_student.go b/pkg/db/user/get_student.go new file mode 100644 index 00000000..5abec8fe --- /dev/null +++ b/pkg/db/user/get_student.go @@ -0,0 +1,40 @@ +/* +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 user + +import ( + "context" + "errors" + + "gorm.io/gorm" + + "github.com/west2-online/fzuhelper-server/pkg/db/model" + "github.com/west2-online/fzuhelper-server/pkg/errno" + "github.com/west2-online/fzuhelper-server/pkg/logger" +) + +func (c *DBUser) GetStudentById(ctx context.Context, stuId string) (bool, *model.Student, error) { + stuModel := new(model.Student) + if err := c.client.WithContext(ctx).Where("stu_id = ?", stuId).First(stuModel).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + return false, nil, nil + } + logger.Errorf("dal.GetStudentById error:%v", err) + return false, nil, errno.Errorf(errno.InternalDatabaseErrorCode, "dal.GetStudentById error:%v", err) + } + return true, stuModel, nil +} diff --git a/pkg/db/user/get_student_test.go b/pkg/db/user/get_student_test.go new file mode 100644 index 00000000..ca980ba9 --- /dev/null +++ b/pkg/db/user/get_student_test.go @@ -0,0 +1,111 @@ +/* +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 user + +import ( + "context" + "testing" + + "github.com/bytedance/mockey" + "github.com/stretchr/testify/assert" + "gorm.io/gorm" + + "github.com/west2-online/fzuhelper-server/pkg/db/model" + "github.com/west2-online/fzuhelper-server/pkg/utils" +) + +func TestDBUser_GetStudentById(t *testing.T) { + type testCase struct { + name string + inPutId string + mockError error + expectingError bool + expectedStudent *model.Student + ErrorMsg string + } + stu := &model.Student{ + StuId: "102301000", + Sex: "男", + College: "计算机与大数据学院", + Grade: 2023, + Major: "计算机科学与技术", + } + testCases := []testCase{ + { + name: "success", + inPutId: stu.StuId, + mockError: nil, + expectingError: false, + expectedStudent: stu, + }, + { + name: "record not found", + inPutId: stu.StuId, + mockError: gorm.ErrRecordNotFound, + expectingError: true, + expectedStudent: nil, + }, + { + name: "error", + inPutId: stu.StuId, + mockError: gorm.ErrInvalidValue, + expectingError: true, + expectedStudent: nil, + ErrorMsg: "dal.GetStudentById error", + }, + } + defer mockey.UnPatchAll() + for _, tc := range testCases { + mockey.PatchConvey(tc.name, t, func() { + mockGormDB := new(gorm.DB) + mockSnowflake := new(utils.Snowflake) + mockDBUser := NewDBUser(mockGormDB, mockSnowflake) + + mockey.Mock((*gorm.DB).WithContext).To(func(ctx context.Context) *gorm.DB { + return mockGormDB + }).Build() + mockey.Mock((*gorm.DB).Where).To(func(query interface{}, args ...interface{}) *gorm.DB { + return mockGormDB + }).Build() + mockey.Mock((*gorm.DB).First).To(func(dest interface{}, conds ...interface{}) *gorm.DB { + if tc.mockError != nil { + mockGormDB.Error = tc.mockError + return mockGormDB + } + + if res, ok := dest.(*model.Student); ok && tc.expectedStudent != nil { + *res = *tc.expectedStudent + } + return mockGormDB + }).Build() + + _, result, err := mockDBUser.GetStudentById(context.Background(), tc.inPutId) + if tc.expectingError { + if err == nil { + return + } + assert.Error(t, err) + assert.Nil(t, result) + assert.Contains(t, err.Error(), tc.ErrorMsg) + } else { + assert.NoError(t, err) + assert.NotNil(t, result) + assert.Equal(t, tc.expectedStudent, result) + } + }) + } +} diff --git a/pkg/db/user/user.go b/pkg/db/user/user.go new file mode 100644 index 00000000..16292500 --- /dev/null +++ b/pkg/db/user/user.go @@ -0,0 +1,35 @@ +/* +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 user + +import ( + "gorm.io/gorm" + + "github.com/west2-online/fzuhelper-server/pkg/utils" +) + +type DBUser struct { + client *gorm.DB + sf *utils.Snowflake +} + +func NewDBUser(client *gorm.DB, sf *utils.Snowflake) *DBUser { + return &DBUser{ + client: client, + sf: sf, + } +}