From fd1a97d5f9adfe5e1ab95087086a0fe5fd3216ee Mon Sep 17 00:00:00 2001 From: FanR <103872180+FantasyRL@users.noreply.github.com> Date: Mon, 11 Nov 2024 09:56:52 +0800 Subject: [PATCH 1/8] fix: timezone run failed in launch screen (#91) * fix: timezone run failed in launch_screen * fix: custom_router --- internal/launch_screen/service/create_image.go | 7 +++---- internal/launch_screen/service/update_image_property.go | 7 +++---- pkg/db/launch_screen/get_image.go | 9 ++++----- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/internal/launch_screen/service/create_image.go b/internal/launch_screen/service/create_image.go index bc7457e..ce1f7fe 100644 --- a/internal/launch_screen/service/create_image.go +++ b/internal/launch_screen/service/create_image.go @@ -23,13 +23,12 @@ import ( "golang.org/x/sync/errgroup" "github.com/west2-online/fzuhelper-server/kitex_gen/launch_screen" + "github.com/west2-online/fzuhelper-server/pkg/constants" "github.com/west2-online/fzuhelper-server/pkg/db/model" "github.com/west2-online/fzuhelper-server/pkg/upyun" - "github.com/west2-online/fzuhelper-server/pkg/utils" ) func (s *LaunchScreenService) CreateImage(req *launch_screen.CreateImageRequest) (pic *model.Picture, err error) { - Loc := utils.LoadCNLocation() id, err := s.sf.NextVal() if err != nil { return nil, fmt.Errorf("LaunchScreen.CreateImage SFCreateIDError:%w", err) @@ -52,8 +51,8 @@ func (s *LaunchScreenService) CreateImage(req *launch_screen.CreateImageRequest) StartTime: req.StartTime, EndTime: req.EndTime, Regex: req.Regex, - StartAt: time.Unix(req.StartAt, 0).In(Loc), - EndAt: time.Unix(req.EndAt, 0).In(Loc), + StartAt: time.Unix(req.StartAt, 0).Add(constants.TimeZoneOffset * time.Hour), + EndAt: time.Unix(req.EndAt, 0).Add(constants.TimeZoneOffset * time.Hour), } pic, err = s.db.LaunchScreen.CreateImage(s.ctx, pictureModel) return err diff --git a/internal/launch_screen/service/update_image_property.go b/internal/launch_screen/service/update_image_property.go index 3760216..48b09f8 100644 --- a/internal/launch_screen/service/update_image_property.go +++ b/internal/launch_screen/service/update_image_property.go @@ -21,8 +21,8 @@ import ( "time" "github.com/west2-online/fzuhelper-server/kitex_gen/launch_screen" + "github.com/west2-online/fzuhelper-server/pkg/constants" "github.com/west2-online/fzuhelper-server/pkg/db/model" - "github.com/west2-online/fzuhelper-server/pkg/utils" ) func (s *LaunchScreenService) UpdateImageProperty(req *launch_screen.ChangeImagePropertyRequest) (*model.Picture, error) { @@ -30,15 +30,14 @@ func (s *LaunchScreenService) UpdateImageProperty(req *launch_screen.ChangeImage if err != nil { return nil, fmt.Errorf("LaunchScreenService.UpdateImageProperty error: %w", err) } - Loc := utils.LoadCNLocation() origin.PicType = req.PicType origin.SType = req.SType origin.Duration = *req.Duration origin.Href = *req.Href origin.Frequency = req.Frequency origin.Text = req.Text - origin.StartAt = time.Unix(req.StartAt, 0).In(Loc) - origin.EndAt = time.Unix(req.EndAt, 0).In(Loc) + origin.StartAt = time.Unix(req.StartAt, 0).Add(constants.TimeZoneOffset * time.Hour) + origin.EndAt = time.Unix(req.EndAt, 0).Add(constants.TimeZoneOffset * time.Hour) origin.StartTime = req.StartTime origin.EndTime = req.EndTime origin.Regex = req.Regex diff --git a/pkg/db/launch_screen/get_image.go b/pkg/db/launch_screen/get_image.go index a247708..49adff1 100644 --- a/pkg/db/launch_screen/get_image.go +++ b/pkg/db/launch_screen/get_image.go @@ -23,6 +23,7 @@ import ( "github.com/west2-online/fzuhelper-server/pkg/constants" "github.com/west2-online/fzuhelper-server/pkg/db/model" + "github.com/west2-online/fzuhelper-server/pkg/utils" ) func (c *DBLaunchScreen) GetImageById(ctx context.Context, id int64) (*model.Picture, error) { @@ -34,13 +35,11 @@ func (c *DBLaunchScreen) GetImageById(ctx context.Context, id int64) (*model.Pic } func (c *DBLaunchScreen) GetImageBySType(ctx context.Context, sType int64) (*[]model.Picture, int64, error) { + Loc := utils.LoadCNLocation() pictures := new([]model.Picture) var count int64 = 0 - now := time.Now().Add(time.Hour * constants.TimeZoneOffset) - hour := now.Hour() + constants.TimeZoneOffset - if hour > constants.DayTime { - hour -= constants.DayTime - } + now := time.Now().In(Loc) + hour := now.In(Loc).Hour() // 按创建时间降序 if err := c.client.WithContext(ctx). Where("s_type = ? AND start_at < ? AND end_at > ? AND start_time <= ? AND end_time >= ?", From bbb152b1d2d4358d177f34837f00ed8529243025 Mon Sep 17 00:00:00 2001 From: jiuxia211 <2064166368@qq.com> Date: Mon, 11 Nov 2024 14:22:32 +0800 Subject: [PATCH 2/8] fix: validate login code field compatibility (#89) * fix: validate login code field compatibility * fix: change the compatibility mode of ValidateCode --- api/handler/api/user_service.go | 31 ++ api/model/api/api.go | 586 ++++++++++++++++++++++++++++++++ api/router/api/api.go | 4 + api/router/api/middleware.go | 10 + api/router/custom_router.go | 2 - idl/api.thrift | 8 + 6 files changed, 639 insertions(+), 2 deletions(-) diff --git a/api/handler/api/user_service.go b/api/handler/api/user_service.go index 523bfe2..b02e4f9 100644 --- a/api/handler/api/user_service.go +++ b/api/handler/api/user_service.go @@ -90,3 +90,34 @@ func ValidateCode(ctx context.Context, c *app.RequestContext) { c.String(http.StatusOK, res.BodyBuffer().String()) } + +// ValidateCodeForAndroid . +// @router /api/login/validateCode [POST] +func ValidateCodeForAndroid(ctx context.Context, c *app.RequestContext) { + var err error + var req api.ValidateCodeForAndroidRequest + err = c.BindAndValidate(&req) + if err != nil { + logger.Errorf("api.ValidateCodeForAndroid: BindAndValidate error %v", err) + pack.RespError(c, errno.ParamError.WithError(err)) + return + } + + request := new(protocol.Request) + request.SetMethod(consts.MethodPost) + request.SetRequestURI(constants.ValidateCodeURL) + request.SetFormData( + map[string]string{ + "image": req.ValidateCode, + }, + ) + + res := new(protocol.Response) + + if err = ClientSet.HzClient.Do(ctx, request, res); err != nil { + pack.RespError(c, err) + return + } + + c.String(http.StatusOK, res.BodyBuffer().String()) +} diff --git a/api/model/api/api.go b/api/model/api/api.go index 8ea21e5..c9d891b 100644 --- a/api/model/api/api.go +++ b/api/model/api/api.go @@ -1157,6 +1157,238 @@ func (p *ValidateCodeResponse) String() string { } +// Android兼容 +type ValidateCodeForAndroidRequest struct { + ValidateCode string `thrift:"validateCode,1,required" form:"validateCode,required" json:"validateCode,required" query:"validateCode,required"` +} + +func NewValidateCodeForAndroidRequest() *ValidateCodeForAndroidRequest { + return &ValidateCodeForAndroidRequest{} +} + +func (p *ValidateCodeForAndroidRequest) InitDefault() { +} + +func (p *ValidateCodeForAndroidRequest) GetValidateCode() (v string) { + return p.ValidateCode +} + +var fieldIDToName_ValidateCodeForAndroidRequest = map[int16]string{ + 1: "validateCode", +} + +func (p *ValidateCodeForAndroidRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetValidateCode 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 + } + issetValidateCode = 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 !issetValidateCode { + 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_ValidateCodeForAndroidRequest[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_ValidateCodeForAndroidRequest[fieldId])) +} + +func (p *ValidateCodeForAndroidRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.ValidateCode = _field + return nil +} + +func (p *ValidateCodeForAndroidRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ValidateCodeForAndroidRequest"); 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 *ValidateCodeForAndroidRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("validateCode", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.ValidateCode); 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 *ValidateCodeForAndroidRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ValidateCodeForAndroidRequest(%+v)", *p) + +} + +type ValidateCodeForAndroidResponse struct { +} + +func NewValidateCodeForAndroidResponse() *ValidateCodeForAndroidResponse { + return &ValidateCodeForAndroidResponse{} +} + +func (p *ValidateCodeForAndroidResponse) InitDefault() { +} + +var fieldIDToName_ValidateCodeForAndroidResponse = map[int16]string{} + +func (p *ValidateCodeForAndroidResponse) 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 *ValidateCodeForAndroidResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("ValidateCodeForAndroidResponse"); 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 *ValidateCodeForAndroidResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ValidateCodeForAndroidResponse(%+v)", *p) + +} + // course type CourseListRequest struct { Term string `thrift:"term,1,required" form:"term,required" json:"term,required" query:"term,required"` @@ -10941,6 +11173,8 @@ 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) } type UserServiceClient struct { @@ -10987,6 +11221,15 @@ func (p *UserServiceClient) ValidateCode(ctx context.Context, request *ValidateC } 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 +} type CourseService interface { GetCourseList(ctx context.Context, req *CourseListRequest) (r *CourseListResponse, err error) @@ -11857,6 +12100,7 @@ func NewUserServiceProcessor(handler UserService) *UserServiceProcessor { self := &UserServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} self.AddToProcessorMap("GetLoginData", &userServiceProcessorGetLoginData{handler: handler}) self.AddToProcessorMap("ValidateCode", &userServiceProcessorValidateCode{handler: handler}) + self.AddToProcessorMap("ValidateCodeForAndroid", &userServiceProcessorValidateCodeForAndroid{handler: handler}) return self } func (p *UserServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { @@ -11973,6 +12217,54 @@ func (p *userServiceProcessorValidateCode) Process(ctx context.Context, seqId in 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.ReadMessageEnd() + var err2 error + result := UserServiceValidateCodeForAndroidResult{} + var retval *ValidateCodeForAndroidResponse + if retval, err2 = p.handler.ValidateCodeForAndroid(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ValidateCodeForAndroid: "+err2.Error()) + oprot.WriteMessageBegin("ValidateCodeForAndroid", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("ValidateCodeForAndroid", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + type UserServiceGetLoginDataArgs struct { Request *GetLoginDataRequest `thrift:"request,1"` } @@ -12561,6 +12853,300 @@ func (p *UserServiceValidateCodeResult) String() string { } +type UserServiceValidateCodeForAndroidArgs struct { + Request *ValidateCodeForAndroidRequest `thrift:"request,1"` +} + +func NewUserServiceValidateCodeForAndroidArgs() *UserServiceValidateCodeForAndroidArgs { + return &UserServiceValidateCodeForAndroidArgs{} +} + +func (p *UserServiceValidateCodeForAndroidArgs) InitDefault() { +} + +var UserServiceValidateCodeForAndroidArgs_Request_DEFAULT *ValidateCodeForAndroidRequest + +func (p *UserServiceValidateCodeForAndroidArgs) GetRequest() (v *ValidateCodeForAndroidRequest) { + if !p.IsSetRequest() { + return UserServiceValidateCodeForAndroidArgs_Request_DEFAULT + } + return p.Request +} + +var fieldIDToName_UserServiceValidateCodeForAndroidArgs = map[int16]string{ + 1: "request", +} + +func (p *UserServiceValidateCodeForAndroidArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *UserServiceValidateCodeForAndroidArgs) 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_UserServiceValidateCodeForAndroidArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *UserServiceValidateCodeForAndroidArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewValidateCodeForAndroidRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Request = _field + return nil +} + +func (p *UserServiceValidateCodeForAndroidArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ValidateCodeForAndroid_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + 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 *UserServiceValidateCodeForAndroidArgs) 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 *UserServiceValidateCodeForAndroidArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UserServiceValidateCodeForAndroidArgs(%+v)", *p) + +} + +type UserServiceValidateCodeForAndroidResult struct { + Success *ValidateCodeForAndroidResponse `thrift:"success,0,optional"` +} + +func NewUserServiceValidateCodeForAndroidResult() *UserServiceValidateCodeForAndroidResult { + return &UserServiceValidateCodeForAndroidResult{} +} + +func (p *UserServiceValidateCodeForAndroidResult) InitDefault() { +} + +var UserServiceValidateCodeForAndroidResult_Success_DEFAULT *ValidateCodeForAndroidResponse + +func (p *UserServiceValidateCodeForAndroidResult) GetSuccess() (v *ValidateCodeForAndroidResponse) { + if !p.IsSetSuccess() { + return UserServiceValidateCodeForAndroidResult_Success_DEFAULT + } + return p.Success +} + +var fieldIDToName_UserServiceValidateCodeForAndroidResult = map[int16]string{ + 0: "success", +} + +func (p *UserServiceValidateCodeForAndroidResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *UserServiceValidateCodeForAndroidResult) 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_UserServiceValidateCodeForAndroidResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *UserServiceValidateCodeForAndroidResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewValidateCodeForAndroidResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *UserServiceValidateCodeForAndroidResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ValidateCodeForAndroid_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 *UserServiceValidateCodeForAndroidResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *UserServiceValidateCodeForAndroidResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UserServiceValidateCodeForAndroidResult(%+v)", *p) + +} + type CourseServiceProcessor struct { processorMap map[string]thrift.TProcessorFunction handler CourseService diff --git a/api/router/api/api.go b/api/router/api/api.go index ff98ad4..a43e442 100644 --- a/api/router/api/api.go +++ b/api/router/api/api.go @@ -36,6 +36,10 @@ func Register(r *server.Hertz) { root := r.Group("/", rootMw()...) { _api := root.Group("/api", _apiMw()...) + { + _login := _api.Group("/login", _loginMw()...) + _login.POST("/validateCode", append(_validatecodeforandroidMw(), api.ValidateCodeForAndroid)...) + } { _v1 := _api.Group("/v1", _v1Mw()...) { diff --git a/api/router/api/middleware.go b/api/router/api/middleware.go index a7a1f37..c397f5f 100644 --- a/api/router/api/middleware.go +++ b/api/router/api/middleware.go @@ -276,3 +276,13 @@ func _validatecodeMw() []app.HandlerFunc { // your code... return nil } + +func _loginMw() []app.HandlerFunc { + // your code... + return nil +} + +func _validatecodeforandroidMw() []app.HandlerFunc { + // your code... + return nil +} diff --git a/api/router/custom_router.go b/api/router/custom_router.go index c279d67..7bb2869 100644 --- a/api/router/custom_router.go +++ b/api/router/custom_router.go @@ -45,6 +45,4 @@ func customizedRegister(r *server.Hertz) { // 历年卷兼容 r.GET("/api/v1/list", api.ListDirFiles) r.GET("/api/v1/downloadUrl", api.GetDownloadUrl) - // 登录验证码兼容 - r.POST("/api/login/validateCode", api.ValidateCode) } diff --git a/idl/api.thrift b/idl/api.thrift index 62f6e5c..17f28cb 100644 --- a/idl/api.thrift +++ b/idl/api.thrift @@ -34,10 +34,18 @@ struct ValidateCodeRequest { struct ValidateCodeResponse { } +// Android兼容 +struct ValidateCodeForAndroidRequest { + 1: required string validateCode +} + +struct ValidateCodeForAndroidResponse { +} service UserService { GetLoginDataResponse GetLoginData(1: GetLoginDataRequest request)(api.get="/api/v1/jwch/user/login"), ValidateCodeResponse ValidateCode(1: ValidateCodeRequest request)(api.post="/api/v1/jwch/user/validateCode") + ValidateCodeForAndroidResponse ValidateCodeForAndroid(1: ValidateCodeForAndroidRequest request)(api.post="/api/login/validateCode") } // course From 6f12be89d935e83e6f7f2b4f1936aa213cf40195 Mon Sep 17 00:00:00 2001 From: jiuxia211 <2064166368@qq.com> Date: Mon, 11 Nov 2024 16:27:40 +0800 Subject: [PATCH 3/8] fix: login verify response compatibility (#92) --- api/handler/api/user_service.go | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/api/handler/api/user_service.go b/api/handler/api/user_service.go index b02e4f9..06b2794 100644 --- a/api/handler/api/user_service.go +++ b/api/handler/api/user_service.go @@ -20,6 +20,7 @@ package api import ( "context" + "encoding/json" "net/http" "github.com/cloudwego/hertz/pkg/app" @@ -118,6 +119,23 @@ func ValidateCodeForAndroid(ctx context.Context, c *app.RequestContext) { pack.RespError(c, err) return } + // 旧版 Android 使用 message 作为解析后的验证码结果 + var originalResponse struct { + Code string `json:"code"` + Data string `json:"data"` + Message string `json:"message"` + } + if err := json.Unmarshal(res.BodyBuffer().Bytes(), &originalResponse); err != nil { + logger.Errorf("api.ValidateCodeForAndroid: JSON unmarshal error %v", err) + pack.RespError(c, err) + return + } - c.String(http.StatusOK, res.BodyBuffer().String()) + // 构建兼容格式的响应 + compatResponse := map[string]string{ + "code": originalResponse.Code, + "message": originalResponse.Data, // 将解析的验证码作为 message 返回 + } + + c.JSON(http.StatusOK, compatResponse) } From 596e4830841cd164c307dd25abcd8ca99c94a3b3 Mon Sep 17 00:00:00 2001 From: FanR <103872180+FantasyRL@users.noreply.github.com> Date: Mon, 11 Nov 2024 19:12:22 +0800 Subject: [PATCH 4/8] fix:timestamp bug (#95) --- internal/launch_screen/service/create_image.go | 5 ++--- .../launch_screen/service/update_image_property.go | 5 ++--- pkg/db/launch_screen/get_image.go | 11 ++++------- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/internal/launch_screen/service/create_image.go b/internal/launch_screen/service/create_image.go index ce1f7fe..5c3aaaf 100644 --- a/internal/launch_screen/service/create_image.go +++ b/internal/launch_screen/service/create_image.go @@ -23,7 +23,6 @@ import ( "golang.org/x/sync/errgroup" "github.com/west2-online/fzuhelper-server/kitex_gen/launch_screen" - "github.com/west2-online/fzuhelper-server/pkg/constants" "github.com/west2-online/fzuhelper-server/pkg/db/model" "github.com/west2-online/fzuhelper-server/pkg/upyun" ) @@ -51,8 +50,8 @@ func (s *LaunchScreenService) CreateImage(req *launch_screen.CreateImageRequest) StartTime: req.StartTime, EndTime: req.EndTime, Regex: req.Regex, - StartAt: time.Unix(req.StartAt, 0).Add(constants.TimeZoneOffset * time.Hour), - EndAt: time.Unix(req.EndAt, 0).Add(constants.TimeZoneOffset * time.Hour), + StartAt: time.Unix(req.StartAt, 0), + EndAt: time.Unix(req.EndAt, 0), } pic, err = s.db.LaunchScreen.CreateImage(s.ctx, pictureModel) return err diff --git a/internal/launch_screen/service/update_image_property.go b/internal/launch_screen/service/update_image_property.go index 48b09f8..eddaa22 100644 --- a/internal/launch_screen/service/update_image_property.go +++ b/internal/launch_screen/service/update_image_property.go @@ -21,7 +21,6 @@ import ( "time" "github.com/west2-online/fzuhelper-server/kitex_gen/launch_screen" - "github.com/west2-online/fzuhelper-server/pkg/constants" "github.com/west2-online/fzuhelper-server/pkg/db/model" ) @@ -36,8 +35,8 @@ func (s *LaunchScreenService) UpdateImageProperty(req *launch_screen.ChangeImage origin.Href = *req.Href origin.Frequency = req.Frequency origin.Text = req.Text - origin.StartAt = time.Unix(req.StartAt, 0).Add(constants.TimeZoneOffset * time.Hour) - origin.EndAt = time.Unix(req.EndAt, 0).Add(constants.TimeZoneOffset * time.Hour) + origin.StartAt = time.Unix(req.StartAt, 0) + origin.EndAt = time.Unix(req.EndAt, 0) origin.StartTime = req.StartTime origin.EndTime = req.EndTime origin.Regex = req.Regex diff --git a/pkg/db/launch_screen/get_image.go b/pkg/db/launch_screen/get_image.go index 49adff1..a01851d 100644 --- a/pkg/db/launch_screen/get_image.go +++ b/pkg/db/launch_screen/get_image.go @@ -21,7 +21,6 @@ import ( "fmt" "time" - "github.com/west2-online/fzuhelper-server/pkg/constants" "github.com/west2-online/fzuhelper-server/pkg/db/model" "github.com/west2-online/fzuhelper-server/pkg/utils" ) @@ -39,7 +38,7 @@ func (c *DBLaunchScreen) GetImageBySType(ctx context.Context, sType int64) (*[]m pictures := new([]model.Picture) var count int64 = 0 now := time.Now().In(Loc) - hour := now.In(Loc).Hour() + hour := now.Hour() // 按创建时间降序 if err := c.client.WithContext(ctx). Where("s_type = ? AND start_at < ? AND end_at > ? AND start_time <= ? AND end_time >= ?", @@ -53,13 +52,11 @@ func (c *DBLaunchScreen) GetImageBySType(ctx context.Context, sType int64) (*[]m } func (c *DBLaunchScreen) GetImageByIdList(ctx context.Context, imgIdList *[]int64) (*[]model.Picture, int64, error) { + Loc := utils.LoadCNLocation() pictures := new([]model.Picture) var count int64 = 0 - now := time.Now().Add(time.Hour * constants.TimeZoneOffset) - hour := now.Hour() + constants.TimeZoneOffset - if hour > constants.DayTime { - hour -= constants.DayTime - } + now := time.Now().In(Loc) + hour := now.Hour() err := c.client.WithContext(ctx). Where("id IN ? AND start_at < ? AND end_at > ? AND start_time <= ? AND end_time >= ?", *imgIdList, now, now, hour, hour).Count(&count).Order("created_at DESC").Find(pictures).Error From 805eb3ce7d28af34d5ff15f626084c5e419d0f48 Mon Sep 17 00:00:00 2001 From: penQee <138851624+penqee@users.noreply.github.com> Date: Tue, 12 Nov 2024 10:07:06 +0800 Subject: [PATCH 5/8] fix: solve some problems in paper and url service (#93) * fix: url service compatibility issues and format * feat: add Android compatible handlers * feat:Add comments, adjust PaperData and PaperUrlData positions --- api/handler/api/paper_service.go | 68 +- api/handler/api/url_service.go | 40 +- api/model/api/api.go | 8829 ++++++++++++++---------- api/model/model/model.go | 455 +- api/pack/paper.go | 27 + api/router/api/api.go | 2 + api/router/api/middleware.go | 10 + api/router/custom_router.go | 16 +- idl/api.thrift | 24 +- idl/model.thrift | 22 +- idl/paper.thrift | 2 +- internal/paper/service/download_url.go | 2 +- kitex_gen/model/model.go | 6 +- kitex_gen/paper/k-paper.go | 12 +- kitex_gen/paper/paper.go | 28 +- pkg/constants/constants.go | 1 + pkg/errno/code.go | 3 + pkg/upyun/paper.go | 2 - 18 files changed, 5663 insertions(+), 3886 deletions(-) diff --git a/api/handler/api/paper_service.go b/api/handler/api/paper_service.go index 797b259..99b1910 100644 --- a/api/handler/api/paper_service.go +++ b/api/handler/api/paper_service.go @@ -25,6 +25,7 @@ import ( "github.com/cloudwego/hertz/pkg/app" "github.com/west2-online/fzuhelper-server/api/model/api" + "github.com/west2-online/fzuhelper-server/api/model/model" "github.com/west2-online/fzuhelper-server/api/pack" "github.com/west2-online/fzuhelper-server/api/rpc" @@ -71,7 +72,7 @@ func GetDownloadUrl(ctx context.Context, c *app.RequestContext) { } url, err := rpc.GetDownloadUrlRPC(ctx, &paper.GetDownloadUrlRequest{ - Url: req.URL, + Filepath: req.Filepath, }) if err != nil { pack.RespError(c, err) @@ -83,3 +84,68 @@ func GetDownloadUrl(ctx context.Context, c *app.RequestContext) { pack.RespData(c, resp) } + +// ListDirFilesForAndroid . +// @Description 历年卷兼容,查询文件目录 +// @router /api/v1/list [GET] +func ListDirFilesForAndroid(ctx context.Context, c *app.RequestContext) { + var err error + var req api.ListDirFilesForAndroidRequest + + err = c.BindAndValidate(&req) + if err != nil { + logger.Errorf("api.ListDirFilesForAndroid: BindAndValidate error %v", err) + pack.RespErrorInPaper(c, errno.ParamError.WithError(err)) + return + } + + if req.GetPath() == "" { + logger.Errorf("api.ListDirFilesForAndroid: path is empty") + pack.RespErrorInPaper(c, errno.ParamError.WithError(errors.New("path is empty"))) + return + } + + res, err := rpc.GetDirFilesRPC(ctx, &paper.ListDirFilesRequest{ + Path: req.GetPath(), + }) + if err != nil { + pack.RespErrorInPaper(c, err) + return + } + + data := &model.PaperData{ + BasePath: res.BasePath, + Files: res.Files, + Folders: res.Folders, + } + + pack.RespDataInPaper(c, data) +} + +// GetDownloadUrlForAndroid . +// @Description 历年卷兼容,获取url以供下载 +// @router /api/v1/downloadUrl [GET] +func GetDownloadUrlForAndroid(ctx context.Context, c *app.RequestContext) { + var err error + var req api.GetDownloadUrlForAndroidRequest + err = c.BindAndValidate(&req) + if err != nil { + logger.Errorf("api.GetDownloadUrlForAndroid: BindAndValidate error %v", err) + pack.RespErrorInPaper(c, errno.ParamError.WithError(err)) + return + } + + url, err := rpc.GetDownloadUrlRPC(ctx, &paper.GetDownloadUrlRequest{ + Filepath: req.Filepath, + }) + if err != nil { + pack.RespErrorInPaper(c, err) + return + } + + data := &model.PaperUrlData{ + URL: url, + } + + pack.RespDataInPaper(c, data) +} diff --git a/api/handler/api/url_service.go b/api/handler/api/url_service.go index 15c694a..22b1ac5 100644 --- a/api/handler/api/url_service.go +++ b/api/handler/api/url_service.go @@ -20,7 +20,7 @@ package api import ( "context" - "net/http" + "fmt" "strings" "github.com/bytedance/sonic" @@ -32,6 +32,7 @@ import ( api "github.com/west2-online/fzuhelper-server/api/model/api" "github.com/west2-online/fzuhelper-server/api/pack" "github.com/west2-online/fzuhelper-server/pkg/base" + "github.com/west2-online/fzuhelper-server/pkg/constants" "github.com/west2-online/fzuhelper-server/pkg/errno" "github.com/west2-online/fzuhelper-server/pkg/logger" ) @@ -50,7 +51,7 @@ func APILogin(ctx context.Context, c *app.RequestContext) { return } - url := "http://127.0.0.1:5000/api/login" + url := fmt.Sprintf("http://%s:5000/api/login", constants.URLServiceName) request := new(protocol.Request) request.SetMethod(consts.MethodPost) @@ -68,7 +69,7 @@ func APILogin(ctx context.Context, c *app.RequestContext) { return } - c.String(http.StatusOK, res.BodyBuffer().String()) + c.String(consts.StatusOK, res.BodyBuffer().String()) } // UploadVersionInfo . @@ -83,7 +84,7 @@ func UploadVersionInfo(ctx context.Context, c *app.RequestContext) { return } - url := "http://127.0.0.1:5000/api/upload" + url := fmt.Sprintf("http://%s:5000/api/upload", constants.URLServiceName) request := new(protocol.Request) request.SetMethod(consts.MethodPost) @@ -121,7 +122,7 @@ func GetUploadParams(ctx context.Context, c *app.RequestContext) { return } - url := "http://127.0.0.1:5000/api/uploadparams" + url := fmt.Sprintf("http://%s:5000/api/uploadparams", constants.URLServiceName) resp := new(api.GetUploadParamsResponse) request := &protocol.Request{} @@ -157,19 +158,21 @@ func GetUploadParams(ctx context.Context, c *app.RequestContext) { // GetDownloadRelease . // @router /api/v1/url/release.apk [GET] func GetDownloadRelease(ctx context.Context, c *app.RequestContext) { - c.Redirect(http.StatusOK, []byte("http://127.0.0.1:5000/release.apk")) + url := fmt.Sprintf("http://%s:5000/release.apk", constants.URLServiceName) // 与apk无关,仅为一个路径 + c.Redirect(consts.StatusFound, []byte(url)) } // GetDownloadBeta . // @router /api/v1/url/beta.apk [GET] func GetDownloadBeta(ctx context.Context, c *app.RequestContext) { - c.Redirect(http.StatusOK, []byte("http://127.0.0.1:5000/beta.apk")) + url := fmt.Sprintf("http://%s:5000/beta.apk", constants.URLServiceName) // 与apk无关,仅为一个路径 + c.Redirect(consts.StatusFound, []byte(url)) } // GetReleaseVersion . // @router /api/v1/url/version.json [GET] func GetReleaseVersion(ctx context.Context, c *app.RequestContext) { - url := "http://127.0.0.1:5000/version.json" // 和json无关,仅为一个路径 + url := fmt.Sprintf("http://%s:5000/version.json", constants.URLServiceName) // 和json无关,仅为一个路径 request := &protocol.Request{} request.SetMethod(consts.MethodGet) @@ -195,7 +198,7 @@ func GetReleaseVersion(ctx context.Context, c *app.RequestContext) { // GetBetaVersion . // @router /api/v1/url/versionbeta.json [GET] func GetBetaVersion(ctx context.Context, c *app.RequestContext) { - url := "http://127.0.0.1:5000/versionbeta.json" // 和json无关,仅为一个路径 + url := fmt.Sprintf("http://%s:5000/versionbeta.json", constants.URLServiceName) // 和json无关,仅为一个路径 request := &protocol.Request{} request.SetMethod(consts.MethodGet) @@ -230,7 +233,7 @@ func GetCloudSetting(ctx context.Context, c *app.RequestContext) { isLogin := c.DefaultQuery("isLogin", "false") loginType := c.DefaultQuery("loginType", "0") - url := "http://127.0.0.1:5000/settings.php" // 和php无关,仅为一个路径 + url := fmt.Sprintf("http://%s:5000/settings.php", constants.URLServiceName) // 和php无关,仅为一个路径 queryParams := strings.Join( []string{ @@ -268,8 +271,7 @@ func GetCloudSetting(ctx context.Context, c *app.RequestContext) { func GetAllCloudSetting(ctx context.Context, c *app.RequestContext) { var err error - url := "http://127.0.0.1:5000/api/getcloud" - + url := fmt.Sprintf("http://%s:5000/api/getcloud", constants.URLServiceName) request := &protocol.Request{} request.SetMethod(consts.MethodGet) request.SetRequestURI(url) @@ -303,7 +305,7 @@ func SetAllCloudSetting(ctx context.Context, c *app.RequestContext) { return } - url := "127.0.0.1:5000/api/setcloud" + url := fmt.Sprintf("http://%s:5000/api/setcloud", constants.URLServiceName) request := &protocol.Request{} request.SetMethod(consts.MethodPost) @@ -331,8 +333,7 @@ func TestSetting(ctx context.Context, c *app.RequestContext) { return } - url := "http://127.0.0.1:5000/api/test" - + url := fmt.Sprintf("http://%s:5000/api/test", constants.URLServiceName) request := &protocol.Request{} request.SetMethod(consts.MethodPost) request.SetRequestURI(url) @@ -360,7 +361,8 @@ func TestSetting(ctx context.Context, c *app.RequestContext) { func DumpVisit(ctx context.Context, c *app.RequestContext) { var err error - url := "http://127.0.0.1:5000/upupdowndownleftleftrightrightbaba_dump_visit" + url := fmt.Sprintf("http://%s:5000/upupdowndownleftleftrightrightbaba_dump_visit", constants.URLServiceName) + request := &protocol.Request{} request.SetMethod(consts.MethodGet) request.SetRequestURI(url) @@ -387,7 +389,7 @@ func DumpVisit(ctx context.Context, c *app.RequestContext) { func FZUHelperCSS(ctx context.Context, c *app.RequestContext) { var err error - url := "http://127.0.0.1:5000/onekey/FZUHelper.css" // 和html无关,仅为一个路径 + url := fmt.Sprintf("http://%s:5000/onekey/FZUHelper.css", constants.URLServiceName) // 和css无关,仅为一个路径 request := &protocol.Request{} request.SetMethod(consts.MethodGet) @@ -408,7 +410,7 @@ func FZUHelperCSS(ctx context.Context, c *app.RequestContext) { func FZUHelperHTML(ctx context.Context, c *app.RequestContext) { var err error - url := "http://127.0.0.1:5000/onekey/FZUHelper.html" // 和html无关,仅为一个路径 + url := fmt.Sprintf("http://%s:5000/onekey/FZUHelper.html", constants.URLServiceName) // 和html无关,仅为一个路径 request := &protocol.Request{} request.SetMethod(consts.MethodGet) @@ -428,7 +430,7 @@ func FZUHelperHTML(ctx context.Context, c *app.RequestContext) { func UserAgreementHTML(ctx context.Context, c *app.RequestContext) { var err error - url := "http://127.0.0.1:5000/onekey/UserAgreement.html" // 和html无关,仅为一个路径 + url := fmt.Sprintf("http://%s:5000/onekey/UserAgreement.html", constants.URLServiceName) // 和html无关,仅为一个路径 request := &protocol.Request{} request.SetMethod(consts.MethodGet) diff --git a/api/model/api/api.go b/api/model/api/api.go index c9d891b..30d0e90 100644 --- a/api/model/api/api.go +++ b/api/model/api/api.go @@ -5920,7 +5920,7 @@ func (p *ListDirFilesResponse) String() string { } type GetDownloadUrlRequest struct { - URL string `thrift:"url,1,required" form:"url,required" json:"url,required" query:"url,required"` + Filepath string `thrift:"filepath,1,required" form:"filepath,required" json:"filepath,required" query:"filepath,required"` } func NewGetDownloadUrlRequest() *GetDownloadUrlRequest { @@ -5930,19 +5930,19 @@ func NewGetDownloadUrlRequest() *GetDownloadUrlRequest { func (p *GetDownloadUrlRequest) InitDefault() { } -func (p *GetDownloadUrlRequest) GetURL() (v string) { - return p.URL +func (p *GetDownloadUrlRequest) GetFilepath() (v string) { + return p.Filepath } var fieldIDToName_GetDownloadUrlRequest = map[int16]string{ - 1: "url", + 1: "filepath", } func (p *GetDownloadUrlRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetURL bool = false + var issetFilepath bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -5963,7 +5963,7 @@ func (p *GetDownloadUrlRequest) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetURL = true + issetFilepath = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -5980,7 +5980,7 @@ func (p *GetDownloadUrlRequest) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetURL { + if !issetFilepath { fieldId = 1 goto RequiredFieldNotSetError } @@ -6010,7 +6010,7 @@ func (p *GetDownloadUrlRequest) ReadField1(iprot thrift.TProtocol) error { } else { _field = v } - p.URL = _field + p.Filepath = _field return nil } @@ -6043,10 +6043,10 @@ WriteStructEndError: } func (p *GetDownloadUrlRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("url", thrift.STRING, 1); err != nil { + if err = oprot.WriteFieldBegin("filepath", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(p.URL); err != nil { + if err := oprot.WriteString(p.Filepath); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -6215,114 +6215,31 @@ func (p *GetDownloadUrlResponse) String() string { } -// 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 *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 *GetScoresRequest) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("GetScoresRequest(%+v)", *p) - -} - -type GetScoresResponse struct { - Scores []*model.Score `thrift:"scores,1,required" form:"scores,required" json:"scores,required" query:"scores,required"` +// 兼容 +type ListDirFilesForAndroidRequest struct { + Path string `thrift:"path,1,required" form:"path,required" json:"path,required" query:"path,required"` } -func NewGetScoresResponse() *GetScoresResponse { - return &GetScoresResponse{} +func NewListDirFilesForAndroidRequest() *ListDirFilesForAndroidRequest { + return &ListDirFilesForAndroidRequest{} } -func (p *GetScoresResponse) InitDefault() { +func (p *ListDirFilesForAndroidRequest) InitDefault() { } -func (p *GetScoresResponse) GetScores() (v []*model.Score) { - return p.Scores +func (p *ListDirFilesForAndroidRequest) GetPath() (v string) { + return p.Path } -var fieldIDToName_GetScoresResponse = map[int16]string{ - 1: "scores", +var fieldIDToName_ListDirFilesForAndroidRequest = map[int16]string{ + 1: "path", } -func (p *GetScoresResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *ListDirFilesForAndroidRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetScores bool = false + var issetPath bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -6339,11 +6256,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 + issetPath = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -6360,7 +6277,7 @@ func (p *GetScoresResponse) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetScores { + if !issetPath { fieldId = 1 goto RequiredFieldNotSetError } @@ -6370,7 +6287,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_ListDirFilesForAndroidRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -6379,36 +6296,24 @@ 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_ListDirFilesForAndroidRequest[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 *ListDirFilesForAndroidRequest) 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.Path = _field return nil } -func (p *GetScoresResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *ListDirFilesForAndroidRequest) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetScoresResponse"); err != nil { + if err = oprot.WriteStructBegin("ListDirFilesForAndroidRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -6434,19 +6339,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 *ListDirFilesForAndroidRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("path", 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.Path); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -6459,27 +6356,27 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetScoresResponse) String() string { +func (p *ListDirFilesForAndroidRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetScoresResponse(%+v)", *p) + return fmt.Sprintf("ListDirFilesForAndroidRequest(%+v)", *p) } -type GetGPARequest struct { +type ListDirFilesForAndroidResponse struct { } -func NewGetGPARequest() *GetGPARequest { - return &GetGPARequest{} +func NewListDirFilesForAndroidResponse() *ListDirFilesForAndroidResponse { + return &ListDirFilesForAndroidResponse{} } -func (p *GetGPARequest) InitDefault() { +func (p *ListDirFilesForAndroidResponse) InitDefault() { } -var fieldIDToName_GetGPARequest = map[int16]string{} +var fieldIDToName_ListDirFilesForAndroidResponse = map[int16]string{} -func (p *GetGPARequest) Read(iprot thrift.TProtocol) (err error) { +func (p *ListDirFilesForAndroidResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -6521,8 +6418,8 @@ 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 *ListDirFilesForAndroidResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("ListDirFilesForAndroidResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -6542,47 +6439,38 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetGPARequest) String() string { +func (p *ListDirFilesForAndroidResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetGPARequest(%+v)", *p) - -} + return fmt.Sprintf("ListDirFilesForAndroidResponse(%+v)", *p) -type GetGPAResponse struct { - Gpa *model.GPABean `thrift:"gpa,1,required" form:"gpa,required" json:"gpa,required" query:"gpa,required"` } -func NewGetGPAResponse() *GetGPAResponse { - return &GetGPAResponse{} +type GetDownloadUrlForAndroidRequest struct { + Filepath string `thrift:"filepath,1,required" form:"filepath,required" json:"filepath,required" query:"filepath,required"` } -func (p *GetGPAResponse) InitDefault() { +func NewGetDownloadUrlForAndroidRequest() *GetDownloadUrlForAndroidRequest { + return &GetDownloadUrlForAndroidRequest{} } -var GetGPAResponse_Gpa_DEFAULT *model.GPABean - -func (p *GetGPAResponse) GetGpa() (v *model.GPABean) { - if !p.IsSetGpa() { - return GetGPAResponse_Gpa_DEFAULT - } - return p.Gpa +func (p *GetDownloadUrlForAndroidRequest) InitDefault() { } -var fieldIDToName_GetGPAResponse = map[int16]string{ - 1: "gpa", +func (p *GetDownloadUrlForAndroidRequest) GetFilepath() (v string) { + return p.Filepath } -func (p *GetGPAResponse) IsSetGpa() bool { - return p.Gpa != nil +var fieldIDToName_GetDownloadUrlForAndroidRequest = map[int16]string{ + 1: "filepath", } -func (p *GetGPAResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetDownloadUrlForAndroidRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetGpa bool = false + var issetFilepath bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -6599,11 +6487,11 @@ func (p *GetGPAResponse) 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 } - issetGpa = true + issetFilepath = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -6620,7 +6508,7 @@ func (p *GetGPAResponse) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetGpa { + if !issetFilepath { fieldId = 1 goto RequiredFieldNotSetError } @@ -6630,7 +6518,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_GetDownloadUrlForAndroidRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -6639,21 +6527,24 @@ 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_GetDownloadUrlForAndroidRequest[fieldId])) } -func (p *GetGPAResponse) ReadField1(iprot thrift.TProtocol) error { - _field := model.NewGPABean() - if err := _field.Read(iprot); err != nil { +func (p *GetDownloadUrlForAndroidRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { return err + } else { + _field = v } - p.Gpa = _field + p.Filepath = _field return nil } -func (p *GetGPAResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *GetDownloadUrlForAndroidRequest) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetGPAResponse"); err != nil { + if err = oprot.WriteStructBegin("GetDownloadUrlForAndroidRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -6679,11 +6570,11 @@ 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 *GetDownloadUrlForAndroidRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("filepath", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } - if err := p.Gpa.Write(oprot); err != nil { + if err := oprot.WriteString(p.Filepath); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -6696,27 +6587,27 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetGPAResponse) String() string { +func (p *GetDownloadUrlForAndroidRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetGPAResponse(%+v)", *p) + return fmt.Sprintf("GetDownloadUrlForAndroidRequest(%+v)", *p) } -type GetCreditRequest struct { +type GetDownloadUrlForAndroidResponse struct { } -func NewGetCreditRequest() *GetCreditRequest { - return &GetCreditRequest{} +func NewGetDownloadUrlForAndroidResponse() *GetDownloadUrlForAndroidResponse { + return &GetDownloadUrlForAndroidResponse{} } -func (p *GetCreditRequest) InitDefault() { +func (p *GetDownloadUrlForAndroidResponse) InitDefault() { } -var fieldIDToName_GetCreditRequest = map[int16]string{} +var fieldIDToName_GetDownloadUrlForAndroidResponse = map[int16]string{} -func (p *GetCreditRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetDownloadUrlForAndroidResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -6758,8 +6649,8 @@ 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 *GetDownloadUrlForAndroidResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetDownloadUrlForAndroidResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -6779,38 +6670,31 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetCreditRequest) String() string { +func (p *GetDownloadUrlForAndroidResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetCreditRequest(%+v)", *p) - -} + return fmt.Sprintf("GetDownloadUrlForAndroidResponse(%+v)", *p) -type GetCreditResponse struct { - Major []*model.Credit `thrift:"major,1,required" form:"major,required" json:"major,required" query:"major,required"` } -func NewGetCreditResponse() *GetCreditResponse { - return &GetCreditResponse{} +// academic +type GetScoresRequest struct { } -func (p *GetCreditResponse) InitDefault() { +func NewGetScoresRequest() *GetScoresRequest { + return &GetScoresRequest{} } -func (p *GetCreditResponse) GetMajor() (v []*model.Credit) { - return p.Major +func (p *GetScoresRequest) InitDefault() { } -var fieldIDToName_GetCreditResponse = map[int16]string{ - 1: "major", -} +var fieldIDToName_GetScoresRequest = map[int16]string{} -func (p *GetCreditResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetScoresRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetMajor bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -6824,21 +6708,8 @@ func (p *GetCreditResponse) Read(iprot thrift.TProtocol) (err error) { if fieldTypeId == thrift.STOP { break } - - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err = p.ReadField1(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.Skip(fieldTypeId); err != nil { + goto SkipFieldTypeError } if err = iprot.ReadFieldEnd(); err != nil { goto ReadFieldEndError @@ -6848,7 +6719,111 @@ func (p *GetCreditResponse) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetMajor { + 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 *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 *GetScoresRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetScoresRequest(%+v)", *p) + +} + +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 issetScores 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.LIST { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetScores = 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 !issetScores { fieldId = 1 goto RequiredFieldNotSetError } @@ -6858,7 +6833,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_GetScoresResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -6867,16 +6842,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_GetCreditResponse[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetScoresResponse[fieldId])) } -func (p *GetCreditResponse) ReadField1(iprot thrift.TProtocol) error { +func (p *GetScoresResponse) ReadField1(iprot thrift.TProtocol) error { _, size, err := iprot.ReadListBegin() if err != nil { return err } - _field := make([]*model.Credit, 0, size) - values := make([]model.Credit, size) + _field := make([]*model.Score, 0, size) + values := make([]model.Score, size) for i := 0; i < size; i++ { _elem := &values[i] _elem.InitDefault() @@ -6890,13 +6865,13 @@ func (p *GetCreditResponse) ReadField1(iprot thrift.TProtocol) error { if err := iprot.ReadListEnd(); err != nil { return err } - p.Major = _field + p.Scores = _field return nil } -func (p *GetCreditResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *GetScoresResponse) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetCreditResponse"); err != nil { + if err = oprot.WriteStructBegin("GetScoresResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -6922,14 +6897,14 @@ 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 *GetScoresResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("scores", thrift.LIST, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Major)); err != nil { + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Scores)); err != nil { return err } - for _, v := range p.Major { + for _, v := range p.Scores { if err := v.Write(oprot); err != nil { return err } @@ -6947,27 +6922,27 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetCreditResponse) String() string { +func (p *GetScoresResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetCreditResponse(%+v)", *p) + return fmt.Sprintf("GetScoresResponse(%+v)", *p) } -type GetUnifiedExamRequest struct { +type GetGPARequest struct { } -func NewGetUnifiedExamRequest() *GetUnifiedExamRequest { - return &GetUnifiedExamRequest{} +func NewGetGPARequest() *GetGPARequest { + return &GetGPARequest{} } -func (p *GetUnifiedExamRequest) InitDefault() { +func (p *GetGPARequest) InitDefault() { } -var fieldIDToName_GetUnifiedExamRequest = map[int16]string{} +var fieldIDToName_GetGPARequest = map[int16]string{} -func (p *GetUnifiedExamRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetGPARequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -7009,8 +6984,8 @@ 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 *GetGPARequest) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetGPARequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -7030,38 +7005,47 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetUnifiedExamRequest) String() string { +func (p *GetGPARequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetUnifiedExamRequest(%+v)", *p) + return fmt.Sprintf("GetGPARequest(%+v)", *p) } -type GetUnifiedExamResponse struct { - UnifiedExam []*model.UnifiedExam `thrift:"unifiedExam,1,required" form:"unifiedExam,required" json:"unifiedExam,required" query:"unifiedExam,required"` +type GetGPAResponse struct { + Gpa *model.GPABean `thrift:"gpa,1,required" form:"gpa,required" json:"gpa,required" query:"gpa,required"` } -func NewGetUnifiedExamResponse() *GetUnifiedExamResponse { - return &GetUnifiedExamResponse{} +func NewGetGPAResponse() *GetGPAResponse { + return &GetGPAResponse{} } -func (p *GetUnifiedExamResponse) InitDefault() { +func (p *GetGPAResponse) InitDefault() { } -func (p *GetUnifiedExamResponse) GetUnifiedExam() (v []*model.UnifiedExam) { - return p.UnifiedExam +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_GetUnifiedExamResponse = map[int16]string{ - 1: "unifiedExam", +var fieldIDToName_GetGPAResponse = map[int16]string{ + 1: "gpa", } -func (p *GetUnifiedExamResponse) 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 issetUnifiedExam bool = false + var issetGpa bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -7078,11 +7062,11 @@ func (p *GetUnifiedExamResponse) 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 } - issetUnifiedExam = true + issetGpa = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -7099,7 +7083,7 @@ func (p *GetUnifiedExamResponse) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetUnifiedExam { + if !issetGpa { fieldId = 1 goto RequiredFieldNotSetError } @@ -7109,7 +7093,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_GetGPAResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -7118,36 +7102,21 @@ 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_GetGPAResponse[fieldId])) } -func (p *GetUnifiedExamResponse) 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) - 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 *GetGPAResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewGPABean() + if err := _field.Read(iprot); err != nil { return err } - p.UnifiedExam = _field + p.Gpa = _field return nil } -func (p *GetUnifiedExamResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *GetGPAResponse) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetUnifiedExamResponse"); err != nil { + if err = oprot.WriteStructBegin("GetGPAResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -7173,19 +7142,11 @@ 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 *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.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 { + if err := p.Gpa.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -7198,39 +7159,121 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetUnifiedExamResponse) String() string { +func (p *GetGPAResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetUnifiedExamResponse(%+v)", *p) + return fmt.Sprintf("GetGPAResponse(%+v)", *p) } -// url -type APILoginRequest struct { - Password string `thrift:"password,1,required" form:"password,required" json:"password,required" query:"password,required"` +type GetCreditRequest struct { } -func NewAPILoginRequest() *APILoginRequest { - return &APILoginRequest{} +func NewGetCreditRequest() *GetCreditRequest { + return &GetCreditRequest{} } -func (p *APILoginRequest) InitDefault() { +func (p *GetCreditRequest) InitDefault() { } -func (p *APILoginRequest) GetPassword() (v string) { - return p.Password -} +var fieldIDToName_GetCreditRequest = map[int16]string{} -var fieldIDToName_APILoginRequest = map[int16]string{ - 1: "password", +func (p *GetCreditRequest) 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 *APILoginRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetCreditRequest) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetCreditRequest"); 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 *GetCreditRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetCreditRequest(%+v)", *p) + +} + +type GetCreditResponse struct { + Major []*model.Credit `thrift:"major,1,required" form:"major,required" json:"major,required" query:"major,required"` +} + +func NewGetCreditResponse() *GetCreditResponse { + return &GetCreditResponse{} +} + +func (p *GetCreditResponse) InitDefault() { +} + +func (p *GetCreditResponse) GetMajor() (v []*model.Credit) { + return p.Major +} + +var fieldIDToName_GetCreditResponse = map[int16]string{ + 1: "major", +} + +func (p *GetCreditResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetPassword bool = false + var issetMajor bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -7247,11 +7290,11 @@ func (p *APILoginRequest) Read(iprot thrift.TProtocol) (err error) { switch fieldId { case 1: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.LIST { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetPassword = true + issetMajor = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -7268,7 +7311,7 @@ func (p *APILoginRequest) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetPassword { + if !issetMajor { fieldId = 1 goto RequiredFieldNotSetError } @@ -7278,7 +7321,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_APILoginRequest[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) @@ -7287,24 +7330,36 @@ 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_APILoginRequest[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetCreditResponse[fieldId])) } -func (p *APILoginRequest) 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.Credit, 0, size) + values := make([]model.Credit, 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.Password = _field + p.Major = _field return nil } -func (p *APILoginRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *GetCreditResponse) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("APILoginRequest"); err != nil { + if err = oprot.WriteStructBegin("GetCreditResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -7330,11 +7385,19 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *APILoginRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("password", thrift.STRING, 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.WriteString(p.Password); err != nil { + 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 { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -7347,27 +7410,27 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *APILoginRequest) String() string { +func (p *GetCreditResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("APILoginRequest(%+v)", *p) + return fmt.Sprintf("GetCreditResponse(%+v)", *p) } -type APILoginResponse struct { +type GetUnifiedExamRequest struct { } -func NewAPILoginResponse() *APILoginResponse { - return &APILoginResponse{} +func NewGetUnifiedExamRequest() *GetUnifiedExamRequest { + return &GetUnifiedExamRequest{} } -func (p *APILoginResponse) InitDefault() { +func (p *GetUnifiedExamRequest) InitDefault() { } -var fieldIDToName_APILoginResponse = map[int16]string{} +var fieldIDToName_GetUnifiedExamRequest = map[int16]string{} -func (p *APILoginResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetUnifiedExamRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -7409,8 +7472,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *APILoginResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("APILoginResponse"); err != nil { +func (p *GetUnifiedExamRequest) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetUnifiedExamRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -7430,73 +7493,38 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *APILoginResponse) String() string { +func (p *GetUnifiedExamRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("APILoginResponse(%+v)", *p) - -} - -type UploadVersionInfoRequest struct { - Password string `thrift:"password,1,required" form:"password,required" json:"password,required" query:"password,required"` - Type string `thrift:"type,2,required" form:"type,required" json:"type,required" query:"type,required"` - Version string `thrift:"version,3,required" form:"version,required" json:"version,required" query:"version,required"` - Code string `thrift:"code,4,required" form:"code,required" json:"code,required" query:"code,required"` - Feature string `thrift:"feature,5,required" form:"feature,required" json:"feature,required" query:"feature,required"` - URL string `thrift:"url,6,required" form:"url,required" json:"url,required" query:"url,required"` -} - -func NewUploadVersionInfoRequest() *UploadVersionInfoRequest { - return &UploadVersionInfoRequest{} -} - -func (p *UploadVersionInfoRequest) InitDefault() { -} - -func (p *UploadVersionInfoRequest) GetPassword() (v string) { - return p.Password -} + return fmt.Sprintf("GetUnifiedExamRequest(%+v)", *p) -func (p *UploadVersionInfoRequest) GetType() (v string) { - return p.Type } -func (p *UploadVersionInfoRequest) GetVersion() (v string) { - return p.Version +type GetUnifiedExamResponse struct { + UnifiedExam []*model.UnifiedExam `thrift:"unifiedExam,1,required" form:"unifiedExam,required" json:"unifiedExam,required" query:"unifiedExam,required"` } -func (p *UploadVersionInfoRequest) GetCode() (v string) { - return p.Code +func NewGetUnifiedExamResponse() *GetUnifiedExamResponse { + return &GetUnifiedExamResponse{} } -func (p *UploadVersionInfoRequest) GetFeature() (v string) { - return p.Feature +func (p *GetUnifiedExamResponse) InitDefault() { } -func (p *UploadVersionInfoRequest) GetURL() (v string) { - return p.URL +func (p *GetUnifiedExamResponse) GetUnifiedExam() (v []*model.UnifiedExam) { + return p.UnifiedExam } -var fieldIDToName_UploadVersionInfoRequest = map[int16]string{ - 1: "password", - 2: "type", - 3: "version", - 4: "code", - 5: "feature", - 6: "url", +var fieldIDToName_GetUnifiedExamResponse = map[int16]string{ + 1: "unifiedExam", } -func (p *UploadVersionInfoRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetUnifiedExamResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetPassword bool = false - var issetType bool = false - var issetVersion bool = false - var issetCode bool = false - var issetFeature bool = false - var issetURL bool = false + var issetUnifiedExam bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -7513,61 +7541,16 @@ func (p *UploadVersionInfoRequest) Read(iprot thrift.TProtocol) (err error) { switch fieldId { case 1: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.LIST { 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 - } - issetType = 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 - } - issetVersion = true + issetUnifiedExam = 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 - } - issetCode = 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 - } - issetFeature = 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 - } - issetURL = true - } 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 } } @@ -7579,42 +7562,17 @@ func (p *UploadVersionInfoRequest) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetPassword { + if !issetUnifiedExam { fieldId = 1 goto RequiredFieldNotSetError } - - if !issetType { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetVersion { - fieldId = 3 - goto RequiredFieldNotSetError - } - - if !issetCode { - fieldId = 4 - goto RequiredFieldNotSetError - } - - if !issetFeature { - fieldId = 5 - goto RequiredFieldNotSetError - } - - if !issetURL { - 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_UploadVersionInfoRequest[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) @@ -7623,79 +7581,36 @@ 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_UploadVersionInfoRequest[fieldId])) -} - -func (p *UploadVersionInfoRequest) 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 *UploadVersionInfoRequest) ReadField2(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Type = _field - return nil + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetUnifiedExamResponse[fieldId])) } -func (p *UploadVersionInfoRequest) ReadField3(iprot thrift.TProtocol) error { - var _field string - if v, err := iprot.ReadString(); err != nil { +func (p *GetUnifiedExamResponse) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { return err - } else { - _field = v } - p.Version = _field - return nil -} -func (p *UploadVersionInfoRequest) ReadField4(iprot thrift.TProtocol) error { + _field := make([]*model.UnifiedExam, 0, size) + values := make([]model.UnifiedExam, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Code = _field - return nil -} -func (p *UploadVersionInfoRequest) ReadField5(iprot thrift.TProtocol) error { + if err := _elem.Read(iprot); err != nil { + return err + } - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v + _field = append(_field, _elem) } - p.Feature = _field - return nil -} -func (p *UploadVersionInfoRequest) ReadField6(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { + if err := iprot.ReadListEnd(); err != nil { return err - } else { - _field = v } - p.URL = _field + p.UnifiedExam = _field return nil } -func (p *UploadVersionInfoRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *GetUnifiedExamResponse) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("UploadVersionInfoRequest"); err != nil { + if err = oprot.WriteStructBegin("GetUnifiedExamResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -7703,26 +7618,6 @@ func (p *UploadVersionInfoRequest) 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 @@ -7741,28 +7636,19 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UploadVersionInfoRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("password", thrift.STRING, 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 := oprot.WriteString(p.Password); err != nil { + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.UnifiedExam)); 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 *UploadVersionInfoRequest) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("type", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError + for _, v := range p.UnifiedExam { + if err := v.Write(oprot); err != nil { + return err + } } - if err := oprot.WriteString(p.Type); err != nil { + if err := oprot.WriteListEnd(); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -7770,190 +7656,40 @@ func (p *UploadVersionInfoRequest) writeField2(oprot thrift.TProtocol) (err erro } return nil WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 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 2 end error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UploadVersionInfoRequest) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("version", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Version); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError +func (p *GetUnifiedExamResponse) 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("GetUnifiedExamResponse(%+v)", *p) -func (p *UploadVersionInfoRequest) writeField4(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("code", thrift.STRING, 4); 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 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) } -func (p *UploadVersionInfoRequest) writeField5(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("feature", thrift.STRING, 5); 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 5 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +// url +type APILoginRequest struct { + Password string `thrift:"password,1,required" form:"password,required" json:"password,required" query:"password,required"` } -func (p *UploadVersionInfoRequest) writeField6(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("url", thrift.STRING, 6); 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 6 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +func NewAPILoginRequest() *APILoginRequest { + return &APILoginRequest{} } -func (p *UploadVersionInfoRequest) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("UploadVersionInfoRequest(%+v)", *p) - +func (p *APILoginRequest) InitDefault() { } -type UploadVersionInfoResponse struct { +func (p *APILoginRequest) GetPassword() (v string) { + return p.Password } -func NewUploadVersionInfoResponse() *UploadVersionInfoResponse { - return &UploadVersionInfoResponse{} -} - -func (p *UploadVersionInfoResponse) InitDefault() { -} - -var fieldIDToName_UploadVersionInfoResponse = map[int16]string{} - -func (p *UploadVersionInfoResponse) 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 *UploadVersionInfoResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("UploadVersionInfoResponse"); 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 *UploadVersionInfoResponse) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("UploadVersionInfoResponse(%+v)", *p) - -} - -type GetUploadParamsRequest struct { - Password string `thrift:"password,1,required" form:"password,required" json:"password,required" query:"password,required"` -} - -func NewGetUploadParamsRequest() *GetUploadParamsRequest { - return &GetUploadParamsRequest{} -} - -func (p *GetUploadParamsRequest) InitDefault() { -} - -func (p *GetUploadParamsRequest) GetPassword() (v string) { - return p.Password -} - -var fieldIDToName_GetUploadParamsRequest = map[int16]string{ +var fieldIDToName_APILoginRequest = map[int16]string{ 1: "password", } -func (p *GetUploadParamsRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *APILoginRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -8005,7 +7741,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_GetUploadParamsRequest[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_APILoginRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -8014,10 +7750,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_GetUploadParamsRequest[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_APILoginRequest[fieldId])) } -func (p *GetUploadParamsRequest) ReadField1(iprot thrift.TProtocol) error { +func (p *APILoginRequest) ReadField1(iprot thrift.TProtocol) error { var _field string if v, err := iprot.ReadString(); err != nil { @@ -8029,9 +7765,9 @@ func (p *GetUploadParamsRequest) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *GetUploadParamsRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *APILoginRequest) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetUploadParamsRequest"); err != nil { + if err = oprot.WriteStructBegin("APILoginRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -8057,7 +7793,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetUploadParamsRequest) writeField1(oprot thrift.TProtocol) (err error) { +func (p *APILoginRequest) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("password", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } @@ -8074,45 +7810,30 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetUploadParamsRequest) String() string { +func (p *APILoginRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetUploadParamsRequest(%+v)", *p) - -} - -type GetUploadParamsResponse struct { - Policy string `thrift:"policy,1,required" form:"policy,required" json:"policy,required" query:"policy,required"` - Authorization string `thrift:"authorization,2,required" form:"authorization,required" json:"authorization,required" query:"authorization,required"` -} + return fmt.Sprintf("APILoginRequest(%+v)", *p) -func NewGetUploadParamsResponse() *GetUploadParamsResponse { - return &GetUploadParamsResponse{} } -func (p *GetUploadParamsResponse) InitDefault() { +type APILoginResponse struct { } -func (p *GetUploadParamsResponse) GetPolicy() (v string) { - return p.Policy +func NewAPILoginResponse() *APILoginResponse { + return &APILoginResponse{} } -func (p *GetUploadParamsResponse) GetAuthorization() (v string) { - return p.Authorization +func (p *APILoginResponse) InitDefault() { } -var fieldIDToName_GetUploadParamsResponse = map[int16]string{ - 1: "policy", - 2: "authorization", -} +var fieldIDToName_APILoginResponse = map[int16]string{} -func (p *GetUploadParamsResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *APILoginResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetPolicy bool = false - var issetAuthorization bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -8126,30 +7847,8 @@ func (p *GetUploadParamsResponse) 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 - } - issetPolicy = 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 - } - issetAuthorization = 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 @@ -8159,70 +7858,25 @@ func (p *GetUploadParamsResponse) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetPolicy { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetAuthorization { - 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_GetUploadParamsResponse[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_GetUploadParamsResponse[fieldId])) -} - -func (p *GetUploadParamsResponse) ReadField1(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 *GetUploadParamsResponse) ReadField2(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 *GetUploadParamsResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("GetUploadParamsResponse"); err != nil { +func (p *APILoginResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("APILoginResponse"); 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 @@ -8233,72 +7887,79 @@ func (p *GetUploadParamsResponse) 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 *GetUploadParamsResponse) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("policy", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Policy); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError +func (p *APILoginResponse) String() string { + if p == 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 fmt.Sprintf("APILoginResponse(%+v)", *p) + } -func (p *GetUploadParamsResponse) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("authorization", thrift.STRING, 2); 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 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +type UploadVersionInfoRequest struct { + Password string `thrift:"password,1,required" form:"password,required" json:"password,required" query:"password,required"` + Type string `thrift:"type,2,required" form:"type,required" json:"type,required" query:"type,required"` + Version string `thrift:"version,3,required" form:"version,required" json:"version,required" query:"version,required"` + Code string `thrift:"code,4,required" form:"code,required" json:"code,required" query:"code,required"` + Feature string `thrift:"feature,5,required" form:"feature,required" json:"feature,required" query:"feature,required"` + URL string `thrift:"url,6,required" form:"url,required" json:"url,required" query:"url,required"` } -func (p *GetUploadParamsResponse) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("GetUploadParamsResponse(%+v)", *p) +func NewUploadVersionInfoRequest() *UploadVersionInfoRequest { + return &UploadVersionInfoRequest{} +} +func (p *UploadVersionInfoRequest) InitDefault() { } -type GetDownloadReleaseRequest struct { +func (p *UploadVersionInfoRequest) GetPassword() (v string) { + return p.Password } -func NewGetDownloadReleaseRequest() *GetDownloadReleaseRequest { - return &GetDownloadReleaseRequest{} +func (p *UploadVersionInfoRequest) GetType() (v string) { + return p.Type } -func (p *GetDownloadReleaseRequest) InitDefault() { +func (p *UploadVersionInfoRequest) GetVersion() (v string) { + return p.Version } -var fieldIDToName_GetDownloadReleaseRequest = map[int16]string{} +func (p *UploadVersionInfoRequest) GetCode() (v string) { + return p.Code +} -func (p *GetDownloadReleaseRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *UploadVersionInfoRequest) GetFeature() (v string) { + return p.Feature +} + +func (p *UploadVersionInfoRequest) GetURL() (v string) { + return p.URL +} + +var fieldIDToName_UploadVersionInfoRequest = map[int16]string{ + 1: "password", + 2: "type", + 3: "version", + 4: "code", + 5: "feature", + 6: "url", +} + +func (p *UploadVersionInfoRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 + var issetPassword bool = false + var issetType bool = false + var issetVersion bool = false + var issetCode bool = false + var issetFeature bool = false + var issetURL bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -8312,8 +7973,66 @@ func (p *GetDownloadReleaseRequest) 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 + } + issetType = 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 + } + issetVersion = 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 + } + issetCode = 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 + } + issetFeature = 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 + } + 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 @@ -8323,25 +8042,150 @@ func (p *GetDownloadReleaseRequest) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } + if !issetPassword { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetType { + fieldId = 2 + goto RequiredFieldNotSetError + } + + if !issetVersion { + fieldId = 3 + goto RequiredFieldNotSetError + } + + if !issetCode { + fieldId = 4 + goto RequiredFieldNotSetError + } + + if !issetFeature { + fieldId = 5 + goto RequiredFieldNotSetError + } + + if !issetURL { + 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) -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_UploadVersionInfoRequest[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_UploadVersionInfoRequest[fieldId])) } -func (p *GetDownloadReleaseRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetDownloadReleaseRequest"); err != nil { +func (p *UploadVersionInfoRequest) 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 *UploadVersionInfoRequest) ReadField2(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 *UploadVersionInfoRequest) ReadField3(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 *UploadVersionInfoRequest) ReadField4(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 *UploadVersionInfoRequest) ReadField5(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 *UploadVersionInfoRequest) ReadField6(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 *UploadVersionInfoRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("UploadVersionInfoRequest"); 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 @@ -8352,33 +8196,137 @@ func (p *GetDownloadReleaseRequest) 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 *GetDownloadReleaseRequest) String() string { - if p == nil { - return "" +func (p *UploadVersionInfoRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("password", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError } - return fmt.Sprintf("GetDownloadReleaseRequest(%+v)", *p) + 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 *UploadVersionInfoRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("type", thrift.STRING, 2); 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 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -type GetDownloadReleaseResponse struct { +func (p *UploadVersionInfoRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("version", thrift.STRING, 3); 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 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) } -func NewGetDownloadReleaseResponse() *GetDownloadReleaseResponse { - return &GetDownloadReleaseResponse{} +func (p *UploadVersionInfoRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("code", thrift.STRING, 4); 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 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) } -func (p *GetDownloadReleaseResponse) InitDefault() { +func (p *UploadVersionInfoRequest) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("feature", thrift.STRING, 5); 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 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) } -var fieldIDToName_GetDownloadReleaseResponse = map[int16]string{} +func (p *UploadVersionInfoRequest) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("url", thrift.STRING, 6); 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 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} -func (p *GetDownloadReleaseResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *UploadVersionInfoRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UploadVersionInfoRequest(%+v)", *p) + +} + +type UploadVersionInfoResponse struct { +} + +func NewUploadVersionInfoResponse() *UploadVersionInfoResponse { + return &UploadVersionInfoResponse{} +} + +func (p *UploadVersionInfoResponse) InitDefault() { +} + +var fieldIDToName_UploadVersionInfoResponse = map[int16]string{} + +func (p *UploadVersionInfoResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -8420,8 +8368,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetDownloadReleaseResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetDownloadReleaseResponse"); err != nil { +func (p *UploadVersionInfoResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("UploadVersionInfoResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -8441,30 +8389,38 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetDownloadReleaseResponse) String() string { +func (p *UploadVersionInfoResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetDownloadReleaseResponse(%+v)", *p) + return fmt.Sprintf("UploadVersionInfoResponse(%+v)", *p) } -type GetDownloadBetaRequest struct { +type GetUploadParamsRequest struct { + Password string `thrift:"password,1,required" form:"password,required" json:"password,required" query:"password,required"` } -func NewGetDownloadBetaRequest() *GetDownloadBetaRequest { - return &GetDownloadBetaRequest{} +func NewGetUploadParamsRequest() *GetUploadParamsRequest { + return &GetUploadParamsRequest{} } -func (p *GetDownloadBetaRequest) InitDefault() { +func (p *GetUploadParamsRequest) InitDefault() { } -var fieldIDToName_GetDownloadBetaRequest = map[int16]string{} +func (p *GetUploadParamsRequest) GetPassword() (v string) { + return p.Password +} -func (p *GetDownloadBetaRequest) Read(iprot thrift.TProtocol) (err error) { +var fieldIDToName_GetUploadParamsRequest = map[int16]string{ + 1: "password", +} + +func (p *GetUploadParamsRequest) 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 @@ -8478,8 +8434,21 @@ func (p *GetDownloadBetaRequest) 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 + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } } if err = iprot.ReadFieldEnd(); err != nil { goto ReadFieldEndError @@ -8489,25 +8458,50 @@ func (p *GetDownloadBetaRequest) 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) -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_GetUploadParamsRequest[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_GetUploadParamsRequest[fieldId])) } -func (p *GetDownloadBetaRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetDownloadBetaRequest"); err != nil { +func (p *GetUploadParamsRequest) 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 *GetUploadParamsRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetUploadParamsRequest"); 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 @@ -8518,36 +8512,70 @@ func (p *GetDownloadBetaRequest) 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 *GetDownloadBetaRequest) String() string { +func (p *GetUploadParamsRequest) 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 *GetUploadParamsRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetDownloadBetaRequest(%+v)", *p) + return fmt.Sprintf("GetUploadParamsRequest(%+v)", *p) } -type GetDownloadBetaResponse struct { +type GetUploadParamsResponse struct { + Policy string `thrift:"policy,1,required" form:"policy,required" json:"policy,required" query:"policy,required"` + Authorization string `thrift:"authorization,2,required" form:"authorization,required" json:"authorization,required" query:"authorization,required"` } -func NewGetDownloadBetaResponse() *GetDownloadBetaResponse { - return &GetDownloadBetaResponse{} +func NewGetUploadParamsResponse() *GetUploadParamsResponse { + return &GetUploadParamsResponse{} } -func (p *GetDownloadBetaResponse) InitDefault() { +func (p *GetUploadParamsResponse) InitDefault() { } -var fieldIDToName_GetDownloadBetaResponse = map[int16]string{} +func (p *GetUploadParamsResponse) GetPolicy() (v string) { + return p.Policy +} -func (p *GetDownloadBetaResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetUploadParamsResponse) GetAuthorization() (v string) { + return p.Authorization +} + +var fieldIDToName_GetUploadParamsResponse = map[int16]string{ + 1: "policy", + 2: "authorization", +} + +func (p *GetUploadParamsResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 + var issetPolicy bool = false + var issetAuthorization bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -8561,36 +8589,103 @@ func (p *GetDownloadBetaResponse) Read(iprot thrift.TProtocol) (err error) { 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 + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetPolicy = 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 + } + issetAuthorization = 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 !issetPolicy { + fieldId = 1 + goto RequiredFieldNotSetError } + if !issetAuthorization { + 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_GetUploadParamsResponse[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_GetUploadParamsResponse[fieldId])) } -func (p *GetDownloadBetaResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetDownloadBetaResponse"); err != nil { +func (p *GetUploadParamsResponse) ReadField1(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 *GetUploadParamsResponse) ReadField2(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 *GetUploadParamsResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetUploadParamsResponse"); 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 @@ -8601,33 +8696,69 @@ func (p *GetDownloadBetaResponse) 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 *GetDownloadBetaResponse) String() string { +func (p *GetUploadParamsResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("policy", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Policy); 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 *GetUploadParamsResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("authorization", thrift.STRING, 2); 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 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *GetUploadParamsResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetDownloadBetaResponse(%+v)", *p) + return fmt.Sprintf("GetUploadParamsResponse(%+v)", *p) } -type GetReleaseVersionRequest struct { +type GetDownloadReleaseRequest struct { } -func NewGetReleaseVersionRequest() *GetReleaseVersionRequest { - return &GetReleaseVersionRequest{} +func NewGetDownloadReleaseRequest() *GetDownloadReleaseRequest { + return &GetDownloadReleaseRequest{} } -func (p *GetReleaseVersionRequest) InitDefault() { +func (p *GetDownloadReleaseRequest) InitDefault() { } -var fieldIDToName_GetReleaseVersionRequest = map[int16]string{} +var fieldIDToName_GetDownloadReleaseRequest = map[int16]string{} -func (p *GetReleaseVersionRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetDownloadReleaseRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -8669,8 +8800,8 @@ 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 { +func (p *GetDownloadReleaseRequest) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetDownloadReleaseRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -8690,27 +8821,27 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetReleaseVersionRequest) String() string { +func (p *GetDownloadReleaseRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetReleaseVersionRequest(%+v)", *p) + return fmt.Sprintf("GetDownloadReleaseRequest(%+v)", *p) } -type GetReleaseVersionResponse struct { +type GetDownloadReleaseResponse struct { } -func NewGetReleaseVersionResponse() *GetReleaseVersionResponse { - return &GetReleaseVersionResponse{} +func NewGetDownloadReleaseResponse() *GetDownloadReleaseResponse { + return &GetDownloadReleaseResponse{} } -func (p *GetReleaseVersionResponse) InitDefault() { +func (p *GetDownloadReleaseResponse) InitDefault() { } -var fieldIDToName_GetReleaseVersionResponse = map[int16]string{} +var fieldIDToName_GetDownloadReleaseResponse = map[int16]string{} -func (p *GetReleaseVersionResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetDownloadReleaseResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -8752,8 +8883,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetReleaseVersionResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetReleaseVersionResponse"); err != nil { +func (p *GetDownloadReleaseResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetDownloadReleaseResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -8773,27 +8904,27 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetReleaseVersionResponse) String() string { +func (p *GetDownloadReleaseResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetReleaseVersionResponse(%+v)", *p) + return fmt.Sprintf("GetDownloadReleaseResponse(%+v)", *p) } -type GetBetaVersionRequest struct { +type GetDownloadBetaRequest struct { } -func NewGetBetaVersionRequest() *GetBetaVersionRequest { - return &GetBetaVersionRequest{} +func NewGetDownloadBetaRequest() *GetDownloadBetaRequest { + return &GetDownloadBetaRequest{} } -func (p *GetBetaVersionRequest) InitDefault() { +func (p *GetDownloadBetaRequest) InitDefault() { } -var fieldIDToName_GetBetaVersionRequest = map[int16]string{} +var fieldIDToName_GetDownloadBetaRequest = map[int16]string{} -func (p *GetBetaVersionRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetDownloadBetaRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -8835,8 +8966,8 @@ 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 *GetDownloadBetaRequest) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetDownloadBetaRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -8856,27 +8987,27 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetBetaVersionRequest) String() string { +func (p *GetDownloadBetaRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetBetaVersionRequest(%+v)", *p) + return fmt.Sprintf("GetDownloadBetaRequest(%+v)", *p) } -type GetBetaVersionResponse struct { +type GetDownloadBetaResponse struct { } -func NewGetBetaVersionResponse() *GetBetaVersionResponse { - return &GetBetaVersionResponse{} +func NewGetDownloadBetaResponse() *GetDownloadBetaResponse { + return &GetDownloadBetaResponse{} } -func (p *GetBetaVersionResponse) InitDefault() { +func (p *GetDownloadBetaResponse) InitDefault() { } -var fieldIDToName_GetBetaVersionResponse = map[int16]string{} +var fieldIDToName_GetDownloadBetaResponse = map[int16]string{} -func (p *GetBetaVersionResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetDownloadBetaResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -8918,8 +9049,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetBetaVersionResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetBetaVersionResponse"); err != nil { +func (p *GetDownloadBetaResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetDownloadBetaResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -8939,118 +9070,110 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetBetaVersionResponse) String() string { +func (p *GetDownloadBetaResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetBetaVersionResponse(%+v)", *p) + return fmt.Sprintf("GetDownloadBetaResponse(%+v)", *p) } -type GetCloudSettingRequest 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 *string `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 *string `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 GetReleaseVersionRequest struct { } -func NewGetCloudSettingRequest() *GetCloudSettingRequest { - return &GetCloudSettingRequest{} +func NewGetReleaseVersionRequest() *GetReleaseVersionRequest { + return &GetReleaseVersionRequest{} } -func (p *GetCloudSettingRequest) InitDefault() { +func (p *GetReleaseVersionRequest) InitDefault() { } -var GetCloudSettingRequest_Account_DEFAULT string +var fieldIDToName_GetReleaseVersionRequest = map[int16]string{} -func (p *GetCloudSettingRequest) GetAccount() (v string) { - if !p.IsSetAccount() { - return GetCloudSettingRequest_Account_DEFAULT - } - return *p.Account -} +func (p *GetReleaseVersionRequest) Read(iprot thrift.TProtocol) (err error) { -var GetCloudSettingRequest_Version_DEFAULT string + var fieldTypeId thrift.TType + var fieldId int16 -func (p *GetCloudSettingRequest) GetVersion() (v string) { - if !p.IsSetVersion() { - return GetCloudSettingRequest_Version_DEFAULT + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } - return *p.Version -} - -var GetCloudSettingRequest_Beta_DEFAULT string -func (p *GetCloudSettingRequest) GetBeta() (v string) { - if !p.IsSetBeta() { - return GetCloudSettingRequest_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 + } } - return *p.Beta -} - -var GetCloudSettingRequest_Phone_DEFAULT string - -func (p *GetCloudSettingRequest) GetPhone() (v string) { - if !p.IsSetPhone() { - return GetCloudSettingRequest_Phone_DEFAULT + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError } - return *p.Phone -} -var GetCloudSettingRequest_IsLogin_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 *GetCloudSettingRequest) GetIsLogin() (v string) { - if !p.IsSetIsLogin() { - return GetCloudSettingRequest_IsLogin_DEFAULT - } - return *p.IsLogin +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 GetCloudSettingRequest_LoginType_DEFAULT string - -func (p *GetCloudSettingRequest) GetLoginType() (v string) { - if !p.IsSetLoginType() { - return GetCloudSettingRequest_LoginType_DEFAULT +func (p *GetReleaseVersionRequest) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetReleaseVersionRequest"); err != nil { + goto WriteStructBeginError } - return *p.LoginType -} - -var fieldIDToName_GetCloudSettingRequest = map[int16]string{ - 1: "account", - 2: "version", - 3: "beta", - 4: "phone", - 5: "isLogin", - 6: "loginType", + 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 *GetCloudSettingRequest) IsSetAccount() bool { - return p.Account != nil -} +func (p *GetReleaseVersionRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetReleaseVersionRequest(%+v)", *p) -func (p *GetCloudSettingRequest) IsSetVersion() bool { - return p.Version != nil } -func (p *GetCloudSettingRequest) IsSetBeta() bool { - return p.Beta != nil +type GetReleaseVersionResponse struct { } -func (p *GetCloudSettingRequest) IsSetPhone() bool { - return p.Phone != nil +func NewGetReleaseVersionResponse() *GetReleaseVersionResponse { + return &GetReleaseVersionResponse{} } -func (p *GetCloudSettingRequest) IsSetIsLogin() bool { - return p.IsLogin != nil +func (p *GetReleaseVersionResponse) InitDefault() { } -func (p *GetCloudSettingRequest) IsSetLoginType() bool { - return p.LoginType != nil -} +var fieldIDToName_GetReleaseVersionResponse = map[int16]string{} -func (p *GetCloudSettingRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetReleaseVersionResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -9067,60 +9190,8 @@ func (p *GetCloudSettingRequest) 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 - } - } 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 - } - 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 { - goto SkipFieldError - } + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldTypeError } if err = iprot.ReadFieldEnd(); err != nil { goto ReadFieldEndError @@ -9135,10 +9206,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_GetCloudSettingRequest[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) @@ -9146,103 +9215,11 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetCloudSettingRequest) 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 *GetCloudSettingRequest) 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 *GetCloudSettingRequest) ReadField3(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Beta = _field - return nil -} -func (p *GetCloudSettingRequest) 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 *GetCloudSettingRequest) ReadField5(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.IsLogin = _field - return nil -} -func (p *GetCloudSettingRequest) 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 *GetCloudSettingRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("GetCloudSettingRequest"); err != nil { +func (p *GetReleaseVersionResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetReleaseVersionResponse"); 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 @@ -9253,149 +9230,33 @@ func (p *GetCloudSettingRequest) 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 *GetCloudSettingRequest) 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: - 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 *GetCloudSettingRequest) 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 *GetCloudSettingRequest) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetBeta() { - if err = oprot.WriteFieldBegin("beta", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*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 *GetCloudSettingRequest) 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 *GetCloudSettingRequest) writeField5(oprot thrift.TProtocol) (err error) { - if p.IsSetIsLogin() { - if err = oprot.WriteFieldBegin("isLogin", thrift.STRING, 5); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*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 *GetCloudSettingRequest) 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 *GetCloudSettingRequest) String() string { +func (p *GetReleaseVersionResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetCloudSettingRequest(%+v)", *p) + return fmt.Sprintf("GetReleaseVersionResponse(%+v)", *p) } -type GetCloudSettingResponse struct { +type GetBetaVersionRequest struct { } -func NewGetCloudSettingResponse() *GetCloudSettingResponse { - return &GetCloudSettingResponse{} +func NewGetBetaVersionRequest() *GetBetaVersionRequest { + return &GetBetaVersionRequest{} } -func (p *GetCloudSettingResponse) InitDefault() { +func (p *GetBetaVersionRequest) InitDefault() { } -var fieldIDToName_GetCloudSettingResponse = map[int16]string{} +var fieldIDToName_GetBetaVersionRequest = map[int16]string{} -func (p *GetCloudSettingResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetBetaVersionRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -9437,8 +9298,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetCloudSettingResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetCloudSettingResponse"); err != nil { +func (p *GetBetaVersionRequest) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetBetaVersionRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -9458,27 +9319,27 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetCloudSettingResponse) String() string { +func (p *GetBetaVersionRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetCloudSettingResponse(%+v)", *p) + return fmt.Sprintf("GetBetaVersionRequest(%+v)", *p) } -type GetAllCloudSettingRequest struct { +type GetBetaVersionResponse struct { } -func NewGetAllCloudSettingRequest() *GetAllCloudSettingRequest { - return &GetAllCloudSettingRequest{} +func NewGetBetaVersionResponse() *GetBetaVersionResponse { + return &GetBetaVersionResponse{} } -func (p *GetAllCloudSettingRequest) InitDefault() { +func (p *GetBetaVersionResponse) InitDefault() { } -var fieldIDToName_GetAllCloudSettingRequest = map[int16]string{} +var fieldIDToName_GetBetaVersionResponse = map[int16]string{} -func (p *GetAllCloudSettingRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetBetaVersionResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -9520,8 +9381,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetAllCloudSettingRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetAllCloudSettingRequest"); err != nil { +func (p *GetBetaVersionResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetBetaVersionResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -9541,27 +9402,118 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetAllCloudSettingRequest) String() string { +func (p *GetBetaVersionResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetAllCloudSettingRequest(%+v)", *p) + return fmt.Sprintf("GetBetaVersionResponse(%+v)", *p) } -type GetAllCloudSettingResponse struct { +type GetCloudSettingRequest 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 *string `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 *string `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 NewGetAllCloudSettingResponse() *GetAllCloudSettingResponse { - return &GetAllCloudSettingResponse{} +func NewGetCloudSettingRequest() *GetCloudSettingRequest { + return &GetCloudSettingRequest{} } -func (p *GetAllCloudSettingResponse) InitDefault() { +func (p *GetCloudSettingRequest) InitDefault() { } -var fieldIDToName_GetAllCloudSettingResponse = map[int16]string{} +var GetCloudSettingRequest_Account_DEFAULT string -func (p *GetAllCloudSettingResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetCloudSettingRequest) GetAccount() (v string) { + if !p.IsSetAccount() { + return GetCloudSettingRequest_Account_DEFAULT + } + return *p.Account +} + +var GetCloudSettingRequest_Version_DEFAULT string + +func (p *GetCloudSettingRequest) GetVersion() (v string) { + if !p.IsSetVersion() { + return GetCloudSettingRequest_Version_DEFAULT + } + return *p.Version +} + +var GetCloudSettingRequest_Beta_DEFAULT string + +func (p *GetCloudSettingRequest) GetBeta() (v string) { + if !p.IsSetBeta() { + return GetCloudSettingRequest_Beta_DEFAULT + } + return *p.Beta +} + +var GetCloudSettingRequest_Phone_DEFAULT string + +func (p *GetCloudSettingRequest) GetPhone() (v string) { + if !p.IsSetPhone() { + return GetCloudSettingRequest_Phone_DEFAULT + } + return *p.Phone +} + +var GetCloudSettingRequest_IsLogin_DEFAULT string + +func (p *GetCloudSettingRequest) GetIsLogin() (v string) { + if !p.IsSetIsLogin() { + return GetCloudSettingRequest_IsLogin_DEFAULT + } + return *p.IsLogin +} + +var GetCloudSettingRequest_LoginType_DEFAULT string + +func (p *GetCloudSettingRequest) GetLoginType() (v string) { + if !p.IsSetLoginType() { + return GetCloudSettingRequest_LoginType_DEFAULT + } + return *p.LoginType +} + +var fieldIDToName_GetCloudSettingRequest = map[int16]string{ + 1: "account", + 2: "version", + 3: "beta", + 4: "phone", + 5: "isLogin", + 6: "loginType", +} + +func (p *GetCloudSettingRequest) IsSetAccount() bool { + return p.Account != nil +} + +func (p *GetCloudSettingRequest) IsSetVersion() bool { + return p.Version != nil +} + +func (p *GetCloudSettingRequest) IsSetBeta() bool { + return p.Beta != nil +} + +func (p *GetCloudSettingRequest) IsSetPhone() bool { + return p.Phone != nil +} + +func (p *GetCloudSettingRequest) IsSetIsLogin() bool { + return p.IsLogin != nil +} + +func (p *GetCloudSettingRequest) IsSetLoginType() bool { + return p.LoginType != nil +} + +func (p *GetCloudSettingRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -9570,104 +9522,6 @@ func (p *GetAllCloudSettingResponse) Read(iprot thrift.TProtocol) (err error) { 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 *GetAllCloudSettingResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetAllCloudSettingResponse"); 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 *GetAllCloudSettingResponse) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("GetAllCloudSettingResponse(%+v)", *p) - -} - -type SetAllCloudSettingRequest 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 NewSetAllCloudSettingRequest() *SetAllCloudSettingRequest { - return &SetAllCloudSettingRequest{} -} - -func (p *SetAllCloudSettingRequest) InitDefault() { -} - -func (p *SetAllCloudSettingRequest) GetPassword() (v string) { - return p.Password -} - -func (p *SetAllCloudSettingRequest) GetSetting() (v string) { - return p.Setting -} - -var fieldIDToName_SetAllCloudSettingRequest = map[int16]string{ - 1: "password", - 2: "setting", -} - -func (p *SetAllCloudSettingRequest) 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 - } - for { _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() if err != nil { @@ -9683,7 +9537,6 @@ func (p *SetAllCloudSettingRequest) 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 } @@ -9692,7 +9545,38 @@ func (p *SetAllCloudSettingRequest) 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.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 + } + 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 } @@ -9709,22 +9593,13 @@ func (p *SetAllCloudSettingRequest) 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_SetAllCloudSettingRequest[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetCloudSettingRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -9732,36 +9607,78 @@ 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_SetAllCloudSettingRequest[fieldId])) } -func (p *SetAllCloudSettingRequest) ReadField1(iprot thrift.TProtocol) error { +func (p *GetCloudSettingRequest) 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 *SetAllCloudSettingRequest) ReadField2(iprot thrift.TProtocol) error { +func (p *GetCloudSettingRequest) 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 *GetCloudSettingRequest) ReadField3(iprot thrift.TProtocol) error { -func (p *SetAllCloudSettingRequest) Write(oprot thrift.TProtocol) (err error) { + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Beta = _field + return nil +} +func (p *GetCloudSettingRequest) 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 *GetCloudSettingRequest) ReadField5(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.IsLogin = _field + return nil +} +func (p *GetCloudSettingRequest) 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 *GetCloudSettingRequest) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("SetAllCloudSettingRequest"); err != nil { + if err = oprot.WriteStructBegin("GetCloudSettingRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -9773,6 +9690,22 @@ func (p *SetAllCloudSettingRequest) 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 @@ -9791,15 +9724,17 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *SetAllCloudSettingRequest) 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 *GetCloudSettingRequest) 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: @@ -9808,15 +9743,17 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *SetAllCloudSettingRequest) 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 *GetCloudSettingRequest) 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: @@ -9825,27 +9762,103 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *SetAllCloudSettingRequest) String() string { +func (p *GetCloudSettingRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetBeta() { + if err = oprot.WriteFieldBegin("beta", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*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 *GetCloudSettingRequest) 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 *GetCloudSettingRequest) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetIsLogin() { + if err = oprot.WriteFieldBegin("isLogin", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*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 *GetCloudSettingRequest) 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 *GetCloudSettingRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("SetAllCloudSettingRequest(%+v)", *p) + return fmt.Sprintf("GetCloudSettingRequest(%+v)", *p) } -type SetAllCloudSettingResponse struct { +type GetCloudSettingResponse struct { } -func NewSetAllCloudSettingResponse() *SetAllCloudSettingResponse { - return &SetAllCloudSettingResponse{} +func NewGetCloudSettingResponse() *GetCloudSettingResponse { + return &GetCloudSettingResponse{} } -func (p *SetAllCloudSettingResponse) InitDefault() { +func (p *GetCloudSettingResponse) InitDefault() { } -var fieldIDToName_SetAllCloudSettingResponse = map[int16]string{} +var fieldIDToName_GetCloudSettingResponse = map[int16]string{} -func (p *SetAllCloudSettingResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetCloudSettingResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -9887,8 +9900,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *SetAllCloudSettingResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("SetAllCloudSettingResponse"); err != nil { +func (p *GetCloudSettingResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetCloudSettingResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -9908,80 +9921,113 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *SetAllCloudSettingResponse) String() string { +func (p *GetCloudSettingResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("SetAllCloudSettingResponse(%+v)", *p) + return fmt.Sprintf("GetCloudSettingResponse(%+v)", *p) } -type TestSettingRequest struct { - Setting string `thrift:"setting,1,required" form:"setting,required" json:"setting,required" query:"setting,required"` - Account string `thrift:"account,2,required" form:"account,required" json:"account,required" query:"account,required"` - Version string `thrift:"version,3,required" form:"version,required" json:"version,required" query:"version,required"` - Beta string `thrift:"beta,4,required" form:"beta,required" json:"beta,required" query:"beta,required"` - Phone string `thrift:"phone,5,required" form:"phone,required" json:"phone,required" query:"phone,required"` - IsLogin string `thrift:"isLogin,6,required" form:"isLogin,required" json:"isLogin,required" query:"isLogin,required"` - LoginType string `thrift:"loginType,7,required" form:"loginType,required" json:"loginType,required" query:"loginType,required"` +type GetAllCloudSettingRequest struct { } -func NewTestSettingRequest() *TestSettingRequest { - return &TestSettingRequest{} +func NewGetAllCloudSettingRequest() *GetAllCloudSettingRequest { + return &GetAllCloudSettingRequest{} } -func (p *TestSettingRequest) InitDefault() { +func (p *GetAllCloudSettingRequest) InitDefault() { } -func (p *TestSettingRequest) GetSetting() (v string) { - return p.Setting -} +var fieldIDToName_GetAllCloudSettingRequest = map[int16]string{} -func (p *TestSettingRequest) GetAccount() (v string) { - return p.Account -} +func (p *GetAllCloudSettingRequest) Read(iprot thrift.TProtocol) (err error) { -func (p *TestSettingRequest) GetVersion() (v string) { - return p.Version + 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 *TestSettingRequest) GetBeta() (v string) { - return p.Beta +func (p *GetAllCloudSettingRequest) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetAllCloudSettingRequest"); 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 *TestSettingRequest) GetPhone() (v string) { - return p.Phone +func (p *GetAllCloudSettingRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetAllCloudSettingRequest(%+v)", *p) + } -func (p *TestSettingRequest) GetIsLogin() (v string) { - return p.IsLogin +type GetAllCloudSettingResponse struct { } -func (p *TestSettingRequest) GetLoginType() (v string) { - return p.LoginType +func NewGetAllCloudSettingResponse() *GetAllCloudSettingResponse { + return &GetAllCloudSettingResponse{} } -var fieldIDToName_TestSettingRequest = map[int16]string{ - 1: "setting", - 2: "account", - 3: "version", - 4: "beta", - 5: "phone", - 6: "isLogin", - 7: "loginType", +func (p *GetAllCloudSettingResponse) InitDefault() { } -func (p *TestSettingRequest) Read(iprot thrift.TProtocol) (err error) { +var fieldIDToName_GetAllCloudSettingResponse = map[int16]string{} + +func (p *GetAllCloudSettingResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetSetting bool = false - var issetAccount bool = false - var issetVersion bool = false - var issetBeta bool = false - var issetPhone bool = false - var issetIsLogin bool = false - var issetLoginType bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -9995,68 +10041,121 @@ func (p *TestSettingRequest) Read(iprot thrift.TProtocol) (err error) { 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 + } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetSetting = 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 - } - issetAccount = 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 - } - issetVersion = 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 - } - issetBeta = 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 - } - issetPhone = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 6: + 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 *GetAllCloudSettingResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetAllCloudSettingResponse"); 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 *GetAllCloudSettingResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetAllCloudSettingResponse(%+v)", *p) + +} + +type SetAllCloudSettingRequest 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 NewSetAllCloudSettingRequest() *SetAllCloudSettingRequest { + return &SetAllCloudSettingRequest{} +} + +func (p *SetAllCloudSettingRequest) InitDefault() { +} + +func (p *SetAllCloudSettingRequest) GetPassword() (v string) { + return p.Password +} + +func (p *SetAllCloudSettingRequest) GetSetting() (v string) { + return p.Setting +} + +var fieldIDToName_SetAllCloudSettingRequest = map[int16]string{ + 1: "password", + 2: "setting", +} + +func (p *SetAllCloudSettingRequest) 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 + } + + 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.ReadField6(iprot); err != nil { + if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetIsLogin = true + issetPassword = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } - case 7: + case 2: if fieldTypeId == thrift.STRING { - if err = p.ReadField7(iprot); err != nil { + if err = p.ReadField2(iprot); err != nil { goto ReadFieldError } - issetLoginType = true + issetSetting = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -10073,47 +10172,22 @@ func (p *TestSettingRequest) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetSetting { + if !issetPassword { fieldId = 1 goto RequiredFieldNotSetError } - if !issetAccount { + if !issetSetting { fieldId = 2 goto RequiredFieldNotSetError } - - if !issetVersion { - fieldId = 3 - goto RequiredFieldNotSetError - } - - if !issetBeta { - fieldId = 4 - goto RequiredFieldNotSetError - } - - if !issetPhone { - fieldId = 5 - goto RequiredFieldNotSetError - } - - if !issetIsLogin { - fieldId = 6 - goto RequiredFieldNotSetError - } - - if !issetLoginType { - 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_TestSettingRequest[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SetAllCloudSettingRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -10122,65 +10196,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_TestSettingRequest[fieldId])) -} - -func (p *TestSettingRequest) ReadField1(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 *TestSettingRequest) ReadField2(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 *TestSettingRequest) ReadField3(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 *TestSettingRequest) ReadField4(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Beta = _field - return nil + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_SetAllCloudSettingRequest[fieldId])) } -func (p *TestSettingRequest) ReadField5(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 *TestSettingRequest) ReadField6(iprot thrift.TProtocol) error { +func (p *SetAllCloudSettingRequest) ReadField1(iprot thrift.TProtocol) error { var _field string if v, err := iprot.ReadString(); err != nil { @@ -10188,10 +10207,10 @@ func (p *TestSettingRequest) ReadField6(iprot thrift.TProtocol) error { } else { _field = v } - p.IsLogin = _field + p.Password = _field return nil } -func (p *TestSettingRequest) ReadField7(iprot thrift.TProtocol) error { +func (p *SetAllCloudSettingRequest) ReadField2(iprot thrift.TProtocol) error { var _field string if v, err := iprot.ReadString(); err != nil { @@ -10199,13 +10218,13 @@ func (p *TestSettingRequest) ReadField7(iprot thrift.TProtocol) error { } else { _field = v } - p.LoginType = _field + p.Setting = _field return nil } -func (p *TestSettingRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *SetAllCloudSettingRequest) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("TestSettingRequest"); err != nil { + if err = oprot.WriteStructBegin("SetAllCloudSettingRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -10217,26 +10236,6 @@ func (p *TestSettingRequest) 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 @@ -10255,11 +10254,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *TestSettingRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("setting", thrift.STRING, 1); err != nil { +func (p *SetAllCloudSettingRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("password", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(p.Setting); err != nil { + if err := oprot.WriteString(p.Password); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -10272,11 +10271,11 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *TestSettingRequest) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("account", thrift.STRING, 2); err != nil { +func (p *SetAllCloudSettingRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("setting", thrift.STRING, 2); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(p.Account); err != nil { + if err := oprot.WriteString(p.Setting); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -10289,112 +10288,27 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *TestSettingRequest) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("version", thrift.STRING, 3); 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 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *TestSettingRequest) writeField4(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("beta", thrift.STRING, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(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 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} - -func (p *TestSettingRequest) writeField5(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("phone", thrift.STRING, 5); 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 5 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) -} - -func (p *TestSettingRequest) writeField6(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("isLogin", thrift.STRING, 6); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(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 6 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) -} - -func (p *TestSettingRequest) writeField7(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("loginType", thrift.STRING, 7); 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 7 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) -} - -func (p *TestSettingRequest) String() string { +func (p *SetAllCloudSettingRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("TestSettingRequest(%+v)", *p) + return fmt.Sprintf("SetAllCloudSettingRequest(%+v)", *p) } -type TestSettingResponse struct { +type SetAllCloudSettingResponse struct { } -func NewTestSettingResponse() *TestSettingResponse { - return &TestSettingResponse{} +func NewSetAllCloudSettingResponse() *SetAllCloudSettingResponse { + return &SetAllCloudSettingResponse{} } -func (p *TestSettingResponse) InitDefault() { +func (p *SetAllCloudSettingResponse) InitDefault() { } -var fieldIDToName_TestSettingResponse = map[int16]string{} +var fieldIDToName_SetAllCloudSettingResponse = map[int16]string{} -func (p *TestSettingResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *SetAllCloudSettingResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -10436,8 +10350,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *TestSettingResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("TestSettingResponse"); err != nil { +func (p *SetAllCloudSettingResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("SetAllCloudSettingResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -10457,113 +10371,80 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *TestSettingResponse) String() string { +func (p *SetAllCloudSettingResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("TestSettingResponse(%+v)", *p) + return fmt.Sprintf("SetAllCloudSettingResponse(%+v)", *p) } -type DumpVisitRequest struct { +type TestSettingRequest struct { + Setting string `thrift:"setting,1,required" form:"setting,required" json:"setting,required" query:"setting,required"` + Account string `thrift:"account,2,required" form:"account,required" json:"account,required" query:"account,required"` + Version string `thrift:"version,3,required" form:"version,required" json:"version,required" query:"version,required"` + Beta string `thrift:"beta,4,required" form:"beta,required" json:"beta,required" query:"beta,required"` + Phone string `thrift:"phone,5,required" form:"phone,required" json:"phone,required" query:"phone,required"` + IsLogin string `thrift:"isLogin,6,required" form:"isLogin,required" json:"isLogin,required" query:"isLogin,required"` + LoginType string `thrift:"loginType,7,required" form:"loginType,required" json:"loginType,required" query:"loginType,required"` } -func NewDumpVisitRequest() *DumpVisitRequest { - return &DumpVisitRequest{} +func NewTestSettingRequest() *TestSettingRequest { + return &TestSettingRequest{} } -func (p *DumpVisitRequest) InitDefault() { +func (p *TestSettingRequest) InitDefault() { } -var fieldIDToName_DumpVisitRequest = map[int16]string{} - -func (p *DumpVisitRequest) 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 *TestSettingRequest) GetSetting() (v string) { + return p.Setting } -func (p *DumpVisitRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("DumpVisitRequest"); 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 *TestSettingRequest) GetAccount() (v string) { + return p.Account } -func (p *DumpVisitRequest) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("DumpVisitRequest(%+v)", *p) +func (p *TestSettingRequest) GetVersion() (v string) { + return p.Version +} +func (p *TestSettingRequest) GetBeta() (v string) { + return p.Beta } -type DumpVisitResponse struct { +func (p *TestSettingRequest) GetPhone() (v string) { + return p.Phone } -func NewDumpVisitResponse() *DumpVisitResponse { - return &DumpVisitResponse{} +func (p *TestSettingRequest) GetIsLogin() (v string) { + return p.IsLogin } -func (p *DumpVisitResponse) InitDefault() { +func (p *TestSettingRequest) GetLoginType() (v string) { + return p.LoginType } -var fieldIDToName_DumpVisitResponse = map[int16]string{} +var fieldIDToName_TestSettingRequest = map[int16]string{ + 1: "setting", + 2: "account", + 3: "version", + 4: "beta", + 5: "phone", + 6: "isLogin", + 7: "loginType", +} -func (p *DumpVisitResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *TestSettingRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 + var issetSetting bool = false + var issetAccount bool = false + var issetVersion bool = false + var issetBeta bool = false + var issetPhone bool = false + var issetIsLogin bool = false + var issetLoginType bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -10577,160 +10458,410 @@ func (p *DumpVisitResponse) Read(iprot thrift.TProtocol) (err error) { 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 *DumpVisitResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("DumpVisitResponse"); err != nil { - goto WriteStructBeginError - } - if p != nil { - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetSetting = 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 + } + issetAccount = 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 + } + issetVersion = 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 + } + issetBeta = 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 + } + issetPhone = 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 + } + issetIsLogin = 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 + } + issetLoginType = 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 = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError } - 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 *DumpVisitResponse) String() string { - if p == nil { - return "" + if !issetSetting { + fieldId = 1 + goto RequiredFieldNotSetError } - return fmt.Sprintf("DumpVisitResponse(%+v)", *p) - -} - -type FZUHelperCSSRequest struct { -} - -func NewFZUHelperCSSRequest() *FZUHelperCSSRequest { - return &FZUHelperCSSRequest{} -} - -func (p *FZUHelperCSSRequest) InitDefault() { -} - -var fieldIDToName_FZUHelperCSSRequest = map[int16]string{} -func (p *FZUHelperCSSRequest) Read(iprot thrift.TProtocol) (err error) { + if !issetAccount { + fieldId = 2 + goto RequiredFieldNotSetError + } - var fieldTypeId thrift.TType - var fieldId int16 + if !issetVersion { + fieldId = 3 + goto RequiredFieldNotSetError + } - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError + if !issetBeta { + fieldId = 4 + goto RequiredFieldNotSetError } - 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 !issetPhone { + fieldId = 5 + goto RequiredFieldNotSetError } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError + + if !issetIsLogin { + fieldId = 6 + goto RequiredFieldNotSetError } + if !issetLoginType { + 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) -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_TestSettingRequest[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_TestSettingRequest[fieldId])) } -func (p *FZUHelperCSSRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("FZUHelperCSSRequest"); 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 *TestSettingRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v } + p.Setting = _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 *TestSettingRequest) ReadField2(iprot thrift.TProtocol) error { -func (p *FZUHelperCSSRequest) String() string { - if p == nil { - return "" + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v } - return fmt.Sprintf("FZUHelperCSSRequest(%+v)", *p) - + p.Account = _field + return nil } +func (p *TestSettingRequest) ReadField3(iprot thrift.TProtocol) error { -type FZUHelperCSSResponse struct { + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Version = _field + return nil } +func (p *TestSettingRequest) ReadField4(iprot thrift.TProtocol) error { -func NewFZUHelperCSSResponse() *FZUHelperCSSResponse { - return &FZUHelperCSSResponse{} + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Beta = _field + return nil } +func (p *TestSettingRequest) ReadField5(iprot thrift.TProtocol) error { -func (p *FZUHelperCSSResponse) InitDefault() { + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Phone = _field + return nil } +func (p *TestSettingRequest) ReadField6(iprot thrift.TProtocol) error { -var fieldIDToName_FZUHelperCSSResponse = map[int16]string{} + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.IsLogin = _field + return nil +} +func (p *TestSettingRequest) ReadField7(iprot thrift.TProtocol) error { -func (p *FZUHelperCSSResponse) Read(iprot thrift.TProtocol) (err error) { + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.LoginType = _field + return nil +} - var fieldTypeId thrift.TType +func (p *TestSettingRequest) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - + if err = oprot.WriteStructBegin("TestSettingRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *TestSettingRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("setting", thrift.STRING, 1); 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 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *TestSettingRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("account", thrift.STRING, 2); 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: + 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 *TestSettingRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("version", thrift.STRING, 3); 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 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *TestSettingRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("beta", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(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 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *TestSettingRequest) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("phone", thrift.STRING, 5); 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 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *TestSettingRequest) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("isLogin", thrift.STRING, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(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 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *TestSettingRequest) writeField7(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("loginType", thrift.STRING, 7); 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 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} + +func (p *TestSettingRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TestSettingRequest(%+v)", *p) + +} + +type TestSettingResponse struct { +} + +func NewTestSettingResponse() *TestSettingResponse { + return &TestSettingResponse{} +} + +func (p *TestSettingResponse) InitDefault() { +} + +var fieldIDToName_TestSettingResponse = map[int16]string{} + +func (p *TestSettingResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError } @@ -10768,8 +10899,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FZUHelperCSSResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("FZUHelperCSSResponse"); err != nil { +func (p *TestSettingResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("TestSettingResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -10789,27 +10920,27 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FZUHelperCSSResponse) String() string { +func (p *TestSettingResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("FZUHelperCSSResponse(%+v)", *p) + return fmt.Sprintf("TestSettingResponse(%+v)", *p) } -type FZUHelperHTMLRequest struct { +type DumpVisitRequest struct { } -func NewFZUHelperHTMLRequest() *FZUHelperHTMLRequest { - return &FZUHelperHTMLRequest{} +func NewDumpVisitRequest() *DumpVisitRequest { + return &DumpVisitRequest{} } -func (p *FZUHelperHTMLRequest) InitDefault() { +func (p *DumpVisitRequest) InitDefault() { } -var fieldIDToName_FZUHelperHTMLRequest = map[int16]string{} +var fieldIDToName_DumpVisitRequest = map[int16]string{} -func (p *FZUHelperHTMLRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *DumpVisitRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -10851,8 +10982,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FZUHelperHTMLRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("FZUHelperHTMLRequest"); err != nil { +func (p *DumpVisitRequest) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("DumpVisitRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -10872,27 +11003,27 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FZUHelperHTMLRequest) String() string { +func (p *DumpVisitRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("FZUHelperHTMLRequest(%+v)", *p) + return fmt.Sprintf("DumpVisitRequest(%+v)", *p) } -type FZUHelperHTMLResponse struct { +type DumpVisitResponse struct { } -func NewFZUHelperHTMLResponse() *FZUHelperHTMLResponse { - return &FZUHelperHTMLResponse{} +func NewDumpVisitResponse() *DumpVisitResponse { + return &DumpVisitResponse{} } -func (p *FZUHelperHTMLResponse) InitDefault() { +func (p *DumpVisitResponse) InitDefault() { } -var fieldIDToName_FZUHelperHTMLResponse = map[int16]string{} +var fieldIDToName_DumpVisitResponse = map[int16]string{} -func (p *FZUHelperHTMLResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *DumpVisitResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -10934,8 +11065,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FZUHelperHTMLResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("FZUHelperHTMLResponse"); err != nil { +func (p *DumpVisitResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("DumpVisitResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -10955,27 +11086,27 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FZUHelperHTMLResponse) String() string { +func (p *DumpVisitResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("FZUHelperHTMLResponse(%+v)", *p) + return fmt.Sprintf("DumpVisitResponse(%+v)", *p) } -type UserAgreementHTMLRequest struct { +type FZUHelperCSSRequest struct { } -func NewUserAgreementHTMLRequest() *UserAgreementHTMLRequest { - return &UserAgreementHTMLRequest{} +func NewFZUHelperCSSRequest() *FZUHelperCSSRequest { + return &FZUHelperCSSRequest{} } -func (p *UserAgreementHTMLRequest) InitDefault() { +func (p *FZUHelperCSSRequest) InitDefault() { } -var fieldIDToName_UserAgreementHTMLRequest = map[int16]string{} +var fieldIDToName_FZUHelperCSSRequest = map[int16]string{} -func (p *UserAgreementHTMLRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *FZUHelperCSSRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -11017,8 +11148,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UserAgreementHTMLRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("UserAgreementHTMLRequest"); err != nil { +func (p *FZUHelperCSSRequest) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("FZUHelperCSSRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -11038,27 +11169,27 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UserAgreementHTMLRequest) String() string { +func (p *FZUHelperCSSRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("UserAgreementHTMLRequest(%+v)", *p) + return fmt.Sprintf("FZUHelperCSSRequest(%+v)", *p) } -type UserAgreementHTMLResponse struct { +type FZUHelperCSSResponse struct { } -func NewUserAgreementHTMLResponse() *UserAgreementHTMLResponse { - return &UserAgreementHTMLResponse{} +func NewFZUHelperCSSResponse() *FZUHelperCSSResponse { + return &FZUHelperCSSResponse{} } -func (p *UserAgreementHTMLResponse) InitDefault() { +func (p *FZUHelperCSSResponse) InitDefault() { } -var fieldIDToName_UserAgreementHTMLResponse = map[int16]string{} +var fieldIDToName_FZUHelperCSSResponse = map[int16]string{} -func (p *UserAgreementHTMLResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *FZUHelperCSSResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -11100,8 +11231,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UserAgreementHTMLResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("UserAgreementHTMLResponse"); err != nil { +func (p *FZUHelperCSSResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("FZUHelperCSSResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -11121,989 +11252,958 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UserAgreementHTMLResponse) String() string { +func (p *FZUHelperCSSResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("UserAgreementHTMLResponse(%+v)", *p) + return fmt.Sprintf("FZUHelperCSSResponse(%+v)", *p) } -type ClassRoomService interface { - GetEmptyClassrooms(ctx context.Context, request *EmptyClassroomRequest) (r *EmptyClassroomResponse, err error) +type FZUHelperHTMLRequest struct { } -type ClassRoomServiceClient struct { - c thrift.TClient +func NewFZUHelperHTMLRequest() *FZUHelperHTMLRequest { + return &FZUHelperHTMLRequest{} } -func NewClassRoomServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *ClassRoomServiceClient { - return &ClassRoomServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), - } +func (p *FZUHelperHTMLRequest) InitDefault() { } -func NewClassRoomServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *ClassRoomServiceClient { - return &ClassRoomServiceClient{ - c: thrift.NewTStandardClient(iprot, oprot), - } -} +var fieldIDToName_FZUHelperHTMLRequest = map[int16]string{} -func NewClassRoomServiceClient(c thrift.TClient) *ClassRoomServiceClient { - return &ClassRoomServiceClient{ - c: c, - } -} +func (p *FZUHelperHTMLRequest) Read(iprot thrift.TProtocol) (err error) { -func (p *ClassRoomServiceClient) Client_() thrift.TClient { - return p.c -} + var fieldTypeId thrift.TType + var fieldId int16 -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 + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } - return _result.GetSuccess(), nil -} -type UserService interface { - GetLoginData(ctx context.Context, request *GetLoginDataRequest) (r *GetLoginDataResponse, err error) + 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 + } - ValidateCode(ctx context.Context, request *ValidateCodeRequest) (r *ValidateCodeResponse, err error) + 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) - ValidateCodeForAndroid(ctx context.Context, request *ValidateCodeForAndroidRequest) (r *ValidateCodeForAndroidResponse, err error) +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -type UserServiceClient struct { - c thrift.TClient +func (p *FZUHelperHTMLRequest) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("FZUHelperHTMLRequest"); 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 NewUserServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *UserServiceClient { - return &UserServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), +func (p *FZUHelperHTMLRequest) String() string { + if p == nil { + return "" } + return fmt.Sprintf("FZUHelperHTMLRequest(%+v)", *p) + } -func NewUserServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *UserServiceClient { - return &UserServiceClient{ - c: thrift.NewTStandardClient(iprot, oprot), - } +type FZUHelperHTMLResponse struct { } -func NewUserServiceClient(c thrift.TClient) *UserServiceClient { - return &UserServiceClient{ - c: c, - } +func NewFZUHelperHTMLResponse() *FZUHelperHTMLResponse { + return &FZUHelperHTMLResponse{} } -func (p *UserServiceClient) Client_() thrift.TClient { - return p.c +func (p *FZUHelperHTMLResponse) InitDefault() { } -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 fieldIDToName_FZUHelperHTMLResponse = map[int16]string{} + +func (p *FZUHelperHTMLResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } - 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 + + 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 + } } - 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 = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError } - return _result.GetSuccess(), nil -} -type CourseService interface { - GetCourseList(ctx context.Context, req *CourseListRequest) (r *CourseListResponse, err error) -} + 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) -type CourseServiceClient struct { - c thrift.TClient +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func NewCourseServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *CourseServiceClient { - return &CourseServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), +func (p *FZUHelperHTMLResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("FZUHelperHTMLResponse"); 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 NewCourseServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *CourseServiceClient { - return &CourseServiceClient{ - c: thrift.NewTStandardClient(iprot, oprot), +func (p *FZUHelperHTMLResponse) String() string { + if p == nil { + return "" } + return fmt.Sprintf("FZUHelperHTMLResponse(%+v)", *p) + } -func NewCourseServiceClient(c thrift.TClient) *CourseServiceClient { - return &CourseServiceClient{ - c: c, - } +type UserAgreementHTMLRequest struct { } -func (p *CourseServiceClient) Client_() thrift.TClient { - return p.c +func NewUserAgreementHTMLRequest() *UserAgreementHTMLRequest { + return &UserAgreementHTMLRequest{} } -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 *UserAgreementHTMLRequest) InitDefault() { } -type LaunchScreenService interface { - CreateImage(ctx context.Context, req *CreateImageRequest) (r *CreateImageResponse, err error) +var fieldIDToName_UserAgreementHTMLRequest = map[int16]string{} - GetImage(ctx context.Context, req *GetImageRequest) (r *GetImageResponse, err error) +func (p *UserAgreementHTMLRequest) Read(iprot thrift.TProtocol) (err error) { - ChangeImageProperty(ctx context.Context, req *ChangeImagePropertyRequest) (r *ChangeImagePropertyResponse, err error) + var fieldTypeId thrift.TType + var fieldId int16 - ChangeImage(ctx context.Context, req *ChangeImageRequest) (r *ChangeImageResponse, err error) + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } - DeleteImage(ctx context.Context, req *DeleteImageRequest) (r *DeleteImageResponse, err error) + 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 + } - MobileGetImage(ctx context.Context, req *MobileGetImageRequest) (r *MobileGetImageResponse, err error) + 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) - AddImagePointTime(ctx context.Context, req *AddImagePointTimeRequest) (r *AddImagePointTimeResponse, err error) +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -type LaunchScreenServiceClient struct { - c thrift.TClient +func (p *UserAgreementHTMLRequest) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("UserAgreementHTMLRequest"); 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 NewLaunchScreenServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *LaunchScreenServiceClient { - return &LaunchScreenServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), +func (p *UserAgreementHTMLRequest) String() string { + if p == nil { + return "" } + return fmt.Sprintf("UserAgreementHTMLRequest(%+v)", *p) + } -func NewLaunchScreenServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *LaunchScreenServiceClient { - return &LaunchScreenServiceClient{ - c: thrift.NewTStandardClient(iprot, oprot), - } +type UserAgreementHTMLResponse struct { } -func NewLaunchScreenServiceClient(c thrift.TClient) *LaunchScreenServiceClient { - return &LaunchScreenServiceClient{ - c: c, - } +func NewUserAgreementHTMLResponse() *UserAgreementHTMLResponse { + return &UserAgreementHTMLResponse{} } -func (p *LaunchScreenServiceClient) Client_() thrift.TClient { - return p.c +func (p *UserAgreementHTMLResponse) InitDefault() { } -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 +var fieldIDToName_UserAgreementHTMLResponse = map[int16]string{} + +func (p *UserAgreementHTMLResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } - 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 + + 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 + } } - return _result.GetSuccess(), nil -} -func (p *LaunchScreenServiceClient) ChangeImageProperty(ctx context.Context, req *ChangeImagePropertyRequest) (r *ChangeImagePropertyResponse, err error) { - var _args LaunchScreenServiceChangeImagePropertyArgs - _args.Req = req - var _result LaunchScreenServiceChangeImagePropertyResult - if err = p.Client_().Call(ctx, "ChangeImageProperty", &_args, &_result); err != nil { - return + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError } - return _result.GetSuccess(), nil + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +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 *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 *UserAgreementHTMLResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("UserAgreementHTMLResponse"); 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) +func (p *UserAgreementHTMLResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UserAgreementHTMLResponse(%+v)", *p) - GetDownloadUrl(ctx context.Context, req *GetDownloadUrlRequest) (r *GetDownloadUrlResponse, err error) } -type PaperServiceClient struct { +type ClassRoomService interface { + GetEmptyClassrooms(ctx context.Context, request *EmptyClassroomRequest) (r *EmptyClassroomResponse, err error) +} + +type ClassRoomServiceClient struct { c thrift.TClient } -func NewPaperServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *PaperServiceClient { - return &PaperServiceClient{ +func NewClassRoomServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *ClassRoomServiceClient { + return &ClassRoomServiceClient{ c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), } } -func NewPaperServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *PaperServiceClient { - return &PaperServiceClient{ +func NewClassRoomServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *ClassRoomServiceClient { + return &ClassRoomServiceClient{ c: thrift.NewTStandardClient(iprot, oprot), } } -func NewPaperServiceClient(c thrift.TClient) *PaperServiceClient { - return &PaperServiceClient{ +func NewClassRoomServiceClient(c thrift.TClient) *ClassRoomServiceClient { + return &ClassRoomServiceClient{ c: c, } } -func (p *PaperServiceClient) Client_() thrift.TClient { +func (p *ClassRoomServiceClient) 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 { +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 } -type AcademicService interface { - GetScores(ctx context.Context, req *GetScoresRequest) (r *GetScoresResponse, err error) - - GetGPA(ctx context.Context, req *GetGPARequest) (r *GetGPAResponse, err error) +type UserService interface { + GetLoginData(ctx context.Context, request *GetLoginDataRequest) (r *GetLoginDataResponse, err error) - GetCredit(ctx context.Context, req *GetCreditRequest) (r *GetCreditResponse, err error) + ValidateCode(ctx context.Context, request *ValidateCodeRequest) (r *ValidateCodeResponse, err error) - GetUnifiedExam(ctx context.Context, req *GetUnifiedExamRequest) (r *GetUnifiedExamResponse, err error) + ValidateCodeForAndroid(ctx context.Context, request *ValidateCodeForAndroidRequest) (r *ValidateCodeForAndroidResponse, err error) } -type AcademicServiceClient struct { +type UserServiceClient 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 NewUserServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *UserServiceClient { + return &UserServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), } } -func NewAcademicServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *AcademicServiceClient { - return &AcademicServiceClient{ +func NewUserServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *UserServiceClient { + return &UserServiceClient{ c: thrift.NewTStandardClient(iprot, oprot), } } -func NewAcademicServiceClient(c thrift.TClient) *AcademicServiceClient { - return &AcademicServiceClient{ +func NewUserServiceClient(c thrift.TClient) *UserServiceClient { + return &UserServiceClient{ c: c, } } -func (p *AcademicServiceClient) Client_() thrift.TClient { +func (p *UserServiceClient) Client_() thrift.TClient { return p.c } -func (p *AcademicServiceClient) GetScores(ctx context.Context, req *GetScoresRequest) (r *GetScoresResponse, err error) { - var _args AcademicServiceGetScoresArgs - _args.Req = req - var _result AcademicServiceGetScoresResult - if err = p.Client_().Call(ctx, "GetScores", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} -func (p *AcademicServiceClient) GetGPA(ctx context.Context, req *GetGPARequest) (r *GetGPAResponse, err error) { - var _args AcademicServiceGetGPAArgs - _args.Req = req - var _result AcademicServiceGetGPAResult - if err = p.Client_().Call(ctx, "GetGPA", &_args, &_result); err != nil { +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 *AcademicServiceClient) GetCredit(ctx context.Context, req *GetCreditRequest) (r *GetCreditResponse, err error) { - var _args AcademicServiceGetCreditArgs - _args.Req = req - var _result AcademicServiceGetCreditResult - if err = p.Client_().Call(ctx, "GetCredit", &_args, &_result); err != nil { +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 *AcademicServiceClient) GetUnifiedExam(ctx context.Context, req *GetUnifiedExamRequest) (r *GetUnifiedExamResponse, err error) { - var _args AcademicServiceGetUnifiedExamArgs - _args.Req = req - var _result AcademicServiceGetUnifiedExamResult - if err = p.Client_().Call(ctx, "GetUnifiedExam", &_args, &_result); err != nil { +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 } -type UrlService interface { - APILogin(ctx context.Context, req *APILoginRequest) (r *APILoginResponse, err error) - - UploadVersionInfo(ctx context.Context, req *UploadVersionInfoRequest) (r *UploadVersionInfoResponse, err error) +type CourseService interface { + GetCourseList(ctx context.Context, req *CourseListRequest) (r *CourseListResponse, err error) +} - GetUploadParams(ctx context.Context, req *GetUploadParamsRequest) (r *GetUploadParamsResponse, err error) +type CourseServiceClient struct { + c thrift.TClient +} - GetDownloadRelease(ctx context.Context, req *GetDownloadReleaseRequest) (r *GetDownloadReleaseResponse, err error) +func NewCourseServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *CourseServiceClient { + return &CourseServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} - GetDownloadBeta(ctx context.Context, req *GetDownloadBetaRequest) (r *GetDownloadBetaResponse, err error) +func NewCourseServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *CourseServiceClient { + return &CourseServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} - GetReleaseVersion(ctx context.Context, req *GetReleaseVersionRequest) (r *GetReleaseVersionResponse, err error) +func NewCourseServiceClient(c thrift.TClient) *CourseServiceClient { + return &CourseServiceClient{ + c: c, + } +} - GetBetaVersion(ctx context.Context, req *GetBetaVersionRequest) (r *GetBetaVersionResponse, err error) +func (p *CourseServiceClient) Client_() thrift.TClient { + return p.c +} - GetCloudSetting(ctx context.Context, req *GetCloudSettingRequest) (r *GetCloudSettingResponse, err error) +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 +} - GetAllCloudSetting(ctx context.Context, req *GetAllCloudSettingRequest) (r *GetAllCloudSettingResponse, err error) +type LaunchScreenService interface { + CreateImage(ctx context.Context, req *CreateImageRequest) (r *CreateImageResponse, err error) - SetAllCloudSetting(ctx context.Context, req *SetAllCloudSettingRequest) (r *SetAllCloudSettingResponse, err error) + GetImage(ctx context.Context, req *GetImageRequest) (r *GetImageResponse, err error) - TestSetting(ctx context.Context, req *TestSettingRequest) (r *TestSettingResponse, err error) + ChangeImageProperty(ctx context.Context, req *ChangeImagePropertyRequest) (r *ChangeImagePropertyResponse, err error) - DumpVisit(ctx context.Context, req *DumpVisitRequest) (r *DumpVisitResponse, err error) + ChangeImage(ctx context.Context, req *ChangeImageRequest) (r *ChangeImageResponse, err error) - FZUHelperCSS(ctx context.Context, req *FZUHelperCSSRequest) (r *FZUHelperCSSResponse, err error) + DeleteImage(ctx context.Context, req *DeleteImageRequest) (r *DeleteImageResponse, err error) - FZUHelperHTML(ctx context.Context, req *FZUHelperHTMLRequest) (r *FZUHelperHTMLResponse, err error) + MobileGetImage(ctx context.Context, req *MobileGetImageRequest) (r *MobileGetImageResponse, err error) - UserAgreementHTML(ctx context.Context, req *UserAgreementHTMLRequest) (r *UserAgreementHTMLResponse, err error) + AddImagePointTime(ctx context.Context, req *AddImagePointTimeRequest) (r *AddImagePointTimeResponse, err error) } -type UrlServiceClient struct { +type LaunchScreenServiceClient struct { c thrift.TClient } -func NewUrlServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *UrlServiceClient { - return &UrlServiceClient{ +func NewLaunchScreenServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *LaunchScreenServiceClient { + return &LaunchScreenServiceClient{ c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), } } -func NewUrlServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *UrlServiceClient { - return &UrlServiceClient{ +func NewLaunchScreenServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *LaunchScreenServiceClient { + return &LaunchScreenServiceClient{ c: thrift.NewTStandardClient(iprot, oprot), } } -func NewUrlServiceClient(c thrift.TClient) *UrlServiceClient { - return &UrlServiceClient{ +func NewLaunchScreenServiceClient(c thrift.TClient) *LaunchScreenServiceClient { + return &LaunchScreenServiceClient{ c: c, } } -func (p *UrlServiceClient) Client_() thrift.TClient { +func (p *LaunchScreenServiceClient) Client_() thrift.TClient { return p.c } -func (p *UrlServiceClient) APILogin(ctx context.Context, req *APILoginRequest) (r *APILoginResponse, err error) { - var _args UrlServiceAPILoginArgs +func (p *LaunchScreenServiceClient) CreateImage(ctx context.Context, req *CreateImageRequest) (r *CreateImageResponse, err error) { + var _args LaunchScreenServiceCreateImageArgs _args.Req = req - var _result UrlServiceAPILoginResult - if err = p.Client_().Call(ctx, "APILogin", &_args, &_result); err != nil { + var _result LaunchScreenServiceCreateImageResult + if err = p.Client_().Call(ctx, "CreateImage", &_args, &_result); err != nil { return } return _result.GetSuccess(), nil } -func (p *UrlServiceClient) UploadVersionInfo(ctx context.Context, req *UploadVersionInfoRequest) (r *UploadVersionInfoResponse, err error) { - var _args UrlServiceUploadVersionInfoArgs +func (p *LaunchScreenServiceClient) GetImage(ctx context.Context, req *GetImageRequest) (r *GetImageResponse, err error) { + var _args LaunchScreenServiceGetImageArgs _args.Req = req - var _result UrlServiceUploadVersionInfoResult - if err = p.Client_().Call(ctx, "UploadVersionInfo", &_args, &_result); err != nil { + var _result LaunchScreenServiceGetImageResult + if err = p.Client_().Call(ctx, "GetImage", &_args, &_result); err != nil { return } return _result.GetSuccess(), nil } -func (p *UrlServiceClient) GetUploadParams(ctx context.Context, req *GetUploadParamsRequest) (r *GetUploadParamsResponse, err error) { - var _args UrlServiceGetUploadParamsArgs +func (p *LaunchScreenServiceClient) ChangeImageProperty(ctx context.Context, req *ChangeImagePropertyRequest) (r *ChangeImagePropertyResponse, err error) { + var _args LaunchScreenServiceChangeImagePropertyArgs _args.Req = req - var _result UrlServiceGetUploadParamsResult - if err = p.Client_().Call(ctx, "GetUploadParams", &_args, &_result); err != nil { + var _result LaunchScreenServiceChangeImagePropertyResult + if err = p.Client_().Call(ctx, "ChangeImageProperty", &_args, &_result); err != nil { return } return _result.GetSuccess(), nil } -func (p *UrlServiceClient) GetDownloadRelease(ctx context.Context, req *GetDownloadReleaseRequest) (r *GetDownloadReleaseResponse, err error) { - var _args UrlServiceGetDownloadReleaseArgs +func (p *LaunchScreenServiceClient) ChangeImage(ctx context.Context, req *ChangeImageRequest) (r *ChangeImageResponse, err error) { + var _args LaunchScreenServiceChangeImageArgs _args.Req = req - var _result UrlServiceGetDownloadReleaseResult - if err = p.Client_().Call(ctx, "GetDownloadRelease", &_args, &_result); err != nil { + var _result LaunchScreenServiceChangeImageResult + if err = p.Client_().Call(ctx, "ChangeImage", &_args, &_result); err != nil { return } return _result.GetSuccess(), nil } -func (p *UrlServiceClient) GetDownloadBeta(ctx context.Context, req *GetDownloadBetaRequest) (r *GetDownloadBetaResponse, err error) { - var _args UrlServiceGetDownloadBetaArgs +func (p *LaunchScreenServiceClient) DeleteImage(ctx context.Context, req *DeleteImageRequest) (r *DeleteImageResponse, err error) { + var _args LaunchScreenServiceDeleteImageArgs _args.Req = req - var _result UrlServiceGetDownloadBetaResult - if err = p.Client_().Call(ctx, "GetDownloadBeta", &_args, &_result); err != nil { + var _result LaunchScreenServiceDeleteImageResult + if err = p.Client_().Call(ctx, "DeleteImage", &_args, &_result); err != nil { return } return _result.GetSuccess(), nil } -func (p *UrlServiceClient) GetReleaseVersion(ctx context.Context, req *GetReleaseVersionRequest) (r *GetReleaseVersionResponse, err error) { - var _args UrlServiceGetReleaseVersionArgs +func (p *LaunchScreenServiceClient) MobileGetImage(ctx context.Context, req *MobileGetImageRequest) (r *MobileGetImageResponse, err error) { + var _args LaunchScreenServiceMobileGetImageArgs _args.Req = req - var _result UrlServiceGetReleaseVersionResult - if err = p.Client_().Call(ctx, "GetReleaseVersion", &_args, &_result); err != nil { + var _result LaunchScreenServiceMobileGetImageResult + if err = p.Client_().Call(ctx, "MobileGetImage", &_args, &_result); err != nil { return } return _result.GetSuccess(), nil } -func (p *UrlServiceClient) GetBetaVersion(ctx context.Context, req *GetBetaVersionRequest) (r *GetBetaVersionResponse, err error) { - var _args UrlServiceGetBetaVersionArgs +func (p *LaunchScreenServiceClient) AddImagePointTime(ctx context.Context, req *AddImagePointTimeRequest) (r *AddImagePointTimeResponse, err error) { + var _args LaunchScreenServiceAddImagePointTimeArgs _args.Req = req - var _result UrlServiceGetBetaVersionResult - if err = p.Client_().Call(ctx, "GetBetaVersion", &_args, &_result); err != nil { + var _result LaunchScreenServiceAddImagePointTimeResult + if err = p.Client_().Call(ctx, "AddImagePointTime", &_args, &_result); err != nil { return } return _result.GetSuccess(), nil } -func (p *UrlServiceClient) GetCloudSetting(ctx context.Context, req *GetCloudSettingRequest) (r *GetCloudSettingResponse, err error) { - var _args UrlServiceGetCloudSettingArgs - _args.Req = req - var _result UrlServiceGetCloudSettingResult - if err = p.Client_().Call(ctx, "GetCloudSetting", &_args, &_result); err != nil { - return + +type PaperService interface { + ListDirFiles(ctx context.Context, req *ListDirFilesRequest) (r *ListDirFilesResponse, err error) + + GetDownloadUrl(ctx context.Context, req *GetDownloadUrlRequest) (r *GetDownloadUrlResponse, err error) + // 兼容安卓 + ListDirFilesForAndroid(ctx context.Context, req *ListDirFilesForAndroidRequest) (r *ListDirFilesForAndroidResponse, err error) + + GetDownloadUrlForAndroid(ctx context.Context, req *GetDownloadUrlForAndroidRequest) (r *GetDownloadUrlForAndroidResponse, err error) +} + +type PaperServiceClient struct { + c thrift.TClient +} + +func NewPaperServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *PaperServiceClient { + return &PaperServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), } - return _result.GetSuccess(), nil } -func (p *UrlServiceClient) GetAllCloudSetting(ctx context.Context, req *GetAllCloudSettingRequest) (r *GetAllCloudSettingResponse, err error) { - var _args UrlServiceGetAllCloudSettingArgs - _args.Req = req - var _result UrlServiceGetAllCloudSettingResult - if err = p.Client_().Call(ctx, "GetAllCloudSetting", &_args, &_result); err != nil { - return + +func NewPaperServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *PaperServiceClient { + return &PaperServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), } - return _result.GetSuccess(), nil } -func (p *UrlServiceClient) SetAllCloudSetting(ctx context.Context, req *SetAllCloudSettingRequest) (r *SetAllCloudSettingResponse, err error) { - var _args UrlServiceSetAllCloudSettingArgs - _args.Req = req - var _result UrlServiceSetAllCloudSettingResult - if err = p.Client_().Call(ctx, "SetAllCloudSetting", &_args, &_result); err != nil { - return + +func NewPaperServiceClient(c thrift.TClient) *PaperServiceClient { + return &PaperServiceClient{ + c: c, } - return _result.GetSuccess(), nil } -func (p *UrlServiceClient) TestSetting(ctx context.Context, req *TestSettingRequest) (r *TestSettingResponse, err error) { - var _args UrlServiceTestSettingArgs + +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 UrlServiceTestSettingResult - if err = p.Client_().Call(ctx, "TestSetting", &_args, &_result); err != nil { + var _result PaperServiceListDirFilesResult + if err = p.Client_().Call(ctx, "ListDirFiles", &_args, &_result); err != nil { return } return _result.GetSuccess(), nil } -func (p *UrlServiceClient) DumpVisit(ctx context.Context, req *DumpVisitRequest) (r *DumpVisitResponse, err error) { - var _args UrlServiceDumpVisitArgs +func (p *PaperServiceClient) GetDownloadUrl(ctx context.Context, req *GetDownloadUrlRequest) (r *GetDownloadUrlResponse, err error) { + var _args PaperServiceGetDownloadUrlArgs _args.Req = req - var _result UrlServiceDumpVisitResult - if err = p.Client_().Call(ctx, "DumpVisit", &_args, &_result); err != nil { + var _result PaperServiceGetDownloadUrlResult + if err = p.Client_().Call(ctx, "GetDownloadUrl", &_args, &_result); err != nil { return } return _result.GetSuccess(), nil } -func (p *UrlServiceClient) FZUHelperCSS(ctx context.Context, req *FZUHelperCSSRequest) (r *FZUHelperCSSResponse, err error) { - var _args UrlServiceFZUHelperCSSArgs +func (p *PaperServiceClient) ListDirFilesForAndroid(ctx context.Context, req *ListDirFilesForAndroidRequest) (r *ListDirFilesForAndroidResponse, err error) { + var _args PaperServiceListDirFilesForAndroidArgs _args.Req = req - var _result UrlServiceFZUHelperCSSResult - if err = p.Client_().Call(ctx, "FZUHelperCSS", &_args, &_result); err != nil { + var _result PaperServiceListDirFilesForAndroidResult + if err = p.Client_().Call(ctx, "ListDirFilesForAndroid", &_args, &_result); err != nil { return } return _result.GetSuccess(), nil } -func (p *UrlServiceClient) FZUHelperHTML(ctx context.Context, req *FZUHelperHTMLRequest) (r *FZUHelperHTMLResponse, err error) { - var _args UrlServiceFZUHelperHTMLArgs +func (p *PaperServiceClient) GetDownloadUrlForAndroid(ctx context.Context, req *GetDownloadUrlForAndroidRequest) (r *GetDownloadUrlForAndroidResponse, err error) { + var _args PaperServiceGetDownloadUrlForAndroidArgs _args.Req = req - var _result UrlServiceFZUHelperHTMLResult - if err = p.Client_().Call(ctx, "FZUHelperHTML", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} -func (p *UrlServiceClient) UserAgreementHTML(ctx context.Context, req *UserAgreementHTMLRequest) (r *UserAgreementHTMLResponse, err error) { - var _args UrlServiceUserAgreementHTMLArgs - _args.Req = req - var _result UrlServiceUserAgreementHTMLResult - if err = p.Client_().Call(ctx, "UserAgreementHTML", &_args, &_result); err != nil { + var _result PaperServiceGetDownloadUrlForAndroidResult + if err = p.Client_().Call(ctx, "GetDownloadUrlForAndroid", &_args, &_result); err != nil { return } return _result.GetSuccess(), nil } -type ClassRoomServiceProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler ClassRoomService -} +type AcademicService interface { + GetScores(ctx context.Context, req *GetScoresRequest) (r *GetScoresResponse, err error) -func (p *ClassRoomServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor -} + GetGPA(ctx context.Context, req *GetGPARequest) (r *GetGPAResponse, err error) -func (p *ClassRoomServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok -} + GetCredit(ctx context.Context, req *GetCreditRequest) (r *GetCreditResponse, err error) -func (p *ClassRoomServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap + GetUnifiedExam(ctx context.Context, req *GetUnifiedExamRequest) (r *GetUnifiedExamResponse, err error) } -func NewClassRoomServiceProcessor(handler ClassRoomService) *ClassRoomServiceProcessor { - self := &ClassRoomServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} - self.AddToProcessorMap("GetEmptyClassrooms", &classRoomServiceProcessorGetEmptyClassrooms{handler: handler}) - return self +type AcademicServiceClient struct { + c thrift.TClient } -func (p *ClassRoomServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - name, _, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return false, err - } - if processor, ok := p.GetProcessorFunction(name); ok { - return processor.Process(ctx, seqId, iprot, oprot) + +func NewAcademicServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *AcademicServiceClient { + return &AcademicServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), } - iprot.Skip(thrift.STRUCT) - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) - oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, x } -type classRoomServiceProcessorGetEmptyClassrooms struct { - handler ClassRoomService +func NewAcademicServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *AcademicServiceClient { + return &AcademicServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } } -func (p *classRoomServiceProcessorGetEmptyClassrooms) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := ClassRoomServiceGetEmptyClassroomsArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetEmptyClassrooms", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func NewAcademicServiceClient(c thrift.TClient) *AcademicServiceClient { + return &AcademicServiceClient{ + c: c, } +} - iprot.ReadMessageEnd() - var err2 error - result := ClassRoomServiceGetEmptyClassroomsResult{} - var retval *EmptyClassroomResponse - if retval, err2 = p.handler.GetEmptyClassrooms(ctx, args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetEmptyClassrooms: "+err2.Error()) - oprot.WriteMessageBegin("GetEmptyClassrooms", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("GetEmptyClassrooms", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 +func (p *AcademicServiceClient) Client_() thrift.TClient { + return p.c +} + +func (p *AcademicServiceClient) GetScores(ctx context.Context, req *GetScoresRequest) (r *GetScoresResponse, err error) { + var _args AcademicServiceGetScoresArgs + _args.Req = req + var _result AcademicServiceGetScoresResult + if err = p.Client_().Call(ctx, "GetScores", &_args, &_result); err != nil { + return } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + return _result.GetSuccess(), nil +} +func (p *AcademicServiceClient) GetGPA(ctx context.Context, req *GetGPARequest) (r *GetGPAResponse, err error) { + var _args AcademicServiceGetGPAArgs + _args.Req = req + var _result AcademicServiceGetGPAResult + if err = p.Client_().Call(ctx, "GetGPA", &_args, &_result); err != nil { + return } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + return _result.GetSuccess(), nil +} +func (p *AcademicServiceClient) GetCredit(ctx context.Context, req *GetCreditRequest) (r *GetCreditResponse, err error) { + var _args AcademicServiceGetCreditArgs + _args.Req = req + var _result AcademicServiceGetCreditResult + if err = p.Client_().Call(ctx, "GetCredit", &_args, &_result); err != nil { + return } - if err != nil { + return _result.GetSuccess(), nil +} +func (p *AcademicServiceClient) GetUnifiedExam(ctx context.Context, req *GetUnifiedExamRequest) (r *GetUnifiedExamResponse, err error) { + var _args AcademicServiceGetUnifiedExamArgs + _args.Req = req + var _result AcademicServiceGetUnifiedExamResult + if err = p.Client_().Call(ctx, "GetUnifiedExam", &_args, &_result); err != nil { return } - return true, err + return _result.GetSuccess(), nil } -type ClassRoomServiceGetEmptyClassroomsArgs struct { - Request *EmptyClassroomRequest `thrift:"request,1"` -} +type UrlService interface { + APILogin(ctx context.Context, req *APILoginRequest) (r *APILoginResponse, err error) -func NewClassRoomServiceGetEmptyClassroomsArgs() *ClassRoomServiceGetEmptyClassroomsArgs { - return &ClassRoomServiceGetEmptyClassroomsArgs{} -} + UploadVersionInfo(ctx context.Context, req *UploadVersionInfoRequest) (r *UploadVersionInfoResponse, err error) -func (p *ClassRoomServiceGetEmptyClassroomsArgs) InitDefault() { -} + GetUploadParams(ctx context.Context, req *GetUploadParamsRequest) (r *GetUploadParamsResponse, err error) -var ClassRoomServiceGetEmptyClassroomsArgs_Request_DEFAULT *EmptyClassroomRequest + GetDownloadRelease(ctx context.Context, req *GetDownloadReleaseRequest) (r *GetDownloadReleaseResponse, err error) -func (p *ClassRoomServiceGetEmptyClassroomsArgs) GetRequest() (v *EmptyClassroomRequest) { - if !p.IsSetRequest() { - return ClassRoomServiceGetEmptyClassroomsArgs_Request_DEFAULT - } - return p.Request -} + GetDownloadBeta(ctx context.Context, req *GetDownloadBetaRequest) (r *GetDownloadBetaResponse, err error) -var fieldIDToName_ClassRoomServiceGetEmptyClassroomsArgs = map[int16]string{ - 1: "request", -} + GetReleaseVersion(ctx context.Context, req *GetReleaseVersionRequest) (r *GetReleaseVersionResponse, err error) -func (p *ClassRoomServiceGetEmptyClassroomsArgs) IsSetRequest() bool { - return p.Request != nil -} + GetBetaVersion(ctx context.Context, req *GetBetaVersionRequest) (r *GetBetaVersionResponse, err error) -func (p *ClassRoomServiceGetEmptyClassroomsArgs) Read(iprot thrift.TProtocol) (err error) { + GetCloudSetting(ctx context.Context, req *GetCloudSettingRequest) (r *GetCloudSettingResponse, err error) - var fieldTypeId thrift.TType - var fieldId int16 + GetAllCloudSetting(ctx context.Context, req *GetAllCloudSettingRequest) (r *GetAllCloudSettingResponse, err error) - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } + SetAllCloudSetting(ctx context.Context, req *SetAllCloudSettingRequest) (r *SetAllCloudSettingResponse, err error) - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } + TestSetting(ctx context.Context, req *TestSettingRequest) (r *TestSettingResponse, 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 - } - 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 - } + DumpVisit(ctx context.Context, req *DumpVisitRequest) (r *DumpVisitResponse, err error) - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ClassRoomServiceGetEmptyClassroomsArgs[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + FZUHelperCSS(ctx context.Context, req *FZUHelperCSSRequest) (r *FZUHelperCSSResponse, err error) -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + FZUHelperHTML(ctx context.Context, req *FZUHelperHTMLRequest) (r *FZUHelperHTMLResponse, err error) + + UserAgreementHTML(ctx context.Context, req *UserAgreementHTMLRequest) (r *UserAgreementHTMLResponse, err error) } -func (p *ClassRoomServiceGetEmptyClassroomsArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewEmptyClassroomRequest() - if err := _field.Read(iprot); err != nil { - return err - } - p.Request = _field - return nil +type UrlServiceClient struct { + c thrift.TClient } -func (p *ClassRoomServiceGetEmptyClassroomsArgs) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("GetEmptyClassrooms_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 +func NewUrlServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *UrlServiceClient { + return &UrlServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), } - 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 *ClassRoomServiceGetEmptyClassroomsArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.Request.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError +func NewUrlServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *UrlServiceClient { + return &UrlServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *ClassRoomServiceGetEmptyClassroomsArgs) String() string { - if p == nil { - return "" +func NewUrlServiceClient(c thrift.TClient) *UrlServiceClient { + return &UrlServiceClient{ + c: c, } - return fmt.Sprintf("ClassRoomServiceGetEmptyClassroomsArgs(%+v)", *p) - -} - -type ClassRoomServiceGetEmptyClassroomsResult struct { - Success *EmptyClassroomResponse `thrift:"success,0,optional"` } -func NewClassRoomServiceGetEmptyClassroomsResult() *ClassRoomServiceGetEmptyClassroomsResult { - return &ClassRoomServiceGetEmptyClassroomsResult{} +func (p *UrlServiceClient) Client_() thrift.TClient { + return p.c } -func (p *ClassRoomServiceGetEmptyClassroomsResult) InitDefault() { +func (p *UrlServiceClient) APILogin(ctx context.Context, req *APILoginRequest) (r *APILoginResponse, err error) { + var _args UrlServiceAPILoginArgs + _args.Req = req + var _result UrlServiceAPILoginResult + if err = p.Client_().Call(ctx, "APILogin", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil } - -var ClassRoomServiceGetEmptyClassroomsResult_Success_DEFAULT *EmptyClassroomResponse - -func (p *ClassRoomServiceGetEmptyClassroomsResult) GetSuccess() (v *EmptyClassroomResponse) { - if !p.IsSetSuccess() { - return ClassRoomServiceGetEmptyClassroomsResult_Success_DEFAULT +func (p *UrlServiceClient) UploadVersionInfo(ctx context.Context, req *UploadVersionInfoRequest) (r *UploadVersionInfoResponse, err error) { + var _args UrlServiceUploadVersionInfoArgs + _args.Req = req + var _result UrlServiceUploadVersionInfoResult + if err = p.Client_().Call(ctx, "UploadVersionInfo", &_args, &_result); err != nil { + return } - return p.Success + return _result.GetSuccess(), nil } - -var fieldIDToName_ClassRoomServiceGetEmptyClassroomsResult = map[int16]string{ - 0: "success", +func (p *UrlServiceClient) GetUploadParams(ctx context.Context, req *GetUploadParamsRequest) (r *GetUploadParamsResponse, err error) { + var _args UrlServiceGetUploadParamsArgs + _args.Req = req + var _result UrlServiceGetUploadParamsResult + if err = p.Client_().Call(ctx, "GetUploadParams", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil } - -func (p *ClassRoomServiceGetEmptyClassroomsResult) IsSetSuccess() bool { - return p.Success != nil +func (p *UrlServiceClient) GetDownloadRelease(ctx context.Context, req *GetDownloadReleaseRequest) (r *GetDownloadReleaseResponse, err error) { + var _args UrlServiceGetDownloadReleaseArgs + _args.Req = req + var _result UrlServiceGetDownloadReleaseResult + if err = p.Client_().Call(ctx, "GetDownloadRelease", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil } - -func (p *ClassRoomServiceGetEmptyClassroomsResult) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError +func (p *UrlServiceClient) GetDownloadBeta(ctx context.Context, req *GetDownloadBetaRequest) (r *GetDownloadBetaResponse, err error) { + var _args UrlServiceGetDownloadBetaArgs + _args.Req = req + var _result UrlServiceGetDownloadBetaResult + if err = p.Client_().Call(ctx, "GetDownloadBeta", &_args, &_result); err != nil { + return } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField0(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } + return _result.GetSuccess(), nil +} +func (p *UrlServiceClient) GetReleaseVersion(ctx context.Context, req *GetReleaseVersionRequest) (r *GetReleaseVersionResponse, err error) { + var _args UrlServiceGetReleaseVersionArgs + _args.Req = req + var _result UrlServiceGetReleaseVersionResult + if err = p.Client_().Call(ctx, "GetReleaseVersion", &_args, &_result); err != nil { + return } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError + return _result.GetSuccess(), nil +} +func (p *UrlServiceClient) GetBetaVersion(ctx context.Context, req *GetBetaVersionRequest) (r *GetBetaVersionResponse, err error) { + var _args UrlServiceGetBetaVersionArgs + _args.Req = req + var _result UrlServiceGetBetaVersionResult + if err = p.Client_().Call(ctx, "GetBetaVersion", &_args, &_result); err != nil { + return } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ClassRoomServiceGetEmptyClassroomsResult[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + return _result.GetSuccess(), nil } - -func (p *ClassRoomServiceGetEmptyClassroomsResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewEmptyClassroomResponse() - if err := _field.Read(iprot); err != nil { - return err +func (p *UrlServiceClient) GetCloudSetting(ctx context.Context, req *GetCloudSettingRequest) (r *GetCloudSettingResponse, err error) { + var _args UrlServiceGetCloudSettingArgs + _args.Req = req + var _result UrlServiceGetCloudSettingResult + if err = p.Client_().Call(ctx, "GetCloudSetting", &_args, &_result); err != nil { + return } - p.Success = _field - return nil + return _result.GetSuccess(), nil } - -func (p *ClassRoomServiceGetEmptyClassroomsResult) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("GetEmptyClassrooms_result"); err != nil { - goto WriteStructBeginError +func (p *UrlServiceClient) GetAllCloudSetting(ctx context.Context, req *GetAllCloudSettingRequest) (r *GetAllCloudSettingResponse, err error) { + var _args UrlServiceGetAllCloudSettingArgs + _args.Req = req + var _result UrlServiceGetAllCloudSettingResult + if err = p.Client_().Call(ctx, "GetAllCloudSetting", &_args, &_result); err != nil { + return } - if p != nil { - if err = p.writeField0(oprot); err != nil { - fieldId = 0 - goto WriteFieldError - } + return _result.GetSuccess(), nil +} +func (p *UrlServiceClient) SetAllCloudSetting(ctx context.Context, req *SetAllCloudSettingRequest) (r *SetAllCloudSettingResponse, err error) { + var _args UrlServiceSetAllCloudSettingArgs + _args.Req = req + var _result UrlServiceSetAllCloudSettingResult + if err = p.Client_().Call(ctx, "SetAllCloudSetting", &_args, &_result); err != nil { + return } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError + return _result.GetSuccess(), nil +} +func (p *UrlServiceClient) TestSetting(ctx context.Context, req *TestSettingRequest) (r *TestSettingResponse, err error) { + var _args UrlServiceTestSettingArgs + _args.Req = req + var _result UrlServiceTestSettingResult + if err = p.Client_().Call(ctx, "TestSetting", &_args, &_result); err != nil { + return } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError + return _result.GetSuccess(), nil +} +func (p *UrlServiceClient) DumpVisit(ctx context.Context, req *DumpVisitRequest) (r *DumpVisitResponse, err error) { + var _args UrlServiceDumpVisitArgs + _args.Req = req + var _result UrlServiceDumpVisitResult + if err = p.Client_().Call(ctx, "DumpVisit", &_args, &_result); err != nil { + return } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) + return _result.GetSuccess(), nil } - -func (p *ClassRoomServiceGetEmptyClassroomsResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - goto WriteFieldBeginError - } - if err := p.Success.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } +func (p *UrlServiceClient) FZUHelperCSS(ctx context.Context, req *FZUHelperCSSRequest) (r *FZUHelperCSSResponse, err error) { + var _args UrlServiceFZUHelperCSSArgs + _args.Req = req + var _result UrlServiceFZUHelperCSSResult + if err = p.Client_().Call(ctx, "FZUHelperCSS", &_args, &_result); err != nil { + return } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) + return _result.GetSuccess(), nil } - -func (p *ClassRoomServiceGetEmptyClassroomsResult) String() string { - if p == nil { - return "" +func (p *UrlServiceClient) FZUHelperHTML(ctx context.Context, req *FZUHelperHTMLRequest) (r *FZUHelperHTMLResponse, err error) { + var _args UrlServiceFZUHelperHTMLArgs + _args.Req = req + var _result UrlServiceFZUHelperHTMLResult + if err = p.Client_().Call(ctx, "FZUHelperHTML", &_args, &_result); err != nil { + return } - return fmt.Sprintf("ClassRoomServiceGetEmptyClassroomsResult(%+v)", *p) - + return _result.GetSuccess(), nil } - -type UserServiceProcessor struct { +func (p *UrlServiceClient) UserAgreementHTML(ctx context.Context, req *UserAgreementHTMLRequest) (r *UserAgreementHTMLResponse, err error) { + var _args UrlServiceUserAgreementHTMLArgs + _args.Req = req + var _result UrlServiceUserAgreementHTMLResult + if err = p.Client_().Call(ctx, "UserAgreementHTML", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +type ClassRoomServiceProcessor struct { processorMap map[string]thrift.TProcessorFunction - handler UserService + handler ClassRoomService } -func (p *UserServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { +func (p *ClassRoomServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { p.processorMap[key] = processor } -func (p *UserServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { +func (p *ClassRoomServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { processor, ok = p.processorMap[key] return processor, ok } -func (p *UserServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { +func (p *ClassRoomServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { return p.processorMap } -func NewUserServiceProcessor(handler UserService) *UserServiceProcessor { - self := &UserServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} - self.AddToProcessorMap("GetLoginData", &userServiceProcessorGetLoginData{handler: handler}) - self.AddToProcessorMap("ValidateCode", &userServiceProcessorValidateCode{handler: handler}) - self.AddToProcessorMap("ValidateCodeForAndroid", &userServiceProcessorValidateCodeForAndroid{handler: handler}) +func NewClassRoomServiceProcessor(handler ClassRoomService) *ClassRoomServiceProcessor { + self := &ClassRoomServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self.AddToProcessorMap("GetEmptyClassrooms", &classRoomServiceProcessorGetEmptyClassrooms{handler: handler}) return self } -func (p *UserServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { +func (p *ClassRoomServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { name, _, seqId, err := iprot.ReadMessageBegin() if err != nil { return false, err @@ -12121,112 +12221,16 @@ func (p *UserServiceProcessor) Process(ctx context.Context, iprot, oprot thrift. 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 - } - return true, err -} - -type userServiceProcessorValidateCodeForAndroid struct { - handler UserService +type classRoomServiceProcessorGetEmptyClassrooms struct { + handler ClassRoomService } -func (p *userServiceProcessorValidateCodeForAndroid) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UserServiceValidateCodeForAndroidArgs{} +func (p *classRoomServiceProcessorGetEmptyClassrooms) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := ClassRoomServiceGetEmptyClassroomsArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("ValidateCodeForAndroid", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("GetEmptyClassrooms", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -12235,11 +12239,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 := ClassRoomServiceGetEmptyClassroomsResult{} + var retval *EmptyClassroomResponse + if retval, err2 = p.handler.GetEmptyClassrooms(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetEmptyClassrooms: "+err2.Error()) + oprot.WriteMessageBegin("GetEmptyClassrooms", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -12247,7 +12251,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("GetEmptyClassrooms", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -12265,35 +12269,35 @@ func (p *userServiceProcessorValidateCodeForAndroid) Process(ctx context.Context return true, err } -type UserServiceGetLoginDataArgs struct { - Request *GetLoginDataRequest `thrift:"request,1"` +type ClassRoomServiceGetEmptyClassroomsArgs struct { + Request *EmptyClassroomRequest `thrift:"request,1"` } -func NewUserServiceGetLoginDataArgs() *UserServiceGetLoginDataArgs { - return &UserServiceGetLoginDataArgs{} +func NewClassRoomServiceGetEmptyClassroomsArgs() *ClassRoomServiceGetEmptyClassroomsArgs { + return &ClassRoomServiceGetEmptyClassroomsArgs{} } -func (p *UserServiceGetLoginDataArgs) InitDefault() { +func (p *ClassRoomServiceGetEmptyClassroomsArgs) InitDefault() { } -var UserServiceGetLoginDataArgs_Request_DEFAULT *GetLoginDataRequest +var ClassRoomServiceGetEmptyClassroomsArgs_Request_DEFAULT *EmptyClassroomRequest -func (p *UserServiceGetLoginDataArgs) GetRequest() (v *GetLoginDataRequest) { +func (p *ClassRoomServiceGetEmptyClassroomsArgs) GetRequest() (v *EmptyClassroomRequest) { if !p.IsSetRequest() { - return UserServiceGetLoginDataArgs_Request_DEFAULT + return ClassRoomServiceGetEmptyClassroomsArgs_Request_DEFAULT } return p.Request } -var fieldIDToName_UserServiceGetLoginDataArgs = map[int16]string{ +var fieldIDToName_ClassRoomServiceGetEmptyClassroomsArgs = map[int16]string{ 1: "request", } -func (p *UserServiceGetLoginDataArgs) IsSetRequest() bool { +func (p *ClassRoomServiceGetEmptyClassroomsArgs) IsSetRequest() bool { return p.Request != nil } -func (p *UserServiceGetLoginDataArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *ClassRoomServiceGetEmptyClassroomsArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -12339,7 +12343,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UserServiceGetLoginDataArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ClassRoomServiceGetEmptyClassroomsArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -12349,8 +12353,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UserServiceGetLoginDataArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetLoginDataRequest() +func (p *ClassRoomServiceGetEmptyClassroomsArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewEmptyClassroomRequest() if err := _field.Read(iprot); err != nil { return err } @@ -12358,9 +12362,9 @@ func (p *UserServiceGetLoginDataArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *UserServiceGetLoginDataArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *ClassRoomServiceGetEmptyClassroomsArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetLoginData_args"); err != nil { + if err = oprot.WriteStructBegin("GetEmptyClassrooms_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -12386,7 +12390,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UserServiceGetLoginDataArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *ClassRoomServiceGetEmptyClassroomsArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -12403,43 +12407,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UserServiceGetLoginDataArgs) String() string { +func (p *ClassRoomServiceGetEmptyClassroomsArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceGetLoginDataArgs(%+v)", *p) + return fmt.Sprintf("ClassRoomServiceGetEmptyClassroomsArgs(%+v)", *p) } -type UserServiceGetLoginDataResult struct { - Success *GetLoginDataResponse `thrift:"success,0,optional"` +type ClassRoomServiceGetEmptyClassroomsResult struct { + Success *EmptyClassroomResponse `thrift:"success,0,optional"` } -func NewUserServiceGetLoginDataResult() *UserServiceGetLoginDataResult { - return &UserServiceGetLoginDataResult{} +func NewClassRoomServiceGetEmptyClassroomsResult() *ClassRoomServiceGetEmptyClassroomsResult { + return &ClassRoomServiceGetEmptyClassroomsResult{} } -func (p *UserServiceGetLoginDataResult) InitDefault() { +func (p *ClassRoomServiceGetEmptyClassroomsResult) InitDefault() { } -var UserServiceGetLoginDataResult_Success_DEFAULT *GetLoginDataResponse +var ClassRoomServiceGetEmptyClassroomsResult_Success_DEFAULT *EmptyClassroomResponse -func (p *UserServiceGetLoginDataResult) GetSuccess() (v *GetLoginDataResponse) { +func (p *ClassRoomServiceGetEmptyClassroomsResult) GetSuccess() (v *EmptyClassroomResponse) { if !p.IsSetSuccess() { - return UserServiceGetLoginDataResult_Success_DEFAULT + return ClassRoomServiceGetEmptyClassroomsResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UserServiceGetLoginDataResult = map[int16]string{ +var fieldIDToName_ClassRoomServiceGetEmptyClassroomsResult = map[int16]string{ 0: "success", } -func (p *UserServiceGetLoginDataResult) IsSetSuccess() bool { +func (p *ClassRoomServiceGetEmptyClassroomsResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UserServiceGetLoginDataResult) Read(iprot thrift.TProtocol) (err error) { +func (p *ClassRoomServiceGetEmptyClassroomsResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -12485,7 +12489,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UserServiceGetLoginDataResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ClassRoomServiceGetEmptyClassroomsResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -12495,8 +12499,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UserServiceGetLoginDataResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetLoginDataResponse() +func (p *ClassRoomServiceGetEmptyClassroomsResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewEmptyClassroomResponse() if err := _field.Read(iprot); err != nil { return err } @@ -12504,9 +12508,9 @@ func (p *UserServiceGetLoginDataResult) ReadField0(iprot thrift.TProtocol) error return nil } -func (p *UserServiceGetLoginDataResult) Write(oprot thrift.TProtocol) (err error) { +func (p *ClassRoomServiceGetEmptyClassroomsResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetLoginData_result"); err != nil { + if err = oprot.WriteStructBegin("GetEmptyClassrooms_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -12532,7 +12536,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UserServiceGetLoginDataResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *ClassRoomServiceGetEmptyClassroomsResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -12551,43 +12555,230 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UserServiceGetLoginDataResult) String() string { +func (p *ClassRoomServiceGetEmptyClassroomsResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceGetLoginDataResult(%+v)", *p) + return fmt.Sprintf("ClassRoomServiceGetEmptyClassroomsResult(%+v)", *p) } -type UserServiceValidateCodeArgs struct { - Request *ValidateCodeRequest `thrift:"request,1"` +type UserServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler UserService } -func NewUserServiceValidateCodeArgs() *UserServiceValidateCodeArgs { - return &UserServiceValidateCodeArgs{} +func (p *UserServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor } -func (p *UserServiceValidateCodeArgs) InitDefault() { +func (p *UserServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok } -var UserServiceValidateCodeArgs_Request_DEFAULT *ValidateCodeRequest - -func (p *UserServiceValidateCodeArgs) GetRequest() (v *ValidateCodeRequest) { - if !p.IsSetRequest() { - return UserServiceValidateCodeArgs_Request_DEFAULT - } - return p.Request +func (p *UserServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap } -var fieldIDToName_UserServiceValidateCodeArgs = map[int16]string{ - 1: "request", +func NewUserServiceProcessor(handler UserService) *UserServiceProcessor { + self := &UserServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self.AddToProcessorMap("GetLoginData", &userServiceProcessorGetLoginData{handler: handler}) + self.AddToProcessorMap("ValidateCode", &userServiceProcessorValidateCode{handler: handler}) + self.AddToProcessorMap("ValidateCodeForAndroid", &userServiceProcessorValidateCodeForAndroid{handler: handler}) + return self } - -func (p *UserServiceValidateCodeArgs) IsSetRequest() bool { +func (p *UserServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + name, _, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return false, err + } + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(ctx, seqId, iprot, oprot) + } + iprot.Skip(thrift.STRUCT) + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) + oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, x +} + +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 + } + 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.ReadMessageEnd() + var err2 error + result := UserServiceValidateCodeForAndroidResult{} + var retval *ValidateCodeForAndroidResponse + if retval, err2 = p.handler.ValidateCodeForAndroid(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ValidateCodeForAndroid: "+err2.Error()) + oprot.WriteMessageBegin("ValidateCodeForAndroid", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("ValidateCodeForAndroid", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +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 *UserServiceValidateCodeArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceGetLoginDataArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -12633,7 +12824,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_UserServiceGetLoginDataArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -12643,8 +12834,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 *UserServiceGetLoginDataArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetLoginDataRequest() if err := _field.Read(iprot); err != nil { return err } @@ -12652,9 +12843,9 @@ func (p *UserServiceValidateCodeArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *UserServiceValidateCodeArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *UserServiceGetLoginDataArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ValidateCode_args"); err != nil { + if err = oprot.WriteStructBegin("GetLoginData_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -12680,7 +12871,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 *UserServiceGetLoginDataArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -12697,43 +12888,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UserServiceValidateCodeArgs) String() string { +func (p *UserServiceGetLoginDataArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceValidateCodeArgs(%+v)", *p) + return fmt.Sprintf("UserServiceGetLoginDataArgs(%+v)", *p) } -type UserServiceValidateCodeResult struct { - Success *ValidateCodeResponse `thrift:"success,0,optional"` +type UserServiceGetLoginDataResult struct { + Success *GetLoginDataResponse `thrift:"success,0,optional"` } -func NewUserServiceValidateCodeResult() *UserServiceValidateCodeResult { - return &UserServiceValidateCodeResult{} +func NewUserServiceGetLoginDataResult() *UserServiceGetLoginDataResult { + return &UserServiceGetLoginDataResult{} } -func (p *UserServiceValidateCodeResult) InitDefault() { +func (p *UserServiceGetLoginDataResult) InitDefault() { } -var UserServiceValidateCodeResult_Success_DEFAULT *ValidateCodeResponse +var UserServiceGetLoginDataResult_Success_DEFAULT *GetLoginDataResponse -func (p *UserServiceValidateCodeResult) GetSuccess() (v *ValidateCodeResponse) { +func (p *UserServiceGetLoginDataResult) GetSuccess() (v *GetLoginDataResponse) { if !p.IsSetSuccess() { - return UserServiceValidateCodeResult_Success_DEFAULT + return UserServiceGetLoginDataResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UserServiceValidateCodeResult = map[int16]string{ +var fieldIDToName_UserServiceGetLoginDataResult = map[int16]string{ 0: "success", } -func (p *UserServiceValidateCodeResult) IsSetSuccess() bool { +func (p *UserServiceGetLoginDataResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UserServiceValidateCodeResult) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceGetLoginDataResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -12779,7 +12970,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_UserServiceGetLoginDataResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -12789,8 +12980,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 *UserServiceGetLoginDataResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetLoginDataResponse() if err := _field.Read(iprot); err != nil { return err } @@ -12798,9 +12989,9 @@ func (p *UserServiceValidateCodeResult) ReadField0(iprot thrift.TProtocol) error return nil } -func (p *UserServiceValidateCodeResult) Write(oprot thrift.TProtocol) (err error) { +func (p *UserServiceGetLoginDataResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ValidateCode_result"); err != nil { + if err = oprot.WriteStructBegin("GetLoginData_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -12826,7 +13017,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 *UserServiceGetLoginDataResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -12845,43 +13036,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UserServiceValidateCodeResult) String() string { +func (p *UserServiceGetLoginDataResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceValidateCodeResult(%+v)", *p) + return fmt.Sprintf("UserServiceGetLoginDataResult(%+v)", *p) } -type UserServiceValidateCodeForAndroidArgs struct { - Request *ValidateCodeForAndroidRequest `thrift:"request,1"` +type UserServiceValidateCodeArgs struct { + Request *ValidateCodeRequest `thrift:"request,1"` } -func NewUserServiceValidateCodeForAndroidArgs() *UserServiceValidateCodeForAndroidArgs { - return &UserServiceValidateCodeForAndroidArgs{} +func NewUserServiceValidateCodeArgs() *UserServiceValidateCodeArgs { + return &UserServiceValidateCodeArgs{} } -func (p *UserServiceValidateCodeForAndroidArgs) InitDefault() { +func (p *UserServiceValidateCodeArgs) InitDefault() { } -var UserServiceValidateCodeForAndroidArgs_Request_DEFAULT *ValidateCodeForAndroidRequest +var UserServiceValidateCodeArgs_Request_DEFAULT *ValidateCodeRequest -func (p *UserServiceValidateCodeForAndroidArgs) GetRequest() (v *ValidateCodeForAndroidRequest) { +func (p *UserServiceValidateCodeArgs) GetRequest() (v *ValidateCodeRequest) { if !p.IsSetRequest() { - return UserServiceValidateCodeForAndroidArgs_Request_DEFAULT + return UserServiceValidateCodeArgs_Request_DEFAULT } return p.Request } -var fieldIDToName_UserServiceValidateCodeForAndroidArgs = map[int16]string{ +var fieldIDToName_UserServiceValidateCodeArgs = map[int16]string{ 1: "request", } -func (p *UserServiceValidateCodeForAndroidArgs) IsSetRequest() bool { +func (p *UserServiceValidateCodeArgs) IsSetRequest() bool { return p.Request != nil } -func (p *UserServiceValidateCodeForAndroidArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceValidateCodeArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -12927,7 +13118,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_UserServiceValidateCodeArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -12937,8 +13128,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 *UserServiceValidateCodeArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewValidateCodeRequest() if err := _field.Read(iprot); err != nil { return err } @@ -12946,9 +13137,9 @@ func (p *UserServiceValidateCodeForAndroidArgs) ReadField1(iprot thrift.TProtoco return nil } -func (p *UserServiceValidateCodeForAndroidArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *UserServiceValidateCodeArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ValidateCodeForAndroid_args"); err != nil { + if err = oprot.WriteStructBegin("ValidateCode_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -12974,7 +13165,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 *UserServiceValidateCodeArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -12991,43 +13182,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UserServiceValidateCodeForAndroidArgs) String() string { +func (p *UserServiceValidateCodeArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceValidateCodeForAndroidArgs(%+v)", *p) + return fmt.Sprintf("UserServiceValidateCodeArgs(%+v)", *p) } -type UserServiceValidateCodeForAndroidResult struct { - Success *ValidateCodeForAndroidResponse `thrift:"success,0,optional"` +type UserServiceValidateCodeResult struct { + Success *ValidateCodeResponse `thrift:"success,0,optional"` } -func NewUserServiceValidateCodeForAndroidResult() *UserServiceValidateCodeForAndroidResult { - return &UserServiceValidateCodeForAndroidResult{} +func NewUserServiceValidateCodeResult() *UserServiceValidateCodeResult { + return &UserServiceValidateCodeResult{} } -func (p *UserServiceValidateCodeForAndroidResult) InitDefault() { +func (p *UserServiceValidateCodeResult) InitDefault() { } -var UserServiceValidateCodeForAndroidResult_Success_DEFAULT *ValidateCodeForAndroidResponse +var UserServiceValidateCodeResult_Success_DEFAULT *ValidateCodeResponse -func (p *UserServiceValidateCodeForAndroidResult) GetSuccess() (v *ValidateCodeForAndroidResponse) { +func (p *UserServiceValidateCodeResult) GetSuccess() (v *ValidateCodeResponse) { if !p.IsSetSuccess() { - return UserServiceValidateCodeForAndroidResult_Success_DEFAULT + return UserServiceValidateCodeResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UserServiceValidateCodeForAndroidResult = map[int16]string{ +var fieldIDToName_UserServiceValidateCodeResult = map[int16]string{ 0: "success", } -func (p *UserServiceValidateCodeForAndroidResult) IsSetSuccess() bool { +func (p *UserServiceValidateCodeResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UserServiceValidateCodeForAndroidResult) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceValidateCodeResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -13073,7 +13264,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_UserServiceValidateCodeResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -13083,8 +13274,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 *UserServiceValidateCodeResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewValidateCodeResponse() if err := _field.Read(iprot); err != nil { return err } @@ -13092,9 +13283,9 @@ func (p *UserServiceValidateCodeForAndroidResult) ReadField0(iprot thrift.TProto return nil } -func (p *UserServiceValidateCodeForAndroidResult) Write(oprot thrift.TProtocol) (err error) { +func (p *UserServiceValidateCodeResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ValidateCodeForAndroid_result"); err != nil { + if err = oprot.WriteStructBegin("ValidateCode_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -13120,7 +13311,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 *UserServiceValidateCodeResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -13139,132 +13330,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UserServiceValidateCodeForAndroidResult) String() string { +func (p *UserServiceValidateCodeResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UserServiceValidateCodeForAndroidResult(%+v)", *p) - -} - -type CourseServiceProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler CourseService -} - -func (p *CourseServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor -} - -func (p *CourseServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok -} - -func (p *CourseServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap -} - -func NewCourseServiceProcessor(handler CourseService) *CourseServiceProcessor { - self := &CourseServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} - self.AddToProcessorMap("GetCourseList", &courseServiceProcessorGetCourseList{handler: handler}) - return self -} -func (p *CourseServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - name, _, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return false, err - } - if processor, ok := p.GetProcessorFunction(name); ok { - return processor.Process(ctx, seqId, iprot, oprot) - } - iprot.Skip(thrift.STRUCT) - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) - oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, x -} - -type courseServiceProcessorGetCourseList struct { - handler CourseService -} - -func (p *courseServiceProcessorGetCourseList) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := CourseServiceGetCourseListArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetCourseList", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } + return fmt.Sprintf("UserServiceValidateCodeResult(%+v)", *p) - iprot.ReadMessageEnd() - var err2 error - result := CourseServiceGetCourseListResult{} - var retval *CourseListResponse - if retval, err2 = p.handler.GetCourseList(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCourseList: "+err2.Error()) - oprot.WriteMessageBegin("GetCourseList", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("GetCourseList", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err } -type CourseServiceGetCourseListArgs struct { - Req *CourseListRequest `thrift:"req,1"` +type UserServiceValidateCodeForAndroidArgs struct { + Request *ValidateCodeForAndroidRequest `thrift:"request,1"` } -func NewCourseServiceGetCourseListArgs() *CourseServiceGetCourseListArgs { - return &CourseServiceGetCourseListArgs{} +func NewUserServiceValidateCodeForAndroidArgs() *UserServiceValidateCodeForAndroidArgs { + return &UserServiceValidateCodeForAndroidArgs{} } -func (p *CourseServiceGetCourseListArgs) InitDefault() { +func (p *UserServiceValidateCodeForAndroidArgs) InitDefault() { } -var CourseServiceGetCourseListArgs_Req_DEFAULT *CourseListRequest +var UserServiceValidateCodeForAndroidArgs_Request_DEFAULT *ValidateCodeForAndroidRequest -func (p *CourseServiceGetCourseListArgs) GetReq() (v *CourseListRequest) { - if !p.IsSetReq() { - return CourseServiceGetCourseListArgs_Req_DEFAULT +func (p *UserServiceValidateCodeForAndroidArgs) GetRequest() (v *ValidateCodeForAndroidRequest) { + if !p.IsSetRequest() { + return UserServiceValidateCodeForAndroidArgs_Request_DEFAULT } - return p.Req + return p.Request } -var fieldIDToName_CourseServiceGetCourseListArgs = map[int16]string{ - 1: "req", +var fieldIDToName_UserServiceValidateCodeForAndroidArgs = map[int16]string{ + 1: "request", } -func (p *CourseServiceGetCourseListArgs) IsSetReq() bool { - return p.Req != nil +func (p *UserServiceValidateCodeForAndroidArgs) IsSetRequest() bool { + return p.Request != nil } -func (p *CourseServiceGetCourseListArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceValidateCodeForAndroidArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -13310,7 +13412,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CourseServiceGetCourseListArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UserServiceValidateCodeForAndroidArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -13320,18 +13422,18 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *CourseServiceGetCourseListArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewCourseListRequest() +func (p *UserServiceValidateCodeForAndroidArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewValidateCodeForAndroidRequest() if err := _field.Read(iprot); err != nil { return err } - p.Req = _field + p.Request = _field return nil } -func (p *CourseServiceGetCourseListArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *UserServiceValidateCodeForAndroidArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetCourseList_args"); err != nil { + if err = oprot.WriteStructBegin("ValidateCodeForAndroid_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -13357,11 +13459,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *CourseServiceGetCourseListArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { +func (p *UserServiceValidateCodeForAndroidArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } - if err := p.Req.Write(oprot); err != nil { + if err := p.Request.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -13374,43 +13476,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *CourseServiceGetCourseListArgs) String() string { +func (p *UserServiceValidateCodeForAndroidArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("CourseServiceGetCourseListArgs(%+v)", *p) + return fmt.Sprintf("UserServiceValidateCodeForAndroidArgs(%+v)", *p) } -type CourseServiceGetCourseListResult struct { - Success *CourseListResponse `thrift:"success,0,optional"` +type UserServiceValidateCodeForAndroidResult struct { + Success *ValidateCodeForAndroidResponse `thrift:"success,0,optional"` } -func NewCourseServiceGetCourseListResult() *CourseServiceGetCourseListResult { - return &CourseServiceGetCourseListResult{} +func NewUserServiceValidateCodeForAndroidResult() *UserServiceValidateCodeForAndroidResult { + return &UserServiceValidateCodeForAndroidResult{} } -func (p *CourseServiceGetCourseListResult) InitDefault() { +func (p *UserServiceValidateCodeForAndroidResult) InitDefault() { } -var CourseServiceGetCourseListResult_Success_DEFAULT *CourseListResponse +var UserServiceValidateCodeForAndroidResult_Success_DEFAULT *ValidateCodeForAndroidResponse -func (p *CourseServiceGetCourseListResult) GetSuccess() (v *CourseListResponse) { +func (p *UserServiceValidateCodeForAndroidResult) GetSuccess() (v *ValidateCodeForAndroidResponse) { if !p.IsSetSuccess() { - return CourseServiceGetCourseListResult_Success_DEFAULT + return UserServiceValidateCodeForAndroidResult_Success_DEFAULT } return p.Success } -var fieldIDToName_CourseServiceGetCourseListResult = map[int16]string{ +var fieldIDToName_UserServiceValidateCodeForAndroidResult = map[int16]string{ 0: "success", } -func (p *CourseServiceGetCourseListResult) IsSetSuccess() bool { +func (p *UserServiceValidateCodeForAndroidResult) IsSetSuccess() bool { return p.Success != nil } -func (p *CourseServiceGetCourseListResult) Read(iprot thrift.TProtocol) (err error) { +func (p *UserServiceValidateCodeForAndroidResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -13456,7 +13558,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CourseServiceGetCourseListResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UserServiceValidateCodeForAndroidResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -13466,8 +13568,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *CourseServiceGetCourseListResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewCourseListResponse() +func (p *UserServiceValidateCodeForAndroidResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewValidateCodeForAndroidResponse() if err := _field.Read(iprot); err != nil { return err } @@ -13475,9 +13577,9 @@ func (p *CourseServiceGetCourseListResult) ReadField0(iprot thrift.TProtocol) er return nil } -func (p *CourseServiceGetCourseListResult) Write(oprot thrift.TProtocol) (err error) { +func (p *UserServiceValidateCodeForAndroidResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetCourseList_result"); err != nil { + if err = oprot.WriteStructBegin("ValidateCodeForAndroid_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -13503,7 +13605,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *CourseServiceGetCourseListResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *UserServiceValidateCodeForAndroidResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -13522,44 +13624,38 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *CourseServiceGetCourseListResult) String() string { +func (p *UserServiceValidateCodeForAndroidResult) String() string { if p == nil { return "" } - return fmt.Sprintf("CourseServiceGetCourseListResult(%+v)", *p) + return fmt.Sprintf("UserServiceValidateCodeForAndroidResult(%+v)", *p) } -type LaunchScreenServiceProcessor struct { +type CourseServiceProcessor struct { processorMap map[string]thrift.TProcessorFunction - handler LaunchScreenService + handler CourseService } -func (p *LaunchScreenServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { +func (p *CourseServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { p.processorMap[key] = processor } -func (p *LaunchScreenServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { +func (p *CourseServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { processor, ok = p.processorMap[key] return processor, ok } -func (p *LaunchScreenServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { +func (p *CourseServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { return p.processorMap } -func NewLaunchScreenServiceProcessor(handler LaunchScreenService) *LaunchScreenServiceProcessor { - self := &LaunchScreenServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} - self.AddToProcessorMap("CreateImage", &launchScreenServiceProcessorCreateImage{handler: handler}) - self.AddToProcessorMap("GetImage", &launchScreenServiceProcessorGetImage{handler: handler}) - self.AddToProcessorMap("ChangeImageProperty", &launchScreenServiceProcessorChangeImageProperty{handler: handler}) - self.AddToProcessorMap("ChangeImage", &launchScreenServiceProcessorChangeImage{handler: handler}) - self.AddToProcessorMap("DeleteImage", &launchScreenServiceProcessorDeleteImage{handler: handler}) - self.AddToProcessorMap("MobileGetImage", &launchScreenServiceProcessorMobileGetImage{handler: handler}) - self.AddToProcessorMap("AddImagePointTime", &launchScreenServiceProcessorAddImagePointTime{handler: handler}) +func NewCourseServiceProcessor(handler CourseService) *CourseServiceProcessor { + self := &CourseServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self.AddToProcessorMap("GetCourseList", &courseServiceProcessorGetCourseList{handler: handler}) return self } -func (p *LaunchScreenServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { +func (p *CourseServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { name, _, seqId, err := iprot.ReadMessageBegin() if err != nil { return false, err @@ -13577,16 +13673,16 @@ func (p *LaunchScreenServiceProcessor) Process(ctx context.Context, iprot, oprot return false, x } -type launchScreenServiceProcessorCreateImage struct { - handler LaunchScreenService +type courseServiceProcessorGetCourseList struct { + handler CourseService } -func (p *launchScreenServiceProcessorCreateImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := LaunchScreenServiceCreateImageArgs{} +func (p *courseServiceProcessorGetCourseList) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := CourseServiceGetCourseListArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("CreateImage", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("GetCourseList", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -13595,11 +13691,11 @@ func (p *launchScreenServiceProcessorCreateImage) Process(ctx context.Context, s iprot.ReadMessageEnd() var err2 error - result := LaunchScreenServiceCreateImageResult{} - var retval *CreateImageResponse - if retval, err2 = p.handler.CreateImage(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CreateImage: "+err2.Error()) - oprot.WriteMessageBegin("CreateImage", thrift.EXCEPTION, seqId) + result := CourseServiceGetCourseListResult{} + var retval *CourseListResponse + if retval, err2 = p.handler.GetCourseList(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCourseList: "+err2.Error()) + oprot.WriteMessageBegin("GetCourseList", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -13607,7 +13703,7 @@ 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("GetCourseList", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -13625,160 +13721,357 @@ func (p *launchScreenServiceProcessorCreateImage) Process(ctx context.Context, s return true, err } -type launchScreenServiceProcessorGetImage struct { - handler LaunchScreenService +type CourseServiceGetCourseListArgs struct { + Req *CourseListRequest `thrift:"req,1"` } -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 - } +func NewCourseServiceGetCourseListArgs() *CourseServiceGetCourseListArgs { + return &CourseServiceGetCourseListArgs{} +} - 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 +func (p *CourseServiceGetCourseListArgs) InitDefault() { +} + +var CourseServiceGetCourseListArgs_Req_DEFAULT *CourseListRequest + +func (p *CourseServiceGetCourseListArgs) GetReq() (v *CourseListRequest) { + if !p.IsSetReq() { + return CourseServiceGetCourseListArgs_Req_DEFAULT } - return true, err + return p.Req } -type launchScreenServiceProcessorChangeImageProperty struct { - handler LaunchScreenService +var fieldIDToName_CourseServiceGetCourseListArgs = map[int16]string{ + 1: "req", } -func (p *launchScreenServiceProcessorChangeImageProperty) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := LaunchScreenServiceChangeImagePropertyArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("ChangeImageProperty", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } +func (p *CourseServiceGetCourseListArgs) IsSetReq() bool { + return p.Req != nil +} - iprot.ReadMessageEnd() - var err2 error - result := LaunchScreenServiceChangeImagePropertyResult{} - var retval *ChangeImagePropertyResponse - if retval, err2 = p.handler.ChangeImageProperty(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ChangeImageProperty: "+err2.Error()) - oprot.WriteMessageBegin("ChangeImageProperty", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("ChangeImageProperty", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 +func (p *CourseServiceGetCourseListArgs) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } } - if err != nil { - return + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError } - return true, err -} -type launchScreenServiceProcessorChangeImage 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_CourseServiceGetCourseListArgs[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 *launchScreenServiceProcessorChangeImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := LaunchScreenServiceChangeImageArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("ChangeImage", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *CourseServiceGetCourseListArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewCourseListRequest() + if err := _field.Read(iprot); err != nil { + return err } + p.Req = _field + return nil +} - iprot.ReadMessageEnd() - var err2 error - result := LaunchScreenServiceChangeImageResult{} - var retval *ChangeImageResponse - if retval, err2 = p.handler.ChangeImage(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ChangeImage: "+err2.Error()) - oprot.WriteMessageBegin("ChangeImage", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("ChangeImage", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 +func (p *CourseServiceGetCourseListArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetCourseList_args"); err != nil { + goto WriteStructBeginError } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError } - if err != nil { - return + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError } - return true, err -} - -type launchScreenServiceProcessorDeleteImage struct { - handler LaunchScreenService + 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 *launchScreenServiceProcessorDeleteImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := LaunchScreenServiceDeleteImageArgs{} +func (p *CourseServiceGetCourseListArgs) 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 *CourseServiceGetCourseListArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CourseServiceGetCourseListArgs(%+v)", *p) + +} + +type CourseServiceGetCourseListResult struct { + Success *CourseListResponse `thrift:"success,0,optional"` +} + +func NewCourseServiceGetCourseListResult() *CourseServiceGetCourseListResult { + return &CourseServiceGetCourseListResult{} +} + +func (p *CourseServiceGetCourseListResult) InitDefault() { +} + +var CourseServiceGetCourseListResult_Success_DEFAULT *CourseListResponse + +func (p *CourseServiceGetCourseListResult) GetSuccess() (v *CourseListResponse) { + if !p.IsSetSuccess() { + return CourseServiceGetCourseListResult_Success_DEFAULT + } + return p.Success +} + +var fieldIDToName_CourseServiceGetCourseListResult = map[int16]string{ + 0: "success", +} + +func (p *CourseServiceGetCourseListResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *CourseServiceGetCourseListResult) 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_CourseServiceGetCourseListResult[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 *CourseServiceGetCourseListResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewCourseListResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *CourseServiceGetCourseListResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetCourseList_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 *CourseServiceGetCourseListResult) 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 *CourseServiceGetCourseListResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CourseServiceGetCourseListResult(%+v)", *p) + +} + +type LaunchScreenServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler LaunchScreenService +} + +func (p *LaunchScreenServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *LaunchScreenServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *LaunchScreenServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewLaunchScreenServiceProcessor(handler LaunchScreenService) *LaunchScreenServiceProcessor { + self := &LaunchScreenServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self.AddToProcessorMap("CreateImage", &launchScreenServiceProcessorCreateImage{handler: handler}) + self.AddToProcessorMap("GetImage", &launchScreenServiceProcessorGetImage{handler: handler}) + self.AddToProcessorMap("ChangeImageProperty", &launchScreenServiceProcessorChangeImageProperty{handler: handler}) + self.AddToProcessorMap("ChangeImage", &launchScreenServiceProcessorChangeImage{handler: handler}) + self.AddToProcessorMap("DeleteImage", &launchScreenServiceProcessorDeleteImage{handler: handler}) + self.AddToProcessorMap("MobileGetImage", &launchScreenServiceProcessorMobileGetImage{handler: handler}) + self.AddToProcessorMap("AddImagePointTime", &launchScreenServiceProcessorAddImagePointTime{handler: handler}) + return self +} +func (p *LaunchScreenServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + name, _, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return false, err + } + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(ctx, seqId, iprot, oprot) + } + 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 launchScreenServiceProcessorCreateImage struct { + handler LaunchScreenService +} + +func (p *launchScreenServiceProcessorCreateImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceCreateImageArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("DeleteImage", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("CreateImage", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -13787,11 +14080,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 := LaunchScreenServiceCreateImageResult{} + var retval *CreateImageResponse + if retval, err2 = p.handler.CreateImage(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CreateImage: "+err2.Error()) + oprot.WriteMessageBegin("CreateImage", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -13799,7 +14092,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("CreateImage", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -13817,131 +14110,911 @@ func (p *launchScreenServiceProcessorDeleteImage) Process(ctx context.Context, s return true, err } -type launchScreenServiceProcessorMobileGetImage struct { - handler LaunchScreenService +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 { + 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 launchScreenServiceProcessorChangeImage struct { + handler LaunchScreenService +} + +func (p *launchScreenServiceProcessorChangeImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceChangeImageArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("ChangeImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := LaunchScreenServiceChangeImageResult{} + var retval *ChangeImageResponse + if retval, err2 = p.handler.ChangeImage(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ChangeImage: "+err2.Error()) + oprot.WriteMessageBegin("ChangeImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("ChangeImage", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type launchScreenServiceProcessorDeleteImage struct { + handler LaunchScreenService +} + +func (p *launchScreenServiceProcessorDeleteImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceDeleteImageArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("DeleteImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := LaunchScreenServiceDeleteImageResult{} + var retval *DeleteImageResponse + if retval, err2 = p.handler.DeleteImage(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing DeleteImage: "+err2.Error()) + oprot.WriteMessageBegin("DeleteImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("DeleteImage", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type launchScreenServiceProcessorMobileGetImage struct { + handler LaunchScreenService +} + +func (p *launchScreenServiceProcessorMobileGetImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceMobileGetImageArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("MobileGetImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := LaunchScreenServiceMobileGetImageResult{} + var retval *MobileGetImageResponse + if retval, err2 = p.handler.MobileGetImage(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing MobileGetImage: "+err2.Error()) + oprot.WriteMessageBegin("MobileGetImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("MobileGetImage", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type launchScreenServiceProcessorAddImagePointTime struct { + handler LaunchScreenService +} + +func (p *launchScreenServiceProcessorAddImagePointTime) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceAddImagePointTimeArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("AddImagePointTime", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := LaunchScreenServiceAddImagePointTimeResult{} + var retval *AddImagePointTimeResponse + if retval, err2 = p.handler.AddImagePointTime(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing AddImagePointTime: "+err2.Error()) + oprot.WriteMessageBegin("AddImagePointTime", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("AddImagePointTime", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type LaunchScreenServiceCreateImageArgs struct { + Req *CreateImageRequest `thrift:"req,1"` +} + +func NewLaunchScreenServiceCreateImageArgs() *LaunchScreenServiceCreateImageArgs { + return &LaunchScreenServiceCreateImageArgs{} +} + +func (p *LaunchScreenServiceCreateImageArgs) InitDefault() { +} + +var LaunchScreenServiceCreateImageArgs_Req_DEFAULT *CreateImageRequest + +func (p *LaunchScreenServiceCreateImageArgs) GetReq() (v *CreateImageRequest) { + if !p.IsSetReq() { + return LaunchScreenServiceCreateImageArgs_Req_DEFAULT + } + return p.Req +} + +var fieldIDToName_LaunchScreenServiceCreateImageArgs = map[int16]string{ + 1: "req", +} + +func (p *LaunchScreenServiceCreateImageArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *LaunchScreenServiceCreateImageArgs) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + 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 *LaunchScreenServiceCreateImageResult) 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_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 *LaunchScreenServiceCreateImageResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewCreateImageResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *LaunchScreenServiceCreateImageResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("CreateImage_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 *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 + } + } + 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 fmt.Sprintf("LaunchScreenServiceCreateImageResult(%+v)", *p) + +} + +type LaunchScreenServiceGetImageArgs struct { + Req *GetImageRequest `thrift:"req,1"` +} + +func NewLaunchScreenServiceGetImageArgs() *LaunchScreenServiceGetImageArgs { + return &LaunchScreenServiceGetImageArgs{} +} + +func (p *LaunchScreenServiceGetImageArgs) InitDefault() { +} + +var LaunchScreenServiceGetImageArgs_Req_DEFAULT *GetImageRequest + +func (p *LaunchScreenServiceGetImageArgs) GetReq() (v *GetImageRequest) { + if !p.IsSetReq() { + return LaunchScreenServiceGetImageArgs_Req_DEFAULT + } + return p.Req +} + +var fieldIDToName_LaunchScreenServiceGetImageArgs = map[int16]string{ + 1: "req", +} + +func (p *LaunchScreenServiceGetImageArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *LaunchScreenServiceGetImageArgs) 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_LaunchScreenServiceGetImageArgs[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 *LaunchScreenServiceGetImageArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetImageRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *LaunchScreenServiceGetImageArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetImage_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 *LaunchScreenServiceGetImageArgs) 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 *LaunchScreenServiceGetImageArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceGetImageArgs(%+v)", *p) + +} + +type LaunchScreenServiceGetImageResult struct { + Success *GetImageResponse `thrift:"success,0,optional"` } -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 NewLaunchScreenServiceGetImageResult() *LaunchScreenServiceGetImageResult { + return &LaunchScreenServiceGetImageResult{} +} - 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 +func (p *LaunchScreenServiceGetImageResult) InitDefault() { +} + +var LaunchScreenServiceGetImageResult_Success_DEFAULT *GetImageResponse + +func (p *LaunchScreenServiceGetImageResult) GetSuccess() (v *GetImageResponse) { + if !p.IsSetSuccess() { + return LaunchScreenServiceGetImageResult_Success_DEFAULT } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + return p.Success +} + +var fieldIDToName_LaunchScreenServiceGetImageResult = map[int16]string{ + 0: "success", +} + +func (p *LaunchScreenServiceGetImageResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *LaunchScreenServiceGetImageResult) 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 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_LaunchScreenServiceGetImageResult[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 *LaunchScreenServiceGetImageResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetImageResponse() + 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 *LaunchScreenServiceGetImageResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetImage_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 *LaunchScreenServiceGetImageResult) 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 *LaunchScreenServiceGetImageResult) String() string { + if p == nil { + return "" } - return true, err + return fmt.Sprintf("LaunchScreenServiceGetImageResult(%+v)", *p) + } -type LaunchScreenServiceCreateImageArgs struct { - Req *CreateImageRequest `thrift:"req,1"` +type LaunchScreenServiceChangeImagePropertyArgs struct { + Req *ChangeImagePropertyRequest `thrift:"req,1"` } -func NewLaunchScreenServiceCreateImageArgs() *LaunchScreenServiceCreateImageArgs { - return &LaunchScreenServiceCreateImageArgs{} +func NewLaunchScreenServiceChangeImagePropertyArgs() *LaunchScreenServiceChangeImagePropertyArgs { + return &LaunchScreenServiceChangeImagePropertyArgs{} } -func (p *LaunchScreenServiceCreateImageArgs) InitDefault() { +func (p *LaunchScreenServiceChangeImagePropertyArgs) InitDefault() { } -var LaunchScreenServiceCreateImageArgs_Req_DEFAULT *CreateImageRequest +var LaunchScreenServiceChangeImagePropertyArgs_Req_DEFAULT *ChangeImagePropertyRequest -func (p *LaunchScreenServiceCreateImageArgs) GetReq() (v *CreateImageRequest) { +func (p *LaunchScreenServiceChangeImagePropertyArgs) GetReq() (v *ChangeImagePropertyRequest) { if !p.IsSetReq() { - return LaunchScreenServiceCreateImageArgs_Req_DEFAULT + return LaunchScreenServiceChangeImagePropertyArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_LaunchScreenServiceCreateImageArgs = map[int16]string{ +var fieldIDToName_LaunchScreenServiceChangeImagePropertyArgs = map[int16]string{ 1: "req", } -func (p *LaunchScreenServiceCreateImageArgs) IsSetReq() bool { +func (p *LaunchScreenServiceChangeImagePropertyArgs) IsSetReq() bool { return p.Req != nil } -func (p *LaunchScreenServiceCreateImageArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceChangeImagePropertyArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -13987,7 +15060,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_LaunchScreenServiceChangeImagePropertyArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -13997,8 +15070,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 *LaunchScreenServiceChangeImagePropertyArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewChangeImagePropertyRequest() if err := _field.Read(iprot); err != nil { return err } @@ -14006,9 +15079,9 @@ func (p *LaunchScreenServiceCreateImageArgs) ReadField1(iprot thrift.TProtocol) return nil } -func (p *LaunchScreenServiceCreateImageArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceChangeImagePropertyArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("CreateImage_args"); err != nil { + if err = oprot.WriteStructBegin("ChangeImageProperty_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -14034,7 +15107,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 *LaunchScreenServiceChangeImagePropertyArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -14051,43 +15124,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *LaunchScreenServiceCreateImageArgs) String() string { +func (p *LaunchScreenServiceChangeImagePropertyArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceCreateImageArgs(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceChangeImagePropertyArgs(%+v)", *p) } -type LaunchScreenServiceCreateImageResult struct { - Success *CreateImageResponse `thrift:"success,0,optional"` +type LaunchScreenServiceChangeImagePropertyResult struct { + Success *ChangeImagePropertyResponse `thrift:"success,0,optional"` } -func NewLaunchScreenServiceCreateImageResult() *LaunchScreenServiceCreateImageResult { - return &LaunchScreenServiceCreateImageResult{} +func NewLaunchScreenServiceChangeImagePropertyResult() *LaunchScreenServiceChangeImagePropertyResult { + return &LaunchScreenServiceChangeImagePropertyResult{} } -func (p *LaunchScreenServiceCreateImageResult) InitDefault() { +func (p *LaunchScreenServiceChangeImagePropertyResult) InitDefault() { } -var LaunchScreenServiceCreateImageResult_Success_DEFAULT *CreateImageResponse +var LaunchScreenServiceChangeImagePropertyResult_Success_DEFAULT *ChangeImagePropertyResponse -func (p *LaunchScreenServiceCreateImageResult) GetSuccess() (v *CreateImageResponse) { +func (p *LaunchScreenServiceChangeImagePropertyResult) GetSuccess() (v *ChangeImagePropertyResponse) { if !p.IsSetSuccess() { - return LaunchScreenServiceCreateImageResult_Success_DEFAULT + return LaunchScreenServiceChangeImagePropertyResult_Success_DEFAULT } return p.Success } -var fieldIDToName_LaunchScreenServiceCreateImageResult = map[int16]string{ +var fieldIDToName_LaunchScreenServiceChangeImagePropertyResult = map[int16]string{ 0: "success", } -func (p *LaunchScreenServiceCreateImageResult) IsSetSuccess() bool { +func (p *LaunchScreenServiceChangeImagePropertyResult) IsSetSuccess() bool { return p.Success != nil } -func (p *LaunchScreenServiceCreateImageResult) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceChangeImagePropertyResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -14133,7 +15206,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_LaunchScreenServiceChangeImagePropertyResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -14143,8 +15216,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 *LaunchScreenServiceChangeImagePropertyResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewChangeImagePropertyResponse() if err := _field.Read(iprot); err != nil { return err } @@ -14152,9 +15225,9 @@ func (p *LaunchScreenServiceCreateImageResult) ReadField0(iprot thrift.TProtocol return nil } -func (p *LaunchScreenServiceCreateImageResult) Write(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceChangeImagePropertyResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("CreateImage_result"); err != nil { + if err = oprot.WriteStructBegin("ChangeImageProperty_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -14180,7 +15253,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 *LaunchScreenServiceChangeImagePropertyResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -14199,43 +15272,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *LaunchScreenServiceCreateImageResult) String() string { +func (p *LaunchScreenServiceChangeImagePropertyResult) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceCreateImageResult(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceChangeImagePropertyResult(%+v)", *p) } -type LaunchScreenServiceGetImageArgs struct { - Req *GetImageRequest `thrift:"req,1"` +type LaunchScreenServiceChangeImageArgs struct { + Req *ChangeImageRequest `thrift:"req,1"` } -func NewLaunchScreenServiceGetImageArgs() *LaunchScreenServiceGetImageArgs { - return &LaunchScreenServiceGetImageArgs{} +func NewLaunchScreenServiceChangeImageArgs() *LaunchScreenServiceChangeImageArgs { + return &LaunchScreenServiceChangeImageArgs{} } -func (p *LaunchScreenServiceGetImageArgs) InitDefault() { +func (p *LaunchScreenServiceChangeImageArgs) InitDefault() { } -var LaunchScreenServiceGetImageArgs_Req_DEFAULT *GetImageRequest +var LaunchScreenServiceChangeImageArgs_Req_DEFAULT *ChangeImageRequest -func (p *LaunchScreenServiceGetImageArgs) GetReq() (v *GetImageRequest) { +func (p *LaunchScreenServiceChangeImageArgs) GetReq() (v *ChangeImageRequest) { if !p.IsSetReq() { - return LaunchScreenServiceGetImageArgs_Req_DEFAULT + return LaunchScreenServiceChangeImageArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_LaunchScreenServiceGetImageArgs = map[int16]string{ +var fieldIDToName_LaunchScreenServiceChangeImageArgs = map[int16]string{ 1: "req", } -func (p *LaunchScreenServiceGetImageArgs) IsSetReq() bool { +func (p *LaunchScreenServiceChangeImageArgs) IsSetReq() bool { return p.Req != nil } -func (p *LaunchScreenServiceGetImageArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceChangeImageArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -14281,7 +15354,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_LaunchScreenServiceChangeImageArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -14291,8 +15364,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 *LaunchScreenServiceChangeImageArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewChangeImageRequest() if err := _field.Read(iprot); err != nil { return err } @@ -14300,9 +15373,9 @@ func (p *LaunchScreenServiceGetImageArgs) ReadField1(iprot thrift.TProtocol) err return nil } -func (p *LaunchScreenServiceGetImageArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceChangeImageArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetImage_args"); err != nil { + if err = oprot.WriteStructBegin("ChangeImage_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -14328,7 +15401,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 *LaunchScreenServiceChangeImageArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -14345,43 +15418,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *LaunchScreenServiceGetImageArgs) String() string { +func (p *LaunchScreenServiceChangeImageArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceGetImageArgs(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceChangeImageArgs(%+v)", *p) } -type LaunchScreenServiceGetImageResult struct { - Success *GetImageResponse `thrift:"success,0,optional"` +type LaunchScreenServiceChangeImageResult struct { + Success *ChangeImageResponse `thrift:"success,0,optional"` } -func NewLaunchScreenServiceGetImageResult() *LaunchScreenServiceGetImageResult { - return &LaunchScreenServiceGetImageResult{} +func NewLaunchScreenServiceChangeImageResult() *LaunchScreenServiceChangeImageResult { + return &LaunchScreenServiceChangeImageResult{} } -func (p *LaunchScreenServiceGetImageResult) InitDefault() { +func (p *LaunchScreenServiceChangeImageResult) InitDefault() { } -var LaunchScreenServiceGetImageResult_Success_DEFAULT *GetImageResponse +var LaunchScreenServiceChangeImageResult_Success_DEFAULT *ChangeImageResponse -func (p *LaunchScreenServiceGetImageResult) GetSuccess() (v *GetImageResponse) { +func (p *LaunchScreenServiceChangeImageResult) GetSuccess() (v *ChangeImageResponse) { if !p.IsSetSuccess() { - return LaunchScreenServiceGetImageResult_Success_DEFAULT + return LaunchScreenServiceChangeImageResult_Success_DEFAULT } return p.Success } -var fieldIDToName_LaunchScreenServiceGetImageResult = map[int16]string{ +var fieldIDToName_LaunchScreenServiceChangeImageResult = map[int16]string{ 0: "success", } -func (p *LaunchScreenServiceGetImageResult) IsSetSuccess() bool { +func (p *LaunchScreenServiceChangeImageResult) IsSetSuccess() bool { return p.Success != nil } -func (p *LaunchScreenServiceGetImageResult) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceChangeImageResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -14427,7 +15500,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_LaunchScreenServiceChangeImageResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -14437,8 +15510,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 *LaunchScreenServiceChangeImageResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewChangeImageResponse() if err := _field.Read(iprot); err != nil { return err } @@ -14446,9 +15519,9 @@ func (p *LaunchScreenServiceGetImageResult) ReadField0(iprot thrift.TProtocol) e return nil } -func (p *LaunchScreenServiceGetImageResult) Write(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceChangeImageResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetImage_result"); err != nil { + if err = oprot.WriteStructBegin("ChangeImage_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -14474,7 +15547,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 *LaunchScreenServiceChangeImageResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -14493,43 +15566,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *LaunchScreenServiceGetImageResult) String() string { +func (p *LaunchScreenServiceChangeImageResult) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceGetImageResult(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceChangeImageResult(%+v)", *p) } -type LaunchScreenServiceChangeImagePropertyArgs struct { - Req *ChangeImagePropertyRequest `thrift:"req,1"` +type LaunchScreenServiceDeleteImageArgs struct { + Req *DeleteImageRequest `thrift:"req,1"` } -func NewLaunchScreenServiceChangeImagePropertyArgs() *LaunchScreenServiceChangeImagePropertyArgs { - return &LaunchScreenServiceChangeImagePropertyArgs{} +func NewLaunchScreenServiceDeleteImageArgs() *LaunchScreenServiceDeleteImageArgs { + return &LaunchScreenServiceDeleteImageArgs{} } -func (p *LaunchScreenServiceChangeImagePropertyArgs) InitDefault() { +func (p *LaunchScreenServiceDeleteImageArgs) InitDefault() { } -var LaunchScreenServiceChangeImagePropertyArgs_Req_DEFAULT *ChangeImagePropertyRequest +var LaunchScreenServiceDeleteImageArgs_Req_DEFAULT *DeleteImageRequest -func (p *LaunchScreenServiceChangeImagePropertyArgs) GetReq() (v *ChangeImagePropertyRequest) { +func (p *LaunchScreenServiceDeleteImageArgs) GetReq() (v *DeleteImageRequest) { if !p.IsSetReq() { - return LaunchScreenServiceChangeImagePropertyArgs_Req_DEFAULT + return LaunchScreenServiceDeleteImageArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_LaunchScreenServiceChangeImagePropertyArgs = map[int16]string{ +var fieldIDToName_LaunchScreenServiceDeleteImageArgs = map[int16]string{ 1: "req", } -func (p *LaunchScreenServiceChangeImagePropertyArgs) IsSetReq() bool { +func (p *LaunchScreenServiceDeleteImageArgs) IsSetReq() bool { return p.Req != nil } -func (p *LaunchScreenServiceChangeImagePropertyArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceDeleteImageArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -14575,7 +15648,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_LaunchScreenServiceDeleteImageArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -14585,8 +15658,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 *LaunchScreenServiceDeleteImageArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewDeleteImageRequest() if err := _field.Read(iprot); err != nil { return err } @@ -14594,9 +15667,9 @@ func (p *LaunchScreenServiceChangeImagePropertyArgs) ReadField1(iprot thrift.TPr return nil } -func (p *LaunchScreenServiceChangeImagePropertyArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceDeleteImageArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ChangeImageProperty_args"); err != nil { + if err = oprot.WriteStructBegin("DeleteImage_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -14622,7 +15695,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 *LaunchScreenServiceDeleteImageArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -14639,43 +15712,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *LaunchScreenServiceChangeImagePropertyArgs) String() string { +func (p *LaunchScreenServiceDeleteImageArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceChangeImagePropertyArgs(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceDeleteImageArgs(%+v)", *p) } -type LaunchScreenServiceChangeImagePropertyResult struct { - Success *ChangeImagePropertyResponse `thrift:"success,0,optional"` +type LaunchScreenServiceDeleteImageResult struct { + Success *DeleteImageResponse `thrift:"success,0,optional"` } -func NewLaunchScreenServiceChangeImagePropertyResult() *LaunchScreenServiceChangeImagePropertyResult { - return &LaunchScreenServiceChangeImagePropertyResult{} +func NewLaunchScreenServiceDeleteImageResult() *LaunchScreenServiceDeleteImageResult { + return &LaunchScreenServiceDeleteImageResult{} } -func (p *LaunchScreenServiceChangeImagePropertyResult) InitDefault() { +func (p *LaunchScreenServiceDeleteImageResult) InitDefault() { } -var LaunchScreenServiceChangeImagePropertyResult_Success_DEFAULT *ChangeImagePropertyResponse +var LaunchScreenServiceDeleteImageResult_Success_DEFAULT *DeleteImageResponse -func (p *LaunchScreenServiceChangeImagePropertyResult) GetSuccess() (v *ChangeImagePropertyResponse) { +func (p *LaunchScreenServiceDeleteImageResult) GetSuccess() (v *DeleteImageResponse) { if !p.IsSetSuccess() { - return LaunchScreenServiceChangeImagePropertyResult_Success_DEFAULT + return LaunchScreenServiceDeleteImageResult_Success_DEFAULT } return p.Success } -var fieldIDToName_LaunchScreenServiceChangeImagePropertyResult = map[int16]string{ +var fieldIDToName_LaunchScreenServiceDeleteImageResult = map[int16]string{ 0: "success", } -func (p *LaunchScreenServiceChangeImagePropertyResult) IsSetSuccess() bool { +func (p *LaunchScreenServiceDeleteImageResult) IsSetSuccess() bool { return p.Success != nil } -func (p *LaunchScreenServiceChangeImagePropertyResult) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceDeleteImageResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -14721,7 +15794,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_LaunchScreenServiceDeleteImageResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -14731,8 +15804,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 *LaunchScreenServiceDeleteImageResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewDeleteImageResponse() if err := _field.Read(iprot); err != nil { return err } @@ -14740,9 +15813,9 @@ func (p *LaunchScreenServiceChangeImagePropertyResult) ReadField0(iprot thrift.T return nil } -func (p *LaunchScreenServiceChangeImagePropertyResult) Write(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceDeleteImageResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ChangeImageProperty_result"); err != nil { + if err = oprot.WriteStructBegin("DeleteImage_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -14768,7 +15841,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 *LaunchScreenServiceDeleteImageResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -14787,43 +15860,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *LaunchScreenServiceChangeImagePropertyResult) String() string { +func (p *LaunchScreenServiceDeleteImageResult) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceChangeImagePropertyResult(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceDeleteImageResult(%+v)", *p) } -type LaunchScreenServiceChangeImageArgs struct { - Req *ChangeImageRequest `thrift:"req,1"` +type LaunchScreenServiceMobileGetImageArgs struct { + Req *MobileGetImageRequest `thrift:"req,1"` } -func NewLaunchScreenServiceChangeImageArgs() *LaunchScreenServiceChangeImageArgs { - return &LaunchScreenServiceChangeImageArgs{} +func NewLaunchScreenServiceMobileGetImageArgs() *LaunchScreenServiceMobileGetImageArgs { + return &LaunchScreenServiceMobileGetImageArgs{} } -func (p *LaunchScreenServiceChangeImageArgs) InitDefault() { +func (p *LaunchScreenServiceMobileGetImageArgs) InitDefault() { } -var LaunchScreenServiceChangeImageArgs_Req_DEFAULT *ChangeImageRequest +var LaunchScreenServiceMobileGetImageArgs_Req_DEFAULT *MobileGetImageRequest -func (p *LaunchScreenServiceChangeImageArgs) GetReq() (v *ChangeImageRequest) { +func (p *LaunchScreenServiceMobileGetImageArgs) GetReq() (v *MobileGetImageRequest) { if !p.IsSetReq() { - return LaunchScreenServiceChangeImageArgs_Req_DEFAULT + return LaunchScreenServiceMobileGetImageArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_LaunchScreenServiceChangeImageArgs = map[int16]string{ +var fieldIDToName_LaunchScreenServiceMobileGetImageArgs = map[int16]string{ 1: "req", } -func (p *LaunchScreenServiceChangeImageArgs) IsSetReq() bool { +func (p *LaunchScreenServiceMobileGetImageArgs) IsSetReq() bool { return p.Req != nil } -func (p *LaunchScreenServiceChangeImageArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceMobileGetImageArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -14869,7 +15942,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_LaunchScreenServiceMobileGetImageArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -14879,8 +15952,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 *LaunchScreenServiceMobileGetImageArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewMobileGetImageRequest() if err := _field.Read(iprot); err != nil { return err } @@ -14888,9 +15961,9 @@ func (p *LaunchScreenServiceChangeImageArgs) ReadField1(iprot thrift.TProtocol) return nil } -func (p *LaunchScreenServiceChangeImageArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceMobileGetImageArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ChangeImage_args"); err != nil { + if err = oprot.WriteStructBegin("MobileGetImage_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -14916,7 +15989,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 *LaunchScreenServiceMobileGetImageArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -14933,43 +16006,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *LaunchScreenServiceChangeImageArgs) String() string { +func (p *LaunchScreenServiceMobileGetImageArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceChangeImageArgs(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceMobileGetImageArgs(%+v)", *p) } -type LaunchScreenServiceChangeImageResult struct { - Success *ChangeImageResponse `thrift:"success,0,optional"` +type LaunchScreenServiceMobileGetImageResult struct { + Success *MobileGetImageResponse `thrift:"success,0,optional"` } -func NewLaunchScreenServiceChangeImageResult() *LaunchScreenServiceChangeImageResult { - return &LaunchScreenServiceChangeImageResult{} +func NewLaunchScreenServiceMobileGetImageResult() *LaunchScreenServiceMobileGetImageResult { + return &LaunchScreenServiceMobileGetImageResult{} } -func (p *LaunchScreenServiceChangeImageResult) InitDefault() { +func (p *LaunchScreenServiceMobileGetImageResult) InitDefault() { } -var LaunchScreenServiceChangeImageResult_Success_DEFAULT *ChangeImageResponse +var LaunchScreenServiceMobileGetImageResult_Success_DEFAULT *MobileGetImageResponse -func (p *LaunchScreenServiceChangeImageResult) GetSuccess() (v *ChangeImageResponse) { +func (p *LaunchScreenServiceMobileGetImageResult) GetSuccess() (v *MobileGetImageResponse) { if !p.IsSetSuccess() { - return LaunchScreenServiceChangeImageResult_Success_DEFAULT + return LaunchScreenServiceMobileGetImageResult_Success_DEFAULT } return p.Success } -var fieldIDToName_LaunchScreenServiceChangeImageResult = map[int16]string{ +var fieldIDToName_LaunchScreenServiceMobileGetImageResult = map[int16]string{ 0: "success", } -func (p *LaunchScreenServiceChangeImageResult) IsSetSuccess() bool { +func (p *LaunchScreenServiceMobileGetImageResult) IsSetSuccess() bool { return p.Success != nil } -func (p *LaunchScreenServiceChangeImageResult) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceMobileGetImageResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -15015,7 +16088,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_LaunchScreenServiceMobileGetImageResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -15025,8 +16098,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 *LaunchScreenServiceMobileGetImageResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewMobileGetImageResponse() if err := _field.Read(iprot); err != nil { return err } @@ -15034,9 +16107,9 @@ func (p *LaunchScreenServiceChangeImageResult) ReadField0(iprot thrift.TProtocol return nil } -func (p *LaunchScreenServiceChangeImageResult) Write(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceMobileGetImageResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ChangeImage_result"); err != nil { + if err = oprot.WriteStructBegin("MobileGetImage_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -15062,7 +16135,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 *LaunchScreenServiceMobileGetImageResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -15081,43 +16154,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *LaunchScreenServiceChangeImageResult) String() string { +func (p *LaunchScreenServiceMobileGetImageResult) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceChangeImageResult(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceMobileGetImageResult(%+v)", *p) } -type LaunchScreenServiceDeleteImageArgs struct { - Req *DeleteImageRequest `thrift:"req,1"` +type LaunchScreenServiceAddImagePointTimeArgs struct { + Req *AddImagePointTimeRequest `thrift:"req,1"` } -func NewLaunchScreenServiceDeleteImageArgs() *LaunchScreenServiceDeleteImageArgs { - return &LaunchScreenServiceDeleteImageArgs{} +func NewLaunchScreenServiceAddImagePointTimeArgs() *LaunchScreenServiceAddImagePointTimeArgs { + return &LaunchScreenServiceAddImagePointTimeArgs{} } -func (p *LaunchScreenServiceDeleteImageArgs) InitDefault() { +func (p *LaunchScreenServiceAddImagePointTimeArgs) InitDefault() { } -var LaunchScreenServiceDeleteImageArgs_Req_DEFAULT *DeleteImageRequest +var LaunchScreenServiceAddImagePointTimeArgs_Req_DEFAULT *AddImagePointTimeRequest -func (p *LaunchScreenServiceDeleteImageArgs) GetReq() (v *DeleteImageRequest) { +func (p *LaunchScreenServiceAddImagePointTimeArgs) GetReq() (v *AddImagePointTimeRequest) { if !p.IsSetReq() { - return LaunchScreenServiceDeleteImageArgs_Req_DEFAULT + return LaunchScreenServiceAddImagePointTimeArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_LaunchScreenServiceDeleteImageArgs = map[int16]string{ +var fieldIDToName_LaunchScreenServiceAddImagePointTimeArgs = map[int16]string{ 1: "req", } -func (p *LaunchScreenServiceDeleteImageArgs) IsSetReq() bool { +func (p *LaunchScreenServiceAddImagePointTimeArgs) IsSetReq() bool { return p.Req != nil } -func (p *LaunchScreenServiceDeleteImageArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceAddImagePointTimeArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -15163,7 +16236,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_LaunchScreenServiceAddImagePointTimeArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -15173,8 +16246,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 *LaunchScreenServiceAddImagePointTimeArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewAddImagePointTimeRequest() if err := _field.Read(iprot); err != nil { return err } @@ -15182,9 +16255,9 @@ func (p *LaunchScreenServiceDeleteImageArgs) ReadField1(iprot thrift.TProtocol) return nil } -func (p *LaunchScreenServiceDeleteImageArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceAddImagePointTimeArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("DeleteImage_args"); err != nil { + if err = oprot.WriteStructBegin("AddImagePointTime_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -15210,7 +16283,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 *LaunchScreenServiceAddImagePointTimeArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -15227,43 +16300,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *LaunchScreenServiceDeleteImageArgs) String() string { +func (p *LaunchScreenServiceAddImagePointTimeArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceDeleteImageArgs(%+v)", *p) + return fmt.Sprintf("LaunchScreenServiceAddImagePointTimeArgs(%+v)", *p) } -type LaunchScreenServiceDeleteImageResult struct { - Success *DeleteImageResponse `thrift:"success,0,optional"` +type LaunchScreenServiceAddImagePointTimeResult struct { + Success *AddImagePointTimeResponse `thrift:"success,0,optional"` } -func NewLaunchScreenServiceDeleteImageResult() *LaunchScreenServiceDeleteImageResult { - return &LaunchScreenServiceDeleteImageResult{} +func NewLaunchScreenServiceAddImagePointTimeResult() *LaunchScreenServiceAddImagePointTimeResult { + return &LaunchScreenServiceAddImagePointTimeResult{} } -func (p *LaunchScreenServiceDeleteImageResult) InitDefault() { +func (p *LaunchScreenServiceAddImagePointTimeResult) InitDefault() { } -var LaunchScreenServiceDeleteImageResult_Success_DEFAULT *DeleteImageResponse +var LaunchScreenServiceAddImagePointTimeResult_Success_DEFAULT *AddImagePointTimeResponse -func (p *LaunchScreenServiceDeleteImageResult) GetSuccess() (v *DeleteImageResponse) { +func (p *LaunchScreenServiceAddImagePointTimeResult) GetSuccess() (v *AddImagePointTimeResponse) { if !p.IsSetSuccess() { - return LaunchScreenServiceDeleteImageResult_Success_DEFAULT + return LaunchScreenServiceAddImagePointTimeResult_Success_DEFAULT } return p.Success } -var fieldIDToName_LaunchScreenServiceDeleteImageResult = map[int16]string{ +var fieldIDToName_LaunchScreenServiceAddImagePointTimeResult = map[int16]string{ 0: "success", } -func (p *LaunchScreenServiceDeleteImageResult) IsSetSuccess() bool { +func (p *LaunchScreenServiceAddImagePointTimeResult) IsSetSuccess() bool { return p.Success != nil } -func (p *LaunchScreenServiceDeleteImageResult) Read(iprot thrift.TProtocol) (err error) { +func (p *LaunchScreenServiceAddImagePointTimeResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -15299,119 +16372,355 @@ func (p *LaunchScreenServiceDeleteImageResult) Read(iprot thrift.TProtocol) (err goto ReadFieldEndError } } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError + 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_LaunchScreenServiceAddImagePointTimeResult[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 *LaunchScreenServiceAddImagePointTimeResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewAddImagePointTimeResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *LaunchScreenServiceAddImagePointTimeResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + 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 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 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 paperServiceProcessorGetDownloadUrl struct { + handler PaperService +} + +func (p *paperServiceProcessorGetDownloadUrl) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := PaperServiceGetDownloadUrlArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetDownloadUrl", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + 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 +} - 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_LaunchScreenServiceDeleteImageResult[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) +type paperServiceProcessorListDirFilesForAndroid struct { + handler PaperService } -func (p *LaunchScreenServiceDeleteImageResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewDeleteImageResponse() - if err := _field.Read(iprot); err != nil { - return err +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 } - p.Success = _field - return nil -} -func (p *LaunchScreenServiceDeleteImageResult) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("DeleteImage_result"); err != nil { - goto WriteStructBeginError + 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 p != nil { - if err = p.writeField0(oprot); err != nil { - fieldId = 0 - goto WriteFieldError - } + if err2 = oprot.WriteMessageBegin("ListDirFilesForAndroid", thrift.REPLY, seqId); err2 != nil { + err = err2 } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err } -func (p *LaunchScreenServiceDeleteImageResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - goto WriteFieldBeginError - } - if err := p.Success.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +type paperServiceProcessorGetDownloadUrlForAndroid struct { + handler PaperService } -func (p *LaunchScreenServiceDeleteImageResult) String() string { - if p == nil { - return "" +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 } - return fmt.Sprintf("LaunchScreenServiceDeleteImageResult(%+v)", *p) + iprot.ReadMessageEnd() + var err2 error + result := PaperServiceGetDownloadUrlForAndroidResult{} + var retval *GetDownloadUrlForAndroidResponse + if retval, err2 = p.handler.GetDownloadUrlForAndroid(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetDownloadUrlForAndroid: "+err2.Error()) + oprot.WriteMessageBegin("GetDownloadUrlForAndroid", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetDownloadUrlForAndroid", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err } -type LaunchScreenServiceMobileGetImageArgs struct { - Req *MobileGetImageRequest `thrift:"req,1"` +type PaperServiceListDirFilesArgs struct { + Req *ListDirFilesRequest `thrift:"req,1"` } -func NewLaunchScreenServiceMobileGetImageArgs() *LaunchScreenServiceMobileGetImageArgs { - return &LaunchScreenServiceMobileGetImageArgs{} +func NewPaperServiceListDirFilesArgs() *PaperServiceListDirFilesArgs { + return &PaperServiceListDirFilesArgs{} } -func (p *LaunchScreenServiceMobileGetImageArgs) InitDefault() { +func (p *PaperServiceListDirFilesArgs) InitDefault() { } -var LaunchScreenServiceMobileGetImageArgs_Req_DEFAULT *MobileGetImageRequest +var PaperServiceListDirFilesArgs_Req_DEFAULT *ListDirFilesRequest -func (p *LaunchScreenServiceMobileGetImageArgs) GetReq() (v *MobileGetImageRequest) { +func (p *PaperServiceListDirFilesArgs) GetReq() (v *ListDirFilesRequest) { if !p.IsSetReq() { - return LaunchScreenServiceMobileGetImageArgs_Req_DEFAULT + return PaperServiceListDirFilesArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_LaunchScreenServiceMobileGetImageArgs = map[int16]string{ +var fieldIDToName_PaperServiceListDirFilesArgs = map[int16]string{ 1: "req", } -func (p *LaunchScreenServiceMobileGetImageArgs) IsSetReq() bool { +func (p *PaperServiceListDirFilesArgs) IsSetReq() bool { return p.Req != nil } -func (p *LaunchScreenServiceMobileGetImageArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *PaperServiceListDirFilesArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -15457,7 +16766,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_PaperServiceListDirFilesArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -15467,8 +16776,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 *PaperServiceListDirFilesArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewListDirFilesRequest() if err := _field.Read(iprot); err != nil { return err } @@ -15476,9 +16785,9 @@ func (p *LaunchScreenServiceMobileGetImageArgs) ReadField1(iprot thrift.TProtoco return nil } -func (p *LaunchScreenServiceMobileGetImageArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *PaperServiceListDirFilesArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("MobileGetImage_args"); err != nil { + if err = oprot.WriteStructBegin("ListDirFiles_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -15504,7 +16813,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 *PaperServiceListDirFilesArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -15521,43 +16830,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *LaunchScreenServiceMobileGetImageArgs) String() string { +func (p *PaperServiceListDirFilesArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceMobileGetImageArgs(%+v)", *p) + return fmt.Sprintf("PaperServiceListDirFilesArgs(%+v)", *p) } -type LaunchScreenServiceMobileGetImageResult struct { - Success *MobileGetImageResponse `thrift:"success,0,optional"` +type PaperServiceListDirFilesResult struct { + Success *ListDirFilesResponse `thrift:"success,0,optional"` } -func NewLaunchScreenServiceMobileGetImageResult() *LaunchScreenServiceMobileGetImageResult { - return &LaunchScreenServiceMobileGetImageResult{} +func NewPaperServiceListDirFilesResult() *PaperServiceListDirFilesResult { + return &PaperServiceListDirFilesResult{} } -func (p *LaunchScreenServiceMobileGetImageResult) InitDefault() { +func (p *PaperServiceListDirFilesResult) InitDefault() { } -var LaunchScreenServiceMobileGetImageResult_Success_DEFAULT *MobileGetImageResponse +var PaperServiceListDirFilesResult_Success_DEFAULT *ListDirFilesResponse -func (p *LaunchScreenServiceMobileGetImageResult) GetSuccess() (v *MobileGetImageResponse) { +func (p *PaperServiceListDirFilesResult) GetSuccess() (v *ListDirFilesResponse) { if !p.IsSetSuccess() { - return LaunchScreenServiceMobileGetImageResult_Success_DEFAULT + return PaperServiceListDirFilesResult_Success_DEFAULT } return p.Success } -var fieldIDToName_LaunchScreenServiceMobileGetImageResult = map[int16]string{ +var fieldIDToName_PaperServiceListDirFilesResult = map[int16]string{ 0: "success", } -func (p *LaunchScreenServiceMobileGetImageResult) IsSetSuccess() bool { +func (p *PaperServiceListDirFilesResult) IsSetSuccess() bool { return p.Success != nil } -func (p *LaunchScreenServiceMobileGetImageResult) Read(iprot thrift.TProtocol) (err error) { +func (p *PaperServiceListDirFilesResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -15603,7 +16912,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_PaperServiceListDirFilesResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -15613,8 +16922,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 *PaperServiceListDirFilesResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewListDirFilesResponse() if err := _field.Read(iprot); err != nil { return err } @@ -15622,9 +16931,9 @@ func (p *LaunchScreenServiceMobileGetImageResult) ReadField0(iprot thrift.TProto return nil } -func (p *LaunchScreenServiceMobileGetImageResult) Write(oprot thrift.TProtocol) (err error) { +func (p *PaperServiceListDirFilesResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("MobileGetImage_result"); err != nil { + if err = oprot.WriteStructBegin("ListDirFiles_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -15650,7 +16959,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *LaunchScreenServiceMobileGetImageResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *PaperServiceListDirFilesResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -15669,43 +16978,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *LaunchScreenServiceMobileGetImageResult) String() string { +func (p *PaperServiceListDirFilesResult) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceMobileGetImageResult(%+v)", *p) + return fmt.Sprintf("PaperServiceListDirFilesResult(%+v)", *p) } -type LaunchScreenServiceAddImagePointTimeArgs struct { - Req *AddImagePointTimeRequest `thrift:"req,1"` +type PaperServiceGetDownloadUrlArgs struct { + Req *GetDownloadUrlRequest `thrift:"req,1"` } -func NewLaunchScreenServiceAddImagePointTimeArgs() *LaunchScreenServiceAddImagePointTimeArgs { - return &LaunchScreenServiceAddImagePointTimeArgs{} +func NewPaperServiceGetDownloadUrlArgs() *PaperServiceGetDownloadUrlArgs { + return &PaperServiceGetDownloadUrlArgs{} } -func (p *LaunchScreenServiceAddImagePointTimeArgs) InitDefault() { +func (p *PaperServiceGetDownloadUrlArgs) InitDefault() { } -var LaunchScreenServiceAddImagePointTimeArgs_Req_DEFAULT *AddImagePointTimeRequest +var PaperServiceGetDownloadUrlArgs_Req_DEFAULT *GetDownloadUrlRequest -func (p *LaunchScreenServiceAddImagePointTimeArgs) GetReq() (v *AddImagePointTimeRequest) { +func (p *PaperServiceGetDownloadUrlArgs) GetReq() (v *GetDownloadUrlRequest) { if !p.IsSetReq() { - return LaunchScreenServiceAddImagePointTimeArgs_Req_DEFAULT + return PaperServiceGetDownloadUrlArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_LaunchScreenServiceAddImagePointTimeArgs = map[int16]string{ +var fieldIDToName_PaperServiceGetDownloadUrlArgs = map[int16]string{ 1: "req", } -func (p *LaunchScreenServiceAddImagePointTimeArgs) IsSetReq() bool { +func (p *PaperServiceGetDownloadUrlArgs) IsSetReq() bool { return p.Req != nil } -func (p *LaunchScreenServiceAddImagePointTimeArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *PaperServiceGetDownloadUrlArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -15751,7 +17060,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LaunchScreenServiceAddImagePointTimeArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaperServiceGetDownloadUrlArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -15761,8 +17070,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *LaunchScreenServiceAddImagePointTimeArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewAddImagePointTimeRequest() +func (p *PaperServiceGetDownloadUrlArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetDownloadUrlRequest() if err := _field.Read(iprot); err != nil { return err } @@ -15770,9 +17079,9 @@ func (p *LaunchScreenServiceAddImagePointTimeArgs) ReadField1(iprot thrift.TProt return nil } -func (p *LaunchScreenServiceAddImagePointTimeArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *PaperServiceGetDownloadUrlArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("AddImagePointTime_args"); err != nil { + if err = oprot.WriteStructBegin("GetDownloadUrl_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -15798,7 +17107,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *LaunchScreenServiceAddImagePointTimeArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *PaperServiceGetDownloadUrlArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -15815,43 +17124,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *LaunchScreenServiceAddImagePointTimeArgs) String() string { +func (p *PaperServiceGetDownloadUrlArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("LaunchScreenServiceAddImagePointTimeArgs(%+v)", *p) + return fmt.Sprintf("PaperServiceGetDownloadUrlArgs(%+v)", *p) } -type LaunchScreenServiceAddImagePointTimeResult struct { - Success *AddImagePointTimeResponse `thrift:"success,0,optional"` +type PaperServiceGetDownloadUrlResult struct { + Success *GetDownloadUrlResponse `thrift:"success,0,optional"` } -func NewLaunchScreenServiceAddImagePointTimeResult() *LaunchScreenServiceAddImagePointTimeResult { - return &LaunchScreenServiceAddImagePointTimeResult{} +func NewPaperServiceGetDownloadUrlResult() *PaperServiceGetDownloadUrlResult { + return &PaperServiceGetDownloadUrlResult{} } -func (p *LaunchScreenServiceAddImagePointTimeResult) InitDefault() { +func (p *PaperServiceGetDownloadUrlResult) InitDefault() { } -var LaunchScreenServiceAddImagePointTimeResult_Success_DEFAULT *AddImagePointTimeResponse +var PaperServiceGetDownloadUrlResult_Success_DEFAULT *GetDownloadUrlResponse -func (p *LaunchScreenServiceAddImagePointTimeResult) GetSuccess() (v *AddImagePointTimeResponse) { +func (p *PaperServiceGetDownloadUrlResult) GetSuccess() (v *GetDownloadUrlResponse) { if !p.IsSetSuccess() { - return LaunchScreenServiceAddImagePointTimeResult_Success_DEFAULT + return PaperServiceGetDownloadUrlResult_Success_DEFAULT } return p.Success } -var fieldIDToName_LaunchScreenServiceAddImagePointTimeResult = map[int16]string{ +var fieldIDToName_PaperServiceGetDownloadUrlResult = map[int16]string{ 0: "success", } -func (p *LaunchScreenServiceAddImagePointTimeResult) IsSetSuccess() bool { +func (p *PaperServiceGetDownloadUrlResult) IsSetSuccess() bool { return p.Success != nil } -func (p *LaunchScreenServiceAddImagePointTimeResult) Read(iprot thrift.TProtocol) (err error) { +func (p *PaperServiceGetDownloadUrlResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -15897,7 +17206,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_PaperServiceGetDownloadUrlResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -15907,8 +17216,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *LaunchScreenServiceAddImagePointTimeResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewAddImagePointTimeResponse() +func (p *PaperServiceGetDownloadUrlResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetDownloadUrlResponse() if err := _field.Read(iprot); err != nil { return err } @@ -15916,9 +17225,9 @@ func (p *LaunchScreenServiceAddImagePointTimeResult) ReadField0(iprot thrift.TPr return nil } -func (p *LaunchScreenServiceAddImagePointTimeResult) Write(oprot thrift.TProtocol) (err error) { +func (p *PaperServiceGetDownloadUrlResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("AddImagePointTime_result"); err != nil { + if err = oprot.WriteStructBegin("GetDownloadUrl_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -15944,7 +17253,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *LaunchScreenServiceAddImagePointTimeResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *PaperServiceGetDownloadUrlResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -15963,181 +17272,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *LaunchScreenServiceAddImagePointTimeResult) String() string { +func (p *PaperServiceGetDownloadUrlResult) 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}) - 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 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 paperServiceProcessorGetDownloadUrl struct { - handler PaperService -} - -func (p *paperServiceProcessorGetDownloadUrl) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := PaperServiceGetDownloadUrlArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetDownloadUrl", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } + return fmt.Sprintf("PaperServiceGetDownloadUrlResult(%+v)", *p) - iprot.ReadMessageEnd() - var err2 error - result := PaperServiceGetDownloadUrlResult{} - var retval *GetDownloadUrlResponse - if retval, err2 = p.handler.GetDownloadUrl(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetDownloadUrl: "+err2.Error()) - oprot.WriteMessageBegin("GetDownloadUrl", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("GetDownloadUrl", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err } -type PaperServiceListDirFilesArgs struct { - Req *ListDirFilesRequest `thrift:"req,1"` +type PaperServiceListDirFilesForAndroidArgs struct { + Req *ListDirFilesForAndroidRequest `thrift:"req,1"` } -func NewPaperServiceListDirFilesArgs() *PaperServiceListDirFilesArgs { - return &PaperServiceListDirFilesArgs{} +func NewPaperServiceListDirFilesForAndroidArgs() *PaperServiceListDirFilesForAndroidArgs { + return &PaperServiceListDirFilesForAndroidArgs{} } -func (p *PaperServiceListDirFilesArgs) InitDefault() { +func (p *PaperServiceListDirFilesForAndroidArgs) InitDefault() { } -var PaperServiceListDirFilesArgs_Req_DEFAULT *ListDirFilesRequest +var PaperServiceListDirFilesForAndroidArgs_Req_DEFAULT *ListDirFilesForAndroidRequest -func (p *PaperServiceListDirFilesArgs) GetReq() (v *ListDirFilesRequest) { +func (p *PaperServiceListDirFilesForAndroidArgs) GetReq() (v *ListDirFilesForAndroidRequest) { if !p.IsSetReq() { - return PaperServiceListDirFilesArgs_Req_DEFAULT + return PaperServiceListDirFilesForAndroidArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_PaperServiceListDirFilesArgs = map[int16]string{ +var fieldIDToName_PaperServiceListDirFilesForAndroidArgs = map[int16]string{ 1: "req", } -func (p *PaperServiceListDirFilesArgs) IsSetReq() bool { +func (p *PaperServiceListDirFilesForAndroidArgs) IsSetReq() bool { return p.Req != nil } -func (p *PaperServiceListDirFilesArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *PaperServiceListDirFilesForAndroidArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -16183,7 +17354,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_PaperServiceListDirFilesForAndroidArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -16193,8 +17364,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 *PaperServiceListDirFilesForAndroidArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewListDirFilesForAndroidRequest() if err := _field.Read(iprot); err != nil { return err } @@ -16202,9 +17373,9 @@ func (p *PaperServiceListDirFilesArgs) ReadField1(iprot thrift.TProtocol) error return nil } -func (p *PaperServiceListDirFilesArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *PaperServiceListDirFilesForAndroidArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ListDirFiles_args"); err != nil { + if err = oprot.WriteStructBegin("ListDirFilesForAndroid_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -16230,7 +17401,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 *PaperServiceListDirFilesForAndroidArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -16247,43 +17418,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *PaperServiceListDirFilesArgs) String() string { +func (p *PaperServiceListDirFilesForAndroidArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("PaperServiceListDirFilesArgs(%+v)", *p) + return fmt.Sprintf("PaperServiceListDirFilesForAndroidArgs(%+v)", *p) } -type PaperServiceListDirFilesResult struct { - Success *ListDirFilesResponse `thrift:"success,0,optional"` +type PaperServiceListDirFilesForAndroidResult struct { + Success *ListDirFilesForAndroidResponse `thrift:"success,0,optional"` } -func NewPaperServiceListDirFilesResult() *PaperServiceListDirFilesResult { - return &PaperServiceListDirFilesResult{} +func NewPaperServiceListDirFilesForAndroidResult() *PaperServiceListDirFilesForAndroidResult { + return &PaperServiceListDirFilesForAndroidResult{} } -func (p *PaperServiceListDirFilesResult) InitDefault() { +func (p *PaperServiceListDirFilesForAndroidResult) InitDefault() { } -var PaperServiceListDirFilesResult_Success_DEFAULT *ListDirFilesResponse +var PaperServiceListDirFilesForAndroidResult_Success_DEFAULT *ListDirFilesForAndroidResponse -func (p *PaperServiceListDirFilesResult) GetSuccess() (v *ListDirFilesResponse) { +func (p *PaperServiceListDirFilesForAndroidResult) GetSuccess() (v *ListDirFilesForAndroidResponse) { if !p.IsSetSuccess() { - return PaperServiceListDirFilesResult_Success_DEFAULT + return PaperServiceListDirFilesForAndroidResult_Success_DEFAULT } return p.Success } -var fieldIDToName_PaperServiceListDirFilesResult = map[int16]string{ +var fieldIDToName_PaperServiceListDirFilesForAndroidResult = map[int16]string{ 0: "success", } -func (p *PaperServiceListDirFilesResult) IsSetSuccess() bool { +func (p *PaperServiceListDirFilesForAndroidResult) IsSetSuccess() bool { return p.Success != nil } -func (p *PaperServiceListDirFilesResult) Read(iprot thrift.TProtocol) (err error) { +func (p *PaperServiceListDirFilesForAndroidResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -16329,7 +17500,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_PaperServiceListDirFilesForAndroidResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -16339,8 +17510,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 *PaperServiceListDirFilesForAndroidResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewListDirFilesForAndroidResponse() if err := _field.Read(iprot); err != nil { return err } @@ -16348,9 +17519,9 @@ func (p *PaperServiceListDirFilesResult) ReadField0(iprot thrift.TProtocol) erro return nil } -func (p *PaperServiceListDirFilesResult) Write(oprot thrift.TProtocol) (err error) { +func (p *PaperServiceListDirFilesForAndroidResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("ListDirFiles_result"); err != nil { + if err = oprot.WriteStructBegin("ListDirFilesForAndroid_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -16376,7 +17547,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 *PaperServiceListDirFilesForAndroidResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -16395,43 +17566,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *PaperServiceListDirFilesResult) String() string { +func (p *PaperServiceListDirFilesForAndroidResult) String() string { if p == nil { return "" } - return fmt.Sprintf("PaperServiceListDirFilesResult(%+v)", *p) + return fmt.Sprintf("PaperServiceListDirFilesForAndroidResult(%+v)", *p) } -type PaperServiceGetDownloadUrlArgs struct { - Req *GetDownloadUrlRequest `thrift:"req,1"` +type PaperServiceGetDownloadUrlForAndroidArgs struct { + Req *GetDownloadUrlForAndroidRequest `thrift:"req,1"` } -func NewPaperServiceGetDownloadUrlArgs() *PaperServiceGetDownloadUrlArgs { - return &PaperServiceGetDownloadUrlArgs{} +func NewPaperServiceGetDownloadUrlForAndroidArgs() *PaperServiceGetDownloadUrlForAndroidArgs { + return &PaperServiceGetDownloadUrlForAndroidArgs{} } -func (p *PaperServiceGetDownloadUrlArgs) InitDefault() { +func (p *PaperServiceGetDownloadUrlForAndroidArgs) InitDefault() { } -var PaperServiceGetDownloadUrlArgs_Req_DEFAULT *GetDownloadUrlRequest +var PaperServiceGetDownloadUrlForAndroidArgs_Req_DEFAULT *GetDownloadUrlForAndroidRequest -func (p *PaperServiceGetDownloadUrlArgs) GetReq() (v *GetDownloadUrlRequest) { +func (p *PaperServiceGetDownloadUrlForAndroidArgs) GetReq() (v *GetDownloadUrlForAndroidRequest) { if !p.IsSetReq() { - return PaperServiceGetDownloadUrlArgs_Req_DEFAULT + return PaperServiceGetDownloadUrlForAndroidArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_PaperServiceGetDownloadUrlArgs = map[int16]string{ +var fieldIDToName_PaperServiceGetDownloadUrlForAndroidArgs = map[int16]string{ 1: "req", } -func (p *PaperServiceGetDownloadUrlArgs) IsSetReq() bool { +func (p *PaperServiceGetDownloadUrlForAndroidArgs) IsSetReq() bool { return p.Req != nil } -func (p *PaperServiceGetDownloadUrlArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *PaperServiceGetDownloadUrlForAndroidArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -16477,7 +17648,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_PaperServiceGetDownloadUrlForAndroidArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -16487,8 +17658,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 *PaperServiceGetDownloadUrlForAndroidArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetDownloadUrlForAndroidRequest() if err := _field.Read(iprot); err != nil { return err } @@ -16496,9 +17667,9 @@ func (p *PaperServiceGetDownloadUrlArgs) ReadField1(iprot thrift.TProtocol) erro return nil } -func (p *PaperServiceGetDownloadUrlArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *PaperServiceGetDownloadUrlForAndroidArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetDownloadUrl_args"); err != nil { + if err = oprot.WriteStructBegin("GetDownloadUrlForAndroid_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -16524,7 +17695,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 *PaperServiceGetDownloadUrlForAndroidArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -16541,43 +17712,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *PaperServiceGetDownloadUrlArgs) String() string { +func (p *PaperServiceGetDownloadUrlForAndroidArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("PaperServiceGetDownloadUrlArgs(%+v)", *p) + return fmt.Sprintf("PaperServiceGetDownloadUrlForAndroidArgs(%+v)", *p) } -type PaperServiceGetDownloadUrlResult struct { - Success *GetDownloadUrlResponse `thrift:"success,0,optional"` +type PaperServiceGetDownloadUrlForAndroidResult struct { + Success *GetDownloadUrlForAndroidResponse `thrift:"success,0,optional"` } -func NewPaperServiceGetDownloadUrlResult() *PaperServiceGetDownloadUrlResult { - return &PaperServiceGetDownloadUrlResult{} +func NewPaperServiceGetDownloadUrlForAndroidResult() *PaperServiceGetDownloadUrlForAndroidResult { + return &PaperServiceGetDownloadUrlForAndroidResult{} } -func (p *PaperServiceGetDownloadUrlResult) InitDefault() { +func (p *PaperServiceGetDownloadUrlForAndroidResult) InitDefault() { } -var PaperServiceGetDownloadUrlResult_Success_DEFAULT *GetDownloadUrlResponse +var PaperServiceGetDownloadUrlForAndroidResult_Success_DEFAULT *GetDownloadUrlForAndroidResponse -func (p *PaperServiceGetDownloadUrlResult) GetSuccess() (v *GetDownloadUrlResponse) { +func (p *PaperServiceGetDownloadUrlForAndroidResult) GetSuccess() (v *GetDownloadUrlForAndroidResponse) { if !p.IsSetSuccess() { - return PaperServiceGetDownloadUrlResult_Success_DEFAULT + return PaperServiceGetDownloadUrlForAndroidResult_Success_DEFAULT } return p.Success } -var fieldIDToName_PaperServiceGetDownloadUrlResult = map[int16]string{ +var fieldIDToName_PaperServiceGetDownloadUrlForAndroidResult = map[int16]string{ 0: "success", } -func (p *PaperServiceGetDownloadUrlResult) IsSetSuccess() bool { +func (p *PaperServiceGetDownloadUrlForAndroidResult) IsSetSuccess() bool { return p.Success != nil } -func (p *PaperServiceGetDownloadUrlResult) Read(iprot thrift.TProtocol) (err error) { +func (p *PaperServiceGetDownloadUrlForAndroidResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -16623,7 +17794,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_PaperServiceGetDownloadUrlForAndroidResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -16633,8 +17804,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 *PaperServiceGetDownloadUrlForAndroidResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetDownloadUrlForAndroidResponse() if err := _field.Read(iprot); err != nil { return err } @@ -16642,9 +17813,9 @@ func (p *PaperServiceGetDownloadUrlResult) ReadField0(iprot thrift.TProtocol) er return nil } -func (p *PaperServiceGetDownloadUrlResult) Write(oprot thrift.TProtocol) (err error) { +func (p *PaperServiceGetDownloadUrlForAndroidResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetDownloadUrl_result"); err != nil { + if err = oprot.WriteStructBegin("GetDownloadUrlForAndroid_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -16670,7 +17841,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 *PaperServiceGetDownloadUrlForAndroidResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -16689,11 +17860,11 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *PaperServiceGetDownloadUrlResult) String() string { +func (p *PaperServiceGetDownloadUrlForAndroidResult) String() string { if p == nil { return "" } - return fmt.Sprintf("PaperServiceGetDownloadUrlResult(%+v)", *p) + return fmt.Sprintf("PaperServiceGetDownloadUrlForAndroidResult(%+v)", *p) } diff --git a/api/model/model/model.go b/api/model/model/model.go index 0e41f07..627a5db 100644 --- a/api/model/model/model.go +++ b/api/model/model/model.go @@ -2692,9 +2692,14 @@ func (p *Picture) String() string { } -// 又拍云文件目录结构 +/* +* @Description 又拍云文件目录结构 +* @Param base_path 当前所在路径 +* @Param files 当前所在目录文件 +* @Param folders 当前所在目录下的文件夹 + */ type UpYunFileDir struct { - BasePath string `thrift:"basePath,1,required" form:"basePath,required" json:"basePath,required" query:"basePath,required"` + BasePath string `thrift:"base_path,1,required" form:"base_path,required" json:"base_path,required" query:"base_path,required"` Files []string `thrift:"files,2,required" form:"files,required" json:"files,required" query:"files,required"` Folders []string `thrift:"folders,3,required" form:"folders,required" json:"folders,required" query:"folders,required"` } @@ -2719,7 +2724,7 @@ func (p *UpYunFileDir) GetFolders() (v []string) { } var fieldIDToName_UpYunFileDir = map[int16]string{ - 1: "basePath", + 1: "base_path", 2: "files", 3: "folders", } @@ -2913,7 +2918,7 @@ WriteStructEndError: } func (p *UpYunFileDir) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("basePath", thrift.STRING, 1); err != nil { + if err = oprot.WriteFieldBegin("base_path", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } if err := oprot.WriteString(p.BasePath); err != nil { @@ -4387,3 +4392,445 @@ func (p *UnifiedExam) String() string { return fmt.Sprintf("UnifiedExam(%+v)", *p) } + +type PaperData struct { + BasePath string `thrift:"base_path,1,required" form:"base_path,required" json:"base_path,required" query:"base_path,required"` + Files []string `thrift:"files,2,required" form:"files,required" json:"files,required" query:"files,required"` + Folders []string `thrift:"folders,3,required" form:"folders,required" json:"folders,required" query:"folders,required"` +} + +func NewPaperData() *PaperData { + return &PaperData{} +} + +func (p *PaperData) InitDefault() { +} + +func (p *PaperData) GetBasePath() (v string) { + return p.BasePath +} + +func (p *PaperData) GetFiles() (v []string) { + return p.Files +} + +func (p *PaperData) GetFolders() (v []string) { + return p.Folders +} + +var fieldIDToName_PaperData = map[int16]string{ + 1: "base_path", + 2: "files", + 3: "folders", +} + +func (p *PaperData) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetBasePath bool = false + var issetFiles bool = false + var issetFolders bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + 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 + } + issetBasePath = 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 + } + issetFiles = true + } 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 + } + issetFolders = 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 !issetBasePath { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetFiles { + fieldId = 2 + goto RequiredFieldNotSetError + } + + if !issetFolders { + fieldId = 3 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaperData[fieldId]), err) +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_PaperData[fieldId])) +} + +func (p *PaperData) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.BasePath = _field + return nil +} +func (p *PaperData) 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 { + return err + } + p.Files = _field + return nil +} +func (p *PaperData) ReadField3(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]string, 0, size) + for i := 0; i < size; i++ { + + var _elem string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _elem = v + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.Folders = _field + return nil +} + +func (p *PaperData) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("PaperData"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *PaperData) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base_path", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.BasePath); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + 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 *PaperData) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("files", thrift.LIST, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Files)); err != nil { + return err + } + for _, v := range p.Files { + if err := oprot.WriteString(v); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *PaperData) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("folders", thrift.LIST, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Folders)); err != nil { + return err + } + for _, v := range p.Folders { + if err := oprot.WriteString(v); err != nil { + return err + } + } + 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 *PaperData) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PaperData(%+v)", *p) + +} + +type PaperUrlData struct { + URL string `thrift:"url,1,required" form:"url,required" json:"url,required" query:"url,required"` +} + +func NewPaperUrlData() *PaperUrlData { + return &PaperUrlData{} +} + +func (p *PaperUrlData) InitDefault() { +} + +func (p *PaperUrlData) GetURL() (v string) { + return p.URL +} + +var fieldIDToName_PaperUrlData = map[int16]string{ + 1: "url", +} + +func (p *PaperUrlData) 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 + } + + 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 + } + 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 + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + if !issetURL { + fieldId = 1 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaperUrlData[fieldId]), err) +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_PaperUrlData[fieldId])) +} + +func (p *PaperUrlData) 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 *PaperUrlData) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("PaperUrlData"); 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 *PaperUrlData) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("url", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.URL); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + 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 *PaperUrlData) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PaperUrlData(%+v)", *p) + +} diff --git a/api/pack/paper.go b/api/pack/paper.go index b737c27..edca87c 100644 --- a/api/pack/paper.go +++ b/api/pack/paper.go @@ -17,8 +17,12 @@ limitations under the License. package pack import ( + "github.com/cloudwego/hertz/pkg/app" + "github.com/cloudwego/hertz/pkg/protocol/consts" + api "github.com/west2-online/fzuhelper-server/api/model/model" "github.com/west2-online/fzuhelper-server/kitex_gen/model" + "github.com/west2-online/fzuhelper-server/pkg/errno" ) func BuildUpYunFileDir(res *model.UpYunFileDir) *api.UpYunFileDir { @@ -28,3 +32,26 @@ func BuildUpYunFileDir(res *model.UpYunFileDir) *api.UpYunFileDir { Files: res.Files, } } + +type RespWithDataInPaper struct { + Code int `json:"code"` + Data any `json:"data"` + Msg string `json:"msg"` +} + +func RespDataInPaper(c *app.RequestContext, data any) { + c.JSON(consts.StatusOK, RespWithDataInPaper{ + Code: errno.SuccessCodePaper, + Msg: "Success", + Data: data, + }) +} + +func RespErrorInPaper(c *app.RequestContext, err error) { + Errno := errno.ConvertErr(err) + c.JSON(consts.StatusOK, RespWithDataInPaper{ + Code: int(Errno.ErrorCode), + Msg: Errno.ErrorMsg, + Data: nil, + }) +} diff --git a/api/router/api/api.go b/api/router/api/api.go index a43e442..19d2743 100644 --- a/api/router/api/api.go +++ b/api/router/api/api.go @@ -42,6 +42,8 @@ func Register(r *server.Hertz) { } { _v1 := _api.Group("/v1", _v1Mw()...) + _v1.GET("/downloadUrl", append(_getdownloadurlforandroidMw(), api.GetDownloadUrlForAndroid)...) + _v1.GET("/list", append(_listdirfilesforandroidMw(), api.ListDirFilesForAndroid)...) { _common := _v1.Group("/common", _commonMw()...) { diff --git a/api/router/api/middleware.go b/api/router/api/middleware.go index c397f5f..e340f0b 100644 --- a/api/router/api/middleware.go +++ b/api/router/api/middleware.go @@ -286,3 +286,13 @@ func _validatecodeforandroidMw() []app.HandlerFunc { // your code... return nil } + +func _getdownloadurlforandroidMw() []app.HandlerFunc { + // your code... + return nil +} + +func _listdirfilesforandroidMw() []app.HandlerFunc { + // your code... + return nil +} diff --git a/api/router/custom_router.go b/api/router/custom_router.go index 7bb2869..3b9dec3 100644 --- a/api/router/custom_router.go +++ b/api/router/custom_router.go @@ -42,7 +42,17 @@ func customizedRegister(r *server.Hertz) { r.GET("/api/image/point", api.AddImagePointTime) r.GET("/api/screen", api.MobileGetImage) - // 历年卷兼容 - r.GET("/api/v1/list", api.ListDirFiles) - r.GET("/api/v1/downloadUrl", api.GetDownloadUrl) + // url服务的兼容 + /* + 旧的fuu客户端采取的是 + r.GET("/onekey/FZUHelper.html", api.FZUHelperHTML) 对应 福uu隐私政策 + r.GET("/onekey/UserAgreement.html", api.UserAgreementHTML) 对应 福uu用户服务协议 + + 隐私政策和用户协议对应url前缀 + const val USER_AGREEMENT = "https://iosfzuhelper.west2online.com/onekey/UserAgreement.html" + const val PRIVACY_POLICY = "https://iosfzuhelper.west2online.com/onekey/FZUHelper.html" + 飞书文档:https://west2-online.feishu.cn/wiki/AGaHw9B2EiEV04knIHEczlTxn5f + */ + r.GET("/onekey/FZUHelper.html", api.FZUHelperHTML) + r.GET("/onekey/UserAgreement.html", api.UserAgreementHTML) } diff --git a/idl/api.thrift b/idl/api.thrift index 17f28cb..6c17201 100644 --- a/idl/api.thrift +++ b/idl/api.thrift @@ -173,16 +173,38 @@ struct ListDirFilesResponse { } struct GetDownloadUrlRequest { - 1: required string url, + 1: required string filepath, } struct GetDownloadUrlResponse { 1: required string url, } +// 兼容 +struct ListDirFilesForAndroidRequest { + 1: required string path, +} + +struct ListDirFilesForAndroidResponse { + +} + +struct GetDownloadUrlForAndroidRequest { + 1: required string filepath, +} + +struct GetDownloadUrlForAndroidResponse { + +} + + service PaperService { ListDirFilesResponse ListDirFiles(1: ListDirFilesRequest req) (api.get="/api/v1/paper/list"), GetDownloadUrlResponse GetDownloadUrl(1: GetDownloadUrlRequest req) (api.get="/api/v1/paper/download"), + + // 兼容安卓 + ListDirFilesForAndroidResponse ListDirFilesForAndroid(1: ListDirFilesForAndroidRequest req) (api.get="/api/v1/list") + GetDownloadUrlForAndroidResponse GetDownloadUrlForAndroid(1: GetDownloadUrlForAndroidRequest req) (api.get="/api/v1/downloadUrl") } // academic diff --git a/idl/model.thrift b/idl/model.thrift index 76357f9..701f357 100644 --- a/idl/model.thrift +++ b/idl/model.thrift @@ -63,9 +63,15 @@ struct Picture{ 16:string regex, // 推送对象,通过正则里是否有学号来判断是否为推送目标 } -// 又拍云文件目录结构 + +/* +* @Description 又拍云文件目录结构 +* @Param base_path 当前所在路径 +* @Param files 当前所在目录文件 +* @Param folders 当前所在目录下的文件夹 +*/ struct UpYunFileDir { - 1: required string basePath, + 1: required string base_path, 2: required list files, 3: required list folders, } @@ -104,3 +110,15 @@ struct UnifiedExam { 2: required string score 3: required string term } + + + +struct PaperData { + 1: required string base_path, + 2: required list files, + 3: required list folders, +} + +struct PaperUrlData { + 1: required string url, +} \ No newline at end of file diff --git a/idl/paper.thrift b/idl/paper.thrift index 765f935..12c1eb3 100644 --- a/idl/paper.thrift +++ b/idl/paper.thrift @@ -13,7 +13,7 @@ struct ListDirFilesResponse { } struct GetDownloadUrlRequest { - 1: required string url, + 1: required string filepath, } struct GetDownloadUrlResponse { diff --git a/internal/paper/service/download_url.go b/internal/paper/service/download_url.go index 771d73d..565eed2 100644 --- a/internal/paper/service/download_url.go +++ b/internal/paper/service/download_url.go @@ -22,5 +22,5 @@ import ( ) func (s *PaperService) GetDownloadUrl(req *paper.GetDownloadUrlRequest) (string, error) { - return upyun.GetDownloadUrl(req.Url) + return upyun.GetDownloadUrl(req.Filepath) } diff --git a/kitex_gen/model/model.go b/kitex_gen/model/model.go index ca0e336..f5d933d 100644 --- a/kitex_gen/model/model.go +++ b/kitex_gen/model/model.go @@ -3275,7 +3275,7 @@ func (p *Picture) Field16DeepEqual(src string) bool { } type UpYunFileDir struct { - BasePath string `thrift:"basePath,1,required" frugal:"1,required,string" json:"basePath"` + BasePath string `thrift:"base_path,1,required" frugal:"1,required,string" json:"base_path"` Files []string `thrift:"files,2,required" frugal:"2,required,list" json:"files"` Folders []string `thrift:"folders,3,required" frugal:"3,required,list" json:"folders"` } @@ -3309,7 +3309,7 @@ func (p *UpYunFileDir) SetFolders(val []string) { } var fieldIDToName_UpYunFileDir = map[int16]string{ - 1: "basePath", + 1: "base_path", 2: "files", 3: "folders", } @@ -3503,7 +3503,7 @@ WriteStructEndError: } func (p *UpYunFileDir) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("basePath", thrift.STRING, 1); err != nil { + if err = oprot.WriteFieldBegin("base_path", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } if err := oprot.WriteString(p.BasePath); err != nil { diff --git a/kitex_gen/paper/k-paper.go b/kitex_gen/paper/k-paper.go index d8c7457..303c612 100644 --- a/kitex_gen/paper/k-paper.go +++ b/kitex_gen/paper/k-paper.go @@ -309,7 +309,7 @@ func (p *GetDownloadUrlRequest) FastRead(buf []byte) (int, error) { var l int var fieldTypeId thrift.TType var fieldId int16 - var issetUrl bool = false + var issetFilepath bool = false for { fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) offset += l @@ -327,7 +327,7 @@ func (p *GetDownloadUrlRequest) FastRead(buf []byte) (int, error) { if err != nil { goto ReadFieldError } - issetUrl = true + issetFilepath = true } else { l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -344,7 +344,7 @@ func (p *GetDownloadUrlRequest) FastRead(buf []byte) (int, error) { } } - if !issetUrl { + if !issetFilepath { fieldId = 1 goto RequiredFieldNotSetError } @@ -369,7 +369,7 @@ func (p *GetDownloadUrlRequest) FastReadField1(buf []byte) (int, error) { offset += l _field = v } - p.Url = _field + p.Filepath = _field return offset, nil } @@ -399,14 +399,14 @@ func (p *GetDownloadUrlRequest) BLength() int { func (p *GetDownloadUrlRequest) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { offset := 0 offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) - offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.Url) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.Filepath) return offset } func (p *GetDownloadUrlRequest) field1Length() int { l := 0 l += thrift.Binary.FieldBeginLength() - l += thrift.Binary.StringLengthNocopy(p.Url) + l += thrift.Binary.StringLengthNocopy(p.Filepath) return l } diff --git a/kitex_gen/paper/paper.go b/kitex_gen/paper/paper.go index affd6fd..10e8758 100644 --- a/kitex_gen/paper/paper.go +++ b/kitex_gen/paper/paper.go @@ -449,7 +449,7 @@ func (p *ListDirFilesResponse) Field2DeepEqual(src *model.UpYunFileDir) bool { } type GetDownloadUrlRequest struct { - Url string `thrift:"url,1,required" frugal:"1,required,string" json:"url"` + Filepath string `thrift:"filepath,1,required" frugal:"1,required,string" json:"filepath"` } func NewGetDownloadUrlRequest() *GetDownloadUrlRequest { @@ -459,22 +459,22 @@ func NewGetDownloadUrlRequest() *GetDownloadUrlRequest { func (p *GetDownloadUrlRequest) InitDefault() { } -func (p *GetDownloadUrlRequest) GetUrl() (v string) { - return p.Url +func (p *GetDownloadUrlRequest) GetFilepath() (v string) { + return p.Filepath } -func (p *GetDownloadUrlRequest) SetUrl(val string) { - p.Url = val +func (p *GetDownloadUrlRequest) SetFilepath(val string) { + p.Filepath = val } var fieldIDToName_GetDownloadUrlRequest = map[int16]string{ - 1: "url", + 1: "filepath", } func (p *GetDownloadUrlRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetUrl bool = false + var issetFilepath bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -495,7 +495,7 @@ func (p *GetDownloadUrlRequest) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetUrl = true + issetFilepath = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -512,7 +512,7 @@ func (p *GetDownloadUrlRequest) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetUrl { + if !issetFilepath { fieldId = 1 goto RequiredFieldNotSetError } @@ -542,7 +542,7 @@ func (p *GetDownloadUrlRequest) ReadField1(iprot thrift.TProtocol) error { } else { _field = v } - p.Url = _field + p.Filepath = _field return nil } @@ -575,10 +575,10 @@ WriteStructEndError: } func (p *GetDownloadUrlRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("url", thrift.STRING, 1); err != nil { + if err = oprot.WriteFieldBegin("filepath", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(p.Url); err != nil { + if err := oprot.WriteString(p.Filepath); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -605,7 +605,7 @@ func (p *GetDownloadUrlRequest) DeepEqual(ano *GetDownloadUrlRequest) bool { } else if p == nil || ano == nil { return false } - if !p.Field1DeepEqual(ano.Url) { + if !p.Field1DeepEqual(ano.Filepath) { return false } return true @@ -613,7 +613,7 @@ func (p *GetDownloadUrlRequest) DeepEqual(ano *GetDownloadUrlRequest) bool { func (p *GetDownloadUrlRequest) Field1DeepEqual(src string) bool { - if strings.Compare(p.Url, src) != 0 { + if strings.Compare(p.Filepath, src) != 0 { return false } return true diff --git a/pkg/constants/constants.go b/pkg/constants/constants.go index 68ef3ec..377a769 100644 --- a/pkg/constants/constants.go +++ b/pkg/constants/constants.go @@ -33,6 +33,7 @@ const ( ApiServiceName = "api" LaunchScreenServiceName = "launch_screen" PaperServiceName = "paper" + URLServiceName = "url" AcademicServiceName = "academic" TemplateServiceTableName = "template" UserTableName = "user" diff --git a/pkg/errno/code.go b/pkg/errno/code.go index b499801..1f30641 100644 --- a/pkg/errno/code.go +++ b/pkg/errno/code.go @@ -75,4 +75,7 @@ const ( InternalQueueErrorCode = 50018 // 队列错误 InternalETCDErrorCode = 50019 // ETCD错误 InternalTraceErrorCode = 50020 // Trace错误 + + // paper在旧版Android中的SuccessCode是2000,用作兼容 + SuccessCodePaper = 2000 ) diff --git a/pkg/upyun/paper.go b/pkg/upyun/paper.go index 0a86878..114e75e 100644 --- a/pkg/upyun/paper.go +++ b/pkg/upyun/paper.go @@ -26,7 +26,6 @@ import ( "github.com/west2-online/fzuhelper-server/config" "github.com/west2-online/fzuhelper-server/kitex_gen/model" - "github.com/west2-online/fzuhelper-server/pkg/logger" "github.com/west2-online/fzuhelper-server/pkg/utils" ) @@ -58,7 +57,6 @@ func GetDir(path string) (*model.UpYunFileDir, error) { Path: path, ObjectsChan: objsChan, }) - logger.Error(err) }() for obj := range objsChan { if obj.IsDir { From 3ade2785bf351c9b37e2d34172315119aefcfee2 Mon Sep 17 00:00:00 2001 From: penQee <138851624+penqee@users.noreply.github.com> Date: Tue, 12 Nov 2024 20:39:27 +0800 Subject: [PATCH 6/8] fix: add missing file in custom_router and adjust basePath format (#97) * fix: solve some problems in url and paper service * feat: add Android compatible handlers * feat: add comments, adjust PaperData and PaperUrlData positions * feat: modified filepath format * feat: add FZUHelper.css in custom_router --- api/model/model/model.go | 8 +- api/router/custom_router.go | 4 + idl/model.thrift | 4 +- kitex_gen/model/k-model.go | 358 ++++++++++++++++++++++++ kitex_gen/model/model.go | 532 +++++++++++++++++++++++++++++++++++- 5 files changed, 897 insertions(+), 9 deletions(-) diff --git a/api/model/model/model.go b/api/model/model/model.go index 627a5db..3caa75b 100644 --- a/api/model/model/model.go +++ b/api/model/model/model.go @@ -2694,12 +2694,12 @@ func (p *Picture) String() string { /* * @Description 又拍云文件目录结构 -* @Param base_path 当前所在路径 +* @Param basePath 当前所在路径 * @Param files 当前所在目录文件 * @Param folders 当前所在目录下的文件夹 */ type UpYunFileDir struct { - BasePath string `thrift:"base_path,1,required" form:"base_path,required" json:"base_path,required" query:"base_path,required"` + BasePath string `thrift:"basePath,1,required" form:"basePath,required" json:"basePath,required" query:"basePath,required"` Files []string `thrift:"files,2,required" form:"files,required" json:"files,required" query:"files,required"` Folders []string `thrift:"folders,3,required" form:"folders,required" json:"folders,required" query:"folders,required"` } @@ -2724,7 +2724,7 @@ func (p *UpYunFileDir) GetFolders() (v []string) { } var fieldIDToName_UpYunFileDir = map[int16]string{ - 1: "base_path", + 1: "basePath", 2: "files", 3: "folders", } @@ -2918,7 +2918,7 @@ WriteStructEndError: } func (p *UpYunFileDir) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("base_path", thrift.STRING, 1); err != nil { + if err = oprot.WriteFieldBegin("basePath", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } if err := oprot.WriteString(p.BasePath); err != nil { diff --git a/api/router/custom_router.go b/api/router/custom_router.go index 3b9dec3..5755df9 100644 --- a/api/router/custom_router.go +++ b/api/router/custom_router.go @@ -52,7 +52,11 @@ func customizedRegister(r *server.Hertz) { const val USER_AGREEMENT = "https://iosfzuhelper.west2online.com/onekey/UserAgreement.html" const val PRIVACY_POLICY = "https://iosfzuhelper.west2online.com/onekey/FZUHelper.html" 飞书文档:https://west2-online.feishu.cn/wiki/AGaHw9B2EiEV04knIHEczlTxn5f + + r.GET("/onekey/FZUHelper.css", api.FZUHelperCSS) FZUHelper.html需要这个来正常呈现结果 + */ r.GET("/onekey/FZUHelper.html", api.FZUHelperHTML) r.GET("/onekey/UserAgreement.html", api.UserAgreementHTML) + r.GET("/onekey/FZUHelper.css", api.FZUHelperCSS) } diff --git a/idl/model.thrift b/idl/model.thrift index 701f357..9ba2d98 100644 --- a/idl/model.thrift +++ b/idl/model.thrift @@ -66,12 +66,12 @@ struct Picture{ /* * @Description 又拍云文件目录结构 -* @Param base_path 当前所在路径 +* @Param basePath 当前所在路径 * @Param files 当前所在目录文件 * @Param folders 当前所在目录下的文件夹 */ struct UpYunFileDir { - 1: required string base_path, + 1: required string basePath, 2: required list files, 3: required list folders, } diff --git a/kitex_gen/model/k-model.go b/kitex_gen/model/k-model.go index b6ace76..e3f5d02 100644 --- a/kitex_gen/model/k-model.go +++ b/kitex_gen/model/k-model.go @@ -3765,3 +3765,361 @@ func (p *UnifiedExam) field3Length() int { l += thrift.Binary.StringLengthNocopy(p.Term) return l } + +func (p *PaperData) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + var issetBasePath bool = false + var issetFiles bool = false + var issetFolders 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 + } + issetBasePath = true + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetFiles = true + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetFolders = true + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + if !issetBasePath { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetFiles { + fieldId = 2 + goto RequiredFieldNotSetError + } + + if !issetFolders { + fieldId = 3 + goto RequiredFieldNotSetError + } + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaperData[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +RequiredFieldNotSetError: + return offset, thrift.NewProtocolException(thrift.INVALID_DATA, fmt.Sprintf("required field %s is not set", fieldIDToName_PaperData[fieldId])) +} + +func (p *PaperData) FastReadField1(buf []byte) (int, error) { + 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.BasePath = _field + return offset, nil +} + +func (p *PaperData) FastReadField2(buf []byte) (int, error) { + offset := 0 + + _, size, l, err := thrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make([]string, 0, size) + for i := 0; i < size; i++ { + var _elem string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _elem = v + } + + _field = append(_field, _elem) + } + p.Files = _field + return offset, nil +} + +func (p *PaperData) FastReadField3(buf []byte) (int, error) { + offset := 0 + + _, size, l, err := thrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + _field := make([]string, 0, size) + for i := 0; i < size; i++ { + var _elem string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _elem = v + } + + _field = append(_field, _elem) + } + p.Folders = _field + return offset, nil +} + +// for compatibility +func (p *PaperData) FastWrite(buf []byte) int { + return 0 +} + +func (p *PaperData) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField3(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *PaperData) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *PaperData) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.BasePath) + return offset +} + +func (p *PaperData) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 2) + listBeginOffset := offset + offset += thrift.Binary.ListBeginLength() + var length int + for _, v := range p.Files { + length++ + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, v) + } + thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) + return offset +} + +func (p *PaperData) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.LIST, 3) + listBeginOffset := offset + offset += thrift.Binary.ListBeginLength() + var length int + for _, v := range p.Folders { + length++ + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, v) + } + thrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) + return offset +} + +func (p *PaperData) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.BasePath) + return l +} + +func (p *PaperData) field2Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.ListBeginLength() + for _, v := range p.Files { + _ = v + l += thrift.Binary.StringLengthNocopy(v) + } + return l +} + +func (p *PaperData) field3Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.ListBeginLength() + for _, v := range p.Folders { + _ = v + l += thrift.Binary.StringLengthNocopy(v) + } + return l +} + +func (p *PaperUrlData) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + var issetUrl bool = false + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetUrl = true + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + if !issetUrl { + fieldId = 1 + goto RequiredFieldNotSetError + } + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaperUrlData[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +RequiredFieldNotSetError: + return offset, thrift.NewProtocolException(thrift.INVALID_DATA, fmt.Sprintf("required field %s is not set", fieldIDToName_PaperUrlData[fieldId])) +} + +func (p *PaperUrlData) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = v + } + p.Url = _field + return offset, nil +} + +// for compatibility +func (p *PaperUrlData) FastWrite(buf []byte) int { + return 0 +} + +func (p *PaperUrlData) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *PaperUrlData) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *PaperUrlData) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.Url) + return offset +} + +func (p *PaperUrlData) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.Url) + return l +} diff --git a/kitex_gen/model/model.go b/kitex_gen/model/model.go index f5d933d..a68a705 100644 --- a/kitex_gen/model/model.go +++ b/kitex_gen/model/model.go @@ -3275,7 +3275,7 @@ func (p *Picture) Field16DeepEqual(src string) bool { } type UpYunFileDir struct { - BasePath string `thrift:"base_path,1,required" frugal:"1,required,string" json:"base_path"` + BasePath string `thrift:"basePath,1,required" frugal:"1,required,string" json:"basePath"` Files []string `thrift:"files,2,required" frugal:"2,required,list" json:"files"` Folders []string `thrift:"folders,3,required" frugal:"3,required,list" json:"folders"` } @@ -3309,7 +3309,7 @@ func (p *UpYunFileDir) SetFolders(val []string) { } var fieldIDToName_UpYunFileDir = map[int16]string{ - 1: "base_path", + 1: "basePath", 2: "files", 3: "folders", } @@ -3503,7 +3503,7 @@ WriteStructEndError: } func (p *UpYunFileDir) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("base_path", thrift.STRING, 1); err != nil { + if err = oprot.WriteFieldBegin("basePath", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } if err := oprot.WriteString(p.BasePath); err != nil { @@ -5301,3 +5301,529 @@ func (p *UnifiedExam) Field3DeepEqual(src string) bool { } return true } + +type PaperData struct { + BasePath string `thrift:"base_path,1,required" frugal:"1,required,string" json:"base_path"` + Files []string `thrift:"files,2,required" frugal:"2,required,list" json:"files"` + Folders []string `thrift:"folders,3,required" frugal:"3,required,list" json:"folders"` +} + +func NewPaperData() *PaperData { + return &PaperData{} +} + +func (p *PaperData) InitDefault() { +} + +func (p *PaperData) GetBasePath() (v string) { + return p.BasePath +} + +func (p *PaperData) GetFiles() (v []string) { + return p.Files +} + +func (p *PaperData) GetFolders() (v []string) { + return p.Folders +} +func (p *PaperData) SetBasePath(val string) { + p.BasePath = val +} +func (p *PaperData) SetFiles(val []string) { + p.Files = val +} +func (p *PaperData) SetFolders(val []string) { + p.Folders = val +} + +var fieldIDToName_PaperData = map[int16]string{ + 1: "base_path", + 2: "files", + 3: "folders", +} + +func (p *PaperData) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetBasePath bool = false + var issetFiles bool = false + var issetFolders bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + 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 + } + issetBasePath = 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 + } + issetFiles = true + } 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 + } + issetFolders = 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 !issetBasePath { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetFiles { + fieldId = 2 + goto RequiredFieldNotSetError + } + + if !issetFolders { + fieldId = 3 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaperData[fieldId]), err) +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_PaperData[fieldId])) +} + +func (p *PaperData) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.BasePath = _field + return nil +} +func (p *PaperData) 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 { + return err + } + p.Files = _field + return nil +} +func (p *PaperData) ReadField3(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]string, 0, size) + for i := 0; i < size; i++ { + + var _elem string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _elem = v + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.Folders = _field + return nil +} + +func (p *PaperData) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("PaperData"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *PaperData) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base_path", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.BasePath); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + 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 *PaperData) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("files", thrift.LIST, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Files)); err != nil { + return err + } + for _, v := range p.Files { + if err := oprot.WriteString(v); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *PaperData) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("folders", thrift.LIST, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRING, len(p.Folders)); err != nil { + return err + } + for _, v := range p.Folders { + if err := oprot.WriteString(v); err != nil { + return err + } + } + 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 *PaperData) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PaperData(%+v)", *p) + +} + +func (p *PaperData) DeepEqual(ano *PaperData) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.BasePath) { + return false + } + if !p.Field2DeepEqual(ano.Files) { + return false + } + if !p.Field3DeepEqual(ano.Folders) { + return false + } + return true +} + +func (p *PaperData) Field1DeepEqual(src string) bool { + + if strings.Compare(p.BasePath, src) != 0 { + return false + } + return true +} +func (p *PaperData) Field2DeepEqual(src []string) bool { + + if len(p.Files) != len(src) { + return false + } + for i, v := range p.Files { + _src := src[i] + if strings.Compare(v, _src) != 0 { + return false + } + } + return true +} +func (p *PaperData) Field3DeepEqual(src []string) bool { + + if len(p.Folders) != len(src) { + return false + } + for i, v := range p.Folders { + _src := src[i] + if strings.Compare(v, _src) != 0 { + return false + } + } + return true +} + +type PaperUrlData struct { + Url string `thrift:"url,1,required" frugal:"1,required,string" json:"url"` +} + +func NewPaperUrlData() *PaperUrlData { + return &PaperUrlData{} +} + +func (p *PaperUrlData) InitDefault() { +} + +func (p *PaperUrlData) GetUrl() (v string) { + return p.Url +} +func (p *PaperUrlData) SetUrl(val string) { + p.Url = val +} + +var fieldIDToName_PaperUrlData = map[int16]string{ + 1: "url", +} + +func (p *PaperUrlData) 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 + } + + 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 + } + 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 + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + if !issetUrl { + fieldId = 1 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaperUrlData[fieldId]), err) +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_PaperUrlData[fieldId])) +} + +func (p *PaperUrlData) 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 *PaperUrlData) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("PaperUrlData"); 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 *PaperUrlData) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("url", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Url); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + 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 *PaperUrlData) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PaperUrlData(%+v)", *p) + +} + +func (p *PaperUrlData) DeepEqual(ano *PaperUrlData) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Url) { + return false + } + return true +} + +func (p *PaperUrlData) Field1DeepEqual(src string) bool { + + if strings.Compare(p.Url, src) != 0 { + return false + } + return true +} From 1d39651c6aeb8e2a1d08f1b5d18e34de54050186 Mon Sep 17 00:00:00 2001 From: FanR <103872180+FantasyRL@users.noreply.github.com> Date: Wed, 13 Nov 2024 12:02:55 +0800 Subject: [PATCH 7/8] fix:url error in launch_screen (#96) * fix:url error in launch_screen * fix: suffix of launch_screen * fix: CI test * fix: image file check * fix: use external package in utils.IsAllowImageType * fix:go.mod --- api/handler/api/launch_screen_service.go | 8 +- go.mod | 2 + go.sum | 2 + idl/launch_screen.thrift | 2 + .../launch_screen/service/create_image.go | 2 +- .../service/create_image_test.go | 2 +- .../launch_screen/service/update_image.go | 2 +- .../service/update_image_test.go | 1 + kitex_gen/launch_screen/k-launch_screen.go | 88 +++++++++++ kitex_gen/launch_screen/launch_screen.go | 148 +++++++++++++++++- pkg/constants/constants.go | 9 +- pkg/upyun/launch_screen.go | 18 +-- pkg/utils/utils.go | 37 +++-- 13 files changed, 289 insertions(+), 32 deletions(-) diff --git a/api/handler/api/launch_screen_service.go b/api/handler/api/launch_screen_service.go index 4e33d87..de450ec 100644 --- a/api/handler/api/launch_screen_service.go +++ b/api/handler/api/launch_screen_service.go @@ -68,7 +68,8 @@ func CreateImage(ctx context.Context, c *app.RequestContext) { resp := new(api.CreateImageResponse) - if !utils.IsAllowImageFile(imageFile) { + suffix, ok := utils.IsAllowImageFile(imageFile) + if !ok { pack.RespError(c, errno.SuffixError) return } @@ -92,6 +93,7 @@ func CreateImage(ctx context.Context, c *app.RequestContext) { Text: req.Text, Regex: req.Regex, BufferCount: int64(len(imageByte)), + Suffix: suffix, }, imageByte) if err != nil { pack.RespError(c, err) @@ -208,7 +210,8 @@ func ChangeImage(ctx context.Context, c *app.RequestContext) { } resp := new(api.ChangeImageResponse) - if !utils.IsAllowImageFile(imageFile) { + suffix, ok := utils.IsAllowImageFile(imageFile) + if !ok { pack.RespError(c, errno.SuffixError) return } @@ -222,6 +225,7 @@ func ChangeImage(ctx context.Context, c *app.RequestContext) { respImage, err := rpc.ChangeImageRPC(ctx, &launch_screen.ChangeImageRequest{ PictureId: req.PictureID, BufferCount: int64(len(imageByte)), + Suffix: suffix, }, imageByte) if err != nil { pack.RespError(c, err) diff --git a/go.mod b/go.mod index c075ece..73e7062 100644 --- a/go.mod +++ b/go.mod @@ -26,6 +26,8 @@ require ( k8s.io/client-go v0.31.2 ) +require github.com/h2non/filetype v1.1.3 + require ( cloud.google.com/go v0.116.0 // indirect cloud.google.com/go/auth v0.10.0 // indirect diff --git a/go.sum b/go.sum index 11eacb7..d005ac7 100644 --- a/go.sum +++ b/go.sum @@ -219,6 +219,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4 github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 h1:RtRsiaGvWxcwd8y3BiRZxsylPT8hLWZ5SPcfI+3IDNk= github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0/go.mod h1:TzP6duP4Py2pHLVPPQp42aoYI92+PCrVotyR5e8Vqlk= +github.com/h2non/filetype v1.1.3 h1:FKkx9QbD7HR/zjK1Ia5XiBsq9zdLi5Kf3zGyFTAFkGg= +github.com/h2non/filetype v1.1.3/go.mod h1:319b3zT68BvV+WRj7cwy856M2ehB3HqNOt6sy1HndBY= github.com/hashicorp/consul/api v1.30.0 h1:ArHVMMILb1nQv8vZSGIwwQd2gtc+oSQZ6CalyiyH2XQ= github.com/hashicorp/consul/api v1.30.0/go.mod h1:B2uGchvaXVW2JhFoS8nqTxMD5PBykr4ebY4JWHTTeLM= github.com/hashicorp/consul/sdk v0.16.1 h1:V8TxTnImoPD5cj0U9Spl0TUxcytjcbbJeADFF07KdHg= diff --git a/idl/launch_screen.thrift b/idl/launch_screen.thrift index 2fc2c56..c1116c6 100644 --- a/idl/launch_screen.thrift +++ b/idl/launch_screen.thrift @@ -15,6 +15,7 @@ struct CreateImageRequest { 11:required string text, 12:required string regex, 13:i64 buffer_count, + 14:string suffix, } struct CreateImageResponse{ @@ -58,6 +59,7 @@ struct ChangeImageRequest { 1:required i64 picture_id, 2:required binary image, 3:i64 buffer_count, + 4:string suffix, } struct ChangeImageResponse{ diff --git a/internal/launch_screen/service/create_image.go b/internal/launch_screen/service/create_image.go index 5c3aaaf..7a2a9f1 100644 --- a/internal/launch_screen/service/create_image.go +++ b/internal/launch_screen/service/create_image.go @@ -32,7 +32,7 @@ func (s *LaunchScreenService) CreateImage(req *launch_screen.CreateImageRequest) if err != nil { return nil, fmt.Errorf("LaunchScreen.CreateImage SFCreateIDError:%w", err) } - imgUrl := upyun.GenerateImgName(id) + imgUrl := upyun.GenerateImgName(id, req.Suffix) var eg errgroup.Group eg.Go(func() error { diff --git a/internal/launch_screen/service/create_image_test.go b/internal/launch_screen/service/create_image_test.go index 6fcf2c6..77cbf03 100644 --- a/internal/launch_screen/service/create_image_test.go +++ b/internal/launch_screen/service/create_image_test.go @@ -101,7 +101,7 @@ func TestLaunchScreenService_CreateImage(t *testing.T) { launchScreenService := NewLaunchScreenService(context.Background(), mockClientSet) mockey.Mock((*utils.Snowflake).NextVal).To(func() (int64, error) { return expectedResult.ID, nil }).Build() - mockey.Mock(upyun.GenerateImgName).Return(expectedResult.Url).Build() + mockey.Mock(upyun.GenerateImgName).To(func(id int64, suffix string) string { return expectedResult.Url }).Build() mockey.Mock((*launchScreenDB.DBLaunchScreen).CreateImage).Return(tc.mockReturn, nil).Build() mockey.Mock(upyun.UploadImg).Return(tc.mockCloudReturn).Build() diff --git a/internal/launch_screen/service/update_image.go b/internal/launch_screen/service/update_image.go index 60d4578..92cbbe6 100644 --- a/internal/launch_screen/service/update_image.go +++ b/internal/launch_screen/service/update_image.go @@ -33,7 +33,7 @@ func (s *LaunchScreenService) UpdateImagePath(req *launch_screen.ChangeImageRequ } delUrl := origin.Url - imgUrl := upyun.GenerateImgName(req.PictureId) + imgUrl := upyun.GenerateImgName(req.PictureId, req.Suffix) var eg errgroup.Group var err2 error diff --git a/internal/launch_screen/service/update_image_test.go b/internal/launch_screen/service/update_image_test.go index 765f374..9b95f81 100644 --- a/internal/launch_screen/service/update_image_test.go +++ b/internal/launch_screen/service/update_image_test.go @@ -126,6 +126,7 @@ func TestLaunchScreenService_UpdateImagePath(t *testing.T) { } mockey.Mock(upyun.DeleteImg).Return(tc.mockCloudReturn).Build() mockey.Mock(upyun.UploadImg).Return(tc.mockCloudReturn).Build() + mockey.Mock(upyun.GenerateImgName).To(func(id int64, suffix string) string { return expectedResult.Url }).Build() mockey.Mock((*launchScreenDB.DBLaunchScreen).UpdateImage).Return(tc.mockReturn, nil).Build() result, err := launchScreenService.UpdateImagePath(req) diff --git a/kitex_gen/launch_screen/k-launch_screen.go b/kitex_gen/launch_screen/k-launch_screen.go index f580631..47770c0 100644 --- a/kitex_gen/launch_screen/k-launch_screen.go +++ b/kitex_gen/launch_screen/k-launch_screen.go @@ -260,6 +260,20 @@ func (p *CreateImageRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 14: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField14(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 @@ -512,6 +526,20 @@ func (p *CreateImageRequest) FastReadField13(buf []byte) (int, error) { return offset, nil } +func (p *CreateImageRequest) FastReadField14(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.Suffix = _field + return offset, nil +} + // for compatibility func (p *CreateImageRequest) FastWrite(buf []byte) int { return 0 @@ -533,6 +561,7 @@ func (p *CreateImageRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) offset += p.fastWriteField4(buf[offset:], w) offset += p.fastWriteField11(buf[offset:], w) offset += p.fastWriteField12(buf[offset:], w) + offset += p.fastWriteField14(buf[offset:], w) } offset += thrift.Binary.WriteFieldStop(buf[offset:]) return offset @@ -554,6 +583,7 @@ func (p *CreateImageRequest) BLength() int { l += p.field11Length() l += p.field12Length() l += p.field13Length() + l += p.field14Length() } l += thrift.Binary.FieldStopLength() return l @@ -654,6 +684,13 @@ func (p *CreateImageRequest) fastWriteField13(buf []byte, w thrift.NocopyWriter) return offset } +func (p *CreateImageRequest) fastWriteField14(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 14) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.Suffix) + return offset +} + func (p *CreateImageRequest) field1Length() int { l := 0 l += thrift.Binary.FieldBeginLength() @@ -749,6 +786,13 @@ func (p *CreateImageRequest) field13Length() int { return l } +func (p *CreateImageRequest) field14Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.Suffix) + return l +} + func (p *CreateImageResponse) FastRead(buf []byte) (int, error) { var err error var offset int @@ -2009,6 +2053,20 @@ func (p *ChangeImageRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 4: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -2081,6 +2139,20 @@ func (p *ChangeImageRequest) FastReadField3(buf []byte) (int, error) { return offset, nil } +func (p *ChangeImageRequest) 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.Suffix = _field + return offset, nil +} + // for compatibility func (p *ChangeImageRequest) FastWrite(buf []byte) int { return 0 @@ -2092,6 +2164,7 @@ func (p *ChangeImageRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) offset += p.fastWriteField1(buf[offset:], w) offset += p.fastWriteField3(buf[offset:], w) offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField4(buf[offset:], w) } offset += thrift.Binary.WriteFieldStop(buf[offset:]) return offset @@ -2103,6 +2176,7 @@ func (p *ChangeImageRequest) BLength() int { l += p.field1Length() l += p.field2Length() l += p.field3Length() + l += p.field4Length() } l += thrift.Binary.FieldStopLength() return l @@ -2129,6 +2203,13 @@ func (p *ChangeImageRequest) fastWriteField3(buf []byte, w thrift.NocopyWriter) return offset } +func (p *ChangeImageRequest) 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.Suffix) + return offset +} + func (p *ChangeImageRequest) field1Length() int { l := 0 l += thrift.Binary.FieldBeginLength() @@ -2150,6 +2231,13 @@ func (p *ChangeImageRequest) field3Length() int { return l } +func (p *ChangeImageRequest) field4Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.Suffix) + return l +} + func (p *ChangeImageResponse) FastRead(buf []byte) (int, error) { var err error var offset int diff --git a/kitex_gen/launch_screen/launch_screen.go b/kitex_gen/launch_screen/launch_screen.go index fbbd62c..d7aa0b9 100644 --- a/kitex_gen/launch_screen/launch_screen.go +++ b/kitex_gen/launch_screen/launch_screen.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 launch_screen @@ -44,6 +44,7 @@ type CreateImageRequest struct { Text string `thrift:"text,11,required" frugal:"11,required,string" json:"text"` Regex string `thrift:"regex,12,required" frugal:"12,required,string" json:"regex"` BufferCount int64 `thrift:"buffer_count,13" frugal:"13,default,i64" json:"buffer_count"` + Suffix string `thrift:"suffix,14" frugal:"14,default,string" json:"suffix"` } func NewCreateImageRequest() *CreateImageRequest { @@ -114,6 +115,10 @@ func (p *CreateImageRequest) GetRegex() (v string) { func (p *CreateImageRequest) GetBufferCount() (v int64) { return p.BufferCount } + +func (p *CreateImageRequest) GetSuffix() (v string) { + return p.Suffix +} func (p *CreateImageRequest) SetPicType(val int64) { p.PicType = val } @@ -153,6 +158,9 @@ func (p *CreateImageRequest) SetRegex(val string) { func (p *CreateImageRequest) SetBufferCount(val int64) { p.BufferCount = val } +func (p *CreateImageRequest) SetSuffix(val string) { + p.Suffix = val +} var fieldIDToName_CreateImageRequest = map[int16]string{ 1: "pic_type", @@ -168,6 +176,7 @@ var fieldIDToName_CreateImageRequest = map[int16]string{ 11: "text", 12: "regex", 13: "buffer_count", + 14: "suffix", } func (p *CreateImageRequest) IsSetDuration() bool { @@ -321,6 +330,14 @@ func (p *CreateImageRequest) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 14: + if fieldTypeId == thrift.STRING { + if err = p.ReadField14(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 @@ -544,8 +561,20 @@ func (p *CreateImageRequest) ReadField13(iprot thrift.TProtocol) error { p.BufferCount = _field return nil } +func (p *CreateImageRequest) ReadField14(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Suffix = _field + return nil +} func (p *CreateImageRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("CreateImageRequest"); err != nil { goto WriteStructBeginError @@ -603,6 +632,10 @@ func (p *CreateImageRequest) Write(oprot thrift.TProtocol) (err error) { fieldId = 13 goto WriteFieldError } + if err = p.writeField14(oprot); err != nil { + fieldId = 14 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -846,6 +879,23 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 13 end error: ", p), err) } +func (p *CreateImageRequest) writeField14(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("suffix", thrift.STRING, 14); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Suffix); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 14 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 14 end error: ", p), err) +} + func (p *CreateImageRequest) String() string { if p == nil { return "" @@ -899,6 +949,9 @@ func (p *CreateImageRequest) DeepEqual(ano *CreateImageRequest) bool { if !p.Field13DeepEqual(ano.BufferCount) { return false } + if !p.Field14DeepEqual(ano.Suffix) { + return false + } return true } @@ -1003,6 +1056,13 @@ func (p *CreateImageRequest) Field13DeepEqual(src int64) bool { } return true } +func (p *CreateImageRequest) Field14DeepEqual(src string) bool { + + if strings.Compare(p.Suffix, src) != 0 { + return false + } + return true +} type CreateImageResponse struct { Base *model.BaseResp `thrift:"base,1" frugal:"1,default,model.BaseResp" json:"base"` @@ -1135,6 +1195,7 @@ func (p *CreateImageResponse) ReadField2(iprot thrift.TProtocol) error { } func (p *CreateImageResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("CreateImageResponse"); err != nil { goto WriteStructBeginError @@ -1339,6 +1400,7 @@ func (p *GetImageRequest) ReadField1(iprot thrift.TProtocol) error { } func (p *GetImageRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetImageRequest"); err != nil { goto WriteStructBeginError @@ -1542,6 +1604,7 @@ func (p *GetImageResponse) ReadField2(iprot thrift.TProtocol) error { } func (p *GetImageResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetImageResponse"); err != nil { goto WriteStructBeginError @@ -2135,6 +2198,7 @@ func (p *ChangeImagePropertyRequest) ReadField12(iprot thrift.TProtocol) error { } func (p *ChangeImagePropertyRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("ChangeImagePropertyRequest"); err != nil { goto WriteStructBeginError @@ -2693,6 +2757,7 @@ func (p *ChangeImagePropertyResponse) ReadField2(iprot thrift.TProtocol) error { } func (p *ChangeImagePropertyResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("ChangeImagePropertyResponse"); err != nil { goto WriteStructBeginError @@ -2802,6 +2867,7 @@ type ChangeImageRequest struct { PictureId int64 `thrift:"picture_id,1,required" frugal:"1,required,i64" json:"picture_id"` Image []byte `thrift:"image,2,required" frugal:"2,required,binary" json:"image"` BufferCount int64 `thrift:"buffer_count,3" frugal:"3,default,i64" json:"buffer_count"` + Suffix string `thrift:"suffix,4" frugal:"4,default,string" json:"suffix"` } func NewChangeImageRequest() *ChangeImageRequest { @@ -2822,6 +2888,10 @@ func (p *ChangeImageRequest) GetImage() (v []byte) { func (p *ChangeImageRequest) GetBufferCount() (v int64) { return p.BufferCount } + +func (p *ChangeImageRequest) GetSuffix() (v string) { + return p.Suffix +} func (p *ChangeImageRequest) SetPictureId(val int64) { p.PictureId = val } @@ -2831,11 +2901,15 @@ func (p *ChangeImageRequest) SetImage(val []byte) { func (p *ChangeImageRequest) SetBufferCount(val int64) { p.BufferCount = val } +func (p *ChangeImageRequest) SetSuffix(val string) { + p.Suffix = val +} var fieldIDToName_ChangeImageRequest = map[int16]string{ 1: "picture_id", 2: "image", 3: "buffer_count", + 4: "suffix", } func (p *ChangeImageRequest) Read(iprot thrift.TProtocol) (err error) { @@ -2885,6 +2959,14 @@ func (p *ChangeImageRequest) Read(iprot thrift.TProtocol) (err error) { } 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 + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -2958,8 +3040,20 @@ func (p *ChangeImageRequest) ReadField3(iprot thrift.TProtocol) error { p.BufferCount = _field return nil } +func (p *ChangeImageRequest) ReadField4(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Suffix = _field + return nil +} func (p *ChangeImageRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("ChangeImageRequest"); err != nil { goto WriteStructBeginError @@ -2977,6 +3071,10 @@ func (p *ChangeImageRequest) Write(oprot thrift.TProtocol) (err error) { fieldId = 3 goto WriteFieldError } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -3046,6 +3144,23 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) } +func (p *ChangeImageRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("suffix", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Suffix); 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 *ChangeImageRequest) String() string { if p == nil { return "" @@ -3069,6 +3184,9 @@ func (p *ChangeImageRequest) DeepEqual(ano *ChangeImageRequest) bool { if !p.Field3DeepEqual(ano.BufferCount) { return false } + if !p.Field4DeepEqual(ano.Suffix) { + return false + } return true } @@ -3093,6 +3211,13 @@ func (p *ChangeImageRequest) Field3DeepEqual(src int64) bool { } return true } +func (p *ChangeImageRequest) Field4DeepEqual(src string) bool { + + if strings.Compare(p.Suffix, src) != 0 { + return false + } + return true +} type ChangeImageResponse struct { Base *model.BaseResp `thrift:"base,1" frugal:"1,default,model.BaseResp" json:"base"` @@ -3225,6 +3350,7 @@ func (p *ChangeImageResponse) ReadField2(iprot thrift.TProtocol) error { } func (p *ChangeImageResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("ChangeImageResponse"); err != nil { goto WriteStructBeginError @@ -3429,6 +3555,7 @@ func (p *DeleteImageRequest) ReadField1(iprot thrift.TProtocol) error { } func (p *DeleteImageRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("DeleteImageRequest"); err != nil { goto WriteStructBeginError @@ -3598,6 +3725,7 @@ func (p *DeleteImageResponse) ReadField1(iprot thrift.TProtocol) error { } func (p *DeleteImageResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("DeleteImageResponse"); err != nil { goto WriteStructBeginError @@ -3876,6 +4004,7 @@ func (p *MobileGetImageRequest) ReadField4(iprot thrift.TProtocol) error { } func (p *MobileGetImageRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("MobileGetImageRequest"); err != nil { goto WriteStructBeginError @@ -4231,6 +4360,7 @@ func (p *MobileGetImageResponse) ReadField3(iprot thrift.TProtocol) error { } func (p *MobileGetImageResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("MobileGetImageResponse"); err != nil { goto WriteStructBeginError @@ -4487,6 +4617,7 @@ func (p *AddImagePointTimeRequest) ReadField1(iprot thrift.TProtocol) error { } func (p *AddImagePointTimeRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("AddImagePointTimeRequest"); err != nil { goto WriteStructBeginError @@ -4690,6 +4821,7 @@ func (p *AddImagePointTimeResponse) ReadField2(iprot thrift.TProtocol) error { } func (p *AddImagePointTimeResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("AddImagePointTimeResponse"); err != nil { goto WriteStructBeginError @@ -4923,6 +5055,7 @@ func (p *LaunchScreenServiceCreateImageArgs) ReadField1(iprot thrift.TProtocol) } func (p *LaunchScreenServiceCreateImageArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("CreateImage_args"); err != nil { goto WriteStructBeginError @@ -5092,6 +5225,7 @@ func (p *LaunchScreenServiceCreateImageResult) ReadField0(iprot thrift.TProtocol } func (p *LaunchScreenServiceCreateImageResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("CreateImage_result"); err != nil { goto WriteStructBeginError @@ -5263,6 +5397,7 @@ func (p *LaunchScreenServiceGetImageArgs) ReadField1(iprot thrift.TProtocol) err } func (p *LaunchScreenServiceGetImageArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetImage_args"); err != nil { goto WriteStructBeginError @@ -5432,6 +5567,7 @@ func (p *LaunchScreenServiceGetImageResult) ReadField0(iprot thrift.TProtocol) e } func (p *LaunchScreenServiceGetImageResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("GetImage_result"); err != nil { goto WriteStructBeginError @@ -5603,6 +5739,7 @@ func (p *LaunchScreenServiceChangeImagePropertyArgs) ReadField1(iprot thrift.TPr } func (p *LaunchScreenServiceChangeImagePropertyArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("ChangeImageProperty_args"); err != nil { goto WriteStructBeginError @@ -5772,6 +5909,7 @@ func (p *LaunchScreenServiceChangeImagePropertyResult) ReadField0(iprot thrift.T } func (p *LaunchScreenServiceChangeImagePropertyResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("ChangeImageProperty_result"); err != nil { goto WriteStructBeginError @@ -5943,6 +6081,7 @@ func (p *LaunchScreenServiceChangeImageArgs) ReadField1(iprot thrift.TProtocol) } func (p *LaunchScreenServiceChangeImageArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("ChangeImage_args"); err != nil { goto WriteStructBeginError @@ -6112,6 +6251,7 @@ func (p *LaunchScreenServiceChangeImageResult) ReadField0(iprot thrift.TProtocol } func (p *LaunchScreenServiceChangeImageResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("ChangeImage_result"); err != nil { goto WriteStructBeginError @@ -6283,6 +6423,7 @@ func (p *LaunchScreenServiceDeleteImageArgs) ReadField1(iprot thrift.TProtocol) } func (p *LaunchScreenServiceDeleteImageArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("DeleteImage_args"); err != nil { goto WriteStructBeginError @@ -6452,6 +6593,7 @@ func (p *LaunchScreenServiceDeleteImageResult) ReadField0(iprot thrift.TProtocol } func (p *LaunchScreenServiceDeleteImageResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("DeleteImage_result"); err != nil { goto WriteStructBeginError @@ -6623,6 +6765,7 @@ func (p *LaunchScreenServiceMobileGetImageArgs) ReadField1(iprot thrift.TProtoco } func (p *LaunchScreenServiceMobileGetImageArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("MobileGetImage_args"); err != nil { goto WriteStructBeginError @@ -6792,6 +6935,7 @@ func (p *LaunchScreenServiceMobileGetImageResult) ReadField0(iprot thrift.TProto } func (p *LaunchScreenServiceMobileGetImageResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("MobileGetImage_result"); err != nil { goto WriteStructBeginError @@ -6963,6 +7107,7 @@ func (p *LaunchScreenServiceAddImagePointTimeArgs) ReadField1(iprot thrift.TProt } func (p *LaunchScreenServiceAddImagePointTimeArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("AddImagePointTime_args"); err != nil { goto WriteStructBeginError @@ -7132,6 +7277,7 @@ func (p *LaunchScreenServiceAddImagePointTimeResult) ReadField0(iprot thrift.TPr } func (p *LaunchScreenServiceAddImagePointTimeResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 if err = oprot.WriteStructBegin("AddImagePointTime_result"); err != nil { goto WriteStructBeginError diff --git a/pkg/constants/constants.go b/pkg/constants/constants.go index 377a769..7fffaff 100644 --- a/pkg/constants/constants.go +++ b/pkg/constants/constants.go @@ -21,10 +21,11 @@ import "time" const ( JWTValue = "MTAxNTkwMTg1Mw==" - MuxConnection = 1 // (RPC) 最大连接数 - RPCTimeout = 3 * time.Second // (RPC) RPC请求超时时间 - ConnectTimeout = 50 * time.Millisecond // (RPC) 连接超时时间 - StreamBufferSize = 1024 // (RPC) 流请求 Buffer 尺寸 + MuxConnection = 1 // (RPC) 最大连接数 + RPCTimeout = 3 * time.Second // (RPC) RPC请求超时时间 + ConnectTimeout = 50 * time.Millisecond // (RPC) 连接超时时间 + StreamBufferSize = 1024 // (RPC) 流请求 Buffer 尺寸 + CheckFileTypeBufferSize = 512 // 判断文件类型时需读取前512个字节 TemplateServiceName = "template" ClassroomServiceName = "classroom" diff --git a/pkg/upyun/launch_screen.go b/pkg/upyun/launch_screen.go index 00a5d03..b1e3eca 100644 --- a/pkg/upyun/launch_screen.go +++ b/pkg/upyun/launch_screen.go @@ -20,6 +20,7 @@ import ( "bytes" "fmt" "net/http" + "strings" "time" "github.com/west2-online/fzuhelper-server/config" @@ -27,10 +28,8 @@ import ( ) // UploadImg 又拍云上传文件 -func UploadImg(file []byte, name string) error { +func UploadImg(file []byte, url string) error { body := bytes.NewReader(file) - url := config.UpYun.UssDomain + config.UpYun.Path + name - req, err := http.NewRequest("PUT", url, body) if err != nil { return err @@ -49,10 +48,7 @@ func UploadImg(file []byte, name string) error { } // DeleteImg 又拍云删除文件 -func DeleteImg(name string) error { - // body := bytes.NewReader(file) - url := config.UpYun.UssDomain + config.UpYun.Path + name - +func DeleteImg(url string) error { req, err := http.NewRequest("DELETE", url, nil) if err != nil { return err @@ -71,11 +67,15 @@ func DeleteImg(name string) error { } // GenerateImgName 生成图片名字 -func GenerateImgName(id int64) string { +func GenerateImgName(id int64, suffix string) string { currentTime := time.Now() // 获取年月日和小时分钟 year, month, day := currentTime.Date() hour, minute := currentTime.Hour(), currentTime.Minute() second := currentTime.Second() - return fmt.Sprintf("%v_%d%02d%02d_%02d%02d%02d.jpg", id, year, month, day, hour, minute, second) + return strings.Join([]string{ + config.UpYun.UssDomain, config.UpYun.Path, + fmt.Sprintf("%v_%d%02d%02d_%02d%02d%02d.", id, year, month, day, hour, minute, second), + suffix, + }, "") } diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index cbca6f8..eaaf06b 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -32,6 +32,9 @@ import ( "strings" "time" + "github.com/h2non/filetype" + "github.com/h2non/filetype/types" + "github.com/west2-online/fzuhelper-server/config" "github.com/west2-online/fzuhelper-server/pkg/constants" "github.com/west2-online/fzuhelper-server/pkg/errno" @@ -188,23 +191,31 @@ func FileToByteArray(file *multipart.FileHeader) (fileBuf [][]byte, err error) { return fileBuf, nil } -// IsAllowImageFile 检查文件格式是否合规,支持jpg png jpeg格式 -func IsAllowImageFile(header *multipart.FileHeader) bool { - contentType := header.Header.Get("Content-Type") - // MIME类型判断 - if strings.HasPrefix(contentType, "image/") { - return true +// IsAllowImageFile 检查文件格式是否合规,同时获得图片格式 +func IsAllowImageFile(header *multipart.FileHeader) (string, bool) { + file, err := header.Open() + if err != nil { + return "", false } + defer file.Close() - filename := header.Filename - extensions := []string{".jpg", ".png", ".jpeg"} // Add more image extensions if needed - for _, ext := range extensions { - if strings.HasSuffix(strings.ToLower(filename), ext) { - return true - } + buffer := make([]byte, constants.CheckFileTypeBufferSize) + _, err = file.Read(buffer) + if err != nil { + return "", false } - return false + kind, _ := filetype.Match(buffer) + + // 检查是否为jpg、png + switch kind { + case types.Get("jpg"): + return "jpg", true + case types.Get("png"): + return "png", true + default: + return "", false + } } // GenerateRedisKeyByStuId 开屏页通过学号与sType生成缓存对应Key From 81a00c4bfa0fa95147977bb5d9c3a7519c87b1b5 Mon Sep 17 00:00:00 2001 From: FanR <103872180+FantasyRL@users.noreply.github.com> Date: Wed, 13 Nov 2024 15:12:35 +0800 Subject: [PATCH 8/8] fix: add download-domain in config.upyuns (#98) --- config/config.example.yaml | 2 ++ config/types.go | 15 ++++++++------- internal/launch_screen/pack/image.go | 5 ++++- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/config/config.example.yaml b/config/config.example.yaml index c09fd7c..f2b9ffd 100644 --- a/config/config.example.yaml +++ b/config/config.example.yaml @@ -33,6 +33,7 @@ upyuns: token-secret: "" token-timeout: 0 uss-domain: "" + download-domain: "" path: "/pictures/" paper: bucket: "fzuhelper-paper-cos" @@ -41,6 +42,7 @@ upyuns: token-secret: "" token-timeout: 60 uss-domain: "" + download-domain: "" path: "/__Unchecked_adjowe/" elasticsearch: diff --git a/config/types.go b/config/types.go index 392c53f..94bc73c 100644 --- a/config/types.go +++ b/config/types.go @@ -96,13 +96,14 @@ type defaultUser struct { * @UnCheckedDir: 上传目录 */ type upyun struct { - Bucket string - Operator string - Password string - TokenSecret string `mapstructure:"token-secret"` - TokenTimeout int64 `mapstructure:"token-timeout"` - UssDomain string `mapstructure:"uss-domain"` - Path string + Bucket string + Operator string + Password string + TokenSecret string `mapstructure:"token-secret"` + TokenTimeout int64 `mapstructure:"token-timeout"` + UssDomain string `mapstructure:"uss-domain"` + DownloadDomain string `mapstructure:"download-domain"` + Path string } type config struct { diff --git a/internal/launch_screen/pack/image.go b/internal/launch_screen/pack/image.go index 283c229..95de56c 100644 --- a/internal/launch_screen/pack/image.go +++ b/internal/launch_screen/pack/image.go @@ -17,6 +17,9 @@ limitations under the License. package pack import ( + "strings" + + "github.com/west2-online/fzuhelper-server/config" "github.com/west2-online/fzuhelper-server/kitex_gen/model" db "github.com/west2-online/fzuhelper-server/pkg/db/model" ) @@ -24,7 +27,7 @@ import ( func BuildImageResp(dbP *db.Picture) *model.Picture { return &model.Picture{ Id: dbP.ID, - Url: dbP.Url, + Url: strings.Join([]string{config.UpYun.DownloadDomain, strings.TrimPrefix(dbP.Url, config.UpYun.UssDomain)}, ""), Href: dbP.Href, Text: dbP.Text, Type: dbP.PicType,