From 88db13739eb22eaff73ce7ead82d249e5f7cc656 Mon Sep 17 00:00:00 2001 From: penQee <3092572427@qq.com> Date: Mon, 11 Nov 2024 17:07:26 +0800 Subject: [PATCH 1/5] fix: solve some problems in url and paper service --- api/handler/api/paper_service.go | 6 ++-- api/handler/api/url_service.go | 40 ++++++++++++++------------ api/model/api/api.go | 20 ++++++------- api/model/model/model.go | 6 ++-- api/pack/base.go | 8 ++++++ api/router/custom_router.go | 4 +++ idl/api.thrift | 2 +- idl/model.thrift | 2 +- 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 | 5 ++++ pkg/upyun/paper.go | 2 -- 16 files changed, 82 insertions(+), 64 deletions(-) diff --git a/api/handler/api/paper_service.go b/api/handler/api/paper_service.go index 797b2596..9c97a127 100644 --- a/api/handler/api/paper_service.go +++ b/api/handler/api/paper_service.go @@ -55,7 +55,7 @@ func ListDirFiles(ctx context.Context, c *app.RequestContext) { resp := new(api.ListDirFilesResponse) resp.Dir = pack.BuildUpYunFileDir(res) - pack.RespData(c, resp.Dir) + pack.RespDataInPaper(c, resp.Dir) } // GetDownloadUrl . @@ -71,7 +71,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) @@ -81,5 +81,5 @@ func GetDownloadUrl(ctx context.Context, c *app.RequestContext) { resp := new(api.GetDownloadUrlResponse) resp.URL = url - pack.RespData(c, resp) + pack.RespDataInPaper(c, resp) } diff --git a/api/handler/api/url_service.go b/api/handler/api/url_service.go index 15c694a5..22b1ac5a 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 c9d891b6..80c84ed3 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 { diff --git a/api/model/model/model.go b/api/model/model/model.go index 0e41f07c..2b33d604 100644 --- a/api/model/model/model.go +++ b/api/model/model/model.go @@ -2694,7 +2694,7 @@ func (p *Picture) String() string { // 又拍云文件目录结构 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 +2719,7 @@ func (p *UpYunFileDir) GetFolders() (v []string) { } var fieldIDToName_UpYunFileDir = map[int16]string{ - 1: "basePath", + 1: "base_path", 2: "files", 3: "folders", } @@ -2913,7 +2913,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/api/pack/base.go b/api/pack/base.go index 2d2291b7..25ecb6d1 100644 --- a/api/pack/base.go +++ b/api/pack/base.go @@ -69,3 +69,11 @@ func RespList(c *app.RequestContext, items any) { } c.JSON(consts.StatusOK, resp) } + +func RespDataInPaper(c *app.RequestContext, data any) { + c.JSON(consts.StatusOK, RespWithData{ + Code: strconv.FormatInt(errno.SuccessCodePaper, 10), + Msg: "Success", + Data: data, + }) +} diff --git a/api/router/custom_router.go b/api/router/custom_router.go index 7bb28692..b05ad916 100644 --- a/api/router/custom_router.go +++ b/api/router/custom_router.go @@ -45,4 +45,8 @@ func customizedRegister(r *server.Hertz) { // 历年卷兼容 r.GET("/api/v1/list", api.ListDirFiles) r.GET("/api/v1/downloadUrl", api.GetDownloadUrl) + + // url 兼容 ios + 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 17f28cbd..4199d2f7 100644 --- a/idl/api.thrift +++ b/idl/api.thrift @@ -173,7 +173,7 @@ struct ListDirFilesResponse { } struct GetDownloadUrlRequest { - 1: required string url, + 1: required string filepath, } struct GetDownloadUrlResponse { diff --git a/idl/model.thrift b/idl/model.thrift index 76357f9a..c6795a47 100644 --- a/idl/model.thrift +++ b/idl/model.thrift @@ -65,7 +65,7 @@ struct Picture{ // 又拍云文件目录结构 struct UpYunFileDir { - 1: required string basePath, + 1: required string base_path, 2: required list files, 3: required list folders, } diff --git a/idl/paper.thrift b/idl/paper.thrift index 765f935f..12c1eb35 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 771d73de..565eed2e 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 ca0e3365..f5d933dd 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 d8c74575..303c6123 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 affd6fd1..10e8758b 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 68ef3eca..377a7693 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 b4998018..38be3607 100644 --- a/pkg/errno/code.go +++ b/pkg/errno/code.go @@ -76,3 +76,8 @@ const ( InternalETCDErrorCode = 50019 // ETCD错误 InternalTraceErrorCode = 50020 // Trace错误 ) + +// paper的SuccessCode是2000, 不是 10000 +const ( + SuccessCodePaper = 2000 +) diff --git a/pkg/upyun/paper.go b/pkg/upyun/paper.go index 0a868788..114e75e7 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 a42ddf4d114af0c54b3277cf8afb16c6ba367412 Mon Sep 17 00:00:00 2001 From: penQee <3092572427@qq.com> Date: Mon, 11 Nov 2024 22:01:25 +0800 Subject: [PATCH 2/5] feat: add Android compatible handlers --- api/handler/api/paper_service.go | 69 +- api/model/api/api.go | 7139 ++++++++++++++++++------------ api/model/model/model.go | 7 +- api/pack/base.go | 8 - 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 | 34 + idl/model.thrift | 8 +- pkg/errno/code.go | 4 +- 11 files changed, 4541 insertions(+), 2783 deletions(-) diff --git a/api/handler/api/paper_service.go b/api/handler/api/paper_service.go index 9c97a127..fd8d5015 100644 --- a/api/handler/api/paper_service.go +++ b/api/handler/api/paper_service.go @@ -55,7 +55,7 @@ func ListDirFiles(ctx context.Context, c *app.RequestContext) { resp := new(api.ListDirFilesResponse) resp.Dir = pack.BuildUpYunFileDir(res) - pack.RespDataInPaper(c, resp.Dir) + pack.RespData(c, resp.Dir) } // GetDownloadUrl . @@ -81,5 +81,70 @@ func GetDownloadUrl(ctx context.Context, c *app.RequestContext) { resp := new(api.GetDownloadUrlResponse) resp.URL = url - pack.RespDataInPaper(c, resp) + 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 := &api.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 := &api.PaperUrlData{ + URL: url, + } + + pack.RespDataInPaper(c, data) } diff --git a/api/model/api/api.go b/api/model/api/api.go index 80c84ed3..f91cb9f1 100644 --- a/api/model/api/api.go +++ b/api/model/api/api.go @@ -6215,23 +6215,31 @@ func (p *GetDownloadUrlResponse) String() string { } -// academic -type GetScoresRequest struct { +// 兼容 +type ListDirFilesForAndroidRequest struct { + Path string `thrift:"path,1,required" form:"path,required" json:"path,required" query:"path,required"` } -func NewGetScoresRequest() *GetScoresRequest { - return &GetScoresRequest{} +func NewListDirFilesForAndroidRequest() *ListDirFilesForAndroidRequest { + return &ListDirFilesForAndroidRequest{} } -func (p *GetScoresRequest) InitDefault() { +func (p *ListDirFilesForAndroidRequest) InitDefault() { } -var fieldIDToName_GetScoresRequest = map[int16]string{} +func (p *ListDirFilesForAndroidRequest) GetPath() (v string) { + return p.Path +} -func (p *GetScoresRequest) Read(iprot thrift.TProtocol) (err error) { +var fieldIDToName_ListDirFilesForAndroidRequest = map[int16]string{ + 1: "path", +} + +func (p *ListDirFilesForAndroidRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 + var issetPath bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -6245,8 +6253,21 @@ func (p *GetScoresRequest) 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 + } + issetPath = 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 @@ -6256,25 +6277,50 @@ func (p *GetScoresRequest) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } + if !issetPath { + 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_ListDirFilesForAndroidRequest[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_ListDirFilesForAndroidRequest[fieldId])) } -func (p *GetScoresRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetScoresRequest"); err != nil { +func (p *ListDirFilesForAndroidRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Path = _field + return nil +} + +func (p *ListDirFilesForAndroidRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ListDirFilesForAndroidRequest"); 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 @@ -6285,44 +6331,63 @@ func (p *GetScoresRequest) 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 *GetScoresRequest) String() string { +func (p *ListDirFilesForAndroidRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("path", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Path); 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 *ListDirFilesForAndroidRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetScoresRequest(%+v)", *p) + return fmt.Sprintf("ListDirFilesForAndroidRequest(%+v)", *p) } -type GetScoresResponse struct { - Scores []*model.Score `thrift:"scores,1,required" form:"scores,required" json:"scores,required" query:"scores,required"` +type GetDownloadUrlForAndroidRequest struct { + Filepath string `thrift:"filepath,1,required" form:"filepath,required" json:"filepath,required" query:"filepath,required"` } -func NewGetScoresResponse() *GetScoresResponse { - return &GetScoresResponse{} +func NewGetDownloadUrlForAndroidRequest() *GetDownloadUrlForAndroidRequest { + return &GetDownloadUrlForAndroidRequest{} } -func (p *GetScoresResponse) InitDefault() { +func (p *GetDownloadUrlForAndroidRequest) InitDefault() { } -func (p *GetScoresResponse) GetScores() (v []*model.Score) { - return p.Scores +func (p *GetDownloadUrlForAndroidRequest) GetFilepath() (v string) { + return p.Filepath } -var fieldIDToName_GetScoresResponse = map[int16]string{ - 1: "scores", +var fieldIDToName_GetDownloadUrlForAndroidRequest = map[int16]string{ + 1: "filepath", } -func (p *GetScoresResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetDownloadUrlForAndroidRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetScores bool = false + var issetFilepath bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -6339,11 +6404,11 @@ func (p *GetScoresResponse) Read(iprot thrift.TProtocol) (err error) { switch fieldId { case 1: - if fieldTypeId == thrift.LIST { + if fieldTypeId == thrift.STRING { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetScores = true + issetFilepath = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -6360,7 +6425,7 @@ func (p *GetScoresResponse) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetScores { + if !issetFilepath { fieldId = 1 goto RequiredFieldNotSetError } @@ -6370,7 +6435,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetScoresResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetDownloadUrlForAndroidRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -6379,36 +6444,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_GetDownloadUrlForAndroidRequest[fieldId])) } -func (p *GetScoresResponse) ReadField1(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _field := make([]*model.Score, 0, size) - values := make([]model.Score, size) - for i := 0; i < size; i++ { - _elem := &values[i] - _elem.InitDefault() - - if err := _elem.Read(iprot); err != nil { - return err - } +func (p *GetDownloadUrlForAndroidRequest) ReadField1(iprot thrift.TProtocol) error { - _field = append(_field, _elem) - } - if err := iprot.ReadListEnd(); err != nil { + var _field string + if v, err := iprot.ReadString(); err != nil { return err + } else { + _field = v } - p.Scores = _field + p.Filepath = _field return nil } -func (p *GetScoresResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *GetDownloadUrlForAndroidRequest) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetScoresResponse"); err != nil { + if err = oprot.WriteStructBegin("GetDownloadUrlForAndroidRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -6434,19 +6487,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetScoresResponse) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("scores", thrift.LIST, 1); err != nil { +func (p *GetDownloadUrlForAndroidRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("filepath", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Scores)); err != nil { - return err - } - for _, v := range p.Scores { - if err := v.Write(oprot); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { + if err := oprot.WriteString(p.Filepath); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -6459,30 +6504,52 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetScoresResponse) String() string { +func (p *GetDownloadUrlForAndroidRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetScoresResponse(%+v)", *p) + return fmt.Sprintf("GetDownloadUrlForAndroidRequest(%+v)", *p) } -type GetGPARequest struct { +type 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 NewGetGPARequest() *GetGPARequest { - return &GetGPARequest{} +func NewPaperData() *PaperData { + return &PaperData{} } -func (p *GetGPARequest) InitDefault() { +func (p *PaperData) InitDefault() { } -var fieldIDToName_GetGPARequest = map[int16]string{} +func (p *PaperData) GetBasePath() (v string) { + return p.BasePath +} -func (p *GetGPARequest) Read(iprot thrift.TProtocol) (err error) { +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 @@ -6496,8 +6563,39 @@ func (p *GetGPARequest) 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 + } + 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 @@ -6507,82 +6605,231 @@ func (p *GetGPARequest) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } + if !issetBasePath { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetFiles { + fieldId = 2 + goto RequiredFieldNotSetError + } + + if !issetFolders { + fieldId = 3 + goto RequiredFieldNotSetError + } return nil ReadStructBeginError: return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -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_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 *GetGPARequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetGPARequest"); err != nil { - goto WriteStructBeginError +func (p *PaperData) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v } - if p != nil { + p.BasePath = _field + return nil +} +func (p *PaperData) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError + _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 = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError + if err := iprot.ReadListEnd(); err != nil { + return err } + p.Files = _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 *GetGPARequest) String() string { - if p == nil { - return "" +func (p *PaperData) ReadField3(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err } - return fmt.Sprintf("GetGPARequest(%+v)", *p) - -} + _field := make([]string, 0, size) + for i := 0; i < size; i++ { -type GetGPAResponse struct { - Gpa *model.GPABean `thrift:"gpa,1,required" form:"gpa,required" json:"gpa,required" query:"gpa,required"` + 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 NewGetGPAResponse() *GetGPAResponse { - return &GetGPAResponse{} +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 *GetGPAResponse) InitDefault() { +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) } -var GetGPAResponse_Gpa_DEFAULT *model.GPABean +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 *GetGPAResponse) GetGpa() (v *model.GPABean) { - if !p.IsSetGpa() { - return GetGPAResponse_Gpa_DEFAULT +func (p *PaperData) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("folders", thrift.LIST, 3); err != nil { + goto WriteFieldBeginError } - return p.Gpa + 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) } -var fieldIDToName_GetGPAResponse = map[int16]string{ - 1: "gpa", +func (p *PaperData) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PaperData(%+v)", *p) + } -func (p *GetGPAResponse) IsSetGpa() bool { - return p.Gpa != nil +type PaperUrlData struct { + URL string `thrift:"url,1,required" form:"url,required" json:"url,required" query:"url,required"` } -func (p *GetGPAResponse) Read(iprot thrift.TProtocol) (err error) { +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 issetGpa bool = false + var issetURL bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -6599,11 +6846,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 + issetURL = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -6620,7 +6867,7 @@ func (p *GetGPAResponse) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetGpa { + if !issetURL { fieldId = 1 goto RequiredFieldNotSetError } @@ -6630,7 +6877,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_PaperUrlData[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -6639,21 +6886,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_PaperUrlData[fieldId])) } -func (p *GetGPAResponse) ReadField1(iprot thrift.TProtocol) error { - _field := model.NewGPABean() - if err := _field.Read(iprot); err != nil { +func (p *PaperUrlData) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { return err + } else { + _field = v } - p.Gpa = _field + p.URL = _field return nil } -func (p *GetGPAResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *PaperUrlData) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetGPAResponse"); err != nil { + if err = oprot.WriteStructBegin("PaperUrlData"); err != nil { goto WriteStructBeginError } if p != nil { @@ -6679,11 +6929,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 *PaperUrlData) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("url", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } - if err := p.Gpa.Write(oprot); err != nil { + if err := oprot.WriteString(p.URL); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -6696,27 +6946,27 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetGPAResponse) String() string { +func (p *PaperUrlData) String() string { if p == nil { return "" } - return fmt.Sprintf("GetGPAResponse(%+v)", *p) + return fmt.Sprintf("PaperUrlData(%+v)", *p) } -type GetCreditRequest struct { +type ListDirFilesForAndroidResponse struct { } -func NewGetCreditRequest() *GetCreditRequest { - return &GetCreditRequest{} +func NewListDirFilesForAndroidResponse() *ListDirFilesForAndroidResponse { + return &ListDirFilesForAndroidResponse{} } -func (p *GetCreditRequest) InitDefault() { +func (p *ListDirFilesForAndroidResponse) InitDefault() { } -var fieldIDToName_GetCreditRequest = map[int16]string{} +var fieldIDToName_ListDirFilesForAndroidResponse = map[int16]string{} -func (p *GetCreditRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *ListDirFilesForAndroidResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -6758,8 +7008,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 *ListDirFilesForAndroidResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("ListDirFilesForAndroidResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -6779,38 +7029,30 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetCreditRequest) String() string { +func (p *ListDirFilesForAndroidResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetCreditRequest(%+v)", *p) - -} + return fmt.Sprintf("ListDirFilesForAndroidResponse(%+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{} +type GetDownloadUrlForAndroidResponse struct { } -func (p *GetCreditResponse) InitDefault() { +func NewGetDownloadUrlForAndroidResponse() *GetDownloadUrlForAndroidResponse { + return &GetDownloadUrlForAndroidResponse{} } -func (p *GetCreditResponse) GetMajor() (v []*model.Credit) { - return p.Major +func (p *GetDownloadUrlForAndroidResponse) InitDefault() { } -var fieldIDToName_GetCreditResponse = map[int16]string{ - 1: "major", -} +var fieldIDToName_GetDownloadUrlForAndroidResponse = map[int16]string{} -func (p *GetCreditResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetDownloadUrlForAndroidResponse) 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 +7066,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,62 +7077,25 @@ func (p *GetCreditResponse) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetMajor { - 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_GetCreditResponse[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_GetCreditResponse[fieldId])) -} - -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() - - if err := _elem.Read(iprot); err != nil { - return err - } - - _field = append(_field, _elem) - } - if err := iprot.ReadListEnd(); err != nil { - return err - } - p.Major = _field - return nil } -func (p *GetCreditResponse) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("GetCreditResponse"); err != nil { +func (p *GetDownloadUrlForAndroidResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetDownloadUrlForAndroidResponse"); 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 @@ -6914,60 +7106,34 @@ func (p *GetCreditResponse) 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 *GetCreditResponse) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("major", thrift.LIST, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.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 +func (p *GetDownloadUrlForAndroidResponse) String() string { + if p == nil { + return "" } - 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 *GetCreditResponse) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("GetCreditResponse(%+v)", *p) + return fmt.Sprintf("GetDownloadUrlForAndroidResponse(%+v)", *p) } -type GetUnifiedExamRequest struct { +// academic +type GetScoresRequest struct { } -func NewGetUnifiedExamRequest() *GetUnifiedExamRequest { - return &GetUnifiedExamRequest{} +func NewGetScoresRequest() *GetScoresRequest { + return &GetScoresRequest{} } -func (p *GetUnifiedExamRequest) InitDefault() { +func (p *GetScoresRequest) InitDefault() { } -var fieldIDToName_GetUnifiedExamRequest = map[int16]string{} +var fieldIDToName_GetScoresRequest = map[int16]string{} -func (p *GetUnifiedExamRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetScoresRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -7009,8 +7175,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 *GetScoresRequest) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetScoresRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -7030,38 +7196,38 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetUnifiedExamRequest) String() string { +func (p *GetScoresRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetUnifiedExamRequest(%+v)", *p) + return fmt.Sprintf("GetScoresRequest(%+v)", *p) } -type GetUnifiedExamResponse struct { - UnifiedExam []*model.UnifiedExam `thrift:"unifiedExam,1,required" form:"unifiedExam,required" json:"unifiedExam,required" query:"unifiedExam,required"` +type GetScoresResponse struct { + Scores []*model.Score `thrift:"scores,1,required" form:"scores,required" json:"scores,required" query:"scores,required"` } -func NewGetUnifiedExamResponse() *GetUnifiedExamResponse { - return &GetUnifiedExamResponse{} +func NewGetScoresResponse() *GetScoresResponse { + return &GetScoresResponse{} } -func (p *GetUnifiedExamResponse) InitDefault() { +func (p *GetScoresResponse) InitDefault() { } -func (p *GetUnifiedExamResponse) GetUnifiedExam() (v []*model.UnifiedExam) { - return p.UnifiedExam +func (p *GetScoresResponse) GetScores() (v []*model.Score) { + return p.Scores } -var fieldIDToName_GetUnifiedExamResponse = map[int16]string{ - 1: "unifiedExam", +var fieldIDToName_GetScoresResponse = map[int16]string{ + 1: "scores", } -func (p *GetUnifiedExamResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetScoresResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetUnifiedExam bool = false + var issetScores bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -7082,7 +7248,7 @@ func (p *GetUnifiedExamResponse) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetUnifiedExam = true + issetScores = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -7099,7 +7265,7 @@ func (p *GetUnifiedExamResponse) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetUnifiedExam { + if !issetScores { fieldId = 1 goto RequiredFieldNotSetError } @@ -7109,7 +7275,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_GetScoresResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -7118,16 +7284,16 @@ ReadFieldEndError: ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetUnifiedExamResponse[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetScoresResponse[fieldId])) } -func (p *GetUnifiedExamResponse) 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.UnifiedExam, 0, size) - values := make([]model.UnifiedExam, size) + _field := make([]*model.Score, 0, size) + values := make([]model.Score, size) for i := 0; i < size; i++ { _elem := &values[i] _elem.InitDefault() @@ -7141,13 +7307,13 @@ func (p *GetUnifiedExamResponse) ReadField1(iprot thrift.TProtocol) error { if err := iprot.ReadListEnd(); err != nil { return err } - p.UnifiedExam = _field + p.Scores = _field return nil } -func (p *GetUnifiedExamResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *GetScoresResponse) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetUnifiedExamResponse"); err != nil { + if err = oprot.WriteStructBegin("GetScoresResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -7173,14 +7339,14 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetUnifiedExamResponse) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("unifiedExam", thrift.LIST, 1); err != nil { +func (p *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.UnifiedExam)); err != nil { + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Scores)); err != nil { return err } - for _, v := range p.UnifiedExam { + for _, v := range p.Scores { if err := v.Write(oprot); err != nil { return err } @@ -7198,39 +7364,130 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetUnifiedExamResponse) String() string { +func (p *GetScoresResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetUnifiedExamResponse(%+v)", *p) + return fmt.Sprintf("GetScoresResponse(%+v)", *p) } -// url -type APILoginRequest struct { - Password string `thrift:"password,1,required" form:"password,required" json:"password,required" query:"password,required"` +type GetGPARequest struct { } -func NewAPILoginRequest() *APILoginRequest { - return &APILoginRequest{} +func NewGetGPARequest() *GetGPARequest { + return &GetGPARequest{} } -func (p *APILoginRequest) InitDefault() { +func (p *GetGPARequest) InitDefault() { } -func (p *APILoginRequest) GetPassword() (v string) { - return p.Password +var fieldIDToName_GetGPARequest = map[int16]string{} + +func (p *GetGPARequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldTypeError + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +SkipFieldTypeError: + return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -var fieldIDToName_APILoginRequest = map[int16]string{ - 1: "password", +func (p *GetGPARequest) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetGPARequest"); 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 *APILoginRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetGPARequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetGPARequest(%+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{} +} + +func (p *GetGPAResponse) InitDefault() { +} + +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_GetGPAResponse = map[int16]string{ + 1: "gpa", +} + +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 issetPassword bool = false + var issetGpa bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -7247,11 +7504,11 @@ func (p *APILoginRequest) Read(iprot thrift.TProtocol) (err error) { switch fieldId { case 1: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.STRUCT { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetPassword = true + issetGpa = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -7268,7 +7525,7 @@ func (p *APILoginRequest) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetPassword { + if !issetGpa { fieldId = 1 goto RequiredFieldNotSetError } @@ -7278,7 +7535,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_GetGPAResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -7287,24 +7544,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_APILoginRequest[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetGPAResponse[fieldId])) } -func (p *APILoginRequest) ReadField1(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { +func (p *GetGPAResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewGPABean() + if err := _field.Read(iprot); err != nil { return err - } else { - _field = v } - p.Password = _field + p.Gpa = _field return nil } -func (p *APILoginRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *GetGPAResponse) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("APILoginRequest"); err != nil { + if err = oprot.WriteStructBegin("GetGPAResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -7330,11 +7584,11 @@ 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 *GetGPAResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("gpa", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(p.Password); err != nil { + if err := p.Gpa.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -7347,27 +7601,27 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *APILoginRequest) String() string { +func (p *GetGPAResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("APILoginRequest(%+v)", *p) + return fmt.Sprintf("GetGPAResponse(%+v)", *p) } -type APILoginResponse struct { +type GetCreditRequest struct { } -func NewAPILoginResponse() *APILoginResponse { - return &APILoginResponse{} +func NewGetCreditRequest() *GetCreditRequest { + return &GetCreditRequest{} } -func (p *APILoginResponse) InitDefault() { +func (p *GetCreditRequest) InitDefault() { } -var fieldIDToName_APILoginResponse = map[int16]string{} +var fieldIDToName_GetCreditRequest = map[int16]string{} -func (p *APILoginResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetCreditRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -7409,8 +7663,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 *GetCreditRequest) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetCreditRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -7430,73 +7684,38 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *APILoginResponse) String() string { +func (p *GetCreditRequest) 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("GetCreditRequest(%+v)", *p) -func (p *UploadVersionInfoRequest) GetType() (v string) { - return p.Type } -func (p *UploadVersionInfoRequest) GetVersion() (v string) { - return p.Version +type GetCreditResponse struct { + Major []*model.Credit `thrift:"major,1,required" form:"major,required" json:"major,required" query:"major,required"` } -func (p *UploadVersionInfoRequest) GetCode() (v string) { - return p.Code +func NewGetCreditResponse() *GetCreditResponse { + return &GetCreditResponse{} } -func (p *UploadVersionInfoRequest) GetFeature() (v string) { - return p.Feature +func (p *GetCreditResponse) InitDefault() { } -func (p *UploadVersionInfoRequest) GetURL() (v string) { - return p.URL +func (p *GetCreditResponse) GetMajor() (v []*model.Credit) { + return p.Major } -var fieldIDToName_UploadVersionInfoRequest = map[int16]string{ - 1: "password", - 2: "type", - 3: "version", - 4: "code", - 5: "feature", - 6: "url", +var fieldIDToName_GetCreditResponse = map[int16]string{ + 1: "major", } -func (p *UploadVersionInfoRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetCreditResponse) 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 issetMajor bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -7513,56 +7732,11 @@ 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 - } 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 + issetMajor = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -7579,42 +7753,17 @@ func (p *UploadVersionInfoRequest) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetPassword { + if !issetMajor { 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_GetCreditResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -7623,79 +7772,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_GetCreditResponse[fieldId])) } -func (p *UploadVersionInfoRequest) ReadField3(iprot thrift.TProtocol) error { - var _field string - if v, err := iprot.ReadString(); err != nil { +func (p *GetCreditResponse) 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.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 { - 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.Major = _field return nil } -func (p *UploadVersionInfoRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *GetCreditResponse) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("UploadVersionInfoRequest"); err != nil { + if err = oprot.WriteStructBegin("GetCreditResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -7703,26 +7809,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,11 +7827,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 *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 { @@ -7758,112 +7852,27 @@ 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 +func (p *GetCreditResponse) String() string { + if p == nil { + return "" } - 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) -} - -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 (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) -} - -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 *UploadVersionInfoRequest) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("UploadVersionInfoRequest(%+v)", *p) + return fmt.Sprintf("GetCreditResponse(%+v)", *p) } -type UploadVersionInfoResponse struct { +type GetUnifiedExamRequest struct { } -func NewUploadVersionInfoResponse() *UploadVersionInfoResponse { - return &UploadVersionInfoResponse{} +func NewGetUnifiedExamRequest() *GetUnifiedExamRequest { + return &GetUnifiedExamRequest{} } -func (p *UploadVersionInfoResponse) InitDefault() { +func (p *GetUnifiedExamRequest) InitDefault() { } -var fieldIDToName_UploadVersionInfoResponse = map[int16]string{} +var fieldIDToName_GetUnifiedExamRequest = map[int16]string{} -func (p *UploadVersionInfoResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetUnifiedExamRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -7905,8 +7914,8 @@ 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 { +func (p *GetUnifiedExamRequest) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetUnifiedExamRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -7926,38 +7935,38 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UploadVersionInfoResponse) String() string { +func (p *GetUnifiedExamRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("UploadVersionInfoResponse(%+v)", *p) + return fmt.Sprintf("GetUnifiedExamRequest(%+v)", *p) } -type GetUploadParamsRequest struct { - Password string `thrift:"password,1,required" form:"password,required" json:"password,required" query:"password,required"` +type GetUnifiedExamResponse struct { + UnifiedExam []*model.UnifiedExam `thrift:"unifiedExam,1,required" form:"unifiedExam,required" json:"unifiedExam,required" query:"unifiedExam,required"` } -func NewGetUploadParamsRequest() *GetUploadParamsRequest { - return &GetUploadParamsRequest{} +func NewGetUnifiedExamResponse() *GetUnifiedExamResponse { + return &GetUnifiedExamResponse{} } -func (p *GetUploadParamsRequest) InitDefault() { +func (p *GetUnifiedExamResponse) InitDefault() { } -func (p *GetUploadParamsRequest) GetPassword() (v string) { - return p.Password +func (p *GetUnifiedExamResponse) GetUnifiedExam() (v []*model.UnifiedExam) { + return p.UnifiedExam } -var fieldIDToName_GetUploadParamsRequest = map[int16]string{ - 1: "password", +var fieldIDToName_GetUnifiedExamResponse = map[int16]string{ + 1: "unifiedExam", } -func (p *GetUploadParamsRequest) 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 issetUnifiedExam bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -7974,11 +7983,11 @@ func (p *GetUploadParamsRequest) 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 + issetUnifiedExam = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -7995,7 +8004,7 @@ func (p *GetUploadParamsRequest) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetPassword { + if !issetUnifiedExam { fieldId = 1 goto RequiredFieldNotSetError } @@ -8005,7 +8014,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_GetUnifiedExamResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -8014,24 +8023,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_GetUploadParamsRequest[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetUnifiedExamResponse[fieldId])) } -func (p *GetUploadParamsRequest) ReadField1(iprot thrift.TProtocol) error { +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() - 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.UnifiedExam = _field return nil } -func (p *GetUploadParamsRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *GetUnifiedExamResponse) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetUploadParamsRequest"); err != nil { + if err = oprot.WriteStructBegin("GetUnifiedExamResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -8057,11 +8078,19 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetUploadParamsRequest) 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 + } + for _, v := range p.UnifiedExam { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -8074,45 +8103,39 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetUploadParamsRequest) String() string { +func (p *GetUnifiedExamResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetUploadParamsRequest(%+v)", *p) - -} + return fmt.Sprintf("GetUnifiedExamResponse(%+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"` } -func NewGetUploadParamsResponse() *GetUploadParamsResponse { - return &GetUploadParamsResponse{} +// url +type APILoginRequest struct { + Password string `thrift:"password,1,required" form:"password,required" json:"password,required" query:"password,required"` } -func (p *GetUploadParamsResponse) InitDefault() { +func NewAPILoginRequest() *APILoginRequest { + return &APILoginRequest{} } -func (p *GetUploadParamsResponse) GetPolicy() (v string) { - return p.Policy +func (p *APILoginRequest) InitDefault() { } -func (p *GetUploadParamsResponse) GetAuthorization() (v string) { - return p.Authorization +func (p *APILoginRequest) GetPassword() (v string) { + return p.Password } -var fieldIDToName_GetUploadParamsResponse = map[int16]string{ - 1: "policy", - 2: "authorization", +var fieldIDToName_APILoginRequest = map[int16]string{ + 1: "password", } -func (p *GetUploadParamsResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *APILoginRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetPolicy bool = false - var issetAuthorization bool = false + var issetPassword bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -8133,16 +8156,7 @@ func (p *GetUploadParamsResponse) Read(iprot thrift.TProtocol) (err error) { 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 + issetPassword = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -8159,22 +8173,17 @@ func (p *GetUploadParamsResponse) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetPolicy { + if !issetPassword { 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) + 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) @@ -8183,21 +8192,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_GetUploadParamsResponse[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_APILoginRequest[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 { +func (p *APILoginRequest) ReadField1(iprot thrift.TProtocol) error { var _field string if v, err := iprot.ReadString(); err != nil { @@ -8205,13 +8203,13 @@ func (p *GetUploadParamsResponse) ReadField2(iprot thrift.TProtocol) error { } else { _field = v } - p.Authorization = _field + p.Password = _field return nil } -func (p *GetUploadParamsResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *APILoginRequest) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetUploadParamsResponse"); err != nil { + if err = oprot.WriteStructBegin("APILoginRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -8219,10 +8217,6 @@ func (p *GetUploadParamsResponse) Write(oprot thrift.TProtocol) (err error) { fieldId = 1 goto WriteFieldError } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -8241,11 +8235,11 @@ 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 { +func (p *APILoginRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("password", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(p.Policy); err != nil { + if err := oprot.WriteString(p.Password); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -8258,44 +8252,27 @@ 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 { +func (p *APILoginRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetUploadParamsResponse(%+v)", *p) + return fmt.Sprintf("APILoginRequest(%+v)", *p) } -type GetDownloadReleaseRequest struct { +type APILoginResponse struct { } -func NewGetDownloadReleaseRequest() *GetDownloadReleaseRequest { - return &GetDownloadReleaseRequest{} +func NewAPILoginResponse() *APILoginResponse { + return &APILoginResponse{} } -func (p *GetDownloadReleaseRequest) InitDefault() { +func (p *APILoginResponse) InitDefault() { } -var fieldIDToName_GetDownloadReleaseRequest = map[int16]string{} +var fieldIDToName_APILoginResponse = map[int16]string{} -func (p *GetDownloadReleaseRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *APILoginResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -8337,8 +8314,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetDownloadReleaseRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetDownloadReleaseRequest"); err != nil { +func (p *APILoginResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("APILoginResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -8358,30 +8335,73 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetDownloadReleaseRequest) String() string { +func (p *APILoginResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetDownloadReleaseRequest(%+v)", *p) + return fmt.Sprintf("APILoginResponse(%+v)", *p) } -type GetDownloadReleaseResponse struct { +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 NewGetDownloadReleaseResponse() *GetDownloadReleaseResponse { - return &GetDownloadReleaseResponse{} +func NewUploadVersionInfoRequest() *UploadVersionInfoRequest { + return &UploadVersionInfoRequest{} } -func (p *GetDownloadReleaseResponse) InitDefault() { +func (p *UploadVersionInfoRequest) InitDefault() { } -var fieldIDToName_GetDownloadReleaseResponse = map[int16]string{} +func (p *UploadVersionInfoRequest) GetPassword() (v string) { + return p.Password +} -func (p *GetDownloadReleaseResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *UploadVersionInfoRequest) GetType() (v string) { + return p.Type +} + +func (p *UploadVersionInfoRequest) GetVersion() (v string) { + return p.Version +} + +func (p *UploadVersionInfoRequest) GetCode() (v string) { + return p.Code +} + +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 @@ -8395,8 +8415,66 @@ func (p *GetDownloadReleaseResponse) 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 @@ -8406,108 +8484,150 @@ func (p *GetDownloadReleaseResponse) 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 *GetDownloadReleaseResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetDownloadReleaseResponse"); 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 *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 -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 *UploadVersionInfoRequest) ReadField2(iprot thrift.TProtocol) error { -func (p *GetDownloadReleaseResponse) String() string { - if p == nil { - return "" + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v } - return fmt.Sprintf("GetDownloadReleaseResponse(%+v)", *p) - -} - -type GetDownloadBetaRequest struct { + p.Type = _field + return nil } +func (p *UploadVersionInfoRequest) ReadField3(iprot thrift.TProtocol) error { -func NewGetDownloadBetaRequest() *GetDownloadBetaRequest { - return &GetDownloadBetaRequest{} + 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 { -func (p *GetDownloadBetaRequest) 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 { -var fieldIDToName_GetDownloadBetaRequest = map[int16]string{} - -func (p *GetDownloadBetaRequest) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError + 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 { - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldTypeError - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v } - + p.URL = _field return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -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 *GetDownloadBetaRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetDownloadBetaRequest"); err != 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 @@ -8518,33 +8638,137 @@ 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 *UploadVersionInfoRequest) 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 *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) +} + +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 (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) +} + +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 *UploadVersionInfoRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetDownloadBetaRequest(%+v)", *p) + return fmt.Sprintf("UploadVersionInfoRequest(%+v)", *p) } -type GetDownloadBetaResponse struct { +type UploadVersionInfoResponse struct { } -func NewGetDownloadBetaResponse() *GetDownloadBetaResponse { - return &GetDownloadBetaResponse{} +func NewUploadVersionInfoResponse() *UploadVersionInfoResponse { + return &UploadVersionInfoResponse{} } -func (p *GetDownloadBetaResponse) InitDefault() { +func (p *UploadVersionInfoResponse) InitDefault() { } -var fieldIDToName_GetDownloadBetaResponse = map[int16]string{} +var fieldIDToName_UploadVersionInfoResponse = map[int16]string{} -func (p *GetDownloadBetaResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *UploadVersionInfoResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -8586,8 +8810,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetDownloadBetaResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetDownloadBetaResponse"); err != nil { +func (p *UploadVersionInfoResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("UploadVersionInfoResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -8607,30 +8831,38 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetDownloadBetaResponse) String() string { +func (p *UploadVersionInfoResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetDownloadBetaResponse(%+v)", *p) + return fmt.Sprintf("UploadVersionInfoResponse(%+v)", *p) } -type GetReleaseVersionRequest struct { +type GetUploadParamsRequest struct { + Password string `thrift:"password,1,required" form:"password,required" json:"password,required" query:"password,required"` } -func NewGetReleaseVersionRequest() *GetReleaseVersionRequest { - return &GetReleaseVersionRequest{} +func NewGetUploadParamsRequest() *GetUploadParamsRequest { + return &GetUploadParamsRequest{} } -func (p *GetReleaseVersionRequest) InitDefault() { +func (p *GetUploadParamsRequest) InitDefault() { } -var fieldIDToName_GetReleaseVersionRequest = map[int16]string{} +func (p *GetUploadParamsRequest) GetPassword() (v string) { + return p.Password +} -func (p *GetReleaseVersionRequest) 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 @@ -8644,36 +8876,74 @@ func (p *GetReleaseVersionRequest) 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) + 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 + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + if !issetPassword { + fieldId = 1 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_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 *GetReleaseVersionRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetReleaseVersionRequest"); 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 @@ -8684,36 +8954,70 @@ func (p *GetReleaseVersionRequest) 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 *GetReleaseVersionRequest) 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("GetReleaseVersionRequest(%+v)", *p) + return fmt.Sprintf("GetUploadParamsRequest(%+v)", *p) } -type GetReleaseVersionResponse 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 NewGetReleaseVersionResponse() *GetReleaseVersionResponse { - return &GetReleaseVersionResponse{} +func NewGetUploadParamsResponse() *GetUploadParamsResponse { + return &GetUploadParamsResponse{} } -func (p *GetReleaseVersionResponse) InitDefault() { +func (p *GetUploadParamsResponse) InitDefault() { } -var fieldIDToName_GetReleaseVersionResponse = map[int16]string{} +func (p *GetUploadParamsResponse) GetPolicy() (v string) { + return p.Policy +} -func (p *GetReleaseVersionResponse) 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 @@ -8727,8 +9031,30 @@ func (p *GetReleaseVersionResponse) 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 + } + 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 @@ -8738,25 +9064,70 @@ func (p *GetReleaseVersionResponse) 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) -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 *GetReleaseVersionResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetReleaseVersionResponse"); 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 @@ -8767,33 +9138,69 @@ func (p *GetReleaseVersionResponse) 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 *GetReleaseVersionResponse) 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("GetReleaseVersionResponse(%+v)", *p) + return fmt.Sprintf("GetUploadParamsResponse(%+v)", *p) } -type GetBetaVersionRequest struct { +type GetDownloadReleaseRequest struct { } -func NewGetBetaVersionRequest() *GetBetaVersionRequest { - return &GetBetaVersionRequest{} +func NewGetDownloadReleaseRequest() *GetDownloadReleaseRequest { + return &GetDownloadReleaseRequest{} } -func (p *GetBetaVersionRequest) InitDefault() { +func (p *GetDownloadReleaseRequest) InitDefault() { } -var fieldIDToName_GetBetaVersionRequest = map[int16]string{} +var fieldIDToName_GetDownloadReleaseRequest = map[int16]string{} -func (p *GetBetaVersionRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetDownloadReleaseRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -8835,8 +9242,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 *GetDownloadReleaseRequest) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetDownloadReleaseRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -8856,27 +9263,27 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetBetaVersionRequest) String() string { +func (p *GetDownloadReleaseRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetBetaVersionRequest(%+v)", *p) + return fmt.Sprintf("GetDownloadReleaseRequest(%+v)", *p) } -type GetBetaVersionResponse struct { +type GetDownloadReleaseResponse struct { } -func NewGetBetaVersionResponse() *GetBetaVersionResponse { - return &GetBetaVersionResponse{} +func NewGetDownloadReleaseResponse() *GetDownloadReleaseResponse { + return &GetDownloadReleaseResponse{} } -func (p *GetBetaVersionResponse) InitDefault() { +func (p *GetDownloadReleaseResponse) InitDefault() { } -var fieldIDToName_GetBetaVersionResponse = map[int16]string{} +var fieldIDToName_GetDownloadReleaseResponse = map[int16]string{} -func (p *GetBetaVersionResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetDownloadReleaseResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -8918,8 +9325,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 *GetDownloadReleaseResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetDownloadReleaseResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -8939,118 +9346,110 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetBetaVersionResponse) String() string { +func (p *GetDownloadReleaseResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetBetaVersionResponse(%+v)", *p) + return fmt.Sprintf("GetDownloadReleaseResponse(%+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 GetDownloadBetaRequest struct { } -func NewGetCloudSettingRequest() *GetCloudSettingRequest { - return &GetCloudSettingRequest{} +func NewGetDownloadBetaRequest() *GetDownloadBetaRequest { + return &GetDownloadBetaRequest{} } -func (p *GetCloudSettingRequest) InitDefault() { +func (p *GetDownloadBetaRequest) InitDefault() { } -var GetCloudSettingRequest_Account_DEFAULT string +var fieldIDToName_GetDownloadBetaRequest = map[int16]string{} -func (p *GetCloudSettingRequest) GetAccount() (v string) { - if !p.IsSetAccount() { - return GetCloudSettingRequest_Account_DEFAULT - } - return *p.Account -} +func (p *GetDownloadBetaRequest) 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 *GetDownloadBetaRequest) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetDownloadBetaRequest"); 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 *GetDownloadBetaRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetDownloadBetaRequest(%+v)", *p) -func (p *GetCloudSettingRequest) IsSetVersion() bool { - return p.Version != nil } -func (p *GetCloudSettingRequest) IsSetBeta() bool { - return p.Beta != nil +type GetDownloadBetaResponse struct { } -func (p *GetCloudSettingRequest) IsSetPhone() bool { - return p.Phone != nil +func NewGetDownloadBetaResponse() *GetDownloadBetaResponse { + return &GetDownloadBetaResponse{} } -func (p *GetCloudSettingRequest) IsSetIsLogin() bool { - return p.IsLogin != nil +func (p *GetDownloadBetaResponse) InitDefault() { } -func (p *GetCloudSettingRequest) IsSetLoginType() bool { - return p.LoginType != nil -} +var fieldIDToName_GetDownloadBetaResponse = map[int16]string{} -func (p *GetCloudSettingRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetDownloadBetaResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -9067,60 +9466,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 +9482,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,104 +9491,95 @@ 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 +func (p *GetDownloadBetaResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetDownloadBetaResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError } - p.Account = _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 *GetCloudSettingRequest) ReadField2(iprot thrift.TProtocol) error { - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v +func (p *GetDownloadBetaResponse) String() string { + if p == nil { + return "" } - p.Version = _field - return nil + return fmt.Sprintf("GetDownloadBetaResponse(%+v)", *p) + } -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 +type GetReleaseVersionRequest struct { } -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 NewGetReleaseVersionRequest() *GetReleaseVersionRequest { + return &GetReleaseVersionRequest{} } -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 *GetReleaseVersionRequest) InitDefault() { } -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 -} +var fieldIDToName_GetReleaseVersionRequest = map[int16]string{} -func (p *GetCloudSettingRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *GetReleaseVersionRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType var fieldId int16 - if err = oprot.WriteStructBegin("GetCloudSettingRequest"); err != nil { - goto WriteStructBeginError + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } - 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 + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError + if fieldTypeId == thrift.STOP { + break } - if err = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldTypeError } - if err = p.writeField6(oprot); err != nil { - fieldId = 6 - goto WriteFieldError + 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 *GetReleaseVersionRequest) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetReleaseVersionRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError } @@ -9253,149 +9589,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 *GetReleaseVersionRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetCloudSettingRequest(%+v)", *p) + return fmt.Sprintf("GetReleaseVersionRequest(%+v)", *p) } -type GetCloudSettingResponse struct { +type GetReleaseVersionResponse struct { } -func NewGetCloudSettingResponse() *GetCloudSettingResponse { - return &GetCloudSettingResponse{} +func NewGetReleaseVersionResponse() *GetReleaseVersionResponse { + return &GetReleaseVersionResponse{} } -func (p *GetCloudSettingResponse) InitDefault() { +func (p *GetReleaseVersionResponse) InitDefault() { } -var fieldIDToName_GetCloudSettingResponse = map[int16]string{} +var fieldIDToName_GetReleaseVersionResponse = map[int16]string{} -func (p *GetCloudSettingResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetReleaseVersionResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -9437,8 +9657,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 *GetReleaseVersionResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetReleaseVersionResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -9458,27 +9678,27 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetCloudSettingResponse) String() string { +func (p *GetReleaseVersionResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetCloudSettingResponse(%+v)", *p) + return fmt.Sprintf("GetReleaseVersionResponse(%+v)", *p) } -type GetAllCloudSettingRequest struct { +type GetBetaVersionRequest struct { } -func NewGetAllCloudSettingRequest() *GetAllCloudSettingRequest { - return &GetAllCloudSettingRequest{} +func NewGetBetaVersionRequest() *GetBetaVersionRequest { + return &GetBetaVersionRequest{} } -func (p *GetAllCloudSettingRequest) InitDefault() { +func (p *GetBetaVersionRequest) InitDefault() { } -var fieldIDToName_GetAllCloudSettingRequest = map[int16]string{} +var fieldIDToName_GetBetaVersionRequest = map[int16]string{} -func (p *GetAllCloudSettingRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetBetaVersionRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -9520,8 +9740,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 *GetBetaVersionRequest) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetBetaVersionRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -9541,27 +9761,27 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetAllCloudSettingRequest) String() string { +func (p *GetBetaVersionRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetAllCloudSettingRequest(%+v)", *p) + return fmt.Sprintf("GetBetaVersionRequest(%+v)", *p) } -type GetAllCloudSettingResponse struct { +type GetBetaVersionResponse struct { } -func NewGetAllCloudSettingResponse() *GetAllCloudSettingResponse { - return &GetAllCloudSettingResponse{} +func NewGetBetaVersionResponse() *GetBetaVersionResponse { + return &GetBetaVersionResponse{} } -func (p *GetAllCloudSettingResponse) InitDefault() { +func (p *GetBetaVersionResponse) InitDefault() { } -var fieldIDToName_GetAllCloudSettingResponse = map[int16]string{} +var fieldIDToName_GetBetaVersionResponse = map[int16]string{} -func (p *GetAllCloudSettingResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetBetaVersionResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -9603,8 +9823,8 @@ 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 { +func (p *GetBetaVersionResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("GetBetaVersionResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -9624,45 +9844,121 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetAllCloudSettingResponse) String() string { +func (p *GetBetaVersionResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetAllCloudSettingResponse(%+v)", *p) + return fmt.Sprintf("GetBetaVersionResponse(%+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"` +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 NewSetAllCloudSettingRequest() *SetAllCloudSettingRequest { - return &SetAllCloudSettingRequest{} +func NewGetCloudSettingRequest() *GetCloudSettingRequest { + return &GetCloudSettingRequest{} } -func (p *SetAllCloudSettingRequest) InitDefault() { +func (p *GetCloudSettingRequest) InitDefault() { } -func (p *SetAllCloudSettingRequest) GetPassword() (v string) { - return p.Password +var GetCloudSettingRequest_Account_DEFAULT string + +func (p *GetCloudSettingRequest) GetAccount() (v string) { + if !p.IsSetAccount() { + return GetCloudSettingRequest_Account_DEFAULT + } + return *p.Account } -func (p *SetAllCloudSettingRequest) GetSetting() (v string) { - return p.Setting +var GetCloudSettingRequest_Version_DEFAULT string + +func (p *GetCloudSettingRequest) GetVersion() (v string) { + if !p.IsSetVersion() { + return GetCloudSettingRequest_Version_DEFAULT + } + return *p.Version } -var fieldIDToName_SetAllCloudSettingRequest = map[int16]string{ - 1: "password", - 2: "setting", +var GetCloudSettingRequest_Beta_DEFAULT string + +func (p *GetCloudSettingRequest) GetBeta() (v string) { + if !p.IsSetBeta() { + return GetCloudSettingRequest_Beta_DEFAULT + } + return *p.Beta } -func (p *SetAllCloudSettingRequest) Read(iprot thrift.TProtocol) (err error) { +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 - var issetPassword bool = false - var issetSetting bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -9683,7 +9979,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 +9987,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 +10035,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 +10049,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,15 +10132,31 @@ func (p *SetAllCloudSettingRequest) Write(oprot thrift.TProtocol) (err error) { fieldId = 2 goto WriteFieldError } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) WriteFieldError: return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) @@ -9791,15 +10166,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 +10185,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 +10204,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 +10342,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 +10363,30 @@ 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) - -} - -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 NewTestSettingRequest() *TestSettingRequest { - return &TestSettingRequest{} -} - -func (p *TestSettingRequest) InitDefault() { -} - -func (p *TestSettingRequest) GetSetting() (v string) { - return p.Setting -} - -func (p *TestSettingRequest) GetAccount() (v string) { - return p.Account -} - -func (p *TestSettingRequest) GetVersion() (v string) { - return p.Version -} + return fmt.Sprintf("GetCloudSettingResponse(%+v)", *p) -func (p *TestSettingRequest) GetBeta() (v string) { - return p.Beta } -func (p *TestSettingRequest) GetPhone() (v string) { - return p.Phone +type GetAllCloudSettingRequest struct { } -func (p *TestSettingRequest) GetIsLogin() (v string) { - return p.IsLogin +func NewGetAllCloudSettingRequest() *GetAllCloudSettingRequest { + return &GetAllCloudSettingRequest{} } -func (p *TestSettingRequest) GetLoginType() (v string) { - return p.LoginType +func (p *GetAllCloudSettingRequest) InitDefault() { } -var fieldIDToName_TestSettingRequest = map[int16]string{ - 1: "setting", - 2: "account", - 3: "version", - 4: "beta", - 5: "phone", - 6: "isLogin", - 7: "loginType", -} +var fieldIDToName_GetAllCloudSettingRequest = map[int16]string{} -func (p *TestSettingRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetAllCloudSettingRequest) 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 +10400,204 @@ 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 *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 *GetAllCloudSettingRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetAllCloudSettingRequest(%+v)", *p) + +} + +type GetAllCloudSettingResponse struct { +} + +func NewGetAllCloudSettingResponse() *GetAllCloudSettingResponse { + return &GetAllCloudSettingResponse{} +} + +func (p *GetAllCloudSettingResponse) InitDefault() { +} + +var fieldIDToName_GetAllCloudSettingResponse = map[int16]string{} + +func (p *GetAllCloudSettingResponse) 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 *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 +10614,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,10 +10638,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])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_SetAllCloudSettingRequest[fieldId])) } -func (p *TestSettingRequest) ReadField1(iprot thrift.TProtocol) error { +func (p *SetAllCloudSettingRequest) ReadField1(iprot thrift.TProtocol) error { var _field string if v, err := iprot.ReadString(); err != nil { @@ -10133,10 +10649,10 @@ func (p *TestSettingRequest) ReadField1(iprot thrift.TProtocol) error { } else { _field = v } - p.Setting = _field + p.Password = _field return nil } -func (p *TestSettingRequest) ReadField2(iprot thrift.TProtocol) error { +func (p *SetAllCloudSettingRequest) ReadField2(iprot thrift.TProtocol) error { var _field string if v, err := iprot.ReadString(); err != nil { @@ -10144,68 +10660,13 @@ func (p *TestSettingRequest) ReadField2(iprot thrift.TProtocol) error { } else { _field = v } - p.Account = _field + p.Setting = _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 -} -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 { - - 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 { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.LoginType = _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 +10678,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 +10696,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 +10713,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 +10730,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 +10792,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 +10813,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 *TestSettingRequest) GetSetting() (v string) { + return p.Setting +} -func (p *DumpVisitRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *TestSettingRequest) GetAccount() (v string) { + return p.Account +} - var fieldTypeId thrift.TType - var fieldId int16 +func (p *TestSettingRequest) GetVersion() (v string) { + return p.Version +} - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } +func (p *TestSettingRequest) GetBeta() (v string) { + return p.Beta +} - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldTypeError - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } +func (p *TestSettingRequest) GetPhone() (v string) { + return p.Phone +} - 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 *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 *DumpVisitRequest) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("DumpVisitRequest(%+v)", *p) - -} - -type DumpVisitResponse struct { +func (p *TestSettingRequest) GetIsLogin() (v string) { + return p.IsLogin } -func NewDumpVisitResponse() *DumpVisitResponse { - return &DumpVisitResponse{} +func (p *TestSettingRequest) GetLoginType() (v string) { + return p.LoginType } -func (p *DumpVisitResponse) InitDefault() { +var fieldIDToName_TestSettingRequest = map[int16]string{ + 1: "setting", + 2: "account", + 3: "version", + 4: "beta", + 5: "phone", + 6: "isLogin", + 7: "loginType", } -var fieldIDToName_DumpVisitResponse = map[int16]string{} - -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,8 +10900,75 @@ func (p *DumpVisitResponse) 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 + } + 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 @@ -10588,108 +10978,170 @@ func (p *DumpVisitResponse) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } + if !issetSetting { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetAccount { + 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) -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 *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 - } - 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 *DumpVisitResponse) String() string { - if p == nil { - return "" + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v } - return fmt.Sprintf("DumpVisitResponse(%+v)", *p) - + p.Account = _field + return nil } +func (p *TestSettingRequest) ReadField3(iprot thrift.TProtocol) error { -type FZUHelperCSSRequest 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 NewFZUHelperCSSRequest() *FZUHelperCSSRequest { - return &FZUHelperCSSRequest{} + 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 *FZUHelperCSSRequest) 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_FZUHelperCSSRequest = map[int16]string{} - -func (p *FZUHelperCSSRequest) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError + 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 { - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldTypeError - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v } - + p.LoginType = _field return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -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 *FZUHelperCSSRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("FZUHelperCSSRequest"); err != nil { +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 @@ -10700,33 +11152,154 @@ func (p *FZUHelperCSSRequest) 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 *FZUHelperCSSRequest) String() string { +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("FZUHelperCSSRequest(%+v)", *p) + return fmt.Sprintf("TestSettingRequest(%+v)", *p) } -type FZUHelperCSSResponse struct { +type TestSettingResponse struct { } -func NewFZUHelperCSSResponse() *FZUHelperCSSResponse { - return &FZUHelperCSSResponse{} +func NewTestSettingResponse() *TestSettingResponse { + return &TestSettingResponse{} } -func (p *FZUHelperCSSResponse) InitDefault() { +func (p *TestSettingResponse) InitDefault() { } -var fieldIDToName_FZUHelperCSSResponse = map[int16]string{} +var fieldIDToName_TestSettingResponse = map[int16]string{} -func (p *FZUHelperCSSResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *TestSettingResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -10768,8 +11341,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 +11362,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 +11424,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 +11445,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 +11507,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 +11528,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 +11590,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 +11611,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 +11673,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,527 +11694,881 @@ 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 (p *FZUHelperHTMLRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError } -} -func NewClassRoomServiceClient(c thrift.TClient) *ClassRoomServiceClient { - return &ClassRoomServiceClient{ - c: c, + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldTypeError + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError } -} -func (p *ClassRoomServiceClient) Client_() thrift.TClient { - return p.c + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +SkipFieldTypeError: + return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *ClassRoomServiceClient) GetEmptyClassrooms(ctx context.Context, request *EmptyClassroomRequest) (r *EmptyClassroomResponse, err error) { - var _args ClassRoomServiceGetEmptyClassroomsArgs - _args.Request = request - var _result ClassRoomServiceGetEmptyClassroomsResult - if err = p.Client_().Call(ctx, "GetEmptyClassrooms", &_args, &_result); err != nil { - return +func (p *FZUHelperHTMLRequest) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("FZUHelperHTMLRequest"); err != nil { + goto WriteStructBeginError } - return _result.GetSuccess(), nil + 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) } -type UserService interface { - GetLoginData(ctx context.Context, request *GetLoginDataRequest) (r *GetLoginDataResponse, err error) +func (p *FZUHelperHTMLRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("FZUHelperHTMLRequest(%+v)", *p) - ValidateCode(ctx context.Context, request *ValidateCodeRequest) (r *ValidateCodeResponse, err error) +} - ValidateCodeForAndroid(ctx context.Context, request *ValidateCodeForAndroidRequest) (r *ValidateCodeForAndroidResponse, err error) +type FZUHelperHTMLResponse struct { } -type UserServiceClient struct { - c thrift.TClient +func NewFZUHelperHTMLResponse() *FZUHelperHTMLResponse { + return &FZUHelperHTMLResponse{} } -func NewUserServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *UserServiceClient { - return &UserServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), - } +func (p *FZUHelperHTMLResponse) InitDefault() { } -func NewUserServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *UserServiceClient { - return &UserServiceClient{ - c: thrift.NewTStandardClient(iprot, oprot), +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 } -} -func NewUserServiceClient(c thrift.TClient) *UserServiceClient { - return &UserServiceClient{ - c: c, + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldTypeError + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError } -} -func (p *UserServiceClient) Client_() thrift.TClient { - return p.c + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +SkipFieldTypeError: + return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *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 +func (p *FZUHelperHTMLResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("FZUHelperHTMLResponse"); err != nil { + goto WriteStructBeginError } - return _result.GetSuccess(), nil -} -func (p *UserServiceClient) ValidateCode(ctx context.Context, request *ValidateCodeRequest) (r *ValidateCodeResponse, err error) { - var _args UserServiceValidateCodeArgs - _args.Request = request - var _result UserServiceValidateCodeResult - if err = p.Client_().Call(ctx, "ValidateCode", &_args, &_result); err != nil { - return + if p != nil { } - return _result.GetSuccess(), nil -} -func (p *UserServiceClient) ValidateCodeForAndroid(ctx context.Context, request *ValidateCodeForAndroidRequest) (r *ValidateCodeForAndroidResponse, err error) { - var _args UserServiceValidateCodeForAndroidArgs - _args.Request = request - var _result UserServiceValidateCodeForAndroidResult - if err = p.Client_().Call(ctx, "ValidateCodeForAndroid", &_args, &_result); err != nil { - return + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError } - return _result.GetSuccess(), nil + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -type CourseService interface { - GetCourseList(ctx context.Context, req *CourseListRequest) (r *CourseListResponse, err error) +func (p *FZUHelperHTMLResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("FZUHelperHTMLResponse(%+v)", *p) + } -type CourseServiceClient struct { - c thrift.TClient +type UserAgreementHTMLRequest struct { } -func NewCourseServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *CourseServiceClient { - return &CourseServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), - } +func NewUserAgreementHTMLRequest() *UserAgreementHTMLRequest { + return &UserAgreementHTMLRequest{} } -func NewCourseServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *CourseServiceClient { - return &CourseServiceClient{ - c: thrift.NewTStandardClient(iprot, oprot), - } -} - -func NewCourseServiceClient(c thrift.TClient) *CourseServiceClient { - return &CourseServiceClient{ - c: c, - } -} - -func (p *CourseServiceClient) Client_() thrift.TClient { - return p.c -} - -func (p *CourseServiceClient) GetCourseList(ctx context.Context, req *CourseListRequest) (r *CourseListResponse, err error) { - var _args CourseServiceGetCourseListArgs - _args.Req = req - var _result CourseServiceGetCourseListResult - if err = p.Client_().Call(ctx, "GetCourseList", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil +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{ +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 + +func NewPaperServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *PaperServiceClient { + return &PaperServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewPaperServiceClient(c thrift.TClient) *PaperServiceClient { + return &PaperServiceClient{ + c: c, + } +} + +func (p *PaperServiceClient) Client_() thrift.TClient { + return p.c +} + +func (p *PaperServiceClient) ListDirFiles(ctx context.Context, req *ListDirFilesRequest) (r *ListDirFilesResponse, err error) { + var _args PaperServiceListDirFilesArgs _args.Req = req - var _result UrlServiceGetAllCloudSettingResult - if err = p.Client_().Call(ctx, "GetAllCloudSetting", &_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) SetAllCloudSetting(ctx context.Context, req *SetAllCloudSettingRequest) (r *SetAllCloudSettingResponse, err error) { - var _args UrlServiceSetAllCloudSettingArgs +func (p *PaperServiceClient) GetDownloadUrl(ctx context.Context, req *GetDownloadUrlRequest) (r *GetDownloadUrlResponse, err error) { + var _args PaperServiceGetDownloadUrlArgs + _args.Req = req + var _result PaperServiceGetDownloadUrlResult + if err = p.Client_().Call(ctx, "GetDownloadUrl", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *PaperServiceClient) ListDirFilesForAndroid(ctx context.Context, req *ListDirFilesForAndroidRequest) (r *ListDirFilesForAndroidResponse, err error) { + var _args PaperServiceListDirFilesForAndroidArgs + _args.Req = req + var _result PaperServiceListDirFilesForAndroidResult + if err = p.Client_().Call(ctx, "ListDirFilesForAndroid", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *PaperServiceClient) GetDownloadUrlForAndroid(ctx context.Context, req *GetDownloadUrlForAndroidRequest) (r *GetDownloadUrlForAndroidResponse, err error) { + var _args PaperServiceGetDownloadUrlForAndroidArgs + _args.Req = req + var _result PaperServiceGetDownloadUrlForAndroidResult + if err = p.Client_().Call(ctx, "GetDownloadUrlForAndroid", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +type AcademicService interface { + GetScores(ctx context.Context, req *GetScoresRequest) (r *GetScoresResponse, err error) + + GetGPA(ctx context.Context, req *GetGPARequest) (r *GetGPAResponse, err error) + + GetCredit(ctx context.Context, req *GetCreditRequest) (r *GetCreditResponse, err error) + + GetUnifiedExam(ctx context.Context, req *GetUnifiedExamRequest) (r *GetUnifiedExamResponse, err error) +} + +type AcademicServiceClient struct { + c thrift.TClient +} + +func NewAcademicServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *AcademicServiceClient { + return &AcademicServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewAcademicServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *AcademicServiceClient { + return &AcademicServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewAcademicServiceClient(c thrift.TClient) *AcademicServiceClient { + return &AcademicServiceClient{ + c: c, + } +} + +func (p *AcademicServiceClient) Client_() thrift.TClient { + return p.c +} + +func (p *AcademicServiceClient) GetScores(ctx context.Context, req *GetScoresRequest) (r *GetScoresResponse, err error) { + var _args AcademicServiceGetScoresArgs + _args.Req = req + var _result AcademicServiceGetScoresResult + 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 { + 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 { + 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 { + 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) + + GetUploadParams(ctx context.Context, req *GetUploadParamsRequest) (r *GetUploadParamsResponse, err error) + + GetDownloadRelease(ctx context.Context, req *GetDownloadReleaseRequest) (r *GetDownloadReleaseResponse, err error) + + GetDownloadBeta(ctx context.Context, req *GetDownloadBetaRequest) (r *GetDownloadBetaResponse, err error) + + GetReleaseVersion(ctx context.Context, req *GetReleaseVersionRequest) (r *GetReleaseVersionResponse, err error) + + GetBetaVersion(ctx context.Context, req *GetBetaVersionRequest) (r *GetBetaVersionResponse, err error) + + GetCloudSetting(ctx context.Context, req *GetCloudSettingRequest) (r *GetCloudSettingResponse, err error) + + GetAllCloudSetting(ctx context.Context, req *GetAllCloudSettingRequest) (r *GetAllCloudSettingResponse, err error) + + SetAllCloudSetting(ctx context.Context, req *SetAllCloudSettingRequest) (r *SetAllCloudSettingResponse, err error) + + TestSetting(ctx context.Context, req *TestSettingRequest) (r *TestSettingResponse, err error) + + DumpVisit(ctx context.Context, req *DumpVisitRequest) (r *DumpVisitResponse, err error) + + FZUHelperCSS(ctx context.Context, req *FZUHelperCSSRequest) (r *FZUHelperCSSResponse, err error) + + FZUHelperHTML(ctx context.Context, req *FZUHelperHTMLRequest) (r *FZUHelperHTMLResponse, err error) + + UserAgreementHTML(ctx context.Context, req *UserAgreementHTMLRequest) (r *UserAgreementHTMLResponse, err error) +} + +type UrlServiceClient struct { + c thrift.TClient +} + +func NewUrlServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *UrlServiceClient { + return &UrlServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewUrlServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *UrlServiceClient { + return &UrlServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewUrlServiceClient(c thrift.TClient) *UrlServiceClient { + return &UrlServiceClient{ + c: c, + } +} + +func (p *UrlServiceClient) Client_() thrift.TClient { + return p.c +} + +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 +} +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 _result.GetSuccess(), nil +} +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 *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 *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 + } + 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 + } + 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 _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 + } + 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 + } + 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 { @@ -13817,131 +14744,719 @@ func (p *launchScreenServiceProcessorDeleteImage) Process(ctx context.Context, s return true, err } -type launchScreenServiceProcessorMobileGetImage struct { - handler LaunchScreenService +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 +15502,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 +15512,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 +15521,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 +15549,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 +15566,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 +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_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 +15658,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 +15667,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 +15695,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 +15714,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 +15796,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 +15806,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 +15815,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 +15843,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 +15860,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 +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_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 +15952,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 +15961,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 +15989,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 +16008,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 +16090,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 +16100,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 +16109,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 +16137,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 +16154,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 +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_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 +16246,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 +16255,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 +16283,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 +16302,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 +16384,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 +16394,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 +16403,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 +16431,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 +16448,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 +16530,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 +16540,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 +16549,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 +16577,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 +16596,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 +16678,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 +16688,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 +16697,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 +16725,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 +16742,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 +16814,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 +17208,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 +17218,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 +17227,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 +17255,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 +17272,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 +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_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 +17364,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 +17373,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 +17401,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 +17420,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 +17502,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 +17512,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 +17521,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 +17549,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 +17566,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 +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_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 +17658,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 +17667,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 +17695,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 +17714,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 +17796,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 +17806,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 +17815,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 +17843,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 +17860,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 +17942,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 +17952,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 +17961,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 +17989,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 +18008,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 +18090,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 +18100,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 +18109,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 +18137,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 +18154,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 +18236,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 +18246,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 +18255,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 +18283,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 +18302,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 2b33d604..52769235 100644 --- a/api/model/model/model.go +++ b/api/model/model/model.go @@ -2692,7 +2692,12 @@ func (p *Picture) String() string { } -// 又拍云文件目录结构 +/* +* @Description 又拍云文件目录结构 +* @Param base_path 当前所在路径 +* @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"` Files []string `thrift:"files,2,required" form:"files,required" json:"files,required" query:"files,required"` diff --git a/api/pack/base.go b/api/pack/base.go index 25ecb6d1..2d2291b7 100644 --- a/api/pack/base.go +++ b/api/pack/base.go @@ -69,11 +69,3 @@ func RespList(c *app.RequestContext, items any) { } c.JSON(consts.StatusOK, resp) } - -func RespDataInPaper(c *app.RequestContext, data any) { - c.JSON(consts.StatusOK, RespWithData{ - Code: strconv.FormatInt(errno.SuccessCodePaper, 10), - Msg: "Success", - Data: data, - }) -} diff --git a/api/pack/paper.go b/api/pack/paper.go index b737c277..edca87c9 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 a43e442e..19d2743b 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 c397f5fc..e340f0bf 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 b05ad916..3b9dec3c 100644 --- a/api/router/custom_router.go +++ b/api/router/custom_router.go @@ -42,11 +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 兼容 ios + // 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 4199d2f7..c9ee5f2b 100644 --- a/idl/api.thrift +++ b/idl/api.thrift @@ -180,9 +180,43 @@ struct GetDownloadUrlResponse { 1: required string url, } +// 兼容 +struct ListDirFilesForAndroidRequest { + 1: required string path, +} + +struct GetDownloadUrlForAndroidRequest { + 1: required string filepath, +} + +struct PaperData { + 1: required string base_path, + 2: required list files, + 3: required list folders, +} + +struct PaperUrlData { + 1: required string url, +} + + +struct ListDirFilesForAndroidResponse { + +} + + +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 c6795a47..85b4089b 100644 --- a/idl/model.thrift +++ b/idl/model.thrift @@ -63,7 +63,13 @@ struct Picture{ 16:string regex, // 推送对象,通过正则里是否有学号来判断是否为推送目标 } -// 又拍云文件目录结构 + +/* +* @Description 又拍云文件目录结构 +* @Param base_path 当前所在路径 +* @Param files 当前所在目录文件 +* @Param folders 当前所在目录下的文件夹 +*/ struct UpYunFileDir { 1: required string base_path, 2: required list files, diff --git a/pkg/errno/code.go b/pkg/errno/code.go index 38be3607..c6419856 100644 --- a/pkg/errno/code.go +++ b/pkg/errno/code.go @@ -75,9 +75,7 @@ const ( InternalQueueErrorCode = 50018 // 队列错误 InternalETCDErrorCode = 50019 // ETCD错误 InternalTraceErrorCode = 50020 // Trace错误 -) -// paper的SuccessCode是2000, 不是 10000 -const ( + // paper的SuccessCode是2000, 不是 10000 SuccessCodePaper = 2000 ) From f899dafdabb66b5a4fc34e522826b8a278f1c247 Mon Sep 17 00:00:00 2001 From: penQee <3092572427@qq.com> Date: Mon, 11 Nov 2024 22:20:37 +0800 Subject: [PATCH 3/5] feat:Add comments, adjust PaperData and PaperUrlData positions --- api/handler/api/paper_service.go | 5 +- api/model/api/api.go | 518 +++---------------------------- api/model/model/model.go | 442 ++++++++++++++++++++++++++ idl/api.thrift | 18 +- idl/model.thrift | 12 + pkg/errno/code.go | 2 +- 6 files changed, 499 insertions(+), 498 deletions(-) diff --git a/api/handler/api/paper_service.go b/api/handler/api/paper_service.go index fd8d5015..99b1910c 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" @@ -112,7 +113,7 @@ func ListDirFilesForAndroid(ctx context.Context, c *app.RequestContext) { return } - data := &api.PaperData{ + data := &model.PaperData{ BasePath: res.BasePath, Files: res.Files, Folders: res.Folders, @@ -142,7 +143,7 @@ func GetDownloadUrlForAndroid(ctx context.Context, c *app.RequestContext) { return } - data := &api.PaperUrlData{ + data := &model.PaperUrlData{ URL: url, } diff --git a/api/model/api/api.go b/api/model/api/api.go index f91cb9f1..30d0e908 100644 --- a/api/model/api/api.go +++ b/api/model/api/api.go @@ -6364,192 +6364,22 @@ func (p *ListDirFilesForAndroidRequest) String() string { } -type GetDownloadUrlForAndroidRequest struct { - Filepath string `thrift:"filepath,1,required" form:"filepath,required" json:"filepath,required" query:"filepath,required"` -} - -func NewGetDownloadUrlForAndroidRequest() *GetDownloadUrlForAndroidRequest { - return &GetDownloadUrlForAndroidRequest{} -} - -func (p *GetDownloadUrlForAndroidRequest) InitDefault() { -} - -func (p *GetDownloadUrlForAndroidRequest) GetFilepath() (v string) { - return p.Filepath -} - -var fieldIDToName_GetDownloadUrlForAndroidRequest = map[int16]string{ - 1: "filepath", -} - -func (p *GetDownloadUrlForAndroidRequest) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetFilepath 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 - } - issetFilepath = 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 !issetFilepath { - 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_GetDownloadUrlForAndroidRequest[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_GetDownloadUrlForAndroidRequest[fieldId])) -} - -func (p *GetDownloadUrlForAndroidRequest) ReadField1(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Filepath = _field - return nil -} - -func (p *GetDownloadUrlForAndroidRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("GetDownloadUrlForAndroidRequest"); 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 *GetDownloadUrlForAndroidRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("filepath", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Filepath); 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 *GetDownloadUrlForAndroidRequest) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("GetDownloadUrlForAndroidRequest(%+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 +type ListDirFilesForAndroidResponse struct { } -func (p *PaperData) GetFiles() (v []string) { - return p.Files +func NewListDirFilesForAndroidResponse() *ListDirFilesForAndroidResponse { + return &ListDirFilesForAndroidResponse{} } -func (p *PaperData) GetFolders() (v []string) { - return p.Folders +func (p *ListDirFilesForAndroidResponse) InitDefault() { } -var fieldIDToName_PaperData = map[int16]string{ - 1: "base_path", - 2: "files", - 3: "folders", -} +var fieldIDToName_ListDirFilesForAndroidResponse = map[int16]string{} -func (p *PaperData) Read(iprot thrift.TProtocol) (err error) { +func (p *ListDirFilesForAndroidResponse) 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 @@ -6563,39 +6393,8 @@ func (p *PaperData) 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 - } - 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.Skip(fieldTypeId); err != nil { + goto SkipFieldTypeError } if err = iprot.ReadFieldEnd(); err != nil { goto ReadFieldEndError @@ -6605,114 +6404,25 @@ func (p *PaperData) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetBasePath { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetFiles { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetFolders { - fieldId = 3 - goto RequiredFieldNotSetError - } return nil ReadStructBeginError: return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaperData[fieldId]), err) -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_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 { +func (p *ListDirFilesForAndroidResponse) Write(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteStructBegin("ListDirFilesForAndroidResponse"); 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 @@ -6723,113 +6433,44 @@ func (p *PaperData) 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 *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 { +func (p *ListDirFilesForAndroidResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("PaperData(%+v)", *p) + return fmt.Sprintf("ListDirFilesForAndroidResponse(%+v)", *p) } -type PaperUrlData struct { - URL string `thrift:"url,1,required" form:"url,required" json:"url,required" query:"url,required"` +type GetDownloadUrlForAndroidRequest struct { + Filepath string `thrift:"filepath,1,required" form:"filepath,required" json:"filepath,required" query:"filepath,required"` } -func NewPaperUrlData() *PaperUrlData { - return &PaperUrlData{} +func NewGetDownloadUrlForAndroidRequest() *GetDownloadUrlForAndroidRequest { + return &GetDownloadUrlForAndroidRequest{} } -func (p *PaperUrlData) InitDefault() { +func (p *GetDownloadUrlForAndroidRequest) InitDefault() { } -func (p *PaperUrlData) GetURL() (v string) { - return p.URL +func (p *GetDownloadUrlForAndroidRequest) GetFilepath() (v string) { + return p.Filepath } -var fieldIDToName_PaperUrlData = map[int16]string{ - 1: "url", +var fieldIDToName_GetDownloadUrlForAndroidRequest = map[int16]string{ + 1: "filepath", } -func (p *PaperUrlData) Read(iprot thrift.TProtocol) (err error) { +func (p *GetDownloadUrlForAndroidRequest) 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 @@ -6850,7 +6491,7 @@ func (p *PaperUrlData) 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 } @@ -6867,7 +6508,7 @@ func (p *PaperUrlData) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetURL { + if !issetFilepath { fieldId = 1 goto RequiredFieldNotSetError } @@ -6877,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_PaperUrlData[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) @@ -6886,10 +6527,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_PaperUrlData[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetDownloadUrlForAndroidRequest[fieldId])) } -func (p *PaperUrlData) ReadField1(iprot thrift.TProtocol) error { +func (p *GetDownloadUrlForAndroidRequest) ReadField1(iprot thrift.TProtocol) error { var _field string if v, err := iprot.ReadString(); err != nil { @@ -6897,13 +6538,13 @@ func (p *PaperUrlData) ReadField1(iprot thrift.TProtocol) error { } else { _field = v } - p.URL = _field + p.Filepath = _field return nil } -func (p *PaperUrlData) Write(oprot thrift.TProtocol) (err error) { +func (p *GetDownloadUrlForAndroidRequest) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("PaperUrlData"); err != nil { + if err = oprot.WriteStructBegin("GetDownloadUrlForAndroidRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -6929,11 +6570,11 @@ 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 { +func (p *GetDownloadUrlForAndroidRequest) writeField1(oprot thrift.TProtocol) (err error) { + 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 { @@ -6946,94 +6587,11 @@ 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) - -} - -type ListDirFilesForAndroidResponse struct { -} - -func NewListDirFilesForAndroidResponse() *ListDirFilesForAndroidResponse { - return &ListDirFilesForAndroidResponse{} -} - -func (p *ListDirFilesForAndroidResponse) InitDefault() { -} - -var fieldIDToName_ListDirFilesForAndroidResponse = map[int16]string{} - -func (p *ListDirFilesForAndroidResponse) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldTypeError - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -SkipFieldTypeError: - return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *ListDirFilesForAndroidResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("ListDirFilesForAndroidResponse"); 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 *ListDirFilesForAndroidResponse) String() string { +func (p *GetDownloadUrlForAndroidRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("ListDirFilesForAndroidResponse(%+v)", *p) + return fmt.Sprintf("GetDownloadUrlForAndroidRequest(%+v)", *p) } diff --git a/api/model/model/model.go b/api/model/model/model.go index 52769235..627a5db1 100644 --- a/api/model/model/model.go +++ b/api/model/model/model.go @@ -4392,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/idl/api.thrift b/idl/api.thrift index c9ee5f2b..6c17201f 100644 --- a/idl/api.thrift +++ b/idl/api.thrift @@ -185,25 +185,13 @@ struct ListDirFilesForAndroidRequest { 1: required string path, } -struct GetDownloadUrlForAndroidRequest { - 1: required string filepath, -} - -struct PaperData { - 1: required string base_path, - 2: required list files, - 3: required list folders, -} - -struct PaperUrlData { - 1: required string url, -} - - struct ListDirFilesForAndroidResponse { } +struct GetDownloadUrlForAndroidRequest { + 1: required string filepath, +} struct GetDownloadUrlForAndroidResponse { diff --git a/idl/model.thrift b/idl/model.thrift index 85b4089b..701f3576 100644 --- a/idl/model.thrift +++ b/idl/model.thrift @@ -110,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/pkg/errno/code.go b/pkg/errno/code.go index c6419856..1f306413 100644 --- a/pkg/errno/code.go +++ b/pkg/errno/code.go @@ -76,6 +76,6 @@ const ( InternalETCDErrorCode = 50019 // ETCD错误 InternalTraceErrorCode = 50020 // Trace错误 - // paper的SuccessCode是2000, 不是 10000 + // paper在旧版Android中的SuccessCode是2000,用作兼容 SuccessCodePaper = 2000 ) From a6c2a3ad0cb772a531ff73fb16aa5e62368e2ede Mon Sep 17 00:00:00 2001 From: penQee <3092572427@qq.com> Date: Mon, 11 Nov 2024 22:29:13 +0800 Subject: [PATCH 4/5] feat: modified filepath format --- api/model/model/model.go | 8 +- idl/model.thrift | 4 +- kitex_gen/model/k-model.go | 358 +++++++++++++++++++++++++ kitex_gen/model/model.go | 532 ++++++++++++++++++++++++++++++++++++- 4 files changed, 893 insertions(+), 9 deletions(-) diff --git a/api/model/model/model.go b/api/model/model/model.go index 627a5db1..3caa75b1 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/idl/model.thrift b/idl/model.thrift index 701f3576..9ba2d98f 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 b6ace762..e3f5d022 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 f5d933dd..a68a7057 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 413e767847cbec756919a36e352a713f5245addd Mon Sep 17 00:00:00 2001 From: penQee <3092572427@qq.com> Date: Tue, 12 Nov 2024 19:00:41 +0800 Subject: [PATCH 5/5] feat: add FZUHelper.css in custom_router --- api/router/custom_router.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/router/custom_router.go b/api/router/custom_router.go index 3b9dec3c..5755df92 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) }