diff --git a/Makefile b/Makefile index 7119b104..2c4f8fe3 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ OUTPUT_PATH = $(DIR)/output API_PATH= $(DIR)/cmd/api # 服务名 -SERVICES := api user classroom course launch_screen paper academic +SERVICES := api user classroom course launch_screen paper academic version common service = $(word 1, $@) PREFIX = "[Makefile]" diff --git a/api/handler/api/common_service.go b/api/handler/api/common_service.go new file mode 100644 index 00000000..2faaffd3 --- /dev/null +++ b/api/handler/api/common_service.go @@ -0,0 +1,91 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by hertz generator. + +package api + +import ( + "context" + + "github.com/west2-online/fzuhelper-server/kitex_gen/common" + + "github.com/cloudwego/hertz/pkg/app" + "github.com/cloudwego/hertz/pkg/protocol/consts" + + api "github.com/west2-online/fzuhelper-server/api/model/api" + "github.com/west2-online/fzuhelper-server/api/pack" + "github.com/west2-online/fzuhelper-server/api/rpc" + "github.com/west2-online/fzuhelper-server/pkg/errno" + "github.com/west2-online/fzuhelper-server/pkg/logger" +) + +// GetCSS . +// @router /api/v2/url/onekey/FZUHelper.css [GET] +func GetCSS(ctx context.Context, c *app.RequestContext) { + var err error + var req api.GetCSSRequest + err = c.BindAndValidate(&req) + if err != nil { + logger.Errorf("api.GetCSS: BindAndValidate error %v", err) + pack.RespError(c, errno.ParamError.WithError(err)) + return + } + + css, err := rpc.GetCSSRPC(ctx, &common.GetCSSRequest{}) + if err != nil { + pack.RespError(c, err) + } + c.Data(consts.StatusOK, "text/css", *css) +} + +// GetHtml . +// @router /api/v2/url/onekey/FZUHelper.html [GET] +func GetHtml(ctx context.Context, c *app.RequestContext) { + var err error + var req api.GetHtmlRequest + err = c.BindAndValidate(&req) + if err != nil { + logger.Errorf("api.GetHtml: BindAndValidate error %v", err) + pack.RespError(c, errno.ParamError.WithError(err)) + return + } + + html, err := rpc.GetHtmlRPC(ctx, &common.GetHtmlRequest{}) + if err != nil { + pack.RespError(c, err) + } + c.Data(consts.StatusOK, "text/html", *html) +} + +// GetUserAgreement . +// @router /api/v2/url/onekey/UserAgreement.html [GET] +func GetUserAgreement(ctx context.Context, c *app.RequestContext) { + var err error + var req api.GetUserAgreementRequest + err = c.BindAndValidate(&req) + if err != nil { + logger.Errorf("api.GetUserAgreement: BindAndValidate error %v", err) + pack.RespError(c, errno.ParamError.WithError(err)) + return + } + + userAgreement, err := rpc.GetUserAgreementRPC(ctx, &common.GetUserAgreementRequest{}) + if err != nil { + pack.RespError(c, err) + } + c.Data(consts.StatusOK, "text/html", *userAgreement) +} diff --git a/api/handler/api/url_service.go b/api/handler/api/url_service.go deleted file mode 100644 index f551c333..00000000 --- a/api/handler/api/url_service.go +++ /dev/null @@ -1,441 +0,0 @@ -/* -Copyright 2024 The west2-online Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by hertz generator. - -package api - -import ( - "context" - "fmt" - uri "net/url" - "strings" - - "github.com/bytedance/sonic" - "github.com/cloudwego/hertz/pkg/app" - "github.com/cloudwego/hertz/pkg/protocol" - "github.com/cloudwego/hertz/pkg/protocol/consts" - - "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" -) - -var ClientSet *base.ClientSet - -// APILogin . -// @router /api/v1/url/login [POST] -func APILogin(ctx context.Context, c *app.RequestContext) { - var err error - var req api.APILoginRequest - err = c.BindAndValidate(&req) - if err != nil { - pack.RespError(c, errno.ParamError.WithError(err)) - return - } - - url := fmt.Sprintf("http://%s:5000/api/login", constants.URLServiceName) - - request := new(protocol.Request) - request.SetMethod(consts.MethodPost) - request.SetRequestURI(url) - request.SetFormData( - map[string]string{ - "password": req.Password, - }, - ) - - res := new(protocol.Response) - - if err = ClientSet.HzClient.Do(ctx, request, res); err != nil { - pack.RespError(c, err) - return - } - - c.String(consts.StatusOK, res.BodyBuffer().String()) -} - -// UploadVersionInfo . -// @router /api/v1/url/api/upload [POST] -func UploadVersionInfo(ctx context.Context, c *app.RequestContext) { - var err error - var req api.UploadVersionInfoRequest - err = c.BindAndValidate(&req) - if err != nil { - pack.RespError(c, errno.ParamError.WithError(err)) - return - } - - url := fmt.Sprintf("http://%s:5000/api/upload", constants.URLServiceName) - - request := new(protocol.Request) - request.SetMethod(consts.MethodPost) - request.SetRequestURI(url) - request.SetFormData( - map[string]string{ - "password": req.Password, - "type": req.Type, - "version": req.Version, - "code": req.Code, - "feature": req.Feature, - "url": req.URL, - }, - ) - - res := new(protocol.Response) - - if err = ClientSet.HzClient.Do(ctx, request, res); err != nil { - pack.RespError(c, err) - return - } - - c.String(consts.StatusOK, res.BodyBuffer().String()) -} - -// GetUploadParams . -// @router /api/v1/url/api/uploadparams [POST] -func GetUploadParams(ctx context.Context, c *app.RequestContext) { - var err error - var req api.GetUploadParamsRequest - err = c.BindAndValidate(&req) - if err != nil { - pack.RespError(c, errno.ParamError.WithError(err)) - return - } - - url := fmt.Sprintf("http://%s:5000/api/uploadparams", constants.URLServiceName) - resp := new(api.GetUploadParamsResponse) - - request := &protocol.Request{} - request.SetMethod(consts.MethodPost) - request.SetRequestURI(url) - request.SetFormData( - map[string]string{ - "password": req.Password, - }, - ) - - res := &protocol.Response{} - - if err = ClientSet.HzClient.Do(ctx, request, res); err != nil { - pack.RespError(c, err) - return - } - - if res.BodyBuffer().String() == "illegal access" { - c.String(consts.StatusOK, res.BodyBuffer().String()) - return - } - - err = sonic.Unmarshal(res.BodyBytes(), resp) - if err != nil { - pack.RespError(c, err) - return - } - - c.JSON(consts.StatusOK, resp) -} - -// GetDownloadRelease . -// @router /api/v1/url/release.apk [GET] -func GetDownloadRelease(ctx context.Context, c *app.RequestContext) { - 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) { - 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 := fmt.Sprintf("http://%s:5000/version.json", constants.URLServiceName) // 和json无关,仅为一个路径 - - request := &protocol.Request{} - request.SetMethod(consts.MethodGet) - request.SetRequestURI(url) - - res := new(protocol.Response) - keyValue := make(map[string]interface{}) - - if err := ClientSet.HzClient.Do(ctx, request, res); err != nil { - pack.RespError(c, err) - return - } - - err := sonic.Unmarshal(res.BodyBytes(), &keyValue) - if err != nil { - pack.RespError(c, err) - return - } - - c.JSON(consts.StatusOK, keyValue) -} - -// GetBetaVersion . -// @router /api/v1/url/versionbeta.json [GET] -func GetBetaVersion(ctx context.Context, c *app.RequestContext) { - url := fmt.Sprintf("http://%s:5000/versionbeta.json", constants.URLServiceName) // 和json无关,仅为一个路径 - - request := &protocol.Request{} - request.SetMethod(consts.MethodGet) - request.SetRequestURI(url) - - res := new(protocol.Response) - keyValue := make(map[string]interface{}) - - if err := ClientSet.HzClient.Do(ctx, request, res); err != nil { - pack.RespError(c, err) - return - } - - err := sonic.Unmarshal(res.BodyBytes(), &keyValue) - if err != nil { - pack.RespError(c, err) - return - } - - c.JSON(consts.StatusOK, keyValue) -} - -// GetCloudSetting . -// @router /api/v1/url/settings.php [GET] -func GetCloudSetting(ctx context.Context, c *app.RequestContext) { - var err error - - account := c.DefaultQuery("account", "") - verison := c.DefaultQuery("version", "") - beta := c.DefaultQuery("beta", "false") - phone := c.DefaultQuery("phone", "") - isLogin := c.DefaultQuery("isLogin", "false") - loginType := c.DefaultQuery("loginType", "0") - - url := fmt.Sprintf("http://%s:5000/settings.php", constants.URLServiceName) // 和php无关,仅为一个路径 - - queryParams := strings.Join( - []string{ - "?account=" + uri.QueryEscape(account), - "version=" + uri.QueryEscape(verison), - "beta=" + uri.QueryEscape(beta), - "phone=" + uri.QueryEscape(phone), - "isLogin=" + uri.QueryEscape(isLogin), - "loginType=" + uri.QueryEscape(loginType), - }, "&", - ) - - request := protocol.Request{} - request.SetMethod(consts.MethodGet) - request.SetRequestURI(url + queryParams) - - res := new(protocol.Response) - keyValue := make(map[string]interface{}) - - if err = ClientSet.HzClient.Do(ctx, &request, res); err != nil { - pack.RespError(c, err) - return - } - - if err = sonic.Unmarshal(res.BodyBytes(), &keyValue); err != nil { - pack.RespError(c, err) - return - } - - c.JSON(consts.StatusOK, keyValue) -} - -// GetAllCloudSetting . -// @router /api/v1/url/api/getcloud [GET] -func GetAllCloudSetting(ctx context.Context, c *app.RequestContext) { - var err error - - url := fmt.Sprintf("http://%s:5000/api/getcloud", constants.URLServiceName) - request := &protocol.Request{} - request.SetMethod(consts.MethodGet) - request.SetRequestURI(url) - - res := new(protocol.Response) - keyValue := make(map[string]interface{}) - - if err = ClientSet.HzClient.Do(ctx, request, res); err != nil { - pack.RespError(c, err) - return - } - - err = sonic.Unmarshal(res.BodyBytes(), &keyValue) - if err != nil { - pack.RespError(c, err) - return - } - - c.JSON(consts.StatusOK, keyValue) -} - -// SetAllCloudSetting . -// @router /api/v1/url/api/setcloud [POST] -func SetAllCloudSetting(ctx context.Context, c *app.RequestContext) { - var err error - var req api.SetAllCloudSettingRequest - err = c.BindAndValidate(&req) - if err != nil { - pack.RespError(c, errno.ParamError.WithError(err)) - return - } - - url := fmt.Sprintf("http://%s:5000/api/setcloud", constants.URLServiceName) - - request := &protocol.Request{} - request.SetMethod(consts.MethodPost) - request.SetRequestURI(url) - - res := new(protocol.Response) - - if err = ClientSet.HzClient.Do(ctx, request, res); err != nil { - pack.RespError(c, err) - return - } - - c.JSON(consts.StatusOK, res.BodyBuffer().String()) -} - -// TestSetting . -// @router /api/v1/url/api/test [POST] -func TestSetting(ctx context.Context, c *app.RequestContext) { - var err error - var req api.TestSettingRequest - err = c.BindAndValidate(&req) - if err != nil { - pack.RespError(c, errno.ParamError.WithError(err)) - return - } - - url := fmt.Sprintf("http://%s:5000/api/test", constants.URLServiceName) - request := &protocol.Request{} - request.SetMethod(consts.MethodPost) - request.SetRequestURI(url) - - res := new(protocol.Response) - - if err = ClientSet.HzClient.Do(ctx, request, res); err != nil { - pack.RespError(c, err) - return - } - - keyValue := make(map[string]interface{}) - - err = sonic.Unmarshal(res.BodyBytes(), keyValue) - if err != nil { - pack.RespError(c, err) - return - } - - c.JSON(consts.StatusOK, keyValue) -} - -// DumpVisit . -// @router /api/v1/url/dump [GET] -func DumpVisit(ctx context.Context, c *app.RequestContext) { - var err error - - url := fmt.Sprintf("http://%s:5000/upupdowndownleftleftrightrightbaba_dump_visit", constants.URLServiceName) - - request := &protocol.Request{} - request.SetMethod(consts.MethodGet) - request.SetRequestURI(url) - - res := new(protocol.Response) - keyValue := make(map[string]interface{}) - - if err = ClientSet.HzClient.Do(ctx, request, res); err != nil { - pack.RespError(c, err) - return - } - - err = sonic.Unmarshal(res.BodyBytes(), &keyValue) - if err != nil { - pack.RespError(c, err) - return - } - - c.JSON(consts.StatusOK, keyValue) -} - -// FZUHelperCSS . -// @router /api/v1/url/onekey/FZUHelper.css [GET] -func FZUHelperCSS(ctx context.Context, c *app.RequestContext) { - var err error - - url := fmt.Sprintf("http://%s:5000/onekey/FZUHelper.css", constants.URLServiceName) // 和css无关,仅为一个路径 - - request := &protocol.Request{} - request.SetMethod(consts.MethodGet) - request.SetRequestURI(url) - - res := new(protocol.Response) - if err = ClientSet.HzClient.Do(ctx, request, res); err != nil { - pack.RespError(c, err) - return - } - - c.SetContentType("text/css") - c.Data(consts.StatusOK, "text/css", res.BodyBytes()) -} - -// FZUHelperHTML . -// @router /api/v1/url/onekey/FZUHelper.html [GET] -func FZUHelperHTML(ctx context.Context, c *app.RequestContext) { - var err error - - url := fmt.Sprintf("http://%s:5000/onekey/FZUHelper.html", constants.URLServiceName) // 和html无关,仅为一个路径 - - request := &protocol.Request{} - request.SetMethod(consts.MethodGet) - request.SetRequestURI(url) - - res := new(protocol.Response) - - if err = ClientSet.HzClient.Do(ctx, request, res); err != nil { - pack.RespError(c, err) - return - } - c.Data(consts.StatusOK, "text/html", res.BodyBytes()) -} - -// UserAgreementHTML . -// @router /api/v1/url/onekey/UserAgreement.html [GET] -func UserAgreementHTML(ctx context.Context, c *app.RequestContext) { - var err error - - url := fmt.Sprintf("http://%s:5000/onekey/UserAgreement.html", constants.URLServiceName) // 和html无关,仅为一个路径 - - request := &protocol.Request{} - request.SetMethod(consts.MethodGet) - request.SetRequestURI(url) - - res := new(protocol.Response) - - if err = ClientSet.HzClient.Do(ctx, request, res); err != nil { - pack.RespError(c, err) - return - } - - c.Data(consts.StatusOK, "text/html", res.BodyBytes()) -} diff --git a/api/handler/api/user_service.go b/api/handler/api/user_service.go index 0aa4c144..089c0f9b 100644 --- a/api/handler/api/user_service.go +++ b/api/handler/api/user_service.go @@ -24,6 +24,8 @@ import ( "fmt" "net/http" + "github.com/west2-online/fzuhelper-server/api/handler/custom" + "github.com/cloudwego/hertz/pkg/app" "github.com/cloudwego/hertz/pkg/protocol" "github.com/cloudwego/hertz/pkg/protocol/consts" @@ -87,7 +89,7 @@ func ValidateCode(ctx context.Context, c *app.RequestContext) { res := new(protocol.Response) - if err = ClientSet.HzClient.Do(ctx, request, res); err != nil { + if err = custom.ClientSet.HzClient.Do(ctx, request, res); err != nil { pack.RespError(c, err) return } @@ -117,7 +119,7 @@ func ValidateCodeForAndroid(ctx context.Context, c *app.RequestContext) { res := new(protocol.Response) - if err = ClientSet.HzClient.Do(ctx, request, res); err != nil { + if err = custom.ClientSet.HzClient.Do(ctx, request, res); err != nil { pack.RespError(c, err) return } diff --git a/api/handler/api/version_service.go b/api/handler/api/version_service.go new file mode 100644 index 00000000..6d88f528 --- /dev/null +++ b/api/handler/api/version_service.go @@ -0,0 +1,331 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by hertz generator. + +package api + +import ( + "context" + + "github.com/west2-online/fzuhelper-server/api/pack" + "github.com/west2-online/fzuhelper-server/api/rpc" + "github.com/west2-online/fzuhelper-server/kitex_gen/version" + "github.com/west2-online/fzuhelper-server/pkg/errno" + "github.com/west2-online/fzuhelper-server/pkg/logger" + + "github.com/cloudwego/hertz/pkg/app" + "github.com/cloudwego/hertz/pkg/protocol/consts" + + api "github.com/west2-online/fzuhelper-server/api/model/api" +) + +// Login . +// @router /api/v2/url/login [POST] +func Login(ctx context.Context, c *app.RequestContext) { + var err error + var req api.LoginRequest + err = c.BindAndValidate(&req) + if err != nil { + logger.Errorf("api.Login: BindAndValidate error %v", err) + pack.RespError(c, errno.ParamError.WithError(err)) + return + } + + err = rpc.LoginRPC(ctx, &version.LoginRequest{Password: req.Password}) + if err != nil { + pack.RespError(c, err) + return + } + + pack.RespSuccess(c) +} + +// UploadVersion . +// @router /api/v2/url/api/upload [POST] +func UploadVersion(ctx context.Context, c *app.RequestContext) { + var err error + var req api.UploadRequest + err = c.BindAndValidate(&req) + if err != nil { + logger.Errorf("api.UploadVersion: BindAndValidate error %v", err) + pack.RespError(c, errno.ParamError.WithError(err)) + return + } + + // resp := new(api.UploadResponse) + + err = rpc.UploadVersionRPC(ctx, &version.UploadRequest{ + Version: req.Version, + Code: req.Code, + Url: req.URL, + Feature: req.Feature, + Type: req.Type, + Password: req.Password, + }) + if err != nil { + pack.RespError(c, err) + return + } + + pack.RespSuccess(c) +} + +// UploadParams . +// @router /api/v2/url/api/uploadparams [POST] +func UploadParams(ctx context.Context, c *app.RequestContext) { + var err error + var req api.UploadParamsRequest + err = c.BindAndValidate(&req) + if err != nil { + logger.Errorf("api.UploadParams: BindAndValidate error %v", err) + pack.RespError(c, errno.ParamError.WithError(err)) + return + } + + resp := new(api.UploadParamsResponse) + policy, auth, err := rpc.UploadParamsRPC(ctx, &version.UploadParamsRequest{Password: req.Password}) + if err != nil { + pack.RespError(c, err) + return + } + resp.Base = pack.BuildSuccessBase() + resp.Policy = policy + resp.Authorization = auth + c.JSON(consts.StatusOK, resp) +} + +// DownloadReleaseApk . +// @router /api/v2/url/release.apk [GET] +func DownloadReleaseApk(ctx context.Context, c *app.RequestContext) { + var err error + var req api.DownloadReleaseApkRequest + err = c.BindAndValidate(&req) + if err != nil { + logger.Errorf("api.DownloadReleaseApk: BindAndValidate error %v", err) + pack.RespError(c, errno.ParamError.WithError(err)) + return + } + + reUrl, err := rpc.DownloadReleaseApkRPC(ctx, &version.DownloadReleaseApkRequest{}) + if err != nil { + pack.RespError(c, err) + } + + c.Redirect(consts.StatusFound, []byte(*reUrl)) +} + +// DownloadBetaApk . +// @router /api/v2/url/beta.apk [GET] +func DownloadBetaApk(ctx context.Context, c *app.RequestContext) { + var err error + var req api.DownloadBetaApkRequest + err = c.BindAndValidate(&req) + if err != nil { + logger.Errorf("api.DownloadBetaApk: BindAndValidate error %v", err) + pack.RespError(c, errno.ParamError.WithError(err)) + return + } + + reUrl, err := rpc.DownloadBetaApkRPC(ctx, &version.DownloadBetaApkRequest{}) + if err != nil { + pack.RespError(c, err) + } + + c.Redirect(consts.StatusFound, []byte(*reUrl)) +} + +// GetReleaseVersion . +// @router /api/v2/url/version.json [GET] +func GetReleaseVersion(ctx context.Context, c *app.RequestContext) { + var err error + var req api.GetReleaseVersionRequest + err = c.BindAndValidate(&req) + if err != nil { + logger.Errorf("api.GetReleaseVersion: BindAndValidate error %v", err) + pack.RespError(c, errno.ParamError.WithError(err)) + return + } + + resp := new(api.GetReleaseVersionResponse) + + rpcResp, err := rpc.GetReleaseVersionRPC(ctx, &version.GetReleaseVersionRequest{}) + if err != nil { + pack.RespError(c, err) + return + } + resp.Base = pack.BuildSuccessBase() + resp.Version = rpcResp.Version + resp.URL = rpcResp.Url + resp.Code = rpcResp.Code + resp.Feature = rpcResp.Feature + c.JSON(consts.StatusOK, resp) +} + +// GetBetaVersion . +// @router /api/v2/url/versionbeta.json [GET] +func GetBetaVersion(ctx context.Context, c *app.RequestContext) { + var err error + var req api.GetBetaVersionRequest + err = c.BindAndValidate(&req) + if err != nil { + logger.Errorf("api.GetBetaVersion: BindAndValidate error %v", err) + pack.RespError(c, errno.ParamError.WithError(err)) + return + } + + resp := new(api.GetBetaVersionResponse) + + rpcResp, err := rpc.GetBetaVersionRPC(ctx, &version.GetBetaVersionRequest{}) + if err != nil { + pack.RespError(c, err) + return + } + resp.Base = pack.BuildSuccessBase() + resp.Version = rpcResp.Version + resp.URL = rpcResp.Url + resp.Code = rpcResp.Code + resp.Feature = rpcResp.Feature + c.JSON(consts.StatusOK, resp) +} + +// GetSetting . +// @router /api/v2/url/settings.php [GET] +func GetSetting(ctx context.Context, c *app.RequestContext) { + var err error + var req api.GetSettingRequest + err = c.BindAndValidate(&req) + if err != nil { + logger.Errorf("api.GetSetting: BindAndValidate error %v", err) + pack.RespError(c, errno.ParamError.WithError(err)) + return + } + + resp := new(api.GetSettingResponse) + rpcResp, err := rpc.GetSettingRPC(ctx, &version.GetSettingRequest{ + Account: req.Account, + Version: req.Version, + Beta: req.Beta, + Phone: req.Phone, + IsLogin: req.IsLogin, + LoginType: req.LoginType, + }) + if err != nil { + pack.RespError(c, err) + } + + resp.CloudSetting = rpcResp.CloudSetting + c.Data(consts.StatusOK, "application/json", resp.CloudSetting) +} + +// GetTest . +// @router /api/v2/url/test [POST] +func GetTest(ctx context.Context, c *app.RequestContext) { + var err error + var req api.GetTestRequest + err = c.BindAndValidate(&req) + if err != nil { + logger.Errorf("api.GetTest: BindAndValidate error %v", err) + pack.RespError(c, errno.ParamError.WithError(err)) + return + } + + resp := new(api.GetTestResponse) + rpcResp, err := rpc.GetTestRPC(ctx, &version.GetTestRequest{ + Account: req.Account, + Version: req.Version, + Beta: req.Beta, + Phone: req.Phone, + IsLogin: req.IsLogin, + LoginType: req.LoginType, + Setting: req.Setting, + }) + if err != nil { + pack.RespError(c, err) + } + + resp.CloudSetting = rpcResp.CloudSetting + c.Data(consts.StatusOK, "application/json", resp.CloudSetting) +} + +// GetCloud . +// @router /api/v2/url/getcloud [GET] +func GetCloud(ctx context.Context, c *app.RequestContext) { + var err error + var req api.GetCloudRequest + err = c.BindAndValidate(&req) + if err != nil { + logger.Errorf("api.GetCloud: BindAndValidate error %v", err) + pack.RespError(c, errno.ParamError.WithError(err)) + return + } + + resp := new(api.GetCloudResponse) + rpcResp, err := rpc.GetCloudRPC(ctx, &version.GetCloudRequest{}) + if err != nil { + pack.RespError(c, err) + } + + resp.CloudSetting = rpcResp.CloudSetting + pack.CustomUrlRespWithData(c, string(resp.CloudSetting)) + // c.Data(consts.StatusOK, "application/json", resp.CloudSetting) +} + +// SetCloud . +// @router /api/v2/url/setcloud [POST] +func SetCloud(ctx context.Context, c *app.RequestContext) { + var err error + var req api.SetCloudRequest + err = c.BindAndValidate(&req) + if err != nil { + logger.Errorf("api.SetCloud: BindAndValidate error %v", err) + pack.RespError(c, errno.ParamError.WithError(err)) + return + } + + err = rpc.SetCloudRPC(ctx, &version.SetCloudRequest{ + Password: req.Password, + Setting: req.Setting, + }) + if err != nil { + pack.RespError(c, err) + return + } + pack.RespSuccess(c) +} + +// GetDump . +// @router /api/v2/url/dump [GET] +func GetDump(ctx context.Context, c *app.RequestContext) { + var err error + var req api.GetDumpRequest + err = c.BindAndValidate(&req) + if err != nil { + logger.Errorf("api.GetDump: BindAndValidate error %v", err) + pack.RespError(c, errno.ParamError.WithError(err)) + return + } + + resp := new(api.GetDumpResponse) + + rpcResp, err := rpc.GetDumpRPC(ctx, &version.GetDumpRequest{}) + if err != nil { + pack.RespError(c, err) + } + + resp.Data = rpcResp.Data + c.Data(consts.StatusOK, "application/json", []byte(resp.Data)) +} diff --git a/api/handler/custom/url_service.go b/api/handler/custom/url_service.go new file mode 100644 index 00000000..84ab7358 --- /dev/null +++ b/api/handler/custom/url_service.go @@ -0,0 +1,181 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by hertz generator. + +package custom + +import ( + "context" + "net/http" + + "github.com/west2-online/fzuhelper-server/kitex_gen/version" + + "github.com/cloudwego/hertz/pkg/app" + "github.com/cloudwego/hertz/pkg/protocol/consts" + + api "github.com/west2-online/fzuhelper-server/api/model/api" + "github.com/west2-online/fzuhelper-server/api/pack" + "github.com/west2-online/fzuhelper-server/api/rpc" + "github.com/west2-online/fzuhelper-server/pkg/base" + "github.com/west2-online/fzuhelper-server/pkg/errno" + "github.com/west2-online/fzuhelper-server/pkg/logger" +) + +var ( + urlCustomErrorMsg = "illegal access" + ClientSet *base.ClientSet +) + +// 1127-custom by FantasyRL + +// APILogin . +// @router /api/v1/url/login [POST] +func APILogin(ctx context.Context, c *app.RequestContext) { + var err error + var req api.LoginRequest + err = c.BindAndValidate(&req) + if err != nil { + logger.Errorf("api.APILogin: BindAndValidate error %v", err) + pack.RespError(c, errno.ParamError.WithError(err)) + return + } + + err = rpc.LoginRPC(ctx, &version.LoginRequest{Password: req.Password}) + if err != nil { + if errNo := errno.ConvertErr(err); errNo.ErrorCode == http.StatusUnauthorized { + c.String(consts.StatusOK, urlCustomErrorMsg) + return + } + pack.RespError(c, err) + return + } + + c.JSON(consts.StatusOK, consts.StatusOK) +} + +// UploadVersionInfo . +// @router /api/v1/url/api/upload [POST] +func UploadVersionInfo(ctx context.Context, c *app.RequestContext) { + var err error + var req api.UploadRequest + err = c.BindAndValidate(&req) + if err != nil { + logger.Errorf("api.UploadVersion: BindAndValidate error %v", err) + pack.RespError(c, errno.ParamError.WithError(err)) + return + } + + // resp := new(api.UploadResponse) + + err = rpc.UploadVersionRPC(ctx, &version.UploadRequest{ + Version: req.Version, + Code: req.Code, + Url: req.URL, + Feature: req.Feature, + Type: req.Type, + Password: req.Password, + }) + if err != nil { + if errNo := errno.ConvertErr(err); errNo.ErrorCode == http.StatusUnauthorized { + c.String(consts.StatusOK, urlCustomErrorMsg) + return + } + pack.RespError(c, err) + return + } + + c.JSON(consts.StatusOK, consts.StatusOK) +} + +// GetUploadParams . +// @router /api/v1/url/api/uploadparams [POST] +func GetUploadParams(ctx context.Context, c *app.RequestContext) { + var err error + var req api.UploadParamsRequest + err = c.BindAndValidate(&req) + if err != nil { + logger.Errorf("api.UploadParams: BindAndValidate error %v", err) + pack.RespError(c, errno.ParamError.WithError(err)) + return + } + + resp := new(api.UploadParamsResponse) + policy, auth, err := rpc.UploadParamsRPC(ctx, &version.UploadParamsRequest{Password: req.Password}) + if err != nil { + if errNo := errno.ConvertErr(err); errNo.ErrorCode == http.StatusUnauthorized { + c.String(consts.StatusOK, urlCustomErrorMsg) + return + } + pack.RespError(c, err) + return + } + resp.Policy = policy + resp.Authorization = auth + c.JSON(consts.StatusOK, resp) +} + +// GetReleaseVersionModify . +// @router /api/v1/url/version.json [GET] +func GetReleaseVersionModify(ctx context.Context, c *app.RequestContext) { + var err error + var req api.GetReleaseVersionRequest + err = c.BindAndValidate(&req) + if err != nil { + logger.Errorf("api.GetReleaseVersionModify: BindAndValidate error %v", err) + pack.RespError(c, errno.ParamError.WithError(err)) + return + } + + resp := new(api.GetReleaseVersionResponse) + + rpcResp, err := rpc.GetReleaseVersionRPC(ctx, &version.GetReleaseVersionRequest{}) + if err != nil { + pack.RespError(c, err) + return + } + resp.Version = rpcResp.Version + resp.URL = rpcResp.Url + resp.Code = rpcResp.Code + resp.Feature = rpcResp.Feature + c.JSON(consts.StatusOK, resp) +} + +// GetBetaVersionModify . +// @router /api/v1/url/versionbeta.json [GET] +func GetBetaVersionModify(ctx context.Context, c *app.RequestContext) { + var err error + var req api.GetBetaVersionRequest + err = c.BindAndValidate(&req) + if err != nil { + logger.Errorf("api.GetBetaVersionModify: BindAndValidate error %v", err) + pack.RespError(c, errno.ParamError.WithError(err)) + return + } + + resp := new(api.GetBetaVersionResponse) + + rpcResp, err := rpc.GetBetaVersionRPC(ctx, &version.GetBetaVersionRequest{}) + if err != nil { + pack.RespError(c, err) + return + } + resp.Version = rpcResp.Version + resp.URL = rpcResp.Url + resp.Code = rpcResp.Code + resp.Feature = rpcResp.Feature + c.JSON(consts.StatusOK, resp) +} diff --git a/api/model/api/api.go b/api/model/api/api.go index 1828cbc2..ce4f6373 100644 --- a/api/model/api/api.go +++ b/api/model/api/api.go @@ -8786,27 +8786,27 @@ func (p *GetUnifiedExamResponse) String() string { } -// url -type APILoginRequest struct { +// url_refactor->version +type LoginRequest struct { Password string `thrift:"password,1,required" form:"password,required" json:"password,required" query:"password,required"` } -func NewAPILoginRequest() *APILoginRequest { - return &APILoginRequest{} +func NewLoginRequest() *LoginRequest { + return &LoginRequest{} } -func (p *APILoginRequest) InitDefault() { +func (p *LoginRequest) InitDefault() { } -func (p *APILoginRequest) GetPassword() (v string) { +func (p *LoginRequest) GetPassword() (v string) { return p.Password } -var fieldIDToName_APILoginRequest = map[int16]string{ +var fieldIDToName_LoginRequest = map[int16]string{ 1: "password", } -func (p *APILoginRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *LoginRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -8858,7 +8858,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_LoginRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -8867,10 +8867,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_APILoginRequest[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_LoginRequest[fieldId])) } -func (p *APILoginRequest) ReadField1(iprot thrift.TProtocol) error { +func (p *LoginRequest) ReadField1(iprot thrift.TProtocol) error { var _field string if v, err := iprot.ReadString(); err != nil { @@ -8882,10 +8882,10 @@ func (p *APILoginRequest) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *APILoginRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *LoginRequest) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("APILoginRequest"); err != nil { + if err = oprot.WriteStructBegin("LoginRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -8911,7 +8911,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *APILoginRequest) writeField1(oprot thrift.TProtocol) (err error) { +func (p *LoginRequest) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("password", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } @@ -8928,27 +8928,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *APILoginRequest) String() string { +func (p *LoginRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("APILoginRequest(%+v)", *p) + return fmt.Sprintf("LoginRequest(%+v)", *p) } -type APILoginResponse struct { +type LoginResponse struct { + Base *model.BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` +} + +func NewLoginResponse() *LoginResponse { + return &LoginResponse{} +} + +func (p *LoginResponse) InitDefault() { } -func NewAPILoginResponse() *APILoginResponse { - return &APILoginResponse{} +var LoginResponse_Base_DEFAULT *model.BaseResp + +func (p *LoginResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return LoginResponse_Base_DEFAULT + } + return p.Base } -func (p *APILoginResponse) InitDefault() { +var fieldIDToName_LoginResponse = map[int16]string{ + 1: "base", } -var fieldIDToName_APILoginResponse = map[int16]string{} +func (p *LoginResponse) IsSetBase() bool { + return p.Base != nil +} -func (p *APILoginResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *LoginResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -8965,8 +8981,20 @@ func (p *APILoginResponse) Read(iprot thrift.TProtocol) (err error) { if fieldTypeId == thrift.STOP { break } - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldTypeError + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } } if err = iprot.ReadFieldEnd(); err != nil { goto ReadFieldEndError @@ -8981,8 +9009,10 @@ ReadStructBeginError: return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -SkipFieldTypeError: - return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, fieldTypeId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LoginResponse[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) @@ -8990,12 +9020,26 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *APILoginResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *LoginResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} + +func (p *LoginResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("APILoginResponse"); err != nil { + var fieldId int16 + if err = oprot.WriteStructBegin("LoginResponse"); 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 @@ -9006,79 +9050,98 @@ func (p *APILoginResponse) 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 *APILoginResponse) String() string { +func (p *LoginResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + 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 *LoginResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("APILoginResponse(%+v)", *p) + return fmt.Sprintf("LoginResponse(%+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"` +type UploadRequest struct { + Version string `thrift:"version,1,required" form:"version,required" json:"version,required" query:"version,required"` + Code string `thrift:"code,2,required" form:"code,required" json:"code,required" query:"code,required"` + URL string `thrift:"url,3,required" form:"url,required" json:"url,required" query:"url,required"` + Feature string `thrift:"feature,4,required" form:"feature,required" json:"feature,required" query:"feature,required"` + Type string `thrift:"type,5,required" form:"type,required" json:"type,required" query:"type,required"` + Password string `thrift:"password,6,required" form:"password,required" json:"password,required" query:"password,required"` } -func NewUploadVersionInfoRequest() *UploadVersionInfoRequest { - return &UploadVersionInfoRequest{} +func NewUploadRequest() *UploadRequest { + return &UploadRequest{} } -func (p *UploadVersionInfoRequest) InitDefault() { +func (p *UploadRequest) InitDefault() { } -func (p *UploadVersionInfoRequest) GetPassword() (v string) { - return p.Password +func (p *UploadRequest) GetVersion() (v string) { + return p.Version } -func (p *UploadVersionInfoRequest) GetType() (v string) { - return p.Type +func (p *UploadRequest) GetCode() (v string) { + return p.Code } -func (p *UploadVersionInfoRequest) GetVersion() (v string) { - return p.Version +func (p *UploadRequest) GetURL() (v string) { + return p.URL } -func (p *UploadVersionInfoRequest) GetCode() (v string) { - return p.Code +func (p *UploadRequest) GetFeature() (v string) { + return p.Feature } -func (p *UploadVersionInfoRequest) GetFeature() (v string) { - return p.Feature +func (p *UploadRequest) GetType() (v string) { + return p.Type } -func (p *UploadVersionInfoRequest) GetURL() (v string) { - return p.URL +func (p *UploadRequest) GetPassword() (v string) { + return p.Password } -var fieldIDToName_UploadVersionInfoRequest = map[int16]string{ - 1: "password", - 2: "type", - 3: "version", - 4: "code", - 5: "feature", - 6: "url", +var fieldIDToName_UploadRequest = map[int16]string{ + 1: "version", + 2: "code", + 3: "url", + 4: "feature", + 5: "type", + 6: "password", } -func (p *UploadVersionInfoRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *UploadRequest) 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 issetFeature bool = false + var issetType bool = false + var issetPassword bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -9099,7 +9162,7 @@ func (p *UploadVersionInfoRequest) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetPassword = true + issetVersion = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -9108,7 +9171,7 @@ func (p *UploadVersionInfoRequest) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField2(iprot); err != nil { goto ReadFieldError } - issetType = true + issetCode = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -9117,7 +9180,7 @@ func (p *UploadVersionInfoRequest) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField3(iprot); err != nil { goto ReadFieldError } - issetVersion = true + issetURL = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -9126,7 +9189,7 @@ func (p *UploadVersionInfoRequest) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField4(iprot); err != nil { goto ReadFieldError } - issetCode = true + issetFeature = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -9135,7 +9198,7 @@ func (p *UploadVersionInfoRequest) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField5(iprot); err != nil { goto ReadFieldError } - issetFeature = true + issetType = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -9144,7 +9207,7 @@ func (p *UploadVersionInfoRequest) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField6(iprot); err != nil { goto ReadFieldError } - issetURL = true + issetPassword = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -9161,32 +9224,32 @@ func (p *UploadVersionInfoRequest) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetPassword { + if !issetVersion { fieldId = 1 goto RequiredFieldNotSetError } - if !issetType { + if !issetCode { fieldId = 2 goto RequiredFieldNotSetError } - if !issetVersion { + if !issetURL { fieldId = 3 goto RequiredFieldNotSetError } - if !issetCode { + if !issetFeature { fieldId = 4 goto RequiredFieldNotSetError } - if !issetFeature { + if !issetType { fieldId = 5 goto RequiredFieldNotSetError } - if !issetURL { + if !issetPassword { fieldId = 6 goto RequiredFieldNotSetError } @@ -9196,7 +9259,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_UploadVersionInfoRequest[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UploadRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -9205,10 +9268,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_UploadVersionInfoRequest[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_UploadRequest[fieldId])) } -func (p *UploadVersionInfoRequest) ReadField1(iprot thrift.TProtocol) error { +func (p *UploadRequest) ReadField1(iprot thrift.TProtocol) error { var _field string if v, err := iprot.ReadString(); err != nil { @@ -9216,10 +9279,10 @@ func (p *UploadVersionInfoRequest) ReadField1(iprot thrift.TProtocol) error { } else { _field = v } - p.Password = _field + p.Version = _field return nil } -func (p *UploadVersionInfoRequest) ReadField2(iprot thrift.TProtocol) error { +func (p *UploadRequest) ReadField2(iprot thrift.TProtocol) error { var _field string if v, err := iprot.ReadString(); err != nil { @@ -9227,10 +9290,10 @@ func (p *UploadVersionInfoRequest) ReadField2(iprot thrift.TProtocol) error { } else { _field = v } - p.Type = _field + p.Code = _field return nil } -func (p *UploadVersionInfoRequest) ReadField3(iprot thrift.TProtocol) error { +func (p *UploadRequest) ReadField3(iprot thrift.TProtocol) error { var _field string if v, err := iprot.ReadString(); err != nil { @@ -9238,10 +9301,10 @@ func (p *UploadVersionInfoRequest) ReadField3(iprot thrift.TProtocol) error { } else { _field = v } - p.Version = _field + p.URL = _field return nil } -func (p *UploadVersionInfoRequest) ReadField4(iprot thrift.TProtocol) error { +func (p *UploadRequest) ReadField4(iprot thrift.TProtocol) error { var _field string if v, err := iprot.ReadString(); err != nil { @@ -9249,10 +9312,10 @@ func (p *UploadVersionInfoRequest) ReadField4(iprot thrift.TProtocol) error { } else { _field = v } - p.Code = _field + p.Feature = _field return nil } -func (p *UploadVersionInfoRequest) ReadField5(iprot thrift.TProtocol) error { +func (p *UploadRequest) ReadField5(iprot thrift.TProtocol) error { var _field string if v, err := iprot.ReadString(); err != nil { @@ -9260,10 +9323,10 @@ func (p *UploadVersionInfoRequest) ReadField5(iprot thrift.TProtocol) error { } else { _field = v } - p.Feature = _field + p.Type = _field return nil } -func (p *UploadVersionInfoRequest) ReadField6(iprot thrift.TProtocol) error { +func (p *UploadRequest) ReadField6(iprot thrift.TProtocol) error { var _field string if v, err := iprot.ReadString(); err != nil { @@ -9271,14 +9334,14 @@ func (p *UploadVersionInfoRequest) ReadField6(iprot thrift.TProtocol) error { } else { _field = v } - p.URL = _field + p.Password = _field return nil } -func (p *UploadVersionInfoRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *UploadRequest) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("UploadVersionInfoRequest"); err != nil { + if err = oprot.WriteStructBegin("UploadRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -9324,11 +9387,11 @@ 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 *UploadRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("version", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(p.Password); err != nil { + if err := oprot.WriteString(p.Version); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -9341,11 +9404,11 @@ 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 { +func (p *UploadRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("code", thrift.STRING, 2); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(p.Type); err != nil { + if err := oprot.WriteString(p.Code); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -9358,11 +9421,11 @@ 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 { +func (p *UploadRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("url", thrift.STRING, 3); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(p.Version); err != nil { + if err := oprot.WriteString(p.URL); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -9375,11 +9438,11 @@ 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 { +func (p *UploadRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("feature", thrift.STRING, 4); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(p.Code); err != nil { + if err := oprot.WriteString(p.Feature); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -9392,11 +9455,11 @@ 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 { +func (p *UploadRequest) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("type", thrift.STRING, 5); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(p.Feature); err != nil { + if err := oprot.WriteString(p.Type); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -9409,11 +9472,11 @@ 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 { +func (p *UploadRequest) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("password", thrift.STRING, 6); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(p.URL); err != nil { + if err := oprot.WriteString(p.Password); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -9426,27 +9489,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) } -func (p *UploadVersionInfoRequest) String() string { +func (p *UploadRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("UploadVersionInfoRequest(%+v)", *p) + return fmt.Sprintf("UploadRequest(%+v)", *p) + +} + +type UploadResponse struct { + Base *model.BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` +} +func NewUploadResponse() *UploadResponse { + return &UploadResponse{} } -type UploadVersionInfoResponse struct { +func (p *UploadResponse) InitDefault() { } -func NewUploadVersionInfoResponse() *UploadVersionInfoResponse { - return &UploadVersionInfoResponse{} +var UploadResponse_Base_DEFAULT *model.BaseResp + +func (p *UploadResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return UploadResponse_Base_DEFAULT + } + return p.Base } -func (p *UploadVersionInfoResponse) InitDefault() { +var fieldIDToName_UploadResponse = map[int16]string{ + 1: "base", } -var fieldIDToName_UploadVersionInfoResponse = map[int16]string{} +func (p *UploadResponse) IsSetBase() bool { + return p.Base != nil +} -func (p *UploadVersionInfoResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *UploadResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -9463,8 +9542,20 @@ func (p *UploadVersionInfoResponse) Read(iprot thrift.TProtocol) (err error) { if fieldTypeId == thrift.STOP { break } - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldTypeError + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } } if err = iprot.ReadFieldEnd(); err != nil { goto ReadFieldEndError @@ -9479,8 +9570,10 @@ ReadStructBeginError: return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -SkipFieldTypeError: - return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, fieldTypeId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UploadResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) @@ -9488,12 +9581,26 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UploadVersionInfoResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *UploadResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} + +func (p *UploadResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("UploadVersionInfoResponse"); err != nil { + var fieldId int16 + if err = oprot.WriteStructBegin("UploadResponse"); err != nil { goto WriteStructBeginError } if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -9504,40 +9611,59 @@ func (p *UploadVersionInfoResponse) 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 *UploadVersionInfoResponse) String() string { +func (p *UploadResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *UploadResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("UploadVersionInfoResponse(%+v)", *p) + return fmt.Sprintf("UploadResponse(%+v)", *p) } -type GetUploadParamsRequest struct { +type UploadParamsRequest struct { Password string `thrift:"password,1,required" form:"password,required" json:"password,required" query:"password,required"` } -func NewGetUploadParamsRequest() *GetUploadParamsRequest { - return &GetUploadParamsRequest{} +func NewUploadParamsRequest() *UploadParamsRequest { + return &UploadParamsRequest{} } -func (p *GetUploadParamsRequest) InitDefault() { +func (p *UploadParamsRequest) InitDefault() { } -func (p *GetUploadParamsRequest) GetPassword() (v string) { +func (p *UploadParamsRequest) GetPassword() (v string) { return p.Password } -var fieldIDToName_GetUploadParamsRequest = map[int16]string{ +var fieldIDToName_UploadParamsRequest = map[int16]string{ 1: "password", } -func (p *GetUploadParamsRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *UploadParamsRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -9589,7 +9715,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_UploadParamsRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -9598,10 +9724,10 @@ ReadFieldEndError: ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetUploadParamsRequest[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_UploadParamsRequest[fieldId])) } -func (p *GetUploadParamsRequest) ReadField1(iprot thrift.TProtocol) error { +func (p *UploadParamsRequest) ReadField1(iprot thrift.TProtocol) error { var _field string if v, err := iprot.ReadString(); err != nil { @@ -9613,10 +9739,10 @@ func (p *GetUploadParamsRequest) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *GetUploadParamsRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *UploadParamsRequest) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetUploadParamsRequest"); err != nil { + if err = oprot.WriteStructBegin("UploadParamsRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -9642,7 +9768,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetUploadParamsRequest) writeField1(oprot thrift.TProtocol) (err error) { +func (p *UploadParamsRequest) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("password", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } @@ -9659,45 +9785,76 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetUploadParamsRequest) String() string { +func (p *UploadParamsRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetUploadParamsRequest(%+v)", *p) + return fmt.Sprintf("UploadParamsRequest(%+v)", *p) + +} + +type UploadParamsResponse struct { + Base *model.BaseResp `thrift:"base,1,optional" form:"base" json:"base,omitempty" query:"base"` + Policy *string `thrift:"policy,2,optional" form:"policy" json:"policy,omitempty" query:"policy"` + Authorization *string `thrift:"authorization,3,optional" form:"authorization" json:"authorization,omitempty" query:"authorization"` +} + +func NewUploadParamsResponse() *UploadParamsResponse { + return &UploadParamsResponse{} +} + +func (p *UploadParamsResponse) InitDefault() { +} + +var UploadParamsResponse_Base_DEFAULT *model.BaseResp +func (p *UploadParamsResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return UploadParamsResponse_Base_DEFAULT + } + return p.Base } -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"` +var UploadParamsResponse_Policy_DEFAULT string + +func (p *UploadParamsResponse) GetPolicy() (v string) { + if !p.IsSetPolicy() { + return UploadParamsResponse_Policy_DEFAULT + } + return *p.Policy } -func NewGetUploadParamsResponse() *GetUploadParamsResponse { - return &GetUploadParamsResponse{} +var UploadParamsResponse_Authorization_DEFAULT string + +func (p *UploadParamsResponse) GetAuthorization() (v string) { + if !p.IsSetAuthorization() { + return UploadParamsResponse_Authorization_DEFAULT + } + return *p.Authorization } -func (p *GetUploadParamsResponse) InitDefault() { +var fieldIDToName_UploadParamsResponse = map[int16]string{ + 1: "base", + 2: "policy", + 3: "authorization", } -func (p *GetUploadParamsResponse) GetPolicy() (v string) { - return p.Policy +func (p *UploadParamsResponse) IsSetBase() bool { + return p.Base != nil } -func (p *GetUploadParamsResponse) GetAuthorization() (v string) { - return p.Authorization +func (p *UploadParamsResponse) IsSetPolicy() bool { + return p.Policy != nil } -var fieldIDToName_GetUploadParamsResponse = map[int16]string{ - 1: "policy", - 2: "authorization", +func (p *UploadParamsResponse) IsSetAuthorization() bool { + return p.Authorization != nil } -func (p *GetUploadParamsResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *UploadParamsResponse) 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 @@ -9714,11 +9871,10 @@ func (p *GetUploadParamsResponse) 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 } - issetPolicy = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -9727,7 +9883,14 @@ func (p *GetUploadParamsResponse) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField2(iprot); err != nil { goto ReadFieldError } - issetAuthorization = 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 } @@ -9744,22 +9907,13 @@ func (p *GetUploadParamsResponse) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetPolicy { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetAuthorization { - fieldId = 2 - goto RequiredFieldNotSetError - } return nil ReadStructBeginError: return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetUploadParamsResponse[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UploadParamsResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -9767,37 +9921,43 @@ ReadFieldEndError: return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetUploadParamsResponse[fieldId])) } -func (p *GetUploadParamsResponse) ReadField1(iprot thrift.TProtocol) error { +func (p *UploadParamsResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *UploadParamsResponse) 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.Policy = _field return nil } -func (p *GetUploadParamsResponse) ReadField2(iprot thrift.TProtocol) error { +func (p *UploadParamsResponse) ReadField3(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.Authorization = _field return nil } -func (p *GetUploadParamsResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *UploadParamsResponse) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetUploadParamsResponse"); err != nil { + if err = oprot.WriteStructBegin("UploadParamsResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -9809,6 +9969,10 @@ func (p *GetUploadParamsResponse) Write(oprot thrift.TProtocol) (err error) { fieldId = 2 goto WriteFieldError } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -9827,15 +9991,17 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetUploadParamsResponse) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("policy", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Policy); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError +func (p *UploadParamsResponse) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } return nil WriteFieldBeginError: @@ -9844,15 +10010,17 @@ 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 +func (p *UploadParamsResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPolicy() { + if err = oprot.WriteFieldBegin("policy", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Policy); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } return nil WriteFieldBeginError: @@ -9861,27 +10029,46 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *GetUploadParamsResponse) String() string { +func (p *UploadParamsResponse) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetAuthorization() { + if err = oprot.WriteFieldBegin("authorization", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Authorization); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *UploadParamsResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetUploadParamsResponse(%+v)", *p) + return fmt.Sprintf("UploadParamsResponse(%+v)", *p) } -type GetDownloadReleaseRequest struct { +type DownloadReleaseApkRequest struct { } -func NewGetDownloadReleaseRequest() *GetDownloadReleaseRequest { - return &GetDownloadReleaseRequest{} +func NewDownloadReleaseApkRequest() *DownloadReleaseApkRequest { + return &DownloadReleaseApkRequest{} } -func (p *GetDownloadReleaseRequest) InitDefault() { +func (p *DownloadReleaseApkRequest) InitDefault() { } -var fieldIDToName_GetDownloadReleaseRequest = map[int16]string{} +var fieldIDToName_DownloadReleaseApkRequest = map[int16]string{} -func (p *GetDownloadReleaseRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *DownloadReleaseApkRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -9923,9 +10110,9 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetDownloadReleaseRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *DownloadReleaseApkRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetDownloadReleaseRequest"); err != nil { + if err = oprot.WriteStructBegin("DownloadReleaseApkRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -9945,27 +10132,43 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetDownloadReleaseRequest) String() string { +func (p *DownloadReleaseApkRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetDownloadReleaseRequest(%+v)", *p) + return fmt.Sprintf("DownloadReleaseApkRequest(%+v)", *p) + +} + +type DownloadReleaseApkResponse struct { + File []byte `thrift:"file,1,optional" form:"file" json:"file,omitempty" query:"file"` +} +func NewDownloadReleaseApkResponse() *DownloadReleaseApkResponse { + return &DownloadReleaseApkResponse{} } -type GetDownloadReleaseResponse struct { +func (p *DownloadReleaseApkResponse) InitDefault() { } -func NewGetDownloadReleaseResponse() *GetDownloadReleaseResponse { - return &GetDownloadReleaseResponse{} +var DownloadReleaseApkResponse_File_DEFAULT []byte + +func (p *DownloadReleaseApkResponse) GetFile() (v []byte) { + if !p.IsSetFile() { + return DownloadReleaseApkResponse_File_DEFAULT + } + return p.File } -func (p *GetDownloadReleaseResponse) InitDefault() { +var fieldIDToName_DownloadReleaseApkResponse = map[int16]string{ + 1: "file", } -var fieldIDToName_GetDownloadReleaseResponse = map[int16]string{} +func (p *DownloadReleaseApkResponse) IsSetFile() bool { + return p.File != nil +} -func (p *GetDownloadReleaseResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *DownloadReleaseApkResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -9982,8 +10185,20 @@ 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 + } + } 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 @@ -9998,8 +10213,10 @@ ReadStructBeginError: return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -SkipFieldTypeError: - return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, fieldTypeId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DownloadReleaseApkResponse[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) @@ -10007,12 +10224,29 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetDownloadReleaseResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *DownloadReleaseApkResponse) ReadField1(iprot thrift.TProtocol) error { + + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { + return err + } else { + _field = []byte(v) + } + p.File = _field + return nil +} + +func (p *DownloadReleaseApkResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetDownloadReleaseResponse"); err != nil { + var fieldId int16 + if err = oprot.WriteStructBegin("DownloadReleaseApkResponse"); err != nil { goto WriteStructBeginError } if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -10023,33 +10257,54 @@ func (p *GetDownloadReleaseResponse) 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 *GetDownloadReleaseResponse) String() string { +func (p *DownloadReleaseApkResponse) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetFile() { + if err = oprot.WriteFieldBegin("file", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBinary([]byte(p.File)); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + 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 *DownloadReleaseApkResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetDownloadReleaseResponse(%+v)", *p) + return fmt.Sprintf("DownloadReleaseApkResponse(%+v)", *p) } -type GetDownloadBetaRequest struct { +type DownloadBetaApkRequest struct { } -func NewGetDownloadBetaRequest() *GetDownloadBetaRequest { - return &GetDownloadBetaRequest{} +func NewDownloadBetaApkRequest() *DownloadBetaApkRequest { + return &DownloadBetaApkRequest{} } -func (p *GetDownloadBetaRequest) InitDefault() { +func (p *DownloadBetaApkRequest) InitDefault() { } -var fieldIDToName_GetDownloadBetaRequest = map[int16]string{} +var fieldIDToName_DownloadBetaApkRequest = map[int16]string{} -func (p *GetDownloadBetaRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *DownloadBetaApkRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -10091,9 +10346,9 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetDownloadBetaRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *DownloadBetaApkRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetDownloadBetaRequest"); err != nil { + if err = oprot.WriteStructBegin("DownloadBetaApkRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -10113,27 +10368,43 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetDownloadBetaRequest) String() string { +func (p *DownloadBetaApkRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetDownloadBetaRequest(%+v)", *p) + return fmt.Sprintf("DownloadBetaApkRequest(%+v)", *p) + +} + +type DownloadBetaApkResponse struct { + File []byte `thrift:"file,1,optional" form:"file" json:"file,omitempty" query:"file"` +} +func NewDownloadBetaApkResponse() *DownloadBetaApkResponse { + return &DownloadBetaApkResponse{} } -type GetDownloadBetaResponse struct { +func (p *DownloadBetaApkResponse) InitDefault() { } -func NewGetDownloadBetaResponse() *GetDownloadBetaResponse { - return &GetDownloadBetaResponse{} +var DownloadBetaApkResponse_File_DEFAULT []byte + +func (p *DownloadBetaApkResponse) GetFile() (v []byte) { + if !p.IsSetFile() { + return DownloadBetaApkResponse_File_DEFAULT + } + return p.File } -func (p *GetDownloadBetaResponse) InitDefault() { +var fieldIDToName_DownloadBetaApkResponse = map[int16]string{ + 1: "file", } -var fieldIDToName_GetDownloadBetaResponse = map[int16]string{} +func (p *DownloadBetaApkResponse) IsSetFile() bool { + return p.File != nil +} -func (p *GetDownloadBetaResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *DownloadBetaApkResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -10150,8 +10421,20 @@ func (p *GetDownloadBetaResponse) 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 + } + } 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 @@ -10166,8 +10449,10 @@ ReadStructBeginError: return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -SkipFieldTypeError: - return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, fieldTypeId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DownloadBetaApkResponse[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) @@ -10175,12 +10460,29 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetDownloadBetaResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *DownloadBetaApkResponse) ReadField1(iprot thrift.TProtocol) error { + + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { + return err + } else { + _field = []byte(v) + } + p.File = _field + return nil +} + +func (p *DownloadBetaApkResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetDownloadBetaResponse"); err != nil { + var fieldId int16 + if err = oprot.WriteStructBegin("DownloadBetaApkResponse"); 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 @@ -10191,17 +10493,38 @@ func (p *GetDownloadBetaResponse) Write(oprot thrift.TProtocol) (err error) { return nil WriteStructBeginError: return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) WriteFieldStopError: return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetDownloadBetaResponse) String() string { +func (p *DownloadBetaApkResponse) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetFile() { + if err = oprot.WriteFieldBegin("file", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBinary([]byte(p.File)); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + 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 *DownloadBetaApkResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetDownloadBetaResponse(%+v)", *p) + return fmt.Sprintf("DownloadBetaApkResponse(%+v)", *p) } @@ -10290,6 +10613,11 @@ func (p *GetReleaseVersionRequest) String() string { } type GetReleaseVersionResponse struct { + Base *model.BaseResp `thrift:"base,1,optional" form:"base" json:"base,omitempty" query:"base"` + Code *string `thrift:"code,2,optional" form:"code" json:"code,omitempty" query:"code"` + Feature *string `thrift:"feature,3,optional" form:"feature" json:"feature,omitempty" query:"feature"` + URL *string `thrift:"url,4,optional" form:"url" json:"url,omitempty" query:"url"` + Version *string `thrift:"version,5,optional" form:"version" json:"version,omitempty" query:"version"` } func NewGetReleaseVersionResponse() *GetReleaseVersionResponse { @@ -10299,93 +10627,80 @@ func NewGetReleaseVersionResponse() *GetReleaseVersionResponse { func (p *GetReleaseVersionResponse) InitDefault() { } -var fieldIDToName_GetReleaseVersionResponse = map[int16]string{} +var GetReleaseVersionResponse_Base_DEFAULT *model.BaseResp -func (p *GetReleaseVersionResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetReleaseVersionResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return GetReleaseVersionResponse_Base_DEFAULT + } + return p.Base +} - var fieldTypeId thrift.TType - var fieldId int16 +var GetReleaseVersionResponse_Code_DEFAULT string - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError +func (p *GetReleaseVersionResponse) GetCode() (v string) { + if !p.IsSetCode() { + return GetReleaseVersionResponse_Code_DEFAULT } + return *p.Code +} - 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 GetReleaseVersionResponse_Feature_DEFAULT string + +func (p *GetReleaseVersionResponse) GetFeature() (v string) { + if !p.IsSetFeature() { + return GetReleaseVersionResponse_Feature_DEFAULT } + return *p.Feature +} - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -SkipFieldTypeError: - return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, fieldTypeId), err) +var GetReleaseVersionResponse_URL_DEFAULT string -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +func (p *GetReleaseVersionResponse) GetURL() (v string) { + if !p.IsSetURL() { + return GetReleaseVersionResponse_URL_DEFAULT + } + return *p.URL } -func (p *GetReleaseVersionResponse) Write(oprot thrift.TProtocol) (err error) { +var GetReleaseVersionResponse_Version_DEFAULT string - if err = oprot.WriteStructBegin("GetReleaseVersionResponse"); 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 *GetReleaseVersionResponse) GetVersion() (v string) { + if !p.IsSetVersion() { + return GetReleaseVersionResponse_Version_DEFAULT } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) + return *p.Version } -func (p *GetReleaseVersionResponse) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("GetReleaseVersionResponse(%+v)", *p) +var fieldIDToName_GetReleaseVersionResponse = map[int16]string{ + 1: "base", + 2: "code", + 3: "feature", + 4: "url", + 5: "version", +} +func (p *GetReleaseVersionResponse) IsSetBase() bool { + return p.Base != nil } -type GetBetaVersionRequest struct { +func (p *GetReleaseVersionResponse) IsSetCode() bool { + return p.Code != nil } -func NewGetBetaVersionRequest() *GetBetaVersionRequest { - return &GetBetaVersionRequest{} +func (p *GetReleaseVersionResponse) IsSetFeature() bool { + return p.Feature != nil } -func (p *GetBetaVersionRequest) InitDefault() { +func (p *GetReleaseVersionResponse) IsSetURL() bool { + return p.URL != nil } -var fieldIDToName_GetBetaVersionRequest = map[int16]string{} +func (p *GetReleaseVersionResponse) IsSetVersion() bool { + return p.Version != nil +} -func (p *GetBetaVersionRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetReleaseVersionResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -10402,37 +10717,157 @@ func (p *GetBetaVersionRequest) Read(iprot thrift.TProtocol) (err error) { if fieldTypeId == thrift.STOP { break } - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldTypeError - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -SkipFieldTypeError: - return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, fieldTypeId), err) -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRING { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.STRING { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetReleaseVersionResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetBetaVersionRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *GetReleaseVersionResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *GetReleaseVersionResponse) ReadField2(iprot thrift.TProtocol) error { - if err = oprot.WriteStructBegin("GetBetaVersionRequest"); err != nil { + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Code = _field + return nil +} +func (p *GetReleaseVersionResponse) ReadField3(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Feature = _field + return nil +} +func (p *GetReleaseVersionResponse) ReadField4(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.URL = _field + return nil +} +func (p *GetReleaseVersionResponse) ReadField5(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Version = _field + return nil +} + +func (p *GetReleaseVersionResponse) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetReleaseVersionResponse"); err != nil { goto WriteStructBeginError } if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -10443,33 +10878,130 @@ func (p *GetBetaVersionRequest) 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 *GetBetaVersionRequest) String() string { +func (p *GetReleaseVersionResponse) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *GetReleaseVersionResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetCode() { + if err = oprot.WriteFieldBegin("code", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Code); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *GetReleaseVersionResponse) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetFeature() { + if err = oprot.WriteFieldBegin("feature", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Feature); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *GetReleaseVersionResponse) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetURL() { + if err = oprot.WriteFieldBegin("url", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.URL); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *GetReleaseVersionResponse) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetVersion() { + if err = oprot.WriteFieldBegin("version", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Version); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *GetReleaseVersionResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetBetaVersionRequest(%+v)", *p) + return fmt.Sprintf("GetReleaseVersionResponse(%+v)", *p) } -type GetBetaVersionResponse struct { +type GetBetaVersionRequest struct { } -func NewGetBetaVersionResponse() *GetBetaVersionResponse { - return &GetBetaVersionResponse{} +func NewGetBetaVersionRequest() *GetBetaVersionRequest { + return &GetBetaVersionRequest{} } -func (p *GetBetaVersionResponse) InitDefault() { +func (p *GetBetaVersionRequest) InitDefault() { } -var fieldIDToName_GetBetaVersionResponse = map[int16]string{} +var fieldIDToName_GetBetaVersionRequest = map[int16]string{} -func (p *GetBetaVersionResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetBetaVersionRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -10502,8 +11034,950 @@ 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) +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 *GetBetaVersionRequest) Write(oprot thrift.TProtocol) (err error) { + + if err = oprot.WriteStructBegin("GetBetaVersionRequest"); 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 *GetBetaVersionRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetBetaVersionRequest(%+v)", *p) + +} + +type GetBetaVersionResponse struct { + Base *model.BaseResp `thrift:"base,1,optional" form:"base" json:"base,omitempty" query:"base"` + Code *string `thrift:"code,2,optional" form:"code" json:"code,omitempty" query:"code"` + Feature *string `thrift:"feature,3,optional" form:"feature" json:"feature,omitempty" query:"feature"` + URL *string `thrift:"url,4,optional" form:"url" json:"url,omitempty" query:"url"` + Version *string `thrift:"version,5,optional" form:"version" json:"version,omitempty" query:"version"` +} + +func NewGetBetaVersionResponse() *GetBetaVersionResponse { + return &GetBetaVersionResponse{} +} + +func (p *GetBetaVersionResponse) InitDefault() { +} + +var GetBetaVersionResponse_Base_DEFAULT *model.BaseResp + +func (p *GetBetaVersionResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return GetBetaVersionResponse_Base_DEFAULT + } + return p.Base +} + +var GetBetaVersionResponse_Code_DEFAULT string + +func (p *GetBetaVersionResponse) GetCode() (v string) { + if !p.IsSetCode() { + return GetBetaVersionResponse_Code_DEFAULT + } + return *p.Code +} + +var GetBetaVersionResponse_Feature_DEFAULT string + +func (p *GetBetaVersionResponse) GetFeature() (v string) { + if !p.IsSetFeature() { + return GetBetaVersionResponse_Feature_DEFAULT + } + return *p.Feature +} + +var GetBetaVersionResponse_URL_DEFAULT string + +func (p *GetBetaVersionResponse) GetURL() (v string) { + if !p.IsSetURL() { + return GetBetaVersionResponse_URL_DEFAULT + } + return *p.URL +} + +var GetBetaVersionResponse_Version_DEFAULT string + +func (p *GetBetaVersionResponse) GetVersion() (v string) { + if !p.IsSetVersion() { + return GetBetaVersionResponse_Version_DEFAULT + } + return *p.Version +} + +var fieldIDToName_GetBetaVersionResponse = map[int16]string{ + 1: "base", + 2: "code", + 3: "feature", + 4: "url", + 5: "version", +} + +func (p *GetBetaVersionResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *GetBetaVersionResponse) IsSetCode() bool { + return p.Code != nil +} + +func (p *GetBetaVersionResponse) IsSetFeature() bool { + return p.Feature != nil +} + +func (p *GetBetaVersionResponse) IsSetURL() bool { + return p.URL != nil +} + +func (p *GetBetaVersionResponse) IsSetVersion() bool { + return p.Version != nil +} + +func (p *GetBetaVersionResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRING { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.STRING { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetBetaVersionResponse[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 *GetBetaVersionResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *GetBetaVersionResponse) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Code = _field + return nil +} +func (p *GetBetaVersionResponse) ReadField3(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Feature = _field + return nil +} +func (p *GetBetaVersionResponse) ReadField4(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.URL = _field + return nil +} +func (p *GetBetaVersionResponse) ReadField5(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Version = _field + return nil +} + +func (p *GetBetaVersionResponse) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetBetaVersionResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *GetBetaVersionResponse) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *GetBetaVersionResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetCode() { + if err = oprot.WriteFieldBegin("code", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Code); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *GetBetaVersionResponse) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetFeature() { + if err = oprot.WriteFieldBegin("feature", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Feature); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *GetBetaVersionResponse) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetURL() { + if err = oprot.WriteFieldBegin("url", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.URL); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *GetBetaVersionResponse) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetVersion() { + if err = oprot.WriteFieldBegin("version", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Version); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *GetBetaVersionResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetBetaVersionResponse(%+v)", *p) + +} + +type GetSettingRequest struct { + Account *string `thrift:"account,1,optional" form:"account" json:"account,omitempty" query:"account"` + Version *string `thrift:"version,2,optional" form:"version" json:"version,omitempty" query:"version"` + Beta *bool `thrift:"beta,3,optional" form:"beta" json:"beta,omitempty" query:"beta"` + Phone *string `thrift:"phone,4,optional" form:"phone" json:"phone,omitempty" query:"phone"` + IsLogin *bool `thrift:"isLogin,5,optional" form:"isLogin" json:"isLogin,omitempty" query:"isLogin"` + LoginType *string `thrift:"loginType,6,optional" form:"loginType" json:"loginType,omitempty" query:"loginType"` +} + +func NewGetSettingRequest() *GetSettingRequest { + return &GetSettingRequest{} +} + +func (p *GetSettingRequest) InitDefault() { +} + +var GetSettingRequest_Account_DEFAULT string + +func (p *GetSettingRequest) GetAccount() (v string) { + if !p.IsSetAccount() { + return GetSettingRequest_Account_DEFAULT + } + return *p.Account +} + +var GetSettingRequest_Version_DEFAULT string + +func (p *GetSettingRequest) GetVersion() (v string) { + if !p.IsSetVersion() { + return GetSettingRequest_Version_DEFAULT + } + return *p.Version +} + +var GetSettingRequest_Beta_DEFAULT bool + +func (p *GetSettingRequest) GetBeta() (v bool) { + if !p.IsSetBeta() { + return GetSettingRequest_Beta_DEFAULT + } + return *p.Beta +} + +var GetSettingRequest_Phone_DEFAULT string + +func (p *GetSettingRequest) GetPhone() (v string) { + if !p.IsSetPhone() { + return GetSettingRequest_Phone_DEFAULT + } + return *p.Phone +} + +var GetSettingRequest_IsLogin_DEFAULT bool + +func (p *GetSettingRequest) GetIsLogin() (v bool) { + if !p.IsSetIsLogin() { + return GetSettingRequest_IsLogin_DEFAULT + } + return *p.IsLogin +} + +var GetSettingRequest_LoginType_DEFAULT string + +func (p *GetSettingRequest) GetLoginType() (v string) { + if !p.IsSetLoginType() { + return GetSettingRequest_LoginType_DEFAULT + } + return *p.LoginType +} + +var fieldIDToName_GetSettingRequest = map[int16]string{ + 1: "account", + 2: "version", + 3: "beta", + 4: "phone", + 5: "isLogin", + 6: "loginType", +} + +func (p *GetSettingRequest) IsSetAccount() bool { + return p.Account != nil +} + +func (p *GetSettingRequest) IsSetVersion() bool { + return p.Version != nil +} + +func (p *GetSettingRequest) IsSetBeta() bool { + return p.Beta != nil +} + +func (p *GetSettingRequest) IsSetPhone() bool { + return p.Phone != nil +} + +func (p *GetSettingRequest) IsSetIsLogin() bool { + return p.IsLogin != nil +} + +func (p *GetSettingRequest) IsSetLoginType() bool { + return p.LoginType != nil +} + +func (p *GetSettingRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRING { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.STRING { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + 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_GetSettingRequest[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 *GetSettingRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Account = _field + return nil +} +func (p *GetSettingRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Version = _field + return nil +} +func (p *GetSettingRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field *bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = &v + } + p.Beta = _field + return nil +} +func (p *GetSettingRequest) ReadField4(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Phone = _field + return nil +} +func (p *GetSettingRequest) ReadField5(iprot thrift.TProtocol) error { + + var _field *bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = &v + } + p.IsLogin = _field + return nil +} +func (p *GetSettingRequest) ReadField6(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.LoginType = _field + return nil +} + +func (p *GetSettingRequest) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetSettingRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *GetSettingRequest) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetAccount() { + if err = oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Account); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + 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 *GetSettingRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetVersion() { + if err = oprot.WriteFieldBegin("version", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Version); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *GetSettingRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetBeta() { + if err = oprot.WriteFieldBegin("beta", thrift.BOOL, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(*p.Beta); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *GetSettingRequest) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetPhone() { + if err = oprot.WriteFieldBegin("phone", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Phone); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *GetSettingRequest) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetIsLogin() { + if err = oprot.WriteFieldBegin("isLogin", thrift.BOOL, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(*p.IsLogin); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *GetSettingRequest) writeField6(oprot thrift.TProtocol) (err error) { + if p.IsSetLoginType() { + if err = oprot.WriteFieldBegin("loginType", thrift.STRING, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.LoginType); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *GetSettingRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetSettingRequest(%+v)", *p) + +} + +type GetSettingResponse struct { + Base *model.BaseResp `thrift:"base,1,optional" form:"base" json:"base,omitempty" query:"base"` + CloudSetting []byte `thrift:"cloud_setting,2" form:"cloud_setting" json:"cloud_setting" query:"cloud_setting"` +} + +func NewGetSettingResponse() *GetSettingResponse { + return &GetSettingResponse{} +} + +func (p *GetSettingResponse) InitDefault() { +} + +var GetSettingResponse_Base_DEFAULT *model.BaseResp + +func (p *GetSettingResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return GetSettingResponse_Base_DEFAULT + } + return p.Base +} + +func (p *GetSettingResponse) GetCloudSetting() (v []byte) { + return p.CloudSetting +} + +var fieldIDToName_GetSettingResponse = map[int16]string{ + 1: "base", + 2: "cloud_setting", +} + +func (p *GetSettingResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *GetSettingResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + 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_GetSettingResponse[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) @@ -10511,12 +11985,41 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetBetaVersionResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *GetSettingResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *GetSettingResponse) ReadField2(iprot thrift.TProtocol) error { - if err = oprot.WriteStructBegin("GetBetaVersionResponse"); err != nil { + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { + return err + } else { + _field = []byte(v) + } + p.CloudSetting = _field + return nil +} + +func (p *GetSettingResponse) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetSettingResponse"); 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 @@ -10527,124 +12030,177 @@ func (p *GetBetaVersionResponse) 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 *GetBetaVersionResponse) String() string { +func (p *GetSettingResponse) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *GetSettingResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("cloud_setting", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBinary([]byte(p.CloudSetting)); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *GetSettingResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetBetaVersionResponse(%+v)", *p) + return fmt.Sprintf("GetSettingResponse(%+v)", *p) } -type GetCloudSettingRequest struct { +type GetTestRequest struct { Account *string `thrift:"account,1,optional" form:"account" json:"account,omitempty" query:"account"` Version *string `thrift:"version,2,optional" form:"version" json:"version,omitempty" query:"version"` - Beta *string `thrift:"beta,3,optional" form:"beta" json:"beta,omitempty" query:"beta"` + Beta *bool `thrift:"beta,3,optional" form:"beta" json:"beta,omitempty" query:"beta"` Phone *string `thrift:"phone,4,optional" form:"phone" json:"phone,omitempty" query:"phone"` - IsLogin *string `thrift:"isLogin,5,optional" form:"isLogin" json:"isLogin,omitempty" query:"isLogin"` + IsLogin *bool `thrift:"isLogin,5,optional" form:"isLogin" json:"isLogin,omitempty" query:"isLogin"` LoginType *string `thrift:"loginType,6,optional" form:"loginType" json:"loginType,omitempty" query:"loginType"` + Setting *string `thrift:"setting,7,optional" form:"setting" json:"setting,omitempty" query:"setting"` } -func NewGetCloudSettingRequest() *GetCloudSettingRequest { - return &GetCloudSettingRequest{} +func NewGetTestRequest() *GetTestRequest { + return &GetTestRequest{} } -func (p *GetCloudSettingRequest) InitDefault() { +func (p *GetTestRequest) InitDefault() { } -var GetCloudSettingRequest_Account_DEFAULT string +var GetTestRequest_Account_DEFAULT string -func (p *GetCloudSettingRequest) GetAccount() (v string) { +func (p *GetTestRequest) GetAccount() (v string) { if !p.IsSetAccount() { - return GetCloudSettingRequest_Account_DEFAULT + return GetTestRequest_Account_DEFAULT } return *p.Account } -var GetCloudSettingRequest_Version_DEFAULT string +var GetTestRequest_Version_DEFAULT string -func (p *GetCloudSettingRequest) GetVersion() (v string) { +func (p *GetTestRequest) GetVersion() (v string) { if !p.IsSetVersion() { - return GetCloudSettingRequest_Version_DEFAULT + return GetTestRequest_Version_DEFAULT } return *p.Version } -var GetCloudSettingRequest_Beta_DEFAULT string +var GetTestRequest_Beta_DEFAULT bool -func (p *GetCloudSettingRequest) GetBeta() (v string) { +func (p *GetTestRequest) GetBeta() (v bool) { if !p.IsSetBeta() { - return GetCloudSettingRequest_Beta_DEFAULT + return GetTestRequest_Beta_DEFAULT } return *p.Beta } -var GetCloudSettingRequest_Phone_DEFAULT string +var GetTestRequest_Phone_DEFAULT string -func (p *GetCloudSettingRequest) GetPhone() (v string) { +func (p *GetTestRequest) GetPhone() (v string) { if !p.IsSetPhone() { - return GetCloudSettingRequest_Phone_DEFAULT + return GetTestRequest_Phone_DEFAULT } return *p.Phone } -var GetCloudSettingRequest_IsLogin_DEFAULT string +var GetTestRequest_IsLogin_DEFAULT bool -func (p *GetCloudSettingRequest) GetIsLogin() (v string) { +func (p *GetTestRequest) GetIsLogin() (v bool) { if !p.IsSetIsLogin() { - return GetCloudSettingRequest_IsLogin_DEFAULT + return GetTestRequest_IsLogin_DEFAULT } return *p.IsLogin } -var GetCloudSettingRequest_LoginType_DEFAULT string +var GetTestRequest_LoginType_DEFAULT string -func (p *GetCloudSettingRequest) GetLoginType() (v string) { +func (p *GetTestRequest) GetLoginType() (v string) { if !p.IsSetLoginType() { - return GetCloudSettingRequest_LoginType_DEFAULT + return GetTestRequest_LoginType_DEFAULT } return *p.LoginType } -var fieldIDToName_GetCloudSettingRequest = map[int16]string{ +var GetTestRequest_Setting_DEFAULT string + +func (p *GetTestRequest) GetSetting() (v string) { + if !p.IsSetSetting() { + return GetTestRequest_Setting_DEFAULT + } + return *p.Setting +} + +var fieldIDToName_GetTestRequest = map[int16]string{ 1: "account", 2: "version", 3: "beta", 4: "phone", 5: "isLogin", 6: "loginType", + 7: "setting", } -func (p *GetCloudSettingRequest) IsSetAccount() bool { +func (p *GetTestRequest) IsSetAccount() bool { return p.Account != nil } -func (p *GetCloudSettingRequest) IsSetVersion() bool { +func (p *GetTestRequest) IsSetVersion() bool { return p.Version != nil } -func (p *GetCloudSettingRequest) IsSetBeta() bool { +func (p *GetTestRequest) IsSetBeta() bool { return p.Beta != nil } -func (p *GetCloudSettingRequest) IsSetPhone() bool { +func (p *GetTestRequest) IsSetPhone() bool { return p.Phone != nil } -func (p *GetCloudSettingRequest) IsSetIsLogin() bool { +func (p *GetTestRequest) IsSetIsLogin() bool { return p.IsLogin != nil } -func (p *GetCloudSettingRequest) IsSetLoginType() bool { +func (p *GetTestRequest) IsSetLoginType() bool { return p.LoginType != nil } -func (p *GetCloudSettingRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetTestRequest) IsSetSetting() bool { + return p.Setting != nil +} + +func (p *GetTestRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -10680,7 +12236,7 @@ func (p *GetCloudSettingRequest) Read(iprot thrift.TProtocol) (err error) { goto SkipFieldError } case 3: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.BOOL { if err = p.ReadField3(iprot); err != nil { goto ReadFieldError } @@ -10696,7 +12252,7 @@ func (p *GetCloudSettingRequest) Read(iprot thrift.TProtocol) (err error) { goto SkipFieldError } case 5: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.BOOL { if err = p.ReadField5(iprot); err != nil { goto ReadFieldError } @@ -10711,6 +12267,14 @@ func (p *GetCloudSettingRequest) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 7: + if fieldTypeId == thrift.STRING { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -10730,7 +12294,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_GetCloudSettingRequest[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetTestRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -10740,7 +12304,7 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetCloudSettingRequest) ReadField1(iprot thrift.TProtocol) error { +func (p *GetTestRequest) ReadField1(iprot thrift.TProtocol) error { var _field *string if v, err := iprot.ReadString(); err != nil { @@ -10751,7 +12315,7 @@ func (p *GetCloudSettingRequest) ReadField1(iprot thrift.TProtocol) error { p.Account = _field return nil } -func (p *GetCloudSettingRequest) ReadField2(iprot thrift.TProtocol) error { +func (p *GetTestRequest) ReadField2(iprot thrift.TProtocol) error { var _field *string if v, err := iprot.ReadString(); err != nil { @@ -10762,10 +12326,10 @@ func (p *GetCloudSettingRequest) ReadField2(iprot thrift.TProtocol) error { p.Version = _field return nil } -func (p *GetCloudSettingRequest) ReadField3(iprot thrift.TProtocol) error { +func (p *GetTestRequest) ReadField3(iprot thrift.TProtocol) error { - var _field *string - if v, err := iprot.ReadString(); err != nil { + var _field *bool + if v, err := iprot.ReadBool(); err != nil { return err } else { _field = &v @@ -10773,7 +12337,7 @@ func (p *GetCloudSettingRequest) ReadField3(iprot thrift.TProtocol) error { p.Beta = _field return nil } -func (p *GetCloudSettingRequest) ReadField4(iprot thrift.TProtocol) error { +func (p *GetTestRequest) ReadField4(iprot thrift.TProtocol) error { var _field *string if v, err := iprot.ReadString(); err != nil { @@ -10784,10 +12348,10 @@ func (p *GetCloudSettingRequest) ReadField4(iprot thrift.TProtocol) error { p.Phone = _field return nil } -func (p *GetCloudSettingRequest) ReadField5(iprot thrift.TProtocol) error { +func (p *GetTestRequest) ReadField5(iprot thrift.TProtocol) error { - var _field *string - if v, err := iprot.ReadString(); err != nil { + var _field *bool + if v, err := iprot.ReadBool(); err != nil { return err } else { _field = &v @@ -10795,7 +12359,7 @@ func (p *GetCloudSettingRequest) ReadField5(iprot thrift.TProtocol) error { p.IsLogin = _field return nil } -func (p *GetCloudSettingRequest) ReadField6(iprot thrift.TProtocol) error { +func (p *GetTestRequest) ReadField6(iprot thrift.TProtocol) error { var _field *string if v, err := iprot.ReadString(); err != nil { @@ -10806,11 +12370,22 @@ func (p *GetCloudSettingRequest) ReadField6(iprot thrift.TProtocol) error { p.LoginType = _field return nil } +func (p *GetTestRequest) ReadField7(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Setting = _field + return nil +} -func (p *GetCloudSettingRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *GetTestRequest) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetCloudSettingRequest"); err != nil { + if err = oprot.WriteStructBegin("GetTestRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -10838,6 +12413,10 @@ func (p *GetCloudSettingRequest) Write(oprot thrift.TProtocol) (err error) { fieldId = 6 goto WriteFieldError } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -10856,7 +12435,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetCloudSettingRequest) writeField1(oprot thrift.TProtocol) (err error) { +func (p *GetTestRequest) writeField1(oprot thrift.TProtocol) (err error) { if p.IsSetAccount() { if err = oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { goto WriteFieldBeginError @@ -10875,7 +12454,7 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *GetCloudSettingRequest) writeField2(oprot thrift.TProtocol) (err error) { +func (p *GetTestRequest) writeField2(oprot thrift.TProtocol) (err error) { if p.IsSetVersion() { if err = oprot.WriteFieldBegin("version", thrift.STRING, 2); err != nil { goto WriteFieldBeginError @@ -10894,12 +12473,12 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *GetCloudSettingRequest) writeField3(oprot thrift.TProtocol) (err error) { +func (p *GetTestRequest) writeField3(oprot thrift.TProtocol) (err error) { if p.IsSetBeta() { - if err = oprot.WriteFieldBegin("beta", thrift.STRING, 3); err != nil { + if err = oprot.WriteFieldBegin("beta", thrift.BOOL, 3); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(*p.Beta); err != nil { + if err := oprot.WriteBool(*p.Beta); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -10913,7 +12492,7 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) } -func (p *GetCloudSettingRequest) writeField4(oprot thrift.TProtocol) (err error) { +func (p *GetTestRequest) writeField4(oprot thrift.TProtocol) (err error) { if p.IsSetPhone() { if err = oprot.WriteFieldBegin("phone", thrift.STRING, 4); err != nil { goto WriteFieldBeginError @@ -10932,12 +12511,12 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) } -func (p *GetCloudSettingRequest) writeField5(oprot thrift.TProtocol) (err error) { +func (p *GetTestRequest) writeField5(oprot thrift.TProtocol) (err error) { if p.IsSetIsLogin() { - if err = oprot.WriteFieldBegin("isLogin", thrift.STRING, 5); err != nil { + if err = oprot.WriteFieldBegin("isLogin", thrift.BOOL, 5); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(*p.IsLogin); err != nil { + if err := oprot.WriteBool(*p.IsLogin); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -10951,7 +12530,7 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) } -func (p *GetCloudSettingRequest) writeField6(oprot thrift.TProtocol) (err error) { +func (p *GetTestRequest) writeField6(oprot thrift.TProtocol) (err error) { if p.IsSetLoginType() { if err = oprot.WriteFieldBegin("loginType", thrift.STRING, 6); err != nil { goto WriteFieldBeginError @@ -10970,111 +12549,68 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) } -func (p *GetCloudSettingRequest) String() string { +func (p *GetTestRequest) writeField7(oprot thrift.TProtocol) (err error) { + if p.IsSetSetting() { + if err = oprot.WriteFieldBegin("setting", thrift.STRING, 7); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Setting); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} + +func (p *GetTestRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetCloudSettingRequest(%+v)", *p) + return fmt.Sprintf("GetTestRequest(%+v)", *p) } -type GetCloudSettingResponse struct { +type GetTestResponse struct { + Base *model.BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` + CloudSetting []byte `thrift:"cloud_setting,2" form:"cloud_setting" json:"cloud_setting" query:"cloud_setting"` } -func NewGetCloudSettingResponse() *GetCloudSettingResponse { - return &GetCloudSettingResponse{} +func NewGetTestResponse() *GetTestResponse { + return &GetTestResponse{} } -func (p *GetCloudSettingResponse) InitDefault() { -} - -var fieldIDToName_GetCloudSettingResponse = map[int16]string{} - -func (p *GetCloudSettingResponse) 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 *GetTestResponse) InitDefault() { } -func (p *GetCloudSettingResponse) Write(oprot thrift.TProtocol) (err error) { - - if err = oprot.WriteStructBegin("GetCloudSettingResponse"); 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) -} +var GetTestResponse_Base_DEFAULT *model.BaseResp -func (p *GetCloudSettingResponse) String() string { - if p == nil { - return "" +func (p *GetTestResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return GetTestResponse_Base_DEFAULT } - return fmt.Sprintf("GetCloudSettingResponse(%+v)", *p) - + return p.Base } -type GetAllCloudSettingRequest struct { +func (p *GetTestResponse) GetCloudSetting() (v []byte) { + return p.CloudSetting } -func NewGetAllCloudSettingRequest() *GetAllCloudSettingRequest { - return &GetAllCloudSettingRequest{} +var fieldIDToName_GetTestResponse = map[int16]string{ + 1: "base", + 2: "cloud_setting", } -func (p *GetAllCloudSettingRequest) InitDefault() { +func (p *GetTestResponse) IsSetBase() bool { + return p.Base != nil } -var fieldIDToName_GetAllCloudSettingRequest = map[int16]string{} - -func (p *GetAllCloudSettingRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetTestResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -11091,8 +12627,28 @@ func (p *GetAllCloudSettingRequest) Read(iprot thrift.TProtocol) (err error) { if fieldTypeId == thrift.STOP { break } - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldTypeError + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } } if err = iprot.ReadFieldEnd(); err != nil { goto ReadFieldEndError @@ -11107,8 +12663,10 @@ ReadStructBeginError: return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -SkipFieldTypeError: - return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, fieldTypeId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetTestResponse[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) @@ -11116,12 +12674,41 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetAllCloudSettingRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *GetTestResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *GetTestResponse) ReadField2(iprot thrift.TProtocol) error { + + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { + return err + } else { + _field = []byte(v) + } + p.CloudSetting = _field + return nil +} + +func (p *GetTestResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetAllCloudSettingRequest"); err != nil { + var fieldId int16 + if err = oprot.WriteStructBegin("GetTestResponse"); 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 @@ -11132,33 +12719,69 @@ func (p *GetAllCloudSettingRequest) 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 *GetAllCloudSettingRequest) String() string { +func (p *GetTestResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *GetTestResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("cloud_setting", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBinary([]byte(p.CloudSetting)); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *GetTestResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("GetAllCloudSettingRequest(%+v)", *p) + return fmt.Sprintf("GetTestResponse(%+v)", *p) } -type GetAllCloudSettingResponse struct { +type GetCloudRequest struct { } -func NewGetAllCloudSettingResponse() *GetAllCloudSettingResponse { - return &GetAllCloudSettingResponse{} +func NewGetCloudRequest() *GetCloudRequest { + return &GetCloudRequest{} } -func (p *GetAllCloudSettingResponse) InitDefault() { +func (p *GetCloudRequest) InitDefault() { } -var fieldIDToName_GetAllCloudSettingResponse = map[int16]string{} +var fieldIDToName_GetCloudRequest = map[int16]string{} -func (p *GetAllCloudSettingResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetCloudRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -11200,9 +12823,9 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *GetAllCloudSettingResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *GetCloudRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("GetAllCloudSettingResponse"); err != nil { + if err = oprot.WriteStructBegin("GetCloudRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -11222,45 +12845,52 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *GetAllCloudSettingResponse) String() string { +func (p *GetCloudRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("GetAllCloudSettingResponse(%+v)", *p) + return fmt.Sprintf("GetCloudRequest(%+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 GetCloudResponse struct { + Base *model.BaseResp `thrift:"base,1,optional" form:"base" json:"base,omitempty" query:"base"` + CloudSetting []byte `thrift:"cloud_setting,2" form:"cloud_setting" json:"cloud_setting" query:"cloud_setting"` } -func NewSetAllCloudSettingRequest() *SetAllCloudSettingRequest { - return &SetAllCloudSettingRequest{} +func NewGetCloudResponse() *GetCloudResponse { + return &GetCloudResponse{} } -func (p *SetAllCloudSettingRequest) InitDefault() { +func (p *GetCloudResponse) InitDefault() { } -func (p *SetAllCloudSettingRequest) GetPassword() (v string) { - return p.Password +var GetCloudResponse_Base_DEFAULT *model.BaseResp + +func (p *GetCloudResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return GetCloudResponse_Base_DEFAULT + } + return p.Base } -func (p *SetAllCloudSettingRequest) GetSetting() (v string) { - return p.Setting +func (p *GetCloudResponse) GetCloudSetting() (v []byte) { + return p.CloudSetting } -var fieldIDToName_SetAllCloudSettingRequest = map[int16]string{ - 1: "password", - 2: "setting", +var fieldIDToName_GetCloudResponse = map[int16]string{ + 1: "base", + 2: "cloud_setting", +} + +func (p *GetCloudResponse) IsSetBase() bool { + return p.Base != nil } -func (p *SetAllCloudSettingRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetCloudResponse) 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 @@ -11277,11 +12907,10 @@ func (p *SetAllCloudSettingRequest) 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 } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -11290,7 +12919,6 @@ 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 } @@ -11307,22 +12935,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_GetCloudResponse[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -11330,37 +12949,32 @@ 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 { - - var _field string - if v, err := iprot.ReadString(); err != nil { +func (p *GetCloudResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { return err - } else { - _field = v } - p.Password = _field + p.Base = _field return nil } -func (p *SetAllCloudSettingRequest) ReadField2(iprot thrift.TProtocol) error { +func (p *GetCloudResponse) ReadField2(iprot thrift.TProtocol) error { - var _field string - if v, err := iprot.ReadString(); err != nil { + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { return err } else { - _field = v + _field = []byte(v) } - p.Setting = _field + p.CloudSetting = _field return nil } -func (p *SetAllCloudSettingRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *GetCloudResponse) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("SetAllCloudSettingRequest"); err != nil { + if err = oprot.WriteStructBegin("GetCloudResponse"); err != nil { goto WriteStructBeginError } if p != nil { @@ -11390,15 +13004,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 *GetCloudResponse) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } return nil WriteFieldBeginError: @@ -11407,11 +13023,11 @@ 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 { +func (p *GetCloudResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("cloud_setting", thrift.STRING, 2); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(p.Setting); err != nil { + if err := oprot.WriteBinary([]byte(p.CloudSetting)); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -11424,164 +13040,45 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *SetAllCloudSettingRequest) String() string { +func (p *GetCloudResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("SetAllCloudSettingRequest(%+v)", *p) - -} - -type SetAllCloudSettingResponse struct { -} - -func NewSetAllCloudSettingResponse() *SetAllCloudSettingResponse { - return &SetAllCloudSettingResponse{} -} - -func (p *SetAllCloudSettingResponse) InitDefault() { -} - -var fieldIDToName_SetAllCloudSettingResponse = map[int16]string{} - -func (p *SetAllCloudSettingResponse) 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 *SetAllCloudSettingResponse) Write(oprot thrift.TProtocol) (err error) { + return fmt.Sprintf("GetCloudResponse(%+v)", *p) - if err = oprot.WriteStructBegin("SetAllCloudSettingResponse"); 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 *SetAllCloudSettingResponse) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("SetAllCloudSettingResponse(%+v)", *p) - +type SetCloudRequest struct { + Password string `thrift:"password,1,required" form:"password,required" json:"password,required" query:"password,required"` + Setting string `thrift:"setting,2,required" form:"setting,required" json:"setting,required" query:"setting,required"` } -type 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 NewSetCloudRequest() *SetCloudRequest { + return &SetCloudRequest{} } -func NewTestSettingRequest() *TestSettingRequest { - return &TestSettingRequest{} +func (p *SetCloudRequest) InitDefault() { } -func (p *TestSettingRequest) InitDefault() { +func (p *SetCloudRequest) GetPassword() (v string) { + return p.Password } -func (p *TestSettingRequest) GetSetting() (v string) { +func (p *SetCloudRequest) GetSetting() (v string) { return p.Setting } -func (p *TestSettingRequest) GetAccount() (v string) { - return p.Account -} - -func (p *TestSettingRequest) GetVersion() (v string) { - return p.Version -} - -func (p *TestSettingRequest) GetBeta() (v string) { - return p.Beta -} - -func (p *TestSettingRequest) GetPhone() (v string) { - return p.Phone -} - -func (p *TestSettingRequest) GetIsLogin() (v string) { - return p.IsLogin -} - -func (p *TestSettingRequest) GetLoginType() (v string) { - return p.LoginType -} - -var fieldIDToName_TestSettingRequest = map[int16]string{ - 1: "setting", - 2: "account", - 3: "version", - 4: "beta", - 5: "phone", - 6: "isLogin", - 7: "loginType", +var fieldIDToName_SetCloudRequest = map[int16]string{ + 1: "password", + 2: "setting", } -func (p *TestSettingRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *SetCloudRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 + var issetPassword bool = false 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 @@ -11602,7 +13099,7 @@ func (p *TestSettingRequest) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetSetting = true + issetPassword = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -11611,52 +13108,7 @@ func (p *TestSettingRequest) Read(iprot thrift.TProtocol) (err error) { 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 + issetSetting = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -11664,47 +13116,22 @@ func (p *TestSettingRequest) Read(iprot thrift.TProtocol) (err error) { 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 !issetSetting { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetAccount { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetVersion { - fieldId = 3 - goto RequiredFieldNotSetError - } - - if !issetBeta { - fieldId = 4 - goto RequiredFieldNotSetError + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } } - - if !issetPhone { - fieldId = 5 - goto RequiredFieldNotSetError + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError } - if !issetIsLogin { - fieldId = 6 + if !issetPassword { + fieldId = 1 goto RequiredFieldNotSetError } - if !issetLoginType { - fieldId = 7 + if !issetSetting { + fieldId = 2 goto RequiredFieldNotSetError } return nil @@ -11713,7 +13140,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_TestSettingRequest[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SetCloudRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -11722,65 +13149,10 @@ ReadFieldEndError: ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TestSettingRequest[fieldId])) -} - -func (p *TestSettingRequest) ReadField1(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Setting = _field - return nil -} -func (p *TestSettingRequest) ReadField2(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Account = _field - return nil -} -func (p *TestSettingRequest) ReadField3(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Version = _field - return nil -} -func (p *TestSettingRequest) ReadField4(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Beta = _field - return nil + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_SetCloudRequest[fieldId])) } -func (p *TestSettingRequest) ReadField5(iprot thrift.TProtocol) error { - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Phone = _field - return nil -} -func (p *TestSettingRequest) ReadField6(iprot thrift.TProtocol) error { +func (p *SetCloudRequest) ReadField1(iprot thrift.TProtocol) error { var _field string if v, err := iprot.ReadString(); err != nil { @@ -11788,10 +13160,10 @@ func (p *TestSettingRequest) ReadField6(iprot thrift.TProtocol) error { } else { _field = v } - p.IsLogin = _field + p.Password = _field return nil } -func (p *TestSettingRequest) ReadField7(iprot thrift.TProtocol) error { +func (p *SetCloudRequest) ReadField2(iprot thrift.TProtocol) error { var _field string if v, err := iprot.ReadString(); err != nil { @@ -11799,14 +13171,14 @@ func (p *TestSettingRequest) ReadField7(iprot thrift.TProtocol) error { } else { _field = v } - p.LoginType = _field + p.Setting = _field return nil } -func (p *TestSettingRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *SetCloudRequest) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("TestSettingRequest"); err != nil { + if err = oprot.WriteStructBegin("SetCloudRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -11818,26 +13190,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 @@ -11856,11 +13208,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 *SetCloudRequest) 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 { @@ -11873,11 +13225,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 *SetCloudRequest) 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 { @@ -11890,112 +13242,43 @@ 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 +func (p *SetCloudRequest) String() string { + if p == nil { + return "" } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} + return fmt.Sprintf("SetCloudRequest(%+v)", *p) -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) +type SetCloudResponse struct { + Base *model.BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` } -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 NewSetCloudResponse() *SetCloudResponse { + return &SetCloudResponse{} } -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 *SetCloudResponse) InitDefault() { } -func (p *TestSettingRequest) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TestSettingRequest(%+v)", *p) - -} +var SetCloudResponse_Base_DEFAULT *model.BaseResp -type TestSettingResponse struct { +func (p *SetCloudResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return SetCloudResponse_Base_DEFAULT + } + return p.Base } -func NewTestSettingResponse() *TestSettingResponse { - return &TestSettingResponse{} +var fieldIDToName_SetCloudResponse = map[int16]string{ + 1: "base", } -func (p *TestSettingResponse) InitDefault() { +func (p *SetCloudResponse) IsSetBase() bool { + return p.Base != nil } -var fieldIDToName_TestSettingResponse = map[int16]string{} - -func (p *TestSettingResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *SetCloudResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -12012,8 +13295,20 @@ func (p *TestSettingResponse) Read(iprot thrift.TProtocol) (err error) { if fieldTypeId == thrift.STOP { break } - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldTypeError + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } } if err = iprot.ReadFieldEnd(); err != nil { goto ReadFieldEndError @@ -12028,8 +13323,10 @@ ReadStructBeginError: return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -SkipFieldTypeError: - return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, fieldTypeId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SetCloudResponse[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) @@ -12037,12 +13334,26 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *TestSettingResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *SetCloudResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} + +func (p *SetCloudResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("TestSettingResponse"); err != nil { + var fieldId int16 + if err = oprot.WriteStructBegin("SetCloudResponse"); 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 @@ -12053,33 +13364,52 @@ func (p *TestSettingResponse) 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 *TestSettingResponse) String() string { +func (p *SetCloudResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *SetCloudResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("TestSettingResponse(%+v)", *p) + return fmt.Sprintf("SetCloudResponse(%+v)", *p) } -type DumpVisitRequest struct { +type GetDumpRequest struct { } -func NewDumpVisitRequest() *DumpVisitRequest { - return &DumpVisitRequest{} +func NewGetDumpRequest() *GetDumpRequest { + return &GetDumpRequest{} } -func (p *DumpVisitRequest) InitDefault() { +func (p *GetDumpRequest) InitDefault() { } -var fieldIDToName_DumpVisitRequest = map[int16]string{} +var fieldIDToName_GetDumpRequest = map[int16]string{} -func (p *DumpVisitRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetDumpRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -12121,9 +13451,9 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *DumpVisitRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *GetDumpRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("DumpVisitRequest"); err != nil { + if err = oprot.WriteStructBegin("GetDumpRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -12143,27 +13473,49 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *DumpVisitRequest) String() string { +func (p *GetDumpRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("DumpVisitRequest(%+v)", *p) + return fmt.Sprintf("GetDumpRequest(%+v)", *p) + +} + +type GetDumpResponse struct { + Base *model.BaseResp `thrift:"base,1,optional" form:"base" json:"base,omitempty" query:"base"` + Data string `thrift:"data,2" form:"data" json:"data" query:"data"` +} + +func NewGetDumpResponse() *GetDumpResponse { + return &GetDumpResponse{} +} +func (p *GetDumpResponse) InitDefault() { } -type DumpVisitResponse struct { +var GetDumpResponse_Base_DEFAULT *model.BaseResp + +func (p *GetDumpResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return GetDumpResponse_Base_DEFAULT + } + return p.Base } -func NewDumpVisitResponse() *DumpVisitResponse { - return &DumpVisitResponse{} +func (p *GetDumpResponse) GetData() (v string) { + return p.Data } -func (p *DumpVisitResponse) InitDefault() { +var fieldIDToName_GetDumpResponse = map[int16]string{ + 1: "base", + 2: "data", } -var fieldIDToName_DumpVisitResponse = map[int16]string{} +func (p *GetDumpResponse) IsSetBase() bool { + return p.Base != nil +} -func (p *DumpVisitResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetDumpResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -12180,8 +13532,28 @@ 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.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } } if err = iprot.ReadFieldEnd(); err != nil { goto ReadFieldEndError @@ -12196,8 +13568,10 @@ ReadStructBeginError: return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -SkipFieldTypeError: - return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, fieldTypeId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetDumpResponse[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) @@ -12205,12 +13579,41 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *DumpVisitResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *GetDumpResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *GetDumpResponse) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Data = _field + return nil +} + +func (p *GetDumpResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("DumpVisitResponse"); err != nil { + var fieldId int16 + if err = oprot.WriteStructBegin("GetDumpResponse"); 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 @@ -12221,33 +13624,72 @@ func (p *DumpVisitResponse) 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 *DumpVisitResponse) String() string { +func (p *GetDumpResponse) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + 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 *GetDumpResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("data", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Data); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + 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 *GetDumpResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("DumpVisitResponse(%+v)", *p) + return fmt.Sprintf("GetDumpResponse(%+v)", *p) } -type FZUHelperCSSRequest struct { +// common +type GetCSSRequest struct { } -func NewFZUHelperCSSRequest() *FZUHelperCSSRequest { - return &FZUHelperCSSRequest{} +func NewGetCSSRequest() *GetCSSRequest { + return &GetCSSRequest{} } -func (p *FZUHelperCSSRequest) InitDefault() { +func (p *GetCSSRequest) InitDefault() { } -var fieldIDToName_FZUHelperCSSRequest = map[int16]string{} +var fieldIDToName_GetCSSRequest = map[int16]string{} -func (p *FZUHelperCSSRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetCSSRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -12289,9 +13731,9 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FZUHelperCSSRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *GetCSSRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("FZUHelperCSSRequest"); err != nil { + if err = oprot.WriteStructBegin("GetCSSRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -12311,27 +13753,34 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FZUHelperCSSRequest) String() string { +func (p *GetCSSRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("FZUHelperCSSRequest(%+v)", *p) + return fmt.Sprintf("GetCSSRequest(%+v)", *p) + +} +type GetCSSResponse struct { + CSS []byte `thrift:"css,1" form:"css" json:"css" query:"css"` } -type FZUHelperCSSResponse struct { +func NewGetCSSResponse() *GetCSSResponse { + return &GetCSSResponse{} } -func NewFZUHelperCSSResponse() *FZUHelperCSSResponse { - return &FZUHelperCSSResponse{} +func (p *GetCSSResponse) InitDefault() { } -func (p *FZUHelperCSSResponse) InitDefault() { +func (p *GetCSSResponse) GetCSS() (v []byte) { + return p.CSS } -var fieldIDToName_FZUHelperCSSResponse = map[int16]string{} +var fieldIDToName_GetCSSResponse = map[int16]string{ + 1: "css", +} -func (p *FZUHelperCSSResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetCSSResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -12348,8 +13797,20 @@ func (p *FZUHelperCSSResponse) 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 + } + } 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 @@ -12364,8 +13825,10 @@ ReadStructBeginError: return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -SkipFieldTypeError: - return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, fieldTypeId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetCSSResponse[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) @@ -12373,12 +13836,29 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FZUHelperCSSResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *GetCSSResponse) ReadField1(iprot thrift.TProtocol) error { + + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { + return err + } else { + _field = []byte(v) + } + p.CSS = _field + return nil +} + +func (p *GetCSSResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("FZUHelperCSSResponse"); err != nil { + var fieldId int16 + if err = oprot.WriteStructBegin("GetCSSResponse"); 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 @@ -12389,33 +13869,52 @@ func (p *FZUHelperCSSResponse) 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 *FZUHelperCSSResponse) String() string { +func (p *GetCSSResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("css", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBinary([]byte(p.CSS)); 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 *GetCSSResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("FZUHelperCSSResponse(%+v)", *p) + return fmt.Sprintf("GetCSSResponse(%+v)", *p) } -type FZUHelperHTMLRequest struct { +type GetHtmlRequest struct { } -func NewFZUHelperHTMLRequest() *FZUHelperHTMLRequest { - return &FZUHelperHTMLRequest{} +func NewGetHtmlRequest() *GetHtmlRequest { + return &GetHtmlRequest{} } -func (p *FZUHelperHTMLRequest) InitDefault() { +func (p *GetHtmlRequest) InitDefault() { } -var fieldIDToName_FZUHelperHTMLRequest = map[int16]string{} +var fieldIDToName_GetHtmlRequest = map[int16]string{} -func (p *FZUHelperHTMLRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetHtmlRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -12457,9 +13956,9 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FZUHelperHTMLRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *GetHtmlRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("FZUHelperHTMLRequest"); err != nil { + if err = oprot.WriteStructBegin("GetHtmlRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -12479,27 +13978,34 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FZUHelperHTMLRequest) String() string { +func (p *GetHtmlRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("FZUHelperHTMLRequest(%+v)", *p) + return fmt.Sprintf("GetHtmlRequest(%+v)", *p) + +} +type GetHtmlResponse struct { + HTML []byte `thrift:"html,1" form:"html" json:"html" query:"html"` } -type FZUHelperHTMLResponse struct { +func NewGetHtmlResponse() *GetHtmlResponse { + return &GetHtmlResponse{} } -func NewFZUHelperHTMLResponse() *FZUHelperHTMLResponse { - return &FZUHelperHTMLResponse{} +func (p *GetHtmlResponse) InitDefault() { } -func (p *FZUHelperHTMLResponse) InitDefault() { +func (p *GetHtmlResponse) GetHTML() (v []byte) { + return p.HTML } -var fieldIDToName_FZUHelperHTMLResponse = map[int16]string{} +var fieldIDToName_GetHtmlResponse = map[int16]string{ + 1: "html", +} -func (p *FZUHelperHTMLResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetHtmlResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -12516,8 +14022,20 @@ func (p *FZUHelperHTMLResponse) 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 + } + } 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 @@ -12532,8 +14050,10 @@ ReadStructBeginError: return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -SkipFieldTypeError: - return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, fieldTypeId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetHtmlResponse[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) @@ -12541,12 +14061,29 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FZUHelperHTMLResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *GetHtmlResponse) ReadField1(iprot thrift.TProtocol) error { + + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { + return err + } else { + _field = []byte(v) + } + p.HTML = _field + return nil +} + +func (p *GetHtmlResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("FZUHelperHTMLResponse"); err != nil { + var fieldId int16 + if err = oprot.WriteStructBegin("GetHtmlResponse"); 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 @@ -12557,33 +14094,52 @@ func (p *FZUHelperHTMLResponse) 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 *FZUHelperHTMLResponse) String() string { +func (p *GetHtmlResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("html", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBinary([]byte(p.HTML)); err != nil { + 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 *GetHtmlResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("FZUHelperHTMLResponse(%+v)", *p) + return fmt.Sprintf("GetHtmlResponse(%+v)", *p) } -type UserAgreementHTMLRequest struct { +type GetUserAgreementRequest struct { } -func NewUserAgreementHTMLRequest() *UserAgreementHTMLRequest { - return &UserAgreementHTMLRequest{} +func NewGetUserAgreementRequest() *GetUserAgreementRequest { + return &GetUserAgreementRequest{} } -func (p *UserAgreementHTMLRequest) InitDefault() { +func (p *GetUserAgreementRequest) InitDefault() { } -var fieldIDToName_UserAgreementHTMLRequest = map[int16]string{} +var fieldIDToName_GetUserAgreementRequest = map[int16]string{} -func (p *UserAgreementHTMLRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *GetUserAgreementRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -12625,9 +14181,9 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UserAgreementHTMLRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *GetUserAgreementRequest) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("UserAgreementHTMLRequest"); err != nil { + if err = oprot.WriteStructBegin("GetUserAgreementRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -12647,27 +14203,34 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UserAgreementHTMLRequest) String() string { +func (p *GetUserAgreementRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("UserAgreementHTMLRequest(%+v)", *p) + return fmt.Sprintf("GetUserAgreementRequest(%+v)", *p) + +} +type GetUserAgreementResponse struct { + UserAgreement []byte `thrift:"user_agreement,1" form:"user_agreement" json:"user_agreement" query:"user_agreement"` } -type UserAgreementHTMLResponse struct { +func NewGetUserAgreementResponse() *GetUserAgreementResponse { + return &GetUserAgreementResponse{} } -func NewUserAgreementHTMLResponse() *UserAgreementHTMLResponse { - return &UserAgreementHTMLResponse{} +func (p *GetUserAgreementResponse) InitDefault() { } -func (p *UserAgreementHTMLResponse) InitDefault() { +func (p *GetUserAgreementResponse) GetUserAgreement() (v []byte) { + return p.UserAgreement } -var fieldIDToName_UserAgreementHTMLResponse = map[int16]string{} +var fieldIDToName_GetUserAgreementResponse = map[int16]string{ + 1: "user_agreement", +} -func (p *UserAgreementHTMLResponse) Read(iprot thrift.TProtocol) (err error) { +func (p *GetUserAgreementResponse) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -12684,8 +14247,20 @@ func (p *UserAgreementHTMLResponse) 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 + } + } 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 @@ -12700,8 +14275,10 @@ ReadStructBeginError: return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -SkipFieldTypeError: - return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, fieldTypeId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetUserAgreementResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) @@ -12709,12 +14286,29 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UserAgreementHTMLResponse) Write(oprot thrift.TProtocol) (err error) { +func (p *GetUserAgreementResponse) ReadField1(iprot thrift.TProtocol) error { + + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { + return err + } else { + _field = []byte(v) + } + p.UserAgreement = _field + return nil +} + +func (p *GetUserAgreementResponse) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("UserAgreementHTMLResponse"); err != nil { + var fieldId int16 + if err = oprot.WriteStructBegin("GetUserAgreementResponse"); 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 @@ -12725,17 +14319,36 @@ func (p *UserAgreementHTMLResponse) 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 *UserAgreementHTMLResponse) String() string { +func (p *GetUserAgreementResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("user_agreement", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBinary([]byte(p.UserAgreement)); 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 *GetUserAgreementResponse) String() string { if p == nil { return "" } - return fmt.Sprintf("UserAgreementHTMLResponse(%+v)", *p) + return fmt.Sprintf("GetUserAgreementResponse(%+v)", *p) } @@ -13177,195 +14790,224 @@ func (p *AcademicServiceClient) GetUnifiedExam(ctx context.Context, req *GetUnif return _result.GetSuccess(), nil } -type UrlService interface { - APILogin(ctx context.Context, req *APILoginRequest) (r *APILoginResponse, err error) +type VersionService interface { + Login(ctx context.Context, req *LoginRequest) (r *LoginResponse, err error) - UploadVersionInfo(ctx context.Context, req *UploadVersionInfoRequest) (r *UploadVersionInfoResponse, err error) + UploadVersion(ctx context.Context, req *UploadRequest) (r *UploadResponse, err error) - GetUploadParams(ctx context.Context, req *GetUploadParamsRequest) (r *GetUploadParamsResponse, err error) + UploadParams(ctx context.Context, req *UploadParamsRequest) (r *UploadParamsResponse, err error) - GetDownloadRelease(ctx context.Context, req *GetDownloadReleaseRequest) (r *GetDownloadReleaseResponse, err error) + DownloadReleaseApk(ctx context.Context, req *DownloadReleaseApkRequest) (r *DownloadReleaseApkResponse, err error) - GetDownloadBeta(ctx context.Context, req *GetDownloadBetaRequest) (r *GetDownloadBetaResponse, err error) + DownloadBetaApk(ctx context.Context, req *DownloadBetaApkRequest) (r *DownloadBetaApkResponse, err error) GetReleaseVersion(ctx context.Context, req *GetReleaseVersionRequest) (r *GetReleaseVersionResponse, err error) GetBetaVersion(ctx context.Context, req *GetBetaVersionRequest) (r *GetBetaVersionResponse, err error) - GetCloudSetting(ctx context.Context, req *GetCloudSettingRequest) (r *GetCloudSettingResponse, err error) + GetSetting(ctx context.Context, req *GetSettingRequest) (r *GetSettingResponse, err error) - GetAllCloudSetting(ctx context.Context, req *GetAllCloudSettingRequest) (r *GetAllCloudSettingResponse, err error) + GetTest(ctx context.Context, req *GetTestRequest) (r *GetTestResponse, err error) - SetAllCloudSetting(ctx context.Context, req *SetAllCloudSettingRequest) (r *SetAllCloudSettingResponse, err error) + GetCloud(ctx context.Context, req *GetCloudRequest) (r *GetCloudResponse, err error) - TestSetting(ctx context.Context, req *TestSettingRequest) (r *TestSettingResponse, err error) + SetCloud(ctx context.Context, req *SetCloudRequest) (r *SetCloudResponse, 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) + GetDump(ctx context.Context, req *GetDumpRequest) (r *GetDumpResponse, err error) } -type UrlServiceClient struct { +type VersionServiceClient struct { c thrift.TClient } -func NewUrlServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *UrlServiceClient { - return &UrlServiceClient{ +func NewVersionServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *VersionServiceClient { + return &VersionServiceClient{ c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), } } -func NewUrlServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *UrlServiceClient { - return &UrlServiceClient{ +func NewVersionServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *VersionServiceClient { + return &VersionServiceClient{ c: thrift.NewTStandardClient(iprot, oprot), } } -func NewUrlServiceClient(c thrift.TClient) *UrlServiceClient { - return &UrlServiceClient{ +func NewVersionServiceClient(c thrift.TClient) *VersionServiceClient { + return &VersionServiceClient{ c: c, } } -func (p *UrlServiceClient) Client_() thrift.TClient { +func (p *VersionServiceClient) Client_() thrift.TClient { return p.c } -func (p *UrlServiceClient) APILogin(ctx context.Context, req *APILoginRequest) (r *APILoginResponse, err error) { - var _args UrlServiceAPILoginArgs +func (p *VersionServiceClient) Login(ctx context.Context, req *LoginRequest) (r *LoginResponse, err error) { + var _args VersionServiceLoginArgs _args.Req = req - var _result UrlServiceAPILoginResult - if err = p.Client_().Call(ctx, "APILogin", &_args, &_result); err != nil { + var _result VersionServiceLoginResult + if err = p.Client_().Call(ctx, "Login", &_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 *VersionServiceClient) UploadVersion(ctx context.Context, req *UploadRequest) (r *UploadResponse, err error) { + var _args VersionServiceUploadVersionArgs _args.Req = req - var _result UrlServiceUploadVersionInfoResult - if err = p.Client_().Call(ctx, "UploadVersionInfo", &_args, &_result); err != nil { + var _result VersionServiceUploadVersionResult + if err = p.Client_().Call(ctx, "UploadVersion", &_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 *VersionServiceClient) UploadParams(ctx context.Context, req *UploadParamsRequest) (r *UploadParamsResponse, err error) { + var _args VersionServiceUploadParamsArgs _args.Req = req - var _result UrlServiceGetUploadParamsResult - if err = p.Client_().Call(ctx, "GetUploadParams", &_args, &_result); err != nil { + var _result VersionServiceUploadParamsResult + if err = p.Client_().Call(ctx, "UploadParams", &_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 *VersionServiceClient) DownloadReleaseApk(ctx context.Context, req *DownloadReleaseApkRequest) (r *DownloadReleaseApkResponse, err error) { + var _args VersionServiceDownloadReleaseApkArgs _args.Req = req - var _result UrlServiceGetDownloadReleaseResult - if err = p.Client_().Call(ctx, "GetDownloadRelease", &_args, &_result); err != nil { + var _result VersionServiceDownloadReleaseApkResult + if err = p.Client_().Call(ctx, "DownloadReleaseApk", &_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 *VersionServiceClient) DownloadBetaApk(ctx context.Context, req *DownloadBetaApkRequest) (r *DownloadBetaApkResponse, err error) { + var _args VersionServiceDownloadBetaApkArgs _args.Req = req - var _result UrlServiceGetDownloadBetaResult - if err = p.Client_().Call(ctx, "GetDownloadBeta", &_args, &_result); err != nil { + var _result VersionServiceDownloadBetaApkResult + if err = p.Client_().Call(ctx, "DownloadBetaApk", &_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 *VersionServiceClient) GetReleaseVersion(ctx context.Context, req *GetReleaseVersionRequest) (r *GetReleaseVersionResponse, err error) { + var _args VersionServiceGetReleaseVersionArgs _args.Req = req - var _result UrlServiceGetReleaseVersionResult + var _result VersionServiceGetReleaseVersionResult 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 +func (p *VersionServiceClient) GetBetaVersion(ctx context.Context, req *GetBetaVersionRequest) (r *GetBetaVersionResponse, err error) { + var _args VersionServiceGetBetaVersionArgs _args.Req = req - var _result UrlServiceGetBetaVersionResult + var _result VersionServiceGetBetaVersionResult 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 +func (p *VersionServiceClient) GetSetting(ctx context.Context, req *GetSettingRequest) (r *GetSettingResponse, err error) { + var _args VersionServiceGetSettingArgs _args.Req = req - var _result UrlServiceGetCloudSettingResult - if err = p.Client_().Call(ctx, "GetCloudSetting", &_args, &_result); err != nil { + var _result VersionServiceGetSettingResult + if err = p.Client_().Call(ctx, "GetSetting", &_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 +func (p *VersionServiceClient) GetTest(ctx context.Context, req *GetTestRequest) (r *GetTestResponse, err error) { + var _args VersionServiceGetTestArgs _args.Req = req - var _result UrlServiceGetAllCloudSettingResult - if err = p.Client_().Call(ctx, "GetAllCloudSetting", &_args, &_result); err != nil { + var _result VersionServiceGetTestResult + if err = p.Client_().Call(ctx, "GetTest", &_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 *VersionServiceClient) GetCloud(ctx context.Context, req *GetCloudRequest) (r *GetCloudResponse, err error) { + var _args VersionServiceGetCloudArgs _args.Req = req - var _result UrlServiceSetAllCloudSettingResult - if err = p.Client_().Call(ctx, "SetAllCloudSetting", &_args, &_result); err != nil { + var _result VersionServiceGetCloudResult + if err = p.Client_().Call(ctx, "GetCloud", &_args, &_result); err != nil { return } return _result.GetSuccess(), nil } -func (p *UrlServiceClient) TestSetting(ctx context.Context, req *TestSettingRequest) (r *TestSettingResponse, err error) { - var _args UrlServiceTestSettingArgs +func (p *VersionServiceClient) SetCloud(ctx context.Context, req *SetCloudRequest) (r *SetCloudResponse, err error) { + var _args VersionServiceSetCloudArgs _args.Req = req - var _result UrlServiceTestSettingResult - if err = p.Client_().Call(ctx, "TestSetting", &_args, &_result); err != nil { + var _result VersionServiceSetCloudResult + if err = p.Client_().Call(ctx, "SetCloud", &_args, &_result); err != nil { return } return _result.GetSuccess(), nil } -func (p *UrlServiceClient) DumpVisit(ctx context.Context, req *DumpVisitRequest) (r *DumpVisitResponse, err error) { - var _args UrlServiceDumpVisitArgs +func (p *VersionServiceClient) GetDump(ctx context.Context, req *GetDumpRequest) (r *GetDumpResponse, err error) { + var _args VersionServiceGetDumpArgs _args.Req = req - var _result UrlServiceDumpVisitResult - if err = p.Client_().Call(ctx, "DumpVisit", &_args, &_result); err != nil { + var _result VersionServiceGetDumpResult + if err = p.Client_().Call(ctx, "GetDump", &_args, &_result); err != nil { return } return _result.GetSuccess(), nil } -func (p *UrlServiceClient) FZUHelperCSS(ctx context.Context, req *FZUHelperCSSRequest) (r *FZUHelperCSSResponse, err error) { - var _args UrlServiceFZUHelperCSSArgs + +type CommonService interface { + GetCSS(ctx context.Context, req *GetCSSRequest) (r *GetCSSResponse, err error) + + GetHtml(ctx context.Context, req *GetHtmlRequest) (r *GetHtmlResponse, err error) + + GetUserAgreement(ctx context.Context, req *GetUserAgreementRequest) (r *GetUserAgreementResponse, err error) +} + +type CommonServiceClient struct { + c thrift.TClient +} + +func NewCommonServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *CommonServiceClient { + return &CommonServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewCommonServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *CommonServiceClient { + return &CommonServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewCommonServiceClient(c thrift.TClient) *CommonServiceClient { + return &CommonServiceClient{ + c: c, + } +} + +func (p *CommonServiceClient) Client_() thrift.TClient { + return p.c +} + +func (p *CommonServiceClient) GetCSS(ctx context.Context, req *GetCSSRequest) (r *GetCSSResponse, err error) { + var _args CommonServiceGetCSSArgs _args.Req = req - var _result UrlServiceFZUHelperCSSResult - if err = p.Client_().Call(ctx, "FZUHelperCSS", &_args, &_result); err != nil { + var _result CommonServiceGetCSSResult + if err = p.Client_().Call(ctx, "GetCSS", &_args, &_result); err != nil { return } return _result.GetSuccess(), nil } -func (p *UrlServiceClient) FZUHelperHTML(ctx context.Context, req *FZUHelperHTMLRequest) (r *FZUHelperHTMLResponse, err error) { - var _args UrlServiceFZUHelperHTMLArgs +func (p *CommonServiceClient) GetHtml(ctx context.Context, req *GetHtmlRequest) (r *GetHtmlResponse, err error) { + var _args CommonServiceGetHtmlArgs _args.Req = req - var _result UrlServiceFZUHelperHTMLResult - if err = p.Client_().Call(ctx, "FZUHelperHTML", &_args, &_result); err != nil { + var _result CommonServiceGetHtmlResult + if err = p.Client_().Call(ctx, "GetHtml", &_args, &_result); err != nil { return } return _result.GetSuccess(), nil } -func (p *UrlServiceClient) UserAgreementHTML(ctx context.Context, req *UserAgreementHTMLRequest) (r *UserAgreementHTMLResponse, err error) { - var _args UrlServiceUserAgreementHTMLArgs +func (p *CommonServiceClient) GetUserAgreement(ctx context.Context, req *GetUserAgreementRequest) (r *GetUserAgreementResponse, err error) { + var _args CommonServiceGetUserAgreementArgs _args.Req = req - var _result UrlServiceUserAgreementHTMLResult - if err = p.Client_().Call(ctx, "UserAgreementHTML", &_args, &_result); err != nil { + var _result CommonServiceGetUserAgreementResult + if err = p.Client_().Call(ctx, "GetUserAgreement", &_args, &_result); err != nil { return } return _result.GetSuccess(), nil @@ -21891,44 +23533,41 @@ func (p *AcademicServiceGetUnifiedExamResult) String() string { } -type UrlServiceProcessor struct { +type VersionServiceProcessor struct { processorMap map[string]thrift.TProcessorFunction - handler UrlService + handler VersionService } -func (p *UrlServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { +func (p *VersionServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { p.processorMap[key] = processor } -func (p *UrlServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { +func (p *VersionServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { processor, ok = p.processorMap[key] return processor, ok } -func (p *UrlServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { +func (p *VersionServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { return p.processorMap } -func NewUrlServiceProcessor(handler UrlService) *UrlServiceProcessor { - self := &UrlServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} - self.AddToProcessorMap("APILogin", &urlServiceProcessorAPILogin{handler: handler}) - self.AddToProcessorMap("UploadVersionInfo", &urlServiceProcessorUploadVersionInfo{handler: handler}) - self.AddToProcessorMap("GetUploadParams", &urlServiceProcessorGetUploadParams{handler: handler}) - self.AddToProcessorMap("GetDownloadRelease", &urlServiceProcessorGetDownloadRelease{handler: handler}) - self.AddToProcessorMap("GetDownloadBeta", &urlServiceProcessorGetDownloadBeta{handler: handler}) - self.AddToProcessorMap("GetReleaseVersion", &urlServiceProcessorGetReleaseVersion{handler: handler}) - self.AddToProcessorMap("GetBetaVersion", &urlServiceProcessorGetBetaVersion{handler: handler}) - self.AddToProcessorMap("GetCloudSetting", &urlServiceProcessorGetCloudSetting{handler: handler}) - self.AddToProcessorMap("GetAllCloudSetting", &urlServiceProcessorGetAllCloudSetting{handler: handler}) - self.AddToProcessorMap("SetAllCloudSetting", &urlServiceProcessorSetAllCloudSetting{handler: handler}) - self.AddToProcessorMap("TestSetting", &urlServiceProcessorTestSetting{handler: handler}) - self.AddToProcessorMap("DumpVisit", &urlServiceProcessorDumpVisit{handler: handler}) - self.AddToProcessorMap("FZUHelperCSS", &urlServiceProcessorFZUHelperCSS{handler: handler}) - self.AddToProcessorMap("FZUHelperHTML", &urlServiceProcessorFZUHelperHTML{handler: handler}) - self.AddToProcessorMap("UserAgreementHTML", &urlServiceProcessorUserAgreementHTML{handler: handler}) +func NewVersionServiceProcessor(handler VersionService) *VersionServiceProcessor { + self := &VersionServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self.AddToProcessorMap("Login", &versionServiceProcessorLogin{handler: handler}) + self.AddToProcessorMap("UploadVersion", &versionServiceProcessorUploadVersion{handler: handler}) + self.AddToProcessorMap("UploadParams", &versionServiceProcessorUploadParams{handler: handler}) + self.AddToProcessorMap("DownloadReleaseApk", &versionServiceProcessorDownloadReleaseApk{handler: handler}) + self.AddToProcessorMap("DownloadBetaApk", &versionServiceProcessorDownloadBetaApk{handler: handler}) + self.AddToProcessorMap("GetReleaseVersion", &versionServiceProcessorGetReleaseVersion{handler: handler}) + self.AddToProcessorMap("GetBetaVersion", &versionServiceProcessorGetBetaVersion{handler: handler}) + self.AddToProcessorMap("GetSetting", &versionServiceProcessorGetSetting{handler: handler}) + self.AddToProcessorMap("GetTest", &versionServiceProcessorGetTest{handler: handler}) + self.AddToProcessorMap("GetCloud", &versionServiceProcessorGetCloud{handler: handler}) + self.AddToProcessorMap("SetCloud", &versionServiceProcessorSetCloud{handler: handler}) + self.AddToProcessorMap("GetDump", &versionServiceProcessorGetDump{handler: handler}) return self } -func (p *UrlServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { +func (p *VersionServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { name, _, seqId, err := iprot.ReadMessageBegin() if err != nil { return false, err @@ -21946,16 +23585,16 @@ func (p *UrlServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.T return false, x } -type urlServiceProcessorAPILogin struct { - handler UrlService +type versionServiceProcessorLogin struct { + handler VersionService } -func (p *urlServiceProcessorAPILogin) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UrlServiceAPILoginArgs{} +func (p *versionServiceProcessorLogin) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := VersionServiceLoginArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("APILogin", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("Login", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -21964,11 +23603,11 @@ func (p *urlServiceProcessorAPILogin) Process(ctx context.Context, seqId int32, iprot.ReadMessageEnd() var err2 error - result := UrlServiceAPILoginResult{} - var retval *APILoginResponse - if retval, err2 = p.handler.APILogin(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing APILogin: "+err2.Error()) - oprot.WriteMessageBegin("APILogin", thrift.EXCEPTION, seqId) + result := VersionServiceLoginResult{} + var retval *LoginResponse + if retval, err2 = p.handler.Login(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing Login: "+err2.Error()) + oprot.WriteMessageBegin("Login", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -21976,7 +23615,7 @@ func (p *urlServiceProcessorAPILogin) Process(ctx context.Context, seqId int32, } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("APILogin", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("Login", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -21994,16 +23633,16 @@ func (p *urlServiceProcessorAPILogin) Process(ctx context.Context, seqId int32, return true, err } -type urlServiceProcessorUploadVersionInfo struct { - handler UrlService +type versionServiceProcessorUploadVersion struct { + handler VersionService } -func (p *urlServiceProcessorUploadVersionInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UrlServiceUploadVersionInfoArgs{} +func (p *versionServiceProcessorUploadVersion) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := VersionServiceUploadVersionArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("UploadVersionInfo", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("UploadVersion", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -22012,11 +23651,11 @@ func (p *urlServiceProcessorUploadVersionInfo) Process(ctx context.Context, seqI iprot.ReadMessageEnd() var err2 error - result := UrlServiceUploadVersionInfoResult{} - var retval *UploadVersionInfoResponse - if retval, err2 = p.handler.UploadVersionInfo(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing UploadVersionInfo: "+err2.Error()) - oprot.WriteMessageBegin("UploadVersionInfo", thrift.EXCEPTION, seqId) + result := VersionServiceUploadVersionResult{} + var retval *UploadResponse + if retval, err2 = p.handler.UploadVersion(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing UploadVersion: "+err2.Error()) + oprot.WriteMessageBegin("UploadVersion", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -22024,7 +23663,7 @@ func (p *urlServiceProcessorUploadVersionInfo) Process(ctx context.Context, seqI } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("UploadVersionInfo", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("UploadVersion", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -22042,16 +23681,16 @@ func (p *urlServiceProcessorUploadVersionInfo) Process(ctx context.Context, seqI return true, err } -type urlServiceProcessorGetUploadParams struct { - handler UrlService +type versionServiceProcessorUploadParams struct { + handler VersionService } -func (p *urlServiceProcessorGetUploadParams) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UrlServiceGetUploadParamsArgs{} +func (p *versionServiceProcessorUploadParams) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := VersionServiceUploadParamsArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetUploadParams", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("UploadParams", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -22060,11 +23699,11 @@ func (p *urlServiceProcessorGetUploadParams) Process(ctx context.Context, seqId iprot.ReadMessageEnd() var err2 error - result := UrlServiceGetUploadParamsResult{} - var retval *GetUploadParamsResponse - if retval, err2 = p.handler.GetUploadParams(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetUploadParams: "+err2.Error()) - oprot.WriteMessageBegin("GetUploadParams", thrift.EXCEPTION, seqId) + result := VersionServiceUploadParamsResult{} + var retval *UploadParamsResponse + if retval, err2 = p.handler.UploadParams(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing UploadParams: "+err2.Error()) + oprot.WriteMessageBegin("UploadParams", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -22072,7 +23711,7 @@ func (p *urlServiceProcessorGetUploadParams) Process(ctx context.Context, seqId } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("GetUploadParams", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("UploadParams", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -22090,16 +23729,16 @@ func (p *urlServiceProcessorGetUploadParams) Process(ctx context.Context, seqId return true, err } -type urlServiceProcessorGetDownloadRelease struct { - handler UrlService +type versionServiceProcessorDownloadReleaseApk struct { + handler VersionService } -func (p *urlServiceProcessorGetDownloadRelease) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UrlServiceGetDownloadReleaseArgs{} +func (p *versionServiceProcessorDownloadReleaseApk) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := VersionServiceDownloadReleaseApkArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetDownloadRelease", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("DownloadReleaseApk", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -22108,11 +23747,11 @@ func (p *urlServiceProcessorGetDownloadRelease) Process(ctx context.Context, seq iprot.ReadMessageEnd() var err2 error - result := UrlServiceGetDownloadReleaseResult{} - var retval *GetDownloadReleaseResponse - if retval, err2 = p.handler.GetDownloadRelease(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetDownloadRelease: "+err2.Error()) - oprot.WriteMessageBegin("GetDownloadRelease", thrift.EXCEPTION, seqId) + result := VersionServiceDownloadReleaseApkResult{} + var retval *DownloadReleaseApkResponse + if retval, err2 = p.handler.DownloadReleaseApk(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing DownloadReleaseApk: "+err2.Error()) + oprot.WriteMessageBegin("DownloadReleaseApk", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -22120,7 +23759,7 @@ func (p *urlServiceProcessorGetDownloadRelease) Process(ctx context.Context, seq } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("GetDownloadRelease", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("DownloadReleaseApk", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -22138,16 +23777,16 @@ func (p *urlServiceProcessorGetDownloadRelease) Process(ctx context.Context, seq return true, err } -type urlServiceProcessorGetDownloadBeta struct { - handler UrlService +type versionServiceProcessorDownloadBetaApk struct { + handler VersionService } -func (p *urlServiceProcessorGetDownloadBeta) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UrlServiceGetDownloadBetaArgs{} +func (p *versionServiceProcessorDownloadBetaApk) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := VersionServiceDownloadBetaApkArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetDownloadBeta", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("DownloadBetaApk", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -22156,11 +23795,11 @@ func (p *urlServiceProcessorGetDownloadBeta) Process(ctx context.Context, seqId iprot.ReadMessageEnd() var err2 error - result := UrlServiceGetDownloadBetaResult{} - var retval *GetDownloadBetaResponse - if retval, err2 = p.handler.GetDownloadBeta(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetDownloadBeta: "+err2.Error()) - oprot.WriteMessageBegin("GetDownloadBeta", thrift.EXCEPTION, seqId) + result := VersionServiceDownloadBetaApkResult{} + var retval *DownloadBetaApkResponse + if retval, err2 = p.handler.DownloadBetaApk(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing DownloadBetaApk: "+err2.Error()) + oprot.WriteMessageBegin("DownloadBetaApk", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -22168,7 +23807,7 @@ func (p *urlServiceProcessorGetDownloadBeta) Process(ctx context.Context, seqId } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("GetDownloadBeta", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("DownloadBetaApk", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -22186,12 +23825,12 @@ func (p *urlServiceProcessorGetDownloadBeta) Process(ctx context.Context, seqId return true, err } -type urlServiceProcessorGetReleaseVersion struct { - handler UrlService +type versionServiceProcessorGetReleaseVersion struct { + handler VersionService } -func (p *urlServiceProcessorGetReleaseVersion) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UrlServiceGetReleaseVersionArgs{} +func (p *versionServiceProcessorGetReleaseVersion) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := VersionServiceGetReleaseVersionArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) @@ -22204,7 +23843,7 @@ func (p *urlServiceProcessorGetReleaseVersion) Process(ctx context.Context, seqI iprot.ReadMessageEnd() var err2 error - result := UrlServiceGetReleaseVersionResult{} + result := VersionServiceGetReleaseVersionResult{} var retval *GetReleaseVersionResponse if retval, err2 = p.handler.GetReleaseVersion(ctx, args.Req); err2 != nil { x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetReleaseVersion: "+err2.Error()) @@ -22234,12 +23873,12 @@ func (p *urlServiceProcessorGetReleaseVersion) Process(ctx context.Context, seqI return true, err } -type urlServiceProcessorGetBetaVersion struct { - handler UrlService +type versionServiceProcessorGetBetaVersion struct { + handler VersionService } -func (p *urlServiceProcessorGetBetaVersion) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UrlServiceGetBetaVersionArgs{} +func (p *versionServiceProcessorGetBetaVersion) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := VersionServiceGetBetaVersionArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) @@ -22252,7 +23891,7 @@ func (p *urlServiceProcessorGetBetaVersion) Process(ctx context.Context, seqId i iprot.ReadMessageEnd() var err2 error - result := UrlServiceGetBetaVersionResult{} + result := VersionServiceGetBetaVersionResult{} var retval *GetBetaVersionResponse if retval, err2 = p.handler.GetBetaVersion(ctx, args.Req); err2 != nil { x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetBetaVersion: "+err2.Error()) @@ -22282,160 +23921,16 @@ func (p *urlServiceProcessorGetBetaVersion) Process(ctx context.Context, seqId i return true, err } -type urlServiceProcessorGetCloudSetting struct { - handler UrlService -} - -func (p *urlServiceProcessorGetCloudSetting) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UrlServiceGetCloudSettingArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetCloudSetting", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := UrlServiceGetCloudSettingResult{} - var retval *GetCloudSettingResponse - if retval, err2 = p.handler.GetCloudSetting(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCloudSetting: "+err2.Error()) - oprot.WriteMessageBegin("GetCloudSetting", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("GetCloudSetting", 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 urlServiceProcessorGetAllCloudSetting struct { - handler UrlService -} - -func (p *urlServiceProcessorGetAllCloudSetting) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UrlServiceGetAllCloudSettingArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetAllCloudSetting", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := UrlServiceGetAllCloudSettingResult{} - var retval *GetAllCloudSettingResponse - if retval, err2 = p.handler.GetAllCloudSetting(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetAllCloudSetting: "+err2.Error()) - oprot.WriteMessageBegin("GetAllCloudSetting", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("GetAllCloudSetting", 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 urlServiceProcessorSetAllCloudSetting struct { - handler UrlService -} - -func (p *urlServiceProcessorSetAllCloudSetting) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UrlServiceSetAllCloudSettingArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("SetAllCloudSetting", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := UrlServiceSetAllCloudSettingResult{} - var retval *SetAllCloudSettingResponse - if retval, err2 = p.handler.SetAllCloudSetting(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing SetAllCloudSetting: "+err2.Error()) - oprot.WriteMessageBegin("SetAllCloudSetting", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("SetAllCloudSetting", 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 urlServiceProcessorTestSetting struct { - handler UrlService +type versionServiceProcessorGetSetting struct { + handler VersionService } -func (p *urlServiceProcessorTestSetting) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UrlServiceTestSettingArgs{} +func (p *versionServiceProcessorGetSetting) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := VersionServiceGetSettingArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("TestSetting", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("GetSetting", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -22444,11 +23939,11 @@ func (p *urlServiceProcessorTestSetting) Process(ctx context.Context, seqId int3 iprot.ReadMessageEnd() var err2 error - result := UrlServiceTestSettingResult{} - var retval *TestSettingResponse - if retval, err2 = p.handler.TestSetting(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing TestSetting: "+err2.Error()) - oprot.WriteMessageBegin("TestSetting", thrift.EXCEPTION, seqId) + result := VersionServiceGetSettingResult{} + var retval *GetSettingResponse + if retval, err2 = p.handler.GetSetting(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetSetting: "+err2.Error()) + oprot.WriteMessageBegin("GetSetting", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -22456,7 +23951,7 @@ func (p *urlServiceProcessorTestSetting) Process(ctx context.Context, seqId int3 } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("TestSetting", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("GetSetting", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -22474,16 +23969,16 @@ func (p *urlServiceProcessorTestSetting) Process(ctx context.Context, seqId int3 return true, err } -type urlServiceProcessorDumpVisit struct { - handler UrlService +type versionServiceProcessorGetTest struct { + handler VersionService } -func (p *urlServiceProcessorDumpVisit) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UrlServiceDumpVisitArgs{} +func (p *versionServiceProcessorGetTest) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := VersionServiceGetTestArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("DumpVisit", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("GetTest", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -22492,11 +23987,11 @@ func (p *urlServiceProcessorDumpVisit) Process(ctx context.Context, seqId int32, iprot.ReadMessageEnd() var err2 error - result := UrlServiceDumpVisitResult{} - var retval *DumpVisitResponse - if retval, err2 = p.handler.DumpVisit(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing DumpVisit: "+err2.Error()) - oprot.WriteMessageBegin("DumpVisit", thrift.EXCEPTION, seqId) + result := VersionServiceGetTestResult{} + var retval *GetTestResponse + if retval, err2 = p.handler.GetTest(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTest: "+err2.Error()) + oprot.WriteMessageBegin("GetTest", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -22504,7 +23999,7 @@ func (p *urlServiceProcessorDumpVisit) Process(ctx context.Context, seqId int32, } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("DumpVisit", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("GetTest", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -22522,16 +24017,16 @@ func (p *urlServiceProcessorDumpVisit) Process(ctx context.Context, seqId int32, return true, err } -type urlServiceProcessorFZUHelperCSS struct { - handler UrlService +type versionServiceProcessorGetCloud struct { + handler VersionService } -func (p *urlServiceProcessorFZUHelperCSS) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UrlServiceFZUHelperCSSArgs{} +func (p *versionServiceProcessorGetCloud) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := VersionServiceGetCloudArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("FZUHelperCSS", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("GetCloud", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -22540,11 +24035,11 @@ func (p *urlServiceProcessorFZUHelperCSS) Process(ctx context.Context, seqId int iprot.ReadMessageEnd() var err2 error - result := UrlServiceFZUHelperCSSResult{} - var retval *FZUHelperCSSResponse - if retval, err2 = p.handler.FZUHelperCSS(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing FZUHelperCSS: "+err2.Error()) - oprot.WriteMessageBegin("FZUHelperCSS", thrift.EXCEPTION, seqId) + result := VersionServiceGetCloudResult{} + var retval *GetCloudResponse + if retval, err2 = p.handler.GetCloud(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCloud: "+err2.Error()) + oprot.WriteMessageBegin("GetCloud", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -22552,7 +24047,7 @@ func (p *urlServiceProcessorFZUHelperCSS) Process(ctx context.Context, seqId int } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("FZUHelperCSS", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("GetCloud", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -22570,16 +24065,16 @@ func (p *urlServiceProcessorFZUHelperCSS) Process(ctx context.Context, seqId int return true, err } -type urlServiceProcessorFZUHelperHTML struct { - handler UrlService +type versionServiceProcessorSetCloud struct { + handler VersionService } -func (p *urlServiceProcessorFZUHelperHTML) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UrlServiceFZUHelperHTMLArgs{} +func (p *versionServiceProcessorSetCloud) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := VersionServiceSetCloudArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("FZUHelperHTML", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("SetCloud", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -22588,11 +24083,11 @@ func (p *urlServiceProcessorFZUHelperHTML) Process(ctx context.Context, seqId in iprot.ReadMessageEnd() var err2 error - result := UrlServiceFZUHelperHTMLResult{} - var retval *FZUHelperHTMLResponse - if retval, err2 = p.handler.FZUHelperHTML(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing FZUHelperHTML: "+err2.Error()) - oprot.WriteMessageBegin("FZUHelperHTML", thrift.EXCEPTION, seqId) + result := VersionServiceSetCloudResult{} + var retval *SetCloudResponse + if retval, err2 = p.handler.SetCloud(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing SetCloud: "+err2.Error()) + oprot.WriteMessageBegin("SetCloud", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -22600,7 +24095,7 @@ func (p *urlServiceProcessorFZUHelperHTML) Process(ctx context.Context, seqId in } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("FZUHelperHTML", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("SetCloud", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -22618,16 +24113,16 @@ func (p *urlServiceProcessorFZUHelperHTML) Process(ctx context.Context, seqId in return true, err } -type urlServiceProcessorUserAgreementHTML struct { - handler UrlService +type versionServiceProcessorGetDump struct { + handler VersionService } -func (p *urlServiceProcessorUserAgreementHTML) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := UrlServiceUserAgreementHTMLArgs{} +func (p *versionServiceProcessorGetDump) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := VersionServiceGetDumpArgs{} if err = args.Read(iprot); err != nil { iprot.ReadMessageEnd() x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("UserAgreementHTML", thrift.EXCEPTION, seqId) + oprot.WriteMessageBegin("GetDump", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -22636,11 +24131,11 @@ func (p *urlServiceProcessorUserAgreementHTML) Process(ctx context.Context, seqI iprot.ReadMessageEnd() var err2 error - result := UrlServiceUserAgreementHTMLResult{} - var retval *UserAgreementHTMLResponse - if retval, err2 = p.handler.UserAgreementHTML(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing UserAgreementHTML: "+err2.Error()) - oprot.WriteMessageBegin("UserAgreementHTML", thrift.EXCEPTION, seqId) + result := VersionServiceGetDumpResult{} + var retval *GetDumpResponse + if retval, err2 = p.handler.GetDump(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetDump: "+err2.Error()) + oprot.WriteMessageBegin("GetDump", thrift.EXCEPTION, seqId) x.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) @@ -22648,7 +24143,7 @@ func (p *urlServiceProcessorUserAgreementHTML) Process(ctx context.Context, seqI } else { result.Success = retval } - if err2 = oprot.WriteMessageBegin("UserAgreementHTML", thrift.REPLY, seqId); err2 != nil { + if err2 = oprot.WriteMessageBegin("GetDump", thrift.REPLY, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { @@ -22666,35 +24161,35 @@ func (p *urlServiceProcessorUserAgreementHTML) Process(ctx context.Context, seqI return true, err } -type UrlServiceAPILoginArgs struct { - Req *APILoginRequest `thrift:"req,1"` +type VersionServiceLoginArgs struct { + Req *LoginRequest `thrift:"req,1"` } -func NewUrlServiceAPILoginArgs() *UrlServiceAPILoginArgs { - return &UrlServiceAPILoginArgs{} +func NewVersionServiceLoginArgs() *VersionServiceLoginArgs { + return &VersionServiceLoginArgs{} } -func (p *UrlServiceAPILoginArgs) InitDefault() { +func (p *VersionServiceLoginArgs) InitDefault() { } -var UrlServiceAPILoginArgs_Req_DEFAULT *APILoginRequest +var VersionServiceLoginArgs_Req_DEFAULT *LoginRequest -func (p *UrlServiceAPILoginArgs) GetReq() (v *APILoginRequest) { +func (p *VersionServiceLoginArgs) GetReq() (v *LoginRequest) { if !p.IsSetReq() { - return UrlServiceAPILoginArgs_Req_DEFAULT + return VersionServiceLoginArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_UrlServiceAPILoginArgs = map[int16]string{ +var fieldIDToName_VersionServiceLoginArgs = map[int16]string{ 1: "req", } -func (p *UrlServiceAPILoginArgs) IsSetReq() bool { +func (p *VersionServiceLoginArgs) IsSetReq() bool { return p.Req != nil } -func (p *UrlServiceAPILoginArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceLoginArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -22740,7 +24235,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_UrlServiceAPILoginArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceLoginArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -22750,8 +24245,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceAPILoginArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewAPILoginRequest() +func (p *VersionServiceLoginArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewLoginRequest() if err := _field.Read(iprot); err != nil { return err } @@ -22759,10 +24254,10 @@ func (p *UrlServiceAPILoginArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *UrlServiceAPILoginArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceLoginArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("APILogin_args"); err != nil { + if err = oprot.WriteStructBegin("Login_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -22788,7 +24283,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceAPILoginArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceLoginArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -22805,43 +24300,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UrlServiceAPILoginArgs) String() string { +func (p *VersionServiceLoginArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceAPILoginArgs(%+v)", *p) + return fmt.Sprintf("VersionServiceLoginArgs(%+v)", *p) } -type UrlServiceAPILoginResult struct { - Success *APILoginResponse `thrift:"success,0,optional"` +type VersionServiceLoginResult struct { + Success *LoginResponse `thrift:"success,0,optional"` } -func NewUrlServiceAPILoginResult() *UrlServiceAPILoginResult { - return &UrlServiceAPILoginResult{} +func NewVersionServiceLoginResult() *VersionServiceLoginResult { + return &VersionServiceLoginResult{} } -func (p *UrlServiceAPILoginResult) InitDefault() { +func (p *VersionServiceLoginResult) InitDefault() { } -var UrlServiceAPILoginResult_Success_DEFAULT *APILoginResponse +var VersionServiceLoginResult_Success_DEFAULT *LoginResponse -func (p *UrlServiceAPILoginResult) GetSuccess() (v *APILoginResponse) { +func (p *VersionServiceLoginResult) GetSuccess() (v *LoginResponse) { if !p.IsSetSuccess() { - return UrlServiceAPILoginResult_Success_DEFAULT + return VersionServiceLoginResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UrlServiceAPILoginResult = map[int16]string{ +var fieldIDToName_VersionServiceLoginResult = map[int16]string{ 0: "success", } -func (p *UrlServiceAPILoginResult) IsSetSuccess() bool { +func (p *VersionServiceLoginResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UrlServiceAPILoginResult) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceLoginResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -22887,7 +24382,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_UrlServiceAPILoginResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceLoginResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -22897,8 +24392,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceAPILoginResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewAPILoginResponse() +func (p *VersionServiceLoginResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewLoginResponse() if err := _field.Read(iprot); err != nil { return err } @@ -22906,10 +24401,10 @@ func (p *UrlServiceAPILoginResult) ReadField0(iprot thrift.TProtocol) error { return nil } -func (p *UrlServiceAPILoginResult) Write(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceLoginResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("APILogin_result"); err != nil { + if err = oprot.WriteStructBegin("Login_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -22935,7 +24430,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceAPILoginResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceLoginResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -22954,43 +24449,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UrlServiceAPILoginResult) String() string { +func (p *VersionServiceLoginResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceAPILoginResult(%+v)", *p) + return fmt.Sprintf("VersionServiceLoginResult(%+v)", *p) } -type UrlServiceUploadVersionInfoArgs struct { - Req *UploadVersionInfoRequest `thrift:"req,1"` +type VersionServiceUploadVersionArgs struct { + Req *UploadRequest `thrift:"req,1"` } -func NewUrlServiceUploadVersionInfoArgs() *UrlServiceUploadVersionInfoArgs { - return &UrlServiceUploadVersionInfoArgs{} +func NewVersionServiceUploadVersionArgs() *VersionServiceUploadVersionArgs { + return &VersionServiceUploadVersionArgs{} } -func (p *UrlServiceUploadVersionInfoArgs) InitDefault() { +func (p *VersionServiceUploadVersionArgs) InitDefault() { } -var UrlServiceUploadVersionInfoArgs_Req_DEFAULT *UploadVersionInfoRequest +var VersionServiceUploadVersionArgs_Req_DEFAULT *UploadRequest -func (p *UrlServiceUploadVersionInfoArgs) GetReq() (v *UploadVersionInfoRequest) { +func (p *VersionServiceUploadVersionArgs) GetReq() (v *UploadRequest) { if !p.IsSetReq() { - return UrlServiceUploadVersionInfoArgs_Req_DEFAULT + return VersionServiceUploadVersionArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_UrlServiceUploadVersionInfoArgs = map[int16]string{ +var fieldIDToName_VersionServiceUploadVersionArgs = map[int16]string{ 1: "req", } -func (p *UrlServiceUploadVersionInfoArgs) IsSetReq() bool { +func (p *VersionServiceUploadVersionArgs) IsSetReq() bool { return p.Req != nil } -func (p *UrlServiceUploadVersionInfoArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceUploadVersionArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -23036,7 +24531,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_UrlServiceUploadVersionInfoArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceUploadVersionArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -23046,8 +24541,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceUploadVersionInfoArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewUploadVersionInfoRequest() +func (p *VersionServiceUploadVersionArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewUploadRequest() if err := _field.Read(iprot); err != nil { return err } @@ -23055,10 +24550,10 @@ func (p *UrlServiceUploadVersionInfoArgs) ReadField1(iprot thrift.TProtocol) err return nil } -func (p *UrlServiceUploadVersionInfoArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceUploadVersionArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("UploadVersionInfo_args"); err != nil { + if err = oprot.WriteStructBegin("UploadVersion_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -23084,7 +24579,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceUploadVersionInfoArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceUploadVersionArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -23101,43 +24596,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UrlServiceUploadVersionInfoArgs) String() string { +func (p *VersionServiceUploadVersionArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceUploadVersionInfoArgs(%+v)", *p) + return fmt.Sprintf("VersionServiceUploadVersionArgs(%+v)", *p) } -type UrlServiceUploadVersionInfoResult struct { - Success *UploadVersionInfoResponse `thrift:"success,0,optional"` +type VersionServiceUploadVersionResult struct { + Success *UploadResponse `thrift:"success,0,optional"` } -func NewUrlServiceUploadVersionInfoResult() *UrlServiceUploadVersionInfoResult { - return &UrlServiceUploadVersionInfoResult{} +func NewVersionServiceUploadVersionResult() *VersionServiceUploadVersionResult { + return &VersionServiceUploadVersionResult{} } -func (p *UrlServiceUploadVersionInfoResult) InitDefault() { +func (p *VersionServiceUploadVersionResult) InitDefault() { } -var UrlServiceUploadVersionInfoResult_Success_DEFAULT *UploadVersionInfoResponse +var VersionServiceUploadVersionResult_Success_DEFAULT *UploadResponse -func (p *UrlServiceUploadVersionInfoResult) GetSuccess() (v *UploadVersionInfoResponse) { +func (p *VersionServiceUploadVersionResult) GetSuccess() (v *UploadResponse) { if !p.IsSetSuccess() { - return UrlServiceUploadVersionInfoResult_Success_DEFAULT + return VersionServiceUploadVersionResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UrlServiceUploadVersionInfoResult = map[int16]string{ +var fieldIDToName_VersionServiceUploadVersionResult = map[int16]string{ 0: "success", } -func (p *UrlServiceUploadVersionInfoResult) IsSetSuccess() bool { +func (p *VersionServiceUploadVersionResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UrlServiceUploadVersionInfoResult) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceUploadVersionResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -23183,7 +24678,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_UrlServiceUploadVersionInfoResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceUploadVersionResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -23193,8 +24688,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceUploadVersionInfoResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewUploadVersionInfoResponse() +func (p *VersionServiceUploadVersionResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewUploadResponse() if err := _field.Read(iprot); err != nil { return err } @@ -23202,10 +24697,10 @@ func (p *UrlServiceUploadVersionInfoResult) ReadField0(iprot thrift.TProtocol) e return nil } -func (p *UrlServiceUploadVersionInfoResult) Write(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceUploadVersionResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("UploadVersionInfo_result"); err != nil { + if err = oprot.WriteStructBegin("UploadVersion_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -23231,7 +24726,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceUploadVersionInfoResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceUploadVersionResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -23250,43 +24745,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UrlServiceUploadVersionInfoResult) String() string { +func (p *VersionServiceUploadVersionResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceUploadVersionInfoResult(%+v)", *p) + return fmt.Sprintf("VersionServiceUploadVersionResult(%+v)", *p) } -type UrlServiceGetUploadParamsArgs struct { - Req *GetUploadParamsRequest `thrift:"req,1"` +type VersionServiceUploadParamsArgs struct { + Req *UploadParamsRequest `thrift:"req,1"` } -func NewUrlServiceGetUploadParamsArgs() *UrlServiceGetUploadParamsArgs { - return &UrlServiceGetUploadParamsArgs{} +func NewVersionServiceUploadParamsArgs() *VersionServiceUploadParamsArgs { + return &VersionServiceUploadParamsArgs{} } -func (p *UrlServiceGetUploadParamsArgs) InitDefault() { +func (p *VersionServiceUploadParamsArgs) InitDefault() { } -var UrlServiceGetUploadParamsArgs_Req_DEFAULT *GetUploadParamsRequest +var VersionServiceUploadParamsArgs_Req_DEFAULT *UploadParamsRequest -func (p *UrlServiceGetUploadParamsArgs) GetReq() (v *GetUploadParamsRequest) { +func (p *VersionServiceUploadParamsArgs) GetReq() (v *UploadParamsRequest) { if !p.IsSetReq() { - return UrlServiceGetUploadParamsArgs_Req_DEFAULT + return VersionServiceUploadParamsArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_UrlServiceGetUploadParamsArgs = map[int16]string{ +var fieldIDToName_VersionServiceUploadParamsArgs = map[int16]string{ 1: "req", } -func (p *UrlServiceGetUploadParamsArgs) IsSetReq() bool { +func (p *VersionServiceUploadParamsArgs) IsSetReq() bool { return p.Req != nil } -func (p *UrlServiceGetUploadParamsArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceUploadParamsArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -23332,7 +24827,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_UrlServiceGetUploadParamsArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceUploadParamsArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -23342,8 +24837,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceGetUploadParamsArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetUploadParamsRequest() +func (p *VersionServiceUploadParamsArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewUploadParamsRequest() if err := _field.Read(iprot); err != nil { return err } @@ -23351,10 +24846,10 @@ func (p *UrlServiceGetUploadParamsArgs) ReadField1(iprot thrift.TProtocol) error return nil } -func (p *UrlServiceGetUploadParamsArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceUploadParamsArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetUploadParams_args"); err != nil { + if err = oprot.WriteStructBegin("UploadParams_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -23380,7 +24875,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceGetUploadParamsArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceUploadParamsArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -23397,43 +24892,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UrlServiceGetUploadParamsArgs) String() string { +func (p *VersionServiceUploadParamsArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceGetUploadParamsArgs(%+v)", *p) + return fmt.Sprintf("VersionServiceUploadParamsArgs(%+v)", *p) } -type UrlServiceGetUploadParamsResult struct { - Success *GetUploadParamsResponse `thrift:"success,0,optional"` +type VersionServiceUploadParamsResult struct { + Success *UploadParamsResponse `thrift:"success,0,optional"` } -func NewUrlServiceGetUploadParamsResult() *UrlServiceGetUploadParamsResult { - return &UrlServiceGetUploadParamsResult{} +func NewVersionServiceUploadParamsResult() *VersionServiceUploadParamsResult { + return &VersionServiceUploadParamsResult{} } -func (p *UrlServiceGetUploadParamsResult) InitDefault() { +func (p *VersionServiceUploadParamsResult) InitDefault() { } -var UrlServiceGetUploadParamsResult_Success_DEFAULT *GetUploadParamsResponse +var VersionServiceUploadParamsResult_Success_DEFAULT *UploadParamsResponse -func (p *UrlServiceGetUploadParamsResult) GetSuccess() (v *GetUploadParamsResponse) { +func (p *VersionServiceUploadParamsResult) GetSuccess() (v *UploadParamsResponse) { if !p.IsSetSuccess() { - return UrlServiceGetUploadParamsResult_Success_DEFAULT + return VersionServiceUploadParamsResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UrlServiceGetUploadParamsResult = map[int16]string{ +var fieldIDToName_VersionServiceUploadParamsResult = map[int16]string{ 0: "success", } -func (p *UrlServiceGetUploadParamsResult) IsSetSuccess() bool { +func (p *VersionServiceUploadParamsResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UrlServiceGetUploadParamsResult) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceUploadParamsResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -23479,7 +24974,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_UrlServiceGetUploadParamsResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceUploadParamsResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -23489,8 +24984,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceGetUploadParamsResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetUploadParamsResponse() +func (p *VersionServiceUploadParamsResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewUploadParamsResponse() if err := _field.Read(iprot); err != nil { return err } @@ -23498,10 +24993,10 @@ func (p *UrlServiceGetUploadParamsResult) ReadField0(iprot thrift.TProtocol) err return nil } -func (p *UrlServiceGetUploadParamsResult) Write(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceUploadParamsResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetUploadParams_result"); err != nil { + if err = oprot.WriteStructBegin("UploadParams_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -23527,7 +25022,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceGetUploadParamsResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceUploadParamsResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -23546,43 +25041,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UrlServiceGetUploadParamsResult) String() string { +func (p *VersionServiceUploadParamsResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceGetUploadParamsResult(%+v)", *p) + return fmt.Sprintf("VersionServiceUploadParamsResult(%+v)", *p) } -type UrlServiceGetDownloadReleaseArgs struct { - Req *GetDownloadReleaseRequest `thrift:"req,1"` +type VersionServiceDownloadReleaseApkArgs struct { + Req *DownloadReleaseApkRequest `thrift:"req,1"` } -func NewUrlServiceGetDownloadReleaseArgs() *UrlServiceGetDownloadReleaseArgs { - return &UrlServiceGetDownloadReleaseArgs{} +func NewVersionServiceDownloadReleaseApkArgs() *VersionServiceDownloadReleaseApkArgs { + return &VersionServiceDownloadReleaseApkArgs{} } -func (p *UrlServiceGetDownloadReleaseArgs) InitDefault() { +func (p *VersionServiceDownloadReleaseApkArgs) InitDefault() { } -var UrlServiceGetDownloadReleaseArgs_Req_DEFAULT *GetDownloadReleaseRequest +var VersionServiceDownloadReleaseApkArgs_Req_DEFAULT *DownloadReleaseApkRequest -func (p *UrlServiceGetDownloadReleaseArgs) GetReq() (v *GetDownloadReleaseRequest) { +func (p *VersionServiceDownloadReleaseApkArgs) GetReq() (v *DownloadReleaseApkRequest) { if !p.IsSetReq() { - return UrlServiceGetDownloadReleaseArgs_Req_DEFAULT + return VersionServiceDownloadReleaseApkArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_UrlServiceGetDownloadReleaseArgs = map[int16]string{ +var fieldIDToName_VersionServiceDownloadReleaseApkArgs = map[int16]string{ 1: "req", } -func (p *UrlServiceGetDownloadReleaseArgs) IsSetReq() bool { +func (p *VersionServiceDownloadReleaseApkArgs) IsSetReq() bool { return p.Req != nil } -func (p *UrlServiceGetDownloadReleaseArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceDownloadReleaseApkArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -23628,7 +25123,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_UrlServiceGetDownloadReleaseArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceDownloadReleaseApkArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -23638,8 +25133,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceGetDownloadReleaseArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetDownloadReleaseRequest() +func (p *VersionServiceDownloadReleaseApkArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewDownloadReleaseApkRequest() if err := _field.Read(iprot); err != nil { return err } @@ -23647,10 +25142,10 @@ func (p *UrlServiceGetDownloadReleaseArgs) ReadField1(iprot thrift.TProtocol) er return nil } -func (p *UrlServiceGetDownloadReleaseArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceDownloadReleaseApkArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetDownloadRelease_args"); err != nil { + if err = oprot.WriteStructBegin("DownloadReleaseApk_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -23676,7 +25171,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceGetDownloadReleaseArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceDownloadReleaseApkArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -23693,43 +25188,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UrlServiceGetDownloadReleaseArgs) String() string { +func (p *VersionServiceDownloadReleaseApkArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceGetDownloadReleaseArgs(%+v)", *p) + return fmt.Sprintf("VersionServiceDownloadReleaseApkArgs(%+v)", *p) } -type UrlServiceGetDownloadReleaseResult struct { - Success *GetDownloadReleaseResponse `thrift:"success,0,optional"` +type VersionServiceDownloadReleaseApkResult struct { + Success *DownloadReleaseApkResponse `thrift:"success,0,optional"` } -func NewUrlServiceGetDownloadReleaseResult() *UrlServiceGetDownloadReleaseResult { - return &UrlServiceGetDownloadReleaseResult{} +func NewVersionServiceDownloadReleaseApkResult() *VersionServiceDownloadReleaseApkResult { + return &VersionServiceDownloadReleaseApkResult{} } -func (p *UrlServiceGetDownloadReleaseResult) InitDefault() { +func (p *VersionServiceDownloadReleaseApkResult) InitDefault() { } -var UrlServiceGetDownloadReleaseResult_Success_DEFAULT *GetDownloadReleaseResponse +var VersionServiceDownloadReleaseApkResult_Success_DEFAULT *DownloadReleaseApkResponse -func (p *UrlServiceGetDownloadReleaseResult) GetSuccess() (v *GetDownloadReleaseResponse) { +func (p *VersionServiceDownloadReleaseApkResult) GetSuccess() (v *DownloadReleaseApkResponse) { if !p.IsSetSuccess() { - return UrlServiceGetDownloadReleaseResult_Success_DEFAULT + return VersionServiceDownloadReleaseApkResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UrlServiceGetDownloadReleaseResult = map[int16]string{ +var fieldIDToName_VersionServiceDownloadReleaseApkResult = map[int16]string{ 0: "success", } -func (p *UrlServiceGetDownloadReleaseResult) IsSetSuccess() bool { +func (p *VersionServiceDownloadReleaseApkResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UrlServiceGetDownloadReleaseResult) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceDownloadReleaseApkResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -23775,7 +25270,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_UrlServiceGetDownloadReleaseResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceDownloadReleaseApkResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -23785,8 +25280,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceGetDownloadReleaseResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetDownloadReleaseResponse() +func (p *VersionServiceDownloadReleaseApkResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewDownloadReleaseApkResponse() if err := _field.Read(iprot); err != nil { return err } @@ -23794,10 +25289,10 @@ func (p *UrlServiceGetDownloadReleaseResult) ReadField0(iprot thrift.TProtocol) return nil } -func (p *UrlServiceGetDownloadReleaseResult) Write(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceDownloadReleaseApkResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetDownloadRelease_result"); err != nil { + if err = oprot.WriteStructBegin("DownloadReleaseApk_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -23823,7 +25318,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceGetDownloadReleaseResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceDownloadReleaseApkResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -23842,43 +25337,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UrlServiceGetDownloadReleaseResult) String() string { +func (p *VersionServiceDownloadReleaseApkResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceGetDownloadReleaseResult(%+v)", *p) + return fmt.Sprintf("VersionServiceDownloadReleaseApkResult(%+v)", *p) } -type UrlServiceGetDownloadBetaArgs struct { - Req *GetDownloadBetaRequest `thrift:"req,1"` +type VersionServiceDownloadBetaApkArgs struct { + Req *DownloadBetaApkRequest `thrift:"req,1"` } -func NewUrlServiceGetDownloadBetaArgs() *UrlServiceGetDownloadBetaArgs { - return &UrlServiceGetDownloadBetaArgs{} +func NewVersionServiceDownloadBetaApkArgs() *VersionServiceDownloadBetaApkArgs { + return &VersionServiceDownloadBetaApkArgs{} } -func (p *UrlServiceGetDownloadBetaArgs) InitDefault() { +func (p *VersionServiceDownloadBetaApkArgs) InitDefault() { } -var UrlServiceGetDownloadBetaArgs_Req_DEFAULT *GetDownloadBetaRequest +var VersionServiceDownloadBetaApkArgs_Req_DEFAULT *DownloadBetaApkRequest -func (p *UrlServiceGetDownloadBetaArgs) GetReq() (v *GetDownloadBetaRequest) { +func (p *VersionServiceDownloadBetaApkArgs) GetReq() (v *DownloadBetaApkRequest) { if !p.IsSetReq() { - return UrlServiceGetDownloadBetaArgs_Req_DEFAULT + return VersionServiceDownloadBetaApkArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_UrlServiceGetDownloadBetaArgs = map[int16]string{ +var fieldIDToName_VersionServiceDownloadBetaApkArgs = map[int16]string{ 1: "req", } -func (p *UrlServiceGetDownloadBetaArgs) IsSetReq() bool { +func (p *VersionServiceDownloadBetaApkArgs) IsSetReq() bool { return p.Req != nil } -func (p *UrlServiceGetDownloadBetaArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceDownloadBetaApkArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -23924,7 +25419,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_UrlServiceGetDownloadBetaArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceDownloadBetaApkArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -23934,8 +25429,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceGetDownloadBetaArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetDownloadBetaRequest() +func (p *VersionServiceDownloadBetaApkArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewDownloadBetaApkRequest() if err := _field.Read(iprot); err != nil { return err } @@ -23943,10 +25438,10 @@ func (p *UrlServiceGetDownloadBetaArgs) ReadField1(iprot thrift.TProtocol) error return nil } -func (p *UrlServiceGetDownloadBetaArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceDownloadBetaApkArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetDownloadBeta_args"); err != nil { + if err = oprot.WriteStructBegin("DownloadBetaApk_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -23972,7 +25467,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceGetDownloadBetaArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceDownloadBetaApkArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -23989,43 +25484,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UrlServiceGetDownloadBetaArgs) String() string { +func (p *VersionServiceDownloadBetaApkArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceGetDownloadBetaArgs(%+v)", *p) + return fmt.Sprintf("VersionServiceDownloadBetaApkArgs(%+v)", *p) } -type UrlServiceGetDownloadBetaResult struct { - Success *GetDownloadBetaResponse `thrift:"success,0,optional"` +type VersionServiceDownloadBetaApkResult struct { + Success *DownloadBetaApkResponse `thrift:"success,0,optional"` } -func NewUrlServiceGetDownloadBetaResult() *UrlServiceGetDownloadBetaResult { - return &UrlServiceGetDownloadBetaResult{} +func NewVersionServiceDownloadBetaApkResult() *VersionServiceDownloadBetaApkResult { + return &VersionServiceDownloadBetaApkResult{} } -func (p *UrlServiceGetDownloadBetaResult) InitDefault() { +func (p *VersionServiceDownloadBetaApkResult) InitDefault() { } -var UrlServiceGetDownloadBetaResult_Success_DEFAULT *GetDownloadBetaResponse +var VersionServiceDownloadBetaApkResult_Success_DEFAULT *DownloadBetaApkResponse -func (p *UrlServiceGetDownloadBetaResult) GetSuccess() (v *GetDownloadBetaResponse) { +func (p *VersionServiceDownloadBetaApkResult) GetSuccess() (v *DownloadBetaApkResponse) { if !p.IsSetSuccess() { - return UrlServiceGetDownloadBetaResult_Success_DEFAULT + return VersionServiceDownloadBetaApkResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UrlServiceGetDownloadBetaResult = map[int16]string{ +var fieldIDToName_VersionServiceDownloadBetaApkResult = map[int16]string{ 0: "success", } -func (p *UrlServiceGetDownloadBetaResult) IsSetSuccess() bool { +func (p *VersionServiceDownloadBetaApkResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UrlServiceGetDownloadBetaResult) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceDownloadBetaApkResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -24071,7 +25566,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_UrlServiceGetDownloadBetaResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceDownloadBetaApkResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -24081,8 +25576,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceGetDownloadBetaResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetDownloadBetaResponse() +func (p *VersionServiceDownloadBetaApkResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewDownloadBetaApkResponse() if err := _field.Read(iprot); err != nil { return err } @@ -24090,10 +25585,10 @@ func (p *UrlServiceGetDownloadBetaResult) ReadField0(iprot thrift.TProtocol) err return nil } -func (p *UrlServiceGetDownloadBetaResult) Write(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceDownloadBetaApkResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetDownloadBeta_result"); err != nil { + if err = oprot.WriteStructBegin("DownloadBetaApk_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -24119,7 +25614,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceGetDownloadBetaResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceDownloadBetaApkResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -24138,43 +25633,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UrlServiceGetDownloadBetaResult) String() string { +func (p *VersionServiceDownloadBetaApkResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceGetDownloadBetaResult(%+v)", *p) + return fmt.Sprintf("VersionServiceDownloadBetaApkResult(%+v)", *p) } -type UrlServiceGetReleaseVersionArgs struct { +type VersionServiceGetReleaseVersionArgs struct { Req *GetReleaseVersionRequest `thrift:"req,1"` } -func NewUrlServiceGetReleaseVersionArgs() *UrlServiceGetReleaseVersionArgs { - return &UrlServiceGetReleaseVersionArgs{} +func NewVersionServiceGetReleaseVersionArgs() *VersionServiceGetReleaseVersionArgs { + return &VersionServiceGetReleaseVersionArgs{} } -func (p *UrlServiceGetReleaseVersionArgs) InitDefault() { +func (p *VersionServiceGetReleaseVersionArgs) InitDefault() { } -var UrlServiceGetReleaseVersionArgs_Req_DEFAULT *GetReleaseVersionRequest +var VersionServiceGetReleaseVersionArgs_Req_DEFAULT *GetReleaseVersionRequest -func (p *UrlServiceGetReleaseVersionArgs) GetReq() (v *GetReleaseVersionRequest) { +func (p *VersionServiceGetReleaseVersionArgs) GetReq() (v *GetReleaseVersionRequest) { if !p.IsSetReq() { - return UrlServiceGetReleaseVersionArgs_Req_DEFAULT + return VersionServiceGetReleaseVersionArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_UrlServiceGetReleaseVersionArgs = map[int16]string{ +var fieldIDToName_VersionServiceGetReleaseVersionArgs = map[int16]string{ 1: "req", } -func (p *UrlServiceGetReleaseVersionArgs) IsSetReq() bool { +func (p *VersionServiceGetReleaseVersionArgs) IsSetReq() bool { return p.Req != nil } -func (p *UrlServiceGetReleaseVersionArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetReleaseVersionArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -24220,7 +25715,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_UrlServiceGetReleaseVersionArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetReleaseVersionArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -24230,7 +25725,7 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceGetReleaseVersionArgs) ReadField1(iprot thrift.TProtocol) error { +func (p *VersionServiceGetReleaseVersionArgs) ReadField1(iprot thrift.TProtocol) error { _field := NewGetReleaseVersionRequest() if err := _field.Read(iprot); err != nil { return err @@ -24239,7 +25734,7 @@ func (p *UrlServiceGetReleaseVersionArgs) ReadField1(iprot thrift.TProtocol) err return nil } -func (p *UrlServiceGetReleaseVersionArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetReleaseVersionArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 if err = oprot.WriteStructBegin("GetReleaseVersion_args"); err != nil { @@ -24268,7 +25763,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceGetReleaseVersionArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetReleaseVersionArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -24285,43 +25780,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UrlServiceGetReleaseVersionArgs) String() string { +func (p *VersionServiceGetReleaseVersionArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceGetReleaseVersionArgs(%+v)", *p) + return fmt.Sprintf("VersionServiceGetReleaseVersionArgs(%+v)", *p) } -type UrlServiceGetReleaseVersionResult struct { +type VersionServiceGetReleaseVersionResult struct { Success *GetReleaseVersionResponse `thrift:"success,0,optional"` } -func NewUrlServiceGetReleaseVersionResult() *UrlServiceGetReleaseVersionResult { - return &UrlServiceGetReleaseVersionResult{} +func NewVersionServiceGetReleaseVersionResult() *VersionServiceGetReleaseVersionResult { + return &VersionServiceGetReleaseVersionResult{} } -func (p *UrlServiceGetReleaseVersionResult) InitDefault() { +func (p *VersionServiceGetReleaseVersionResult) InitDefault() { } -var UrlServiceGetReleaseVersionResult_Success_DEFAULT *GetReleaseVersionResponse +var VersionServiceGetReleaseVersionResult_Success_DEFAULT *GetReleaseVersionResponse -func (p *UrlServiceGetReleaseVersionResult) GetSuccess() (v *GetReleaseVersionResponse) { +func (p *VersionServiceGetReleaseVersionResult) GetSuccess() (v *GetReleaseVersionResponse) { if !p.IsSetSuccess() { - return UrlServiceGetReleaseVersionResult_Success_DEFAULT + return VersionServiceGetReleaseVersionResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UrlServiceGetReleaseVersionResult = map[int16]string{ +var fieldIDToName_VersionServiceGetReleaseVersionResult = map[int16]string{ 0: "success", } -func (p *UrlServiceGetReleaseVersionResult) IsSetSuccess() bool { +func (p *VersionServiceGetReleaseVersionResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UrlServiceGetReleaseVersionResult) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetReleaseVersionResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -24367,7 +25862,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_UrlServiceGetReleaseVersionResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetReleaseVersionResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -24377,7 +25872,7 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceGetReleaseVersionResult) ReadField0(iprot thrift.TProtocol) error { +func (p *VersionServiceGetReleaseVersionResult) ReadField0(iprot thrift.TProtocol) error { _field := NewGetReleaseVersionResponse() if err := _field.Read(iprot); err != nil { return err @@ -24386,7 +25881,7 @@ func (p *UrlServiceGetReleaseVersionResult) ReadField0(iprot thrift.TProtocol) e return nil } -func (p *UrlServiceGetReleaseVersionResult) Write(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetReleaseVersionResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 if err = oprot.WriteStructBegin("GetReleaseVersion_result"); err != nil { @@ -24415,7 +25910,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceGetReleaseVersionResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetReleaseVersionResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -24434,43 +25929,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UrlServiceGetReleaseVersionResult) String() string { +func (p *VersionServiceGetReleaseVersionResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceGetReleaseVersionResult(%+v)", *p) + return fmt.Sprintf("VersionServiceGetReleaseVersionResult(%+v)", *p) } -type UrlServiceGetBetaVersionArgs struct { +type VersionServiceGetBetaVersionArgs struct { Req *GetBetaVersionRequest `thrift:"req,1"` } -func NewUrlServiceGetBetaVersionArgs() *UrlServiceGetBetaVersionArgs { - return &UrlServiceGetBetaVersionArgs{} +func NewVersionServiceGetBetaVersionArgs() *VersionServiceGetBetaVersionArgs { + return &VersionServiceGetBetaVersionArgs{} } -func (p *UrlServiceGetBetaVersionArgs) InitDefault() { +func (p *VersionServiceGetBetaVersionArgs) InitDefault() { } -var UrlServiceGetBetaVersionArgs_Req_DEFAULT *GetBetaVersionRequest +var VersionServiceGetBetaVersionArgs_Req_DEFAULT *GetBetaVersionRequest -func (p *UrlServiceGetBetaVersionArgs) GetReq() (v *GetBetaVersionRequest) { +func (p *VersionServiceGetBetaVersionArgs) GetReq() (v *GetBetaVersionRequest) { if !p.IsSetReq() { - return UrlServiceGetBetaVersionArgs_Req_DEFAULT + return VersionServiceGetBetaVersionArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_UrlServiceGetBetaVersionArgs = map[int16]string{ +var fieldIDToName_VersionServiceGetBetaVersionArgs = map[int16]string{ 1: "req", } -func (p *UrlServiceGetBetaVersionArgs) IsSetReq() bool { +func (p *VersionServiceGetBetaVersionArgs) IsSetReq() bool { return p.Req != nil } -func (p *UrlServiceGetBetaVersionArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetBetaVersionArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -24516,7 +26011,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_UrlServiceGetBetaVersionArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetBetaVersionArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -24526,7 +26021,7 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceGetBetaVersionArgs) ReadField1(iprot thrift.TProtocol) error { +func (p *VersionServiceGetBetaVersionArgs) ReadField1(iprot thrift.TProtocol) error { _field := NewGetBetaVersionRequest() if err := _field.Read(iprot); err != nil { return err @@ -24535,7 +26030,7 @@ func (p *UrlServiceGetBetaVersionArgs) ReadField1(iprot thrift.TProtocol) error return nil } -func (p *UrlServiceGetBetaVersionArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetBetaVersionArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 if err = oprot.WriteStructBegin("GetBetaVersion_args"); err != nil { @@ -24564,7 +26059,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceGetBetaVersionArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetBetaVersionArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -24581,43 +26076,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UrlServiceGetBetaVersionArgs) String() string { +func (p *VersionServiceGetBetaVersionArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceGetBetaVersionArgs(%+v)", *p) + return fmt.Sprintf("VersionServiceGetBetaVersionArgs(%+v)", *p) } -type UrlServiceGetBetaVersionResult struct { +type VersionServiceGetBetaVersionResult struct { Success *GetBetaVersionResponse `thrift:"success,0,optional"` } -func NewUrlServiceGetBetaVersionResult() *UrlServiceGetBetaVersionResult { - return &UrlServiceGetBetaVersionResult{} +func NewVersionServiceGetBetaVersionResult() *VersionServiceGetBetaVersionResult { + return &VersionServiceGetBetaVersionResult{} } -func (p *UrlServiceGetBetaVersionResult) InitDefault() { +func (p *VersionServiceGetBetaVersionResult) InitDefault() { } -var UrlServiceGetBetaVersionResult_Success_DEFAULT *GetBetaVersionResponse +var VersionServiceGetBetaVersionResult_Success_DEFAULT *GetBetaVersionResponse -func (p *UrlServiceGetBetaVersionResult) GetSuccess() (v *GetBetaVersionResponse) { +func (p *VersionServiceGetBetaVersionResult) GetSuccess() (v *GetBetaVersionResponse) { if !p.IsSetSuccess() { - return UrlServiceGetBetaVersionResult_Success_DEFAULT + return VersionServiceGetBetaVersionResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UrlServiceGetBetaVersionResult = map[int16]string{ +var fieldIDToName_VersionServiceGetBetaVersionResult = map[int16]string{ 0: "success", } -func (p *UrlServiceGetBetaVersionResult) IsSetSuccess() bool { +func (p *VersionServiceGetBetaVersionResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UrlServiceGetBetaVersionResult) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetBetaVersionResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -24663,7 +26158,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_UrlServiceGetBetaVersionResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetBetaVersionResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -24673,7 +26168,7 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceGetBetaVersionResult) ReadField0(iprot thrift.TProtocol) error { +func (p *VersionServiceGetBetaVersionResult) ReadField0(iprot thrift.TProtocol) error { _field := NewGetBetaVersionResponse() if err := _field.Read(iprot); err != nil { return err @@ -24682,7 +26177,7 @@ func (p *UrlServiceGetBetaVersionResult) ReadField0(iprot thrift.TProtocol) erro return nil } -func (p *UrlServiceGetBetaVersionResult) Write(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetBetaVersionResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 if err = oprot.WriteStructBegin("GetBetaVersion_result"); err != nil { @@ -24711,7 +26206,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceGetBetaVersionResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetBetaVersionResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -24730,43 +26225,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UrlServiceGetBetaVersionResult) String() string { +func (p *VersionServiceGetBetaVersionResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceGetBetaVersionResult(%+v)", *p) + return fmt.Sprintf("VersionServiceGetBetaVersionResult(%+v)", *p) } -type UrlServiceGetCloudSettingArgs struct { - Req *GetCloudSettingRequest `thrift:"req,1"` +type VersionServiceGetSettingArgs struct { + Req *GetSettingRequest `thrift:"req,1"` } -func NewUrlServiceGetCloudSettingArgs() *UrlServiceGetCloudSettingArgs { - return &UrlServiceGetCloudSettingArgs{} +func NewVersionServiceGetSettingArgs() *VersionServiceGetSettingArgs { + return &VersionServiceGetSettingArgs{} } -func (p *UrlServiceGetCloudSettingArgs) InitDefault() { +func (p *VersionServiceGetSettingArgs) InitDefault() { } -var UrlServiceGetCloudSettingArgs_Req_DEFAULT *GetCloudSettingRequest +var VersionServiceGetSettingArgs_Req_DEFAULT *GetSettingRequest -func (p *UrlServiceGetCloudSettingArgs) GetReq() (v *GetCloudSettingRequest) { +func (p *VersionServiceGetSettingArgs) GetReq() (v *GetSettingRequest) { if !p.IsSetReq() { - return UrlServiceGetCloudSettingArgs_Req_DEFAULT + return VersionServiceGetSettingArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_UrlServiceGetCloudSettingArgs = map[int16]string{ +var fieldIDToName_VersionServiceGetSettingArgs = map[int16]string{ 1: "req", } -func (p *UrlServiceGetCloudSettingArgs) IsSetReq() bool { +func (p *VersionServiceGetSettingArgs) IsSetReq() bool { return p.Req != nil } -func (p *UrlServiceGetCloudSettingArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetSettingArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -24812,7 +26307,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_UrlServiceGetCloudSettingArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetSettingArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -24822,8 +26317,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceGetCloudSettingArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetCloudSettingRequest() +func (p *VersionServiceGetSettingArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetSettingRequest() if err := _field.Read(iprot); err != nil { return err } @@ -24831,10 +26326,10 @@ func (p *UrlServiceGetCloudSettingArgs) ReadField1(iprot thrift.TProtocol) error return nil } -func (p *UrlServiceGetCloudSettingArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetSettingArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetCloudSetting_args"); err != nil { + if err = oprot.WriteStructBegin("GetSetting_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -24860,7 +26355,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceGetCloudSettingArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetSettingArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -24877,43 +26372,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UrlServiceGetCloudSettingArgs) String() string { +func (p *VersionServiceGetSettingArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceGetCloudSettingArgs(%+v)", *p) + return fmt.Sprintf("VersionServiceGetSettingArgs(%+v)", *p) } -type UrlServiceGetCloudSettingResult struct { - Success *GetCloudSettingResponse `thrift:"success,0,optional"` +type VersionServiceGetSettingResult struct { + Success *GetSettingResponse `thrift:"success,0,optional"` } -func NewUrlServiceGetCloudSettingResult() *UrlServiceGetCloudSettingResult { - return &UrlServiceGetCloudSettingResult{} +func NewVersionServiceGetSettingResult() *VersionServiceGetSettingResult { + return &VersionServiceGetSettingResult{} } -func (p *UrlServiceGetCloudSettingResult) InitDefault() { +func (p *VersionServiceGetSettingResult) InitDefault() { } -var UrlServiceGetCloudSettingResult_Success_DEFAULT *GetCloudSettingResponse +var VersionServiceGetSettingResult_Success_DEFAULT *GetSettingResponse -func (p *UrlServiceGetCloudSettingResult) GetSuccess() (v *GetCloudSettingResponse) { +func (p *VersionServiceGetSettingResult) GetSuccess() (v *GetSettingResponse) { if !p.IsSetSuccess() { - return UrlServiceGetCloudSettingResult_Success_DEFAULT + return VersionServiceGetSettingResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UrlServiceGetCloudSettingResult = map[int16]string{ +var fieldIDToName_VersionServiceGetSettingResult = map[int16]string{ 0: "success", } -func (p *UrlServiceGetCloudSettingResult) IsSetSuccess() bool { +func (p *VersionServiceGetSettingResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UrlServiceGetCloudSettingResult) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetSettingResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -24959,7 +26454,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_UrlServiceGetCloudSettingResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetSettingResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -24969,8 +26464,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceGetCloudSettingResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetCloudSettingResponse() +func (p *VersionServiceGetSettingResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetSettingResponse() if err := _field.Read(iprot); err != nil { return err } @@ -24978,10 +26473,10 @@ func (p *UrlServiceGetCloudSettingResult) ReadField0(iprot thrift.TProtocol) err return nil } -func (p *UrlServiceGetCloudSettingResult) Write(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetSettingResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetCloudSetting_result"); err != nil { + if err = oprot.WriteStructBegin("GetSetting_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -25007,7 +26502,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceGetCloudSettingResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetSettingResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -25026,43 +26521,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UrlServiceGetCloudSettingResult) String() string { +func (p *VersionServiceGetSettingResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceGetCloudSettingResult(%+v)", *p) + return fmt.Sprintf("VersionServiceGetSettingResult(%+v)", *p) } -type UrlServiceGetAllCloudSettingArgs struct { - Req *GetAllCloudSettingRequest `thrift:"req,1"` +type VersionServiceGetTestArgs struct { + Req *GetTestRequest `thrift:"req,1"` } -func NewUrlServiceGetAllCloudSettingArgs() *UrlServiceGetAllCloudSettingArgs { - return &UrlServiceGetAllCloudSettingArgs{} +func NewVersionServiceGetTestArgs() *VersionServiceGetTestArgs { + return &VersionServiceGetTestArgs{} } -func (p *UrlServiceGetAllCloudSettingArgs) InitDefault() { +func (p *VersionServiceGetTestArgs) InitDefault() { } -var UrlServiceGetAllCloudSettingArgs_Req_DEFAULT *GetAllCloudSettingRequest +var VersionServiceGetTestArgs_Req_DEFAULT *GetTestRequest -func (p *UrlServiceGetAllCloudSettingArgs) GetReq() (v *GetAllCloudSettingRequest) { +func (p *VersionServiceGetTestArgs) GetReq() (v *GetTestRequest) { if !p.IsSetReq() { - return UrlServiceGetAllCloudSettingArgs_Req_DEFAULT + return VersionServiceGetTestArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_UrlServiceGetAllCloudSettingArgs = map[int16]string{ +var fieldIDToName_VersionServiceGetTestArgs = map[int16]string{ 1: "req", } -func (p *UrlServiceGetAllCloudSettingArgs) IsSetReq() bool { +func (p *VersionServiceGetTestArgs) IsSetReq() bool { return p.Req != nil } -func (p *UrlServiceGetAllCloudSettingArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetTestArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -25108,7 +26603,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_UrlServiceGetAllCloudSettingArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetTestArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -25118,8 +26613,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceGetAllCloudSettingArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewGetAllCloudSettingRequest() +func (p *VersionServiceGetTestArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetTestRequest() if err := _field.Read(iprot); err != nil { return err } @@ -25127,10 +26622,10 @@ func (p *UrlServiceGetAllCloudSettingArgs) ReadField1(iprot thrift.TProtocol) er return nil } -func (p *UrlServiceGetAllCloudSettingArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetTestArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetAllCloudSetting_args"); err != nil { + if err = oprot.WriteStructBegin("GetTest_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -25156,7 +26651,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceGetAllCloudSettingArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetTestArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -25173,43 +26668,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UrlServiceGetAllCloudSettingArgs) String() string { +func (p *VersionServiceGetTestArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceGetAllCloudSettingArgs(%+v)", *p) + return fmt.Sprintf("VersionServiceGetTestArgs(%+v)", *p) } -type UrlServiceGetAllCloudSettingResult struct { - Success *GetAllCloudSettingResponse `thrift:"success,0,optional"` +type VersionServiceGetTestResult struct { + Success *GetTestResponse `thrift:"success,0,optional"` } -func NewUrlServiceGetAllCloudSettingResult() *UrlServiceGetAllCloudSettingResult { - return &UrlServiceGetAllCloudSettingResult{} +func NewVersionServiceGetTestResult() *VersionServiceGetTestResult { + return &VersionServiceGetTestResult{} } -func (p *UrlServiceGetAllCloudSettingResult) InitDefault() { +func (p *VersionServiceGetTestResult) InitDefault() { } -var UrlServiceGetAllCloudSettingResult_Success_DEFAULT *GetAllCloudSettingResponse +var VersionServiceGetTestResult_Success_DEFAULT *GetTestResponse -func (p *UrlServiceGetAllCloudSettingResult) GetSuccess() (v *GetAllCloudSettingResponse) { +func (p *VersionServiceGetTestResult) GetSuccess() (v *GetTestResponse) { if !p.IsSetSuccess() { - return UrlServiceGetAllCloudSettingResult_Success_DEFAULT + return VersionServiceGetTestResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UrlServiceGetAllCloudSettingResult = map[int16]string{ +var fieldIDToName_VersionServiceGetTestResult = map[int16]string{ 0: "success", } -func (p *UrlServiceGetAllCloudSettingResult) IsSetSuccess() bool { +func (p *VersionServiceGetTestResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UrlServiceGetAllCloudSettingResult) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetTestResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -25255,7 +26750,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_UrlServiceGetAllCloudSettingResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetTestResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -25265,8 +26760,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceGetAllCloudSettingResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewGetAllCloudSettingResponse() +func (p *VersionServiceGetTestResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetTestResponse() if err := _field.Read(iprot); err != nil { return err } @@ -25274,10 +26769,10 @@ func (p *UrlServiceGetAllCloudSettingResult) ReadField0(iprot thrift.TProtocol) return nil } -func (p *UrlServiceGetAllCloudSettingResult) Write(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetTestResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("GetAllCloudSetting_result"); err != nil { + if err = oprot.WriteStructBegin("GetTest_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -25303,7 +26798,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceGetAllCloudSettingResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetTestResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -25322,43 +26817,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UrlServiceGetAllCloudSettingResult) String() string { +func (p *VersionServiceGetTestResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceGetAllCloudSettingResult(%+v)", *p) + return fmt.Sprintf("VersionServiceGetTestResult(%+v)", *p) } -type UrlServiceSetAllCloudSettingArgs struct { - Req *SetAllCloudSettingRequest `thrift:"req,1"` +type VersionServiceGetCloudArgs struct { + Req *GetCloudRequest `thrift:"req,1"` } -func NewUrlServiceSetAllCloudSettingArgs() *UrlServiceSetAllCloudSettingArgs { - return &UrlServiceSetAllCloudSettingArgs{} +func NewVersionServiceGetCloudArgs() *VersionServiceGetCloudArgs { + return &VersionServiceGetCloudArgs{} } -func (p *UrlServiceSetAllCloudSettingArgs) InitDefault() { +func (p *VersionServiceGetCloudArgs) InitDefault() { } -var UrlServiceSetAllCloudSettingArgs_Req_DEFAULT *SetAllCloudSettingRequest +var VersionServiceGetCloudArgs_Req_DEFAULT *GetCloudRequest -func (p *UrlServiceSetAllCloudSettingArgs) GetReq() (v *SetAllCloudSettingRequest) { +func (p *VersionServiceGetCloudArgs) GetReq() (v *GetCloudRequest) { if !p.IsSetReq() { - return UrlServiceSetAllCloudSettingArgs_Req_DEFAULT + return VersionServiceGetCloudArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_UrlServiceSetAllCloudSettingArgs = map[int16]string{ +var fieldIDToName_VersionServiceGetCloudArgs = map[int16]string{ 1: "req", } -func (p *UrlServiceSetAllCloudSettingArgs) IsSetReq() bool { +func (p *VersionServiceGetCloudArgs) IsSetReq() bool { return p.Req != nil } -func (p *UrlServiceSetAllCloudSettingArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetCloudArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -25404,7 +26899,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_UrlServiceSetAllCloudSettingArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetCloudArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -25414,8 +26909,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceSetAllCloudSettingArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewSetAllCloudSettingRequest() +func (p *VersionServiceGetCloudArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetCloudRequest() if err := _field.Read(iprot); err != nil { return err } @@ -25423,10 +26918,10 @@ func (p *UrlServiceSetAllCloudSettingArgs) ReadField1(iprot thrift.TProtocol) er return nil } -func (p *UrlServiceSetAllCloudSettingArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetCloudArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("SetAllCloudSetting_args"); err != nil { + if err = oprot.WriteStructBegin("GetCloud_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -25452,7 +26947,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceSetAllCloudSettingArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetCloudArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -25469,43 +26964,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UrlServiceSetAllCloudSettingArgs) String() string { +func (p *VersionServiceGetCloudArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceSetAllCloudSettingArgs(%+v)", *p) + return fmt.Sprintf("VersionServiceGetCloudArgs(%+v)", *p) } -type UrlServiceSetAllCloudSettingResult struct { - Success *SetAllCloudSettingResponse `thrift:"success,0,optional"` +type VersionServiceGetCloudResult struct { + Success *GetCloudResponse `thrift:"success,0,optional"` } -func NewUrlServiceSetAllCloudSettingResult() *UrlServiceSetAllCloudSettingResult { - return &UrlServiceSetAllCloudSettingResult{} +func NewVersionServiceGetCloudResult() *VersionServiceGetCloudResult { + return &VersionServiceGetCloudResult{} } -func (p *UrlServiceSetAllCloudSettingResult) InitDefault() { +func (p *VersionServiceGetCloudResult) InitDefault() { } -var UrlServiceSetAllCloudSettingResult_Success_DEFAULT *SetAllCloudSettingResponse +var VersionServiceGetCloudResult_Success_DEFAULT *GetCloudResponse -func (p *UrlServiceSetAllCloudSettingResult) GetSuccess() (v *SetAllCloudSettingResponse) { +func (p *VersionServiceGetCloudResult) GetSuccess() (v *GetCloudResponse) { if !p.IsSetSuccess() { - return UrlServiceSetAllCloudSettingResult_Success_DEFAULT + return VersionServiceGetCloudResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UrlServiceSetAllCloudSettingResult = map[int16]string{ +var fieldIDToName_VersionServiceGetCloudResult = map[int16]string{ 0: "success", } -func (p *UrlServiceSetAllCloudSettingResult) IsSetSuccess() bool { +func (p *VersionServiceGetCloudResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UrlServiceSetAllCloudSettingResult) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetCloudResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -25551,7 +27046,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_UrlServiceSetAllCloudSettingResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetCloudResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -25561,8 +27056,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceSetAllCloudSettingResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewSetAllCloudSettingResponse() +func (p *VersionServiceGetCloudResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetCloudResponse() if err := _field.Read(iprot); err != nil { return err } @@ -25570,10 +27065,10 @@ func (p *UrlServiceSetAllCloudSettingResult) ReadField0(iprot thrift.TProtocol) return nil } -func (p *UrlServiceSetAllCloudSettingResult) Write(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetCloudResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("SetAllCloudSetting_result"); err != nil { + if err = oprot.WriteStructBegin("GetCloud_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -25599,7 +27094,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceSetAllCloudSettingResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetCloudResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -25618,43 +27113,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UrlServiceSetAllCloudSettingResult) String() string { +func (p *VersionServiceGetCloudResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceSetAllCloudSettingResult(%+v)", *p) + return fmt.Sprintf("VersionServiceGetCloudResult(%+v)", *p) } -type UrlServiceTestSettingArgs struct { - Req *TestSettingRequest `thrift:"req,1"` +type VersionServiceSetCloudArgs struct { + Req *SetCloudRequest `thrift:"req,1"` } -func NewUrlServiceTestSettingArgs() *UrlServiceTestSettingArgs { - return &UrlServiceTestSettingArgs{} +func NewVersionServiceSetCloudArgs() *VersionServiceSetCloudArgs { + return &VersionServiceSetCloudArgs{} } -func (p *UrlServiceTestSettingArgs) InitDefault() { +func (p *VersionServiceSetCloudArgs) InitDefault() { } -var UrlServiceTestSettingArgs_Req_DEFAULT *TestSettingRequest +var VersionServiceSetCloudArgs_Req_DEFAULT *SetCloudRequest -func (p *UrlServiceTestSettingArgs) GetReq() (v *TestSettingRequest) { +func (p *VersionServiceSetCloudArgs) GetReq() (v *SetCloudRequest) { if !p.IsSetReq() { - return UrlServiceTestSettingArgs_Req_DEFAULT + return VersionServiceSetCloudArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_UrlServiceTestSettingArgs = map[int16]string{ +var fieldIDToName_VersionServiceSetCloudArgs = map[int16]string{ 1: "req", } -func (p *UrlServiceTestSettingArgs) IsSetReq() bool { +func (p *VersionServiceSetCloudArgs) IsSetReq() bool { return p.Req != nil } -func (p *UrlServiceTestSettingArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceSetCloudArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -25700,7 +27195,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_UrlServiceTestSettingArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceSetCloudArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -25710,8 +27205,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceTestSettingArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewTestSettingRequest() +func (p *VersionServiceSetCloudArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewSetCloudRequest() if err := _field.Read(iprot); err != nil { return err } @@ -25719,10 +27214,10 @@ func (p *UrlServiceTestSettingArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *UrlServiceTestSettingArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceSetCloudArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("TestSetting_args"); err != nil { + if err = oprot.WriteStructBegin("SetCloud_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -25748,7 +27243,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceTestSettingArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceSetCloudArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -25765,43 +27260,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UrlServiceTestSettingArgs) String() string { +func (p *VersionServiceSetCloudArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceTestSettingArgs(%+v)", *p) + return fmt.Sprintf("VersionServiceSetCloudArgs(%+v)", *p) } -type UrlServiceTestSettingResult struct { - Success *TestSettingResponse `thrift:"success,0,optional"` +type VersionServiceSetCloudResult struct { + Success *SetCloudResponse `thrift:"success,0,optional"` } -func NewUrlServiceTestSettingResult() *UrlServiceTestSettingResult { - return &UrlServiceTestSettingResult{} +func NewVersionServiceSetCloudResult() *VersionServiceSetCloudResult { + return &VersionServiceSetCloudResult{} } -func (p *UrlServiceTestSettingResult) InitDefault() { +func (p *VersionServiceSetCloudResult) InitDefault() { } -var UrlServiceTestSettingResult_Success_DEFAULT *TestSettingResponse +var VersionServiceSetCloudResult_Success_DEFAULT *SetCloudResponse -func (p *UrlServiceTestSettingResult) GetSuccess() (v *TestSettingResponse) { +func (p *VersionServiceSetCloudResult) GetSuccess() (v *SetCloudResponse) { if !p.IsSetSuccess() { - return UrlServiceTestSettingResult_Success_DEFAULT + return VersionServiceSetCloudResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UrlServiceTestSettingResult = map[int16]string{ +var fieldIDToName_VersionServiceSetCloudResult = map[int16]string{ 0: "success", } -func (p *UrlServiceTestSettingResult) IsSetSuccess() bool { +func (p *VersionServiceSetCloudResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UrlServiceTestSettingResult) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceSetCloudResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -25847,7 +27342,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_UrlServiceTestSettingResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceSetCloudResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -25857,8 +27352,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceTestSettingResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewTestSettingResponse() +func (p *VersionServiceSetCloudResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewSetCloudResponse() if err := _field.Read(iprot); err != nil { return err } @@ -25866,10 +27361,10 @@ func (p *UrlServiceTestSettingResult) ReadField0(iprot thrift.TProtocol) error { return nil } -func (p *UrlServiceTestSettingResult) Write(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceSetCloudResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("TestSetting_result"); err != nil { + if err = oprot.WriteStructBegin("SetCloud_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -25895,7 +27390,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceTestSettingResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceSetCloudResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -25914,43 +27409,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UrlServiceTestSettingResult) String() string { +func (p *VersionServiceSetCloudResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceTestSettingResult(%+v)", *p) + return fmt.Sprintf("VersionServiceSetCloudResult(%+v)", *p) } -type UrlServiceDumpVisitArgs struct { - Req *DumpVisitRequest `thrift:"req,1"` +type VersionServiceGetDumpArgs struct { + Req *GetDumpRequest `thrift:"req,1"` } -func NewUrlServiceDumpVisitArgs() *UrlServiceDumpVisitArgs { - return &UrlServiceDumpVisitArgs{} +func NewVersionServiceGetDumpArgs() *VersionServiceGetDumpArgs { + return &VersionServiceGetDumpArgs{} } -func (p *UrlServiceDumpVisitArgs) InitDefault() { +func (p *VersionServiceGetDumpArgs) InitDefault() { } -var UrlServiceDumpVisitArgs_Req_DEFAULT *DumpVisitRequest +var VersionServiceGetDumpArgs_Req_DEFAULT *GetDumpRequest -func (p *UrlServiceDumpVisitArgs) GetReq() (v *DumpVisitRequest) { +func (p *VersionServiceGetDumpArgs) GetReq() (v *GetDumpRequest) { if !p.IsSetReq() { - return UrlServiceDumpVisitArgs_Req_DEFAULT + return VersionServiceGetDumpArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_UrlServiceDumpVisitArgs = map[int16]string{ +var fieldIDToName_VersionServiceGetDumpArgs = map[int16]string{ 1: "req", } -func (p *UrlServiceDumpVisitArgs) IsSetReq() bool { +func (p *VersionServiceGetDumpArgs) IsSetReq() bool { return p.Req != nil } -func (p *UrlServiceDumpVisitArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetDumpArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -25996,7 +27491,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_UrlServiceDumpVisitArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetDumpArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -26006,8 +27501,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceDumpVisitArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewDumpVisitRequest() +func (p *VersionServiceGetDumpArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetDumpRequest() if err := _field.Read(iprot); err != nil { return err } @@ -26015,10 +27510,10 @@ func (p *UrlServiceDumpVisitArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *UrlServiceDumpVisitArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetDumpArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("DumpVisit_args"); err != nil { + if err = oprot.WriteStructBegin("GetDump_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -26044,7 +27539,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceDumpVisitArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetDumpArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -26061,43 +27556,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UrlServiceDumpVisitArgs) String() string { +func (p *VersionServiceGetDumpArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceDumpVisitArgs(%+v)", *p) + return fmt.Sprintf("VersionServiceGetDumpArgs(%+v)", *p) } -type UrlServiceDumpVisitResult struct { - Success *DumpVisitResponse `thrift:"success,0,optional"` +type VersionServiceGetDumpResult struct { + Success *GetDumpResponse `thrift:"success,0,optional"` } -func NewUrlServiceDumpVisitResult() *UrlServiceDumpVisitResult { - return &UrlServiceDumpVisitResult{} +func NewVersionServiceGetDumpResult() *VersionServiceGetDumpResult { + return &VersionServiceGetDumpResult{} } -func (p *UrlServiceDumpVisitResult) InitDefault() { +func (p *VersionServiceGetDumpResult) InitDefault() { } -var UrlServiceDumpVisitResult_Success_DEFAULT *DumpVisitResponse +var VersionServiceGetDumpResult_Success_DEFAULT *GetDumpResponse -func (p *UrlServiceDumpVisitResult) GetSuccess() (v *DumpVisitResponse) { +func (p *VersionServiceGetDumpResult) GetSuccess() (v *GetDumpResponse) { if !p.IsSetSuccess() { - return UrlServiceDumpVisitResult_Success_DEFAULT + return VersionServiceGetDumpResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UrlServiceDumpVisitResult = map[int16]string{ +var fieldIDToName_VersionServiceGetDumpResult = map[int16]string{ 0: "success", } -func (p *UrlServiceDumpVisitResult) IsSetSuccess() bool { +func (p *VersionServiceGetDumpResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UrlServiceDumpVisitResult) Read(iprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetDumpResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -26143,7 +27638,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_UrlServiceDumpVisitResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetDumpResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -26153,8 +27648,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceDumpVisitResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewDumpVisitResponse() +func (p *VersionServiceGetDumpResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetDumpResponse() if err := _field.Read(iprot); err != nil { return err } @@ -26162,10 +27657,10 @@ func (p *UrlServiceDumpVisitResult) ReadField0(iprot thrift.TProtocol) error { return nil } -func (p *UrlServiceDumpVisitResult) Write(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetDumpResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("DumpVisit_result"); err != nil { + if err = oprot.WriteStructBegin("GetDump_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -26191,7 +27686,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceDumpVisitResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *VersionServiceGetDumpResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -26210,43 +27705,230 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UrlServiceDumpVisitResult) String() string { +func (p *VersionServiceGetDumpResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceDumpVisitResult(%+v)", *p) + return fmt.Sprintf("VersionServiceGetDumpResult(%+v)", *p) + +} + +type CommonServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler CommonService +} + +func (p *CommonServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *CommonServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *CommonServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewCommonServiceProcessor(handler CommonService) *CommonServiceProcessor { + self := &CommonServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self.AddToProcessorMap("GetCSS", &commonServiceProcessorGetCSS{handler: handler}) + self.AddToProcessorMap("GetHtml", &commonServiceProcessorGetHtml{handler: handler}) + self.AddToProcessorMap("GetUserAgreement", &commonServiceProcessorGetUserAgreement{handler: handler}) + return self +} +func (p *CommonServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + name, _, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return false, err + } + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(ctx, seqId, iprot, oprot) + } + iprot.Skip(thrift.STRUCT) + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) + oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, x +} + +type commonServiceProcessorGetCSS struct { + handler CommonService +} + +func (p *commonServiceProcessorGetCSS) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := CommonServiceGetCSSArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetCSS", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := CommonServiceGetCSSResult{} + var retval *GetCSSResponse + if retval, err2 = p.handler.GetCSS(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCSS: "+err2.Error()) + oprot.WriteMessageBegin("GetCSS", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetCSS", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type commonServiceProcessorGetHtml struct { + handler CommonService +} + +func (p *commonServiceProcessorGetHtml) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := CommonServiceGetHtmlArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetHtml", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := CommonServiceGetHtmlResult{} + var retval *GetHtmlResponse + if retval, err2 = p.handler.GetHtml(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetHtml: "+err2.Error()) + oprot.WriteMessageBegin("GetHtml", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetHtml", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type commonServiceProcessorGetUserAgreement struct { + handler CommonService +} + +func (p *commonServiceProcessorGetUserAgreement) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := CommonServiceGetUserAgreementArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetUserAgreement", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + iprot.ReadMessageEnd() + var err2 error + result := CommonServiceGetUserAgreementResult{} + var retval *GetUserAgreementResponse + if retval, err2 = p.handler.GetUserAgreement(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetUserAgreement: "+err2.Error()) + oprot.WriteMessageBegin("GetUserAgreement", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetUserAgreement", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err } -type UrlServiceFZUHelperCSSArgs struct { - Req *FZUHelperCSSRequest `thrift:"req,1"` +type CommonServiceGetCSSArgs struct { + Req *GetCSSRequest `thrift:"req,1"` } -func NewUrlServiceFZUHelperCSSArgs() *UrlServiceFZUHelperCSSArgs { - return &UrlServiceFZUHelperCSSArgs{} +func NewCommonServiceGetCSSArgs() *CommonServiceGetCSSArgs { + return &CommonServiceGetCSSArgs{} } -func (p *UrlServiceFZUHelperCSSArgs) InitDefault() { +func (p *CommonServiceGetCSSArgs) InitDefault() { } -var UrlServiceFZUHelperCSSArgs_Req_DEFAULT *FZUHelperCSSRequest +var CommonServiceGetCSSArgs_Req_DEFAULT *GetCSSRequest -func (p *UrlServiceFZUHelperCSSArgs) GetReq() (v *FZUHelperCSSRequest) { +func (p *CommonServiceGetCSSArgs) GetReq() (v *GetCSSRequest) { if !p.IsSetReq() { - return UrlServiceFZUHelperCSSArgs_Req_DEFAULT + return CommonServiceGetCSSArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_UrlServiceFZUHelperCSSArgs = map[int16]string{ +var fieldIDToName_CommonServiceGetCSSArgs = map[int16]string{ 1: "req", } -func (p *UrlServiceFZUHelperCSSArgs) IsSetReq() bool { +func (p *CommonServiceGetCSSArgs) IsSetReq() bool { return p.Req != nil } -func (p *UrlServiceFZUHelperCSSArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetCSSArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -26292,7 +27974,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_UrlServiceFZUHelperCSSArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetCSSArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -26302,8 +27984,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceFZUHelperCSSArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewFZUHelperCSSRequest() +func (p *CommonServiceGetCSSArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetCSSRequest() if err := _field.Read(iprot); err != nil { return err } @@ -26311,10 +27993,10 @@ func (p *UrlServiceFZUHelperCSSArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *UrlServiceFZUHelperCSSArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetCSSArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("FZUHelperCSS_args"); err != nil { + if err = oprot.WriteStructBegin("GetCSS_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -26340,7 +28022,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceFZUHelperCSSArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetCSSArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -26357,43 +28039,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UrlServiceFZUHelperCSSArgs) String() string { +func (p *CommonServiceGetCSSArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceFZUHelperCSSArgs(%+v)", *p) + return fmt.Sprintf("CommonServiceGetCSSArgs(%+v)", *p) } -type UrlServiceFZUHelperCSSResult struct { - Success *FZUHelperCSSResponse `thrift:"success,0,optional"` +type CommonServiceGetCSSResult struct { + Success *GetCSSResponse `thrift:"success,0,optional"` } -func NewUrlServiceFZUHelperCSSResult() *UrlServiceFZUHelperCSSResult { - return &UrlServiceFZUHelperCSSResult{} +func NewCommonServiceGetCSSResult() *CommonServiceGetCSSResult { + return &CommonServiceGetCSSResult{} } -func (p *UrlServiceFZUHelperCSSResult) InitDefault() { +func (p *CommonServiceGetCSSResult) InitDefault() { } -var UrlServiceFZUHelperCSSResult_Success_DEFAULT *FZUHelperCSSResponse +var CommonServiceGetCSSResult_Success_DEFAULT *GetCSSResponse -func (p *UrlServiceFZUHelperCSSResult) GetSuccess() (v *FZUHelperCSSResponse) { +func (p *CommonServiceGetCSSResult) GetSuccess() (v *GetCSSResponse) { if !p.IsSetSuccess() { - return UrlServiceFZUHelperCSSResult_Success_DEFAULT + return CommonServiceGetCSSResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UrlServiceFZUHelperCSSResult = map[int16]string{ +var fieldIDToName_CommonServiceGetCSSResult = map[int16]string{ 0: "success", } -func (p *UrlServiceFZUHelperCSSResult) IsSetSuccess() bool { +func (p *CommonServiceGetCSSResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UrlServiceFZUHelperCSSResult) Read(iprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetCSSResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -26439,7 +28121,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_UrlServiceFZUHelperCSSResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetCSSResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -26449,8 +28131,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceFZUHelperCSSResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewFZUHelperCSSResponse() +func (p *CommonServiceGetCSSResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetCSSResponse() if err := _field.Read(iprot); err != nil { return err } @@ -26458,10 +28140,10 @@ func (p *UrlServiceFZUHelperCSSResult) ReadField0(iprot thrift.TProtocol) error return nil } -func (p *UrlServiceFZUHelperCSSResult) Write(oprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetCSSResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("FZUHelperCSS_result"); err != nil { + if err = oprot.WriteStructBegin("GetCSS_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -26487,7 +28169,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceFZUHelperCSSResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetCSSResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -26506,43 +28188,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UrlServiceFZUHelperCSSResult) String() string { +func (p *CommonServiceGetCSSResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceFZUHelperCSSResult(%+v)", *p) + return fmt.Sprintf("CommonServiceGetCSSResult(%+v)", *p) } -type UrlServiceFZUHelperHTMLArgs struct { - Req *FZUHelperHTMLRequest `thrift:"req,1"` +type CommonServiceGetHtmlArgs struct { + Req *GetHtmlRequest `thrift:"req,1"` } -func NewUrlServiceFZUHelperHTMLArgs() *UrlServiceFZUHelperHTMLArgs { - return &UrlServiceFZUHelperHTMLArgs{} +func NewCommonServiceGetHtmlArgs() *CommonServiceGetHtmlArgs { + return &CommonServiceGetHtmlArgs{} } -func (p *UrlServiceFZUHelperHTMLArgs) InitDefault() { +func (p *CommonServiceGetHtmlArgs) InitDefault() { } -var UrlServiceFZUHelperHTMLArgs_Req_DEFAULT *FZUHelperHTMLRequest +var CommonServiceGetHtmlArgs_Req_DEFAULT *GetHtmlRequest -func (p *UrlServiceFZUHelperHTMLArgs) GetReq() (v *FZUHelperHTMLRequest) { +func (p *CommonServiceGetHtmlArgs) GetReq() (v *GetHtmlRequest) { if !p.IsSetReq() { - return UrlServiceFZUHelperHTMLArgs_Req_DEFAULT + return CommonServiceGetHtmlArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_UrlServiceFZUHelperHTMLArgs = map[int16]string{ +var fieldIDToName_CommonServiceGetHtmlArgs = map[int16]string{ 1: "req", } -func (p *UrlServiceFZUHelperHTMLArgs) IsSetReq() bool { +func (p *CommonServiceGetHtmlArgs) IsSetReq() bool { return p.Req != nil } -func (p *UrlServiceFZUHelperHTMLArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetHtmlArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -26588,7 +28270,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_UrlServiceFZUHelperHTMLArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetHtmlArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -26598,8 +28280,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceFZUHelperHTMLArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewFZUHelperHTMLRequest() +func (p *CommonServiceGetHtmlArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetHtmlRequest() if err := _field.Read(iprot); err != nil { return err } @@ -26607,10 +28289,10 @@ func (p *UrlServiceFZUHelperHTMLArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *UrlServiceFZUHelperHTMLArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetHtmlArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("FZUHelperHTML_args"); err != nil { + if err = oprot.WriteStructBegin("GetHtml_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -26636,7 +28318,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceFZUHelperHTMLArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetHtmlArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -26653,43 +28335,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UrlServiceFZUHelperHTMLArgs) String() string { +func (p *CommonServiceGetHtmlArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceFZUHelperHTMLArgs(%+v)", *p) + return fmt.Sprintf("CommonServiceGetHtmlArgs(%+v)", *p) } -type UrlServiceFZUHelperHTMLResult struct { - Success *FZUHelperHTMLResponse `thrift:"success,0,optional"` +type CommonServiceGetHtmlResult struct { + Success *GetHtmlResponse `thrift:"success,0,optional"` } -func NewUrlServiceFZUHelperHTMLResult() *UrlServiceFZUHelperHTMLResult { - return &UrlServiceFZUHelperHTMLResult{} +func NewCommonServiceGetHtmlResult() *CommonServiceGetHtmlResult { + return &CommonServiceGetHtmlResult{} } -func (p *UrlServiceFZUHelperHTMLResult) InitDefault() { +func (p *CommonServiceGetHtmlResult) InitDefault() { } -var UrlServiceFZUHelperHTMLResult_Success_DEFAULT *FZUHelperHTMLResponse +var CommonServiceGetHtmlResult_Success_DEFAULT *GetHtmlResponse -func (p *UrlServiceFZUHelperHTMLResult) GetSuccess() (v *FZUHelperHTMLResponse) { +func (p *CommonServiceGetHtmlResult) GetSuccess() (v *GetHtmlResponse) { if !p.IsSetSuccess() { - return UrlServiceFZUHelperHTMLResult_Success_DEFAULT + return CommonServiceGetHtmlResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UrlServiceFZUHelperHTMLResult = map[int16]string{ +var fieldIDToName_CommonServiceGetHtmlResult = map[int16]string{ 0: "success", } -func (p *UrlServiceFZUHelperHTMLResult) IsSetSuccess() bool { +func (p *CommonServiceGetHtmlResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UrlServiceFZUHelperHTMLResult) Read(iprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetHtmlResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -26735,7 +28417,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_UrlServiceFZUHelperHTMLResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetHtmlResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -26745,8 +28427,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceFZUHelperHTMLResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewFZUHelperHTMLResponse() +func (p *CommonServiceGetHtmlResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetHtmlResponse() if err := _field.Read(iprot); err != nil { return err } @@ -26754,10 +28436,10 @@ func (p *UrlServiceFZUHelperHTMLResult) ReadField0(iprot thrift.TProtocol) error return nil } -func (p *UrlServiceFZUHelperHTMLResult) Write(oprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetHtmlResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("FZUHelperHTML_result"); err != nil { + if err = oprot.WriteStructBegin("GetHtml_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -26783,7 +28465,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceFZUHelperHTMLResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetHtmlResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -26802,43 +28484,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UrlServiceFZUHelperHTMLResult) String() string { +func (p *CommonServiceGetHtmlResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceFZUHelperHTMLResult(%+v)", *p) + return fmt.Sprintf("CommonServiceGetHtmlResult(%+v)", *p) } -type UrlServiceUserAgreementHTMLArgs struct { - Req *UserAgreementHTMLRequest `thrift:"req,1"` +type CommonServiceGetUserAgreementArgs struct { + Req *GetUserAgreementRequest `thrift:"req,1"` } -func NewUrlServiceUserAgreementHTMLArgs() *UrlServiceUserAgreementHTMLArgs { - return &UrlServiceUserAgreementHTMLArgs{} +func NewCommonServiceGetUserAgreementArgs() *CommonServiceGetUserAgreementArgs { + return &CommonServiceGetUserAgreementArgs{} } -func (p *UrlServiceUserAgreementHTMLArgs) InitDefault() { +func (p *CommonServiceGetUserAgreementArgs) InitDefault() { } -var UrlServiceUserAgreementHTMLArgs_Req_DEFAULT *UserAgreementHTMLRequest +var CommonServiceGetUserAgreementArgs_Req_DEFAULT *GetUserAgreementRequest -func (p *UrlServiceUserAgreementHTMLArgs) GetReq() (v *UserAgreementHTMLRequest) { +func (p *CommonServiceGetUserAgreementArgs) GetReq() (v *GetUserAgreementRequest) { if !p.IsSetReq() { - return UrlServiceUserAgreementHTMLArgs_Req_DEFAULT + return CommonServiceGetUserAgreementArgs_Req_DEFAULT } return p.Req } -var fieldIDToName_UrlServiceUserAgreementHTMLArgs = map[int16]string{ +var fieldIDToName_CommonServiceGetUserAgreementArgs = map[int16]string{ 1: "req", } -func (p *UrlServiceUserAgreementHTMLArgs) IsSetReq() bool { +func (p *CommonServiceGetUserAgreementArgs) IsSetReq() bool { return p.Req != nil } -func (p *UrlServiceUserAgreementHTMLArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetUserAgreementArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -26884,7 +28566,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_UrlServiceUserAgreementHTMLArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetUserAgreementArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -26894,8 +28576,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceUserAgreementHTMLArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewUserAgreementHTMLRequest() +func (p *CommonServiceGetUserAgreementArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetUserAgreementRequest() if err := _field.Read(iprot); err != nil { return err } @@ -26903,10 +28585,10 @@ func (p *UrlServiceUserAgreementHTMLArgs) ReadField1(iprot thrift.TProtocol) err return nil } -func (p *UrlServiceUserAgreementHTMLArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetUserAgreementArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("UserAgreementHTML_args"); err != nil { + if err = oprot.WriteStructBegin("GetUserAgreement_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -26932,7 +28614,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceUserAgreementHTMLArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetUserAgreementArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -26949,43 +28631,43 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *UrlServiceUserAgreementHTMLArgs) String() string { +func (p *CommonServiceGetUserAgreementArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceUserAgreementHTMLArgs(%+v)", *p) + return fmt.Sprintf("CommonServiceGetUserAgreementArgs(%+v)", *p) } -type UrlServiceUserAgreementHTMLResult struct { - Success *UserAgreementHTMLResponse `thrift:"success,0,optional"` +type CommonServiceGetUserAgreementResult struct { + Success *GetUserAgreementResponse `thrift:"success,0,optional"` } -func NewUrlServiceUserAgreementHTMLResult() *UrlServiceUserAgreementHTMLResult { - return &UrlServiceUserAgreementHTMLResult{} +func NewCommonServiceGetUserAgreementResult() *CommonServiceGetUserAgreementResult { + return &CommonServiceGetUserAgreementResult{} } -func (p *UrlServiceUserAgreementHTMLResult) InitDefault() { +func (p *CommonServiceGetUserAgreementResult) InitDefault() { } -var UrlServiceUserAgreementHTMLResult_Success_DEFAULT *UserAgreementHTMLResponse +var CommonServiceGetUserAgreementResult_Success_DEFAULT *GetUserAgreementResponse -func (p *UrlServiceUserAgreementHTMLResult) GetSuccess() (v *UserAgreementHTMLResponse) { +func (p *CommonServiceGetUserAgreementResult) GetSuccess() (v *GetUserAgreementResponse) { if !p.IsSetSuccess() { - return UrlServiceUserAgreementHTMLResult_Success_DEFAULT + return CommonServiceGetUserAgreementResult_Success_DEFAULT } return p.Success } -var fieldIDToName_UrlServiceUserAgreementHTMLResult = map[int16]string{ +var fieldIDToName_CommonServiceGetUserAgreementResult = map[int16]string{ 0: "success", } -func (p *UrlServiceUserAgreementHTMLResult) IsSetSuccess() bool { +func (p *CommonServiceGetUserAgreementResult) IsSetSuccess() bool { return p.Success != nil } -func (p *UrlServiceUserAgreementHTMLResult) Read(iprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetUserAgreementResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -27031,7 +28713,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_UrlServiceUserAgreementHTMLResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetUserAgreementResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -27041,8 +28723,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *UrlServiceUserAgreementHTMLResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewUserAgreementHTMLResponse() +func (p *CommonServiceGetUserAgreementResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetUserAgreementResponse() if err := _field.Read(iprot); err != nil { return err } @@ -27050,10 +28732,10 @@ func (p *UrlServiceUserAgreementHTMLResult) ReadField0(iprot thrift.TProtocol) e return nil } -func (p *UrlServiceUserAgreementHTMLResult) Write(oprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetUserAgreementResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("UserAgreementHTML_result"); err != nil { + if err = oprot.WriteStructBegin("GetUserAgreement_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -27079,7 +28761,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *UrlServiceUserAgreementHTMLResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *CommonServiceGetUserAgreementResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -27098,10 +28780,10 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *UrlServiceUserAgreementHTMLResult) String() string { +func (p *CommonServiceGetUserAgreementResult) String() string { if p == nil { return "" } - return fmt.Sprintf("UrlServiceUserAgreementHTMLResult(%+v)", *p) + return fmt.Sprintf("CommonServiceGetUserAgreementResult(%+v)", *p) } diff --git a/api/model/model/model.go b/api/model/model/model.go index 11616c6a..4fef7643 100644 --- a/api/model/model/model.go +++ b/api/model/model/model.go @@ -4826,6 +4826,625 @@ func (p *UnifiedExam) String() string { } +// ====== Common ====== +// 校历 +type Term struct { + TermID string `thrift:"term_id,1,required" form:"term_id,required" json:"term_id,required" query:"term_id,required"` + SchoolYear string `thrift:"school_year,2,required" form:"school_year,required" json:"school_year,required" query:"school_year,required"` + Term string `thrift:"term,3,required" form:"term,required" json:"term,required" query:"term,required"` + StartDate string `thrift:"start_date,4,required" form:"start_date,required" json:"start_date,required" query:"start_date,required"` + EndDate string `thrift:"end_date,5,required" form:"end_date,required" json:"end_date,required" query:"end_date,required"` +} + +func NewTerm() *Term { + return &Term{} +} + +func (p *Term) InitDefault() { +} + +func (p *Term) GetTermID() (v string) { + return p.TermID +} + +func (p *Term) GetSchoolYear() (v string) { + return p.SchoolYear +} + +func (p *Term) GetTerm() (v string) { + return p.Term +} + +func (p *Term) GetStartDate() (v string) { + return p.StartDate +} + +func (p *Term) GetEndDate() (v string) { + return p.EndDate +} + +var fieldIDToName_Term = map[int16]string{ + 1: "term_id", + 2: "school_year", + 3: "term", + 4: "start_date", + 5: "end_date", +} + +func (p *Term) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetTermID bool = false + var issetSchoolYear bool = false + var issetTerm bool = false + var issetStartDate bool = false + var issetEndDate bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + 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 + } + issetTermID = 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 + } + issetSchoolYear = 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 + } + issetTerm = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRING { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + issetStartDate = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.STRING { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + issetEndDate = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + 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 !issetTermID { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetSchoolYear { + fieldId = 2 + goto RequiredFieldNotSetError + } + + if !issetTerm { + fieldId = 3 + goto RequiredFieldNotSetError + } + + if !issetStartDate { + fieldId = 4 + goto RequiredFieldNotSetError + } + + if !issetEndDate { + fieldId = 5 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Term[fieldId]), err) +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_Term[fieldId])) +} + +func (p *Term) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.TermID = _field + return nil +} +func (p *Term) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.SchoolYear = _field + return nil +} +func (p *Term) ReadField3(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Term = _field + return nil +} +func (p *Term) ReadField4(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.StartDate = _field + return nil +} +func (p *Term) ReadField5(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.EndDate = _field + return nil +} + +func (p *Term) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("Term"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Term) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("term_id", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.TermID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Term) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("school_year", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.SchoolYear); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *Term) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("term", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Term); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *Term) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("start_date", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.StartDate); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *Term) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("end_date", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.EndDate); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *Term) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Term(%+v)", *p) + +} + +type TermEvent struct { + Name string `thrift:"name,1,required" form:"name,required" json:"name,required" query:"name,required"` + StartDate string `thrift:"start_date,2,required" form:"start_date,required" json:"start_date,required" query:"start_date,required"` + EndDate string `thrift:"end_date,3,required" form:"end_date,required" json:"end_date,required" query:"end_date,required"` +} + +func NewTermEvent() *TermEvent { + return &TermEvent{} +} + +func (p *TermEvent) InitDefault() { +} + +func (p *TermEvent) GetName() (v string) { + return p.Name +} + +func (p *TermEvent) GetStartDate() (v string) { + return p.StartDate +} + +func (p *TermEvent) GetEndDate() (v string) { + return p.EndDate +} + +var fieldIDToName_TermEvent = map[int16]string{ + 1: "name", + 2: "start_date", + 3: "end_date", +} + +func (p *TermEvent) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetName bool = false + var issetStartDate bool = false + var issetEndDate bool = false + + 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 + } + issetName = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + issetStartDate = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + issetEndDate = true + } 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 !issetName { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetStartDate { + fieldId = 2 + goto RequiredFieldNotSetError + } + + if !issetEndDate { + fieldId = 3 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TermEvent[fieldId]), err) +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_TermEvent[fieldId])) +} + +func (p *TermEvent) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *TermEvent) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.StartDate = _field + return nil +} +func (p *TermEvent) ReadField3(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.EndDate = _field + return nil +} + +func (p *TermEvent) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("TermEvent"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *TermEvent) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + 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 *TermEvent) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("start_date", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.StartDate); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *TermEvent) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("end_date", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.EndDate); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *TermEvent) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TermEvent(%+v)", *p) + +} + +// ====== END Common ====== type PaperData struct { BasePath string `thrift:"base_path,1,required" form:"base_path,required" json:"base_path,required" query:"base_path,required"` Files []string `thrift:"files,2,required" form:"files,required" json:"files,required" query:"files,required"` diff --git a/api/pack/base.go b/api/pack/base.go index 3c0522aa..ffeb8d19 100644 --- a/api/pack/base.go +++ b/api/pack/base.go @@ -22,6 +22,7 @@ import ( "github.com/cloudwego/hertz/pkg/app" "github.com/cloudwego/hertz/pkg/protocol/consts" + "github.com/west2-online/fzuhelper-server/api/model/model" "github.com/west2-online/fzuhelper-server/pkg/errno" ) @@ -103,3 +104,27 @@ func CustomLaunchScreenRespSuccess(c *app.RequestContext) { Msg: Errno.ErrorMsg, }) } + +/* + 20241127 + customize for urlService +*/ + +type CustomUrlRespData struct { + Code string `json:"code"` + Data any `json:"data"` +} + +func BuildSuccessBase() *model.BaseResp { + return &model.BaseResp{ + Code: errno.SuccessCode, + Msg: "Success", + } +} + +func CustomUrlRespWithData(c *app.RequestContext, data any) { + c.JSON(consts.StatusOK, CustomUrlRespData{ + Code: strconv.Itoa(consts.StatusOK), + Data: data, + }) +} diff --git a/api/router/api/api.go b/api/router/api/api.go index c9086d20..1a36c101 100644 --- a/api/router/api/api.go +++ b/api/router/api/api.go @@ -99,34 +99,34 @@ func Register(r *server.Hertz) { _paper.GET("/download", append(_getdownloadurlMw(), api.GetDownloadUrl)...) _paper.GET("/list", append(_listdirfilesMw(), api.ListDirFiles)...) } - { - _url := _v1.Group("/url", _urlMw()...) - _url.GET("/beta.apk", append(_getdownloadbetaMw(), api.GetDownloadBeta)...) - _url.GET("/dump", append(_dumpvisitMw(), api.DumpVisit)...) - _url.GET("/getcloud", append(_getallcloudsettingMw(), api.GetAllCloudSetting)...) - _url.POST("/login", append(_apiloginMw(), api.APILogin)...) - _url.GET("/release.apk", append(_getdownloadreleaseMw(), api.GetDownloadRelease)...) - _url.POST("/setcloud", append(_setallcloudsettingMw(), api.SetAllCloudSetting)...) - _url.GET("/settings.php", append(_getcloudsettingMw(), api.GetCloudSetting)...) - _url.POST("/test", append(_testsettingMw(), api.TestSetting)...) - _url.POST("/upload", append(_uploadversioninfoMw(), api.UploadVersionInfo)...) - _url.GET("/version.json", append(_getreleaseversionMw(), api.GetReleaseVersion)...) - _url.GET("/versionbeta.json", append(_getbetaversionMw(), api.GetBetaVersion)...) - { - _api0 := _url.Group("/api", _api0Mw()...) - _api0.POST("/upload-params", append(_getuploadparamsMw(), api.GetUploadParams)...) - } - { - _onekey := _url.Group("/onekey", _onekeyMw()...) - _onekey.GET("/fzu-helper.css", append(_fzuhelpercssMw(), api.FZUHelperCSS)...) - _onekey.GET("/fzu-helper.html", append(_fzuhelperhtmlMw(), api.FZUHelperHTML)...) - _onekey.GET("/user-agreement.html", append(_useragreementhtmlMw(), api.UserAgreementHTML)...) - } - } { _user0 := _v1.Group("/user", _user0Mw()...) _user0.POST("/validate-code", append(_validatecodeMw(), api.ValidateCode)...) } } + { + _v2 := _api.Group("/v2", _v2Mw()...) + { + _common0 := _v2.Group("/common", _common0Mw()...) + _common0.GET("/fzu-helper.css", append(_getcssMw(), api.GetCSS)...) + _common0.GET("/fzu-helper.html", append(_gethtmlMw(), api.GetHtml)...) + _common0.GET("/user-agreement.html", append(_getuseragreementMw(), api.GetUserAgreement)...) + } + { + _url := _v2.Group("/url", _urlMw()...) + _url.GET("/beta.apk", append(_downloadbetaapkMw(), api.DownloadBetaApk)...) + _url.GET("/dump", append(_getdumpMw(), api.GetDump)...) + _url.GET("/getcloud", append(_getcloudMw(), api.GetCloud)...) + _url.POST("/login", append(_login1Mw(), api.Login)...) + _url.GET("/release.apk", append(_downloadreleaseapkMw(), api.DownloadReleaseApk)...) + _url.POST("/setcloud", append(_setcloudMw(), api.SetCloud)...) + _url.GET("/settings.php", append(_getsettingMw(), api.GetSetting)...) + _url.POST("/test", append(_gettestMw(), api.GetTest)...) + _url.POST("/upload", append(_uploadversionMw(), api.UploadVersion)...) + _url.POST("/upload-params", append(_uploadparamsMw(), api.UploadParams)...) + _url.GET("/version.json", append(_getreleaseversionMw(), api.GetReleaseVersion)...) + _url.GET("/versionbeta.json", append(_getbetaversionMw(), api.GetBetaVersion)...) + } + } } } diff --git a/api/router/api/middleware.go b/api/router/api/middleware.go index a9561c3b..aac11106 100644 --- a/api/router/api/middleware.go +++ b/api/router/api/middleware.go @@ -328,3 +328,78 @@ func _user0Mw() []app.HandlerFunc { // your code... return nil } + +func _v2Mw() []app.HandlerFunc { + // your code... + return nil +} + +func _common0Mw() []app.HandlerFunc { + // your code... + return nil +} + +func _getcssMw() []app.HandlerFunc { + // your code... + return nil +} + +func _gethtmlMw() []app.HandlerFunc { + // your code... + return nil +} + +func _getuseragreementMw() []app.HandlerFunc { + // your code... + return nil +} + +func _downloadbetaapkMw() []app.HandlerFunc { + // your code... + return nil +} + +func _getdumpMw() []app.HandlerFunc { + // your code... + return nil +} + +func _getcloudMw() []app.HandlerFunc { + // your code... + return nil +} + +func _login1Mw() []app.HandlerFunc { + // your code... + return nil +} + +func _downloadreleaseapkMw() []app.HandlerFunc { + // your code... + return nil +} + +func _setcloudMw() []app.HandlerFunc { + // your code... + return nil +} + +func _getsettingMw() []app.HandlerFunc { + // your code... + return nil +} + +func _gettestMw() []app.HandlerFunc { + // your code... + return nil +} + +func _uploadversionMw() []app.HandlerFunc { + // your code... + return nil +} + +func _uploadparamsMw() []app.HandlerFunc { + // your code... + return nil +} diff --git a/api/router/custom_router.go b/api/router/custom_router.go index 31b13418..d9b852e9 100644 --- a/api/router/custom_router.go +++ b/api/router/custom_router.go @@ -60,11 +60,30 @@ func customizedRegister(r *server.Hertz) { r.GET("/versionbeta.json", api.GetBetaVersion) 对应 beta版本信息获取 r.GET("/settings.php", api.GetCloudSetting) 对应 获取设置 + 20241128兼容-2024肖垲 + 改为了向本项目内的微服务请求 */ - r.GET("/onekey/FZUHelper.html", api.FZUHelperHTML) - r.GET("/onekey/UserAgreement.html", api.UserAgreementHTML) - r.GET("/onekey/FZUHelper.css", api.FZUHelperCSS) - r.GET("/version.json", api.GetReleaseVersion) - r.GET("/versionbeta.json", api.GetBetaVersion) - r.GET("/settings.php", api.GetCloudSetting) + r.GET("/onekey/FZUHelper.html", api.GetHtml) + r.GET("/onekey/UserAgreement.html", api.GetUserAgreement) + r.GET("/onekey/FZUHelper.css", api.GetCSS) + r.GET("/settings.php", api.GetSetting) + r.GET("/version.json", custom.GetReleaseVersionModify) + r.GET("/versionbeta.json", custom.GetBetaVersionModify) + + r.GET("/api/v1/url/onekey/FZUHelper.html", api.GetHtml) + r.GET("/api/v1/url/onekey/UserAgreement.html", api.GetUserAgreement) + r.GET("/api/v1/url/onekey/FZUHelper.css", api.GetCSS) + r.GET("/api/v1/url/dump", api.GetDump) + r.GET("/api/v1/url/getcloud", api.GetCloud) + r.GET("/api/v1/url/settings.php", api.GetSetting) + r.GET("/api/v1/url/beta.apk", api.DownloadBetaApk) + r.GET("/api/v1/url/release.apk", api.DownloadReleaseApk) + r.POST("/api/v1/url/test", api.GetTest) + r.POST("/api/v1/url/setcloud", api.SetCloud) + + r.POST("/api/v1/url/login", custom.APILogin) + r.POST("/api/v1/url/api/upload", custom.UploadVersionInfo) + r.POST("/api/v1/url/api/uploadparams", custom.GetUploadParams) + r.GET("/api/v1/url/version.json", custom.GetReleaseVersionModify) + r.GET("/api/v1/url/versionbeta.json", custom.GetBetaVersionModify) } diff --git a/api/rpc/common.go b/api/rpc/common.go new file mode 100644 index 00000000..67978348 --- /dev/null +++ b/api/rpc/common.go @@ -0,0 +1,61 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package rpc + +import ( + "context" + + "github.com/west2-online/fzuhelper-server/kitex_gen/common" + "github.com/west2-online/fzuhelper-server/pkg/base/client" + "github.com/west2-online/fzuhelper-server/pkg/errno" + "github.com/west2-online/fzuhelper-server/pkg/logger" +) + +func InitCommonRPC() { + client, err := client.InitCommonRPC() + if err != nil { + logger.Fatalf("api.rpc.common InitCommonRPC failed, err %v", err) + } + commonClient = *client +} + +func GetCSSRPC(ctx context.Context, req *common.GetCSSRequest) (*[]byte, error) { + resp, err := commonClient.GetCSS(ctx, req) + if err != nil { + logger.Errorf("GetCSSRPC: RPC called failed: %v", err.Error()) + return nil, errno.InternalServiceError.WithMessage(err.Error()) + } + return &resp.Css, nil +} + +func GetHtmlRPC(ctx context.Context, req *common.GetHtmlRequest) (*[]byte, error) { + resp, err := commonClient.GetHtml(ctx, req) + if err != nil { + logger.Errorf("GetHtmlRPC: RPC called failed: %v", err.Error()) + return nil, errno.InternalServiceError.WithMessage(err.Error()) + } + return &resp.Html, nil +} + +func GetUserAgreementRPC(ctx context.Context, req *common.GetUserAgreementRequest) (*[]byte, error) { + resp, err := commonClient.GetUserAgreement(ctx, req) + if err != nil { + logger.Errorf("GetUserAgreementRPC: RPC called failed: %v", err.Error()) + return nil, errno.InternalServiceError.WithMessage(err.Error()) + } + return &resp.UserAgreement, nil +} diff --git a/api/rpc/init.go b/api/rpc/init.go index 8a7d8ca0..cc0ea8bd 100644 --- a/api/rpc/init.go +++ b/api/rpc/init.go @@ -19,10 +19,12 @@ package rpc import ( "github.com/west2-online/fzuhelper-server/kitex_gen/academic/academicservice" "github.com/west2-online/fzuhelper-server/kitex_gen/classroom/classroomservice" + "github.com/west2-online/fzuhelper-server/kitex_gen/common/commonservice" "github.com/west2-online/fzuhelper-server/kitex_gen/course/courseservice" "github.com/west2-online/fzuhelper-server/kitex_gen/launch_screen/launchscreenservice" "github.com/west2-online/fzuhelper-server/kitex_gen/paper/paperservice" "github.com/west2-online/fzuhelper-server/kitex_gen/user/userservice" + "github.com/west2-online/fzuhelper-server/kitex_gen/version/versionservice" ) var ( @@ -33,6 +35,8 @@ var ( launchScreenStreamClient launchscreenservice.StreamClient paperClient paperservice.Client academicClient academicservice.Client + versionClient versionservice.Client + commonClient commonservice.Client ) func Init() { @@ -43,4 +47,6 @@ func Init() { InitLaunchScreenStreamRPC() InitPaperRPC() InitAcademicRPC() + InitVersionRPC() + InitCommonRPC() } diff --git a/api/rpc/url.go b/api/rpc/url.go new file mode 100644 index 00000000..23d24ef2 --- /dev/null +++ b/api/rpc/url.go @@ -0,0 +1,158 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package rpc + +import ( + "context" + + "github.com/west2-online/fzuhelper-server/kitex_gen/version" + "github.com/west2-online/fzuhelper-server/pkg/base/client" + "github.com/west2-online/fzuhelper-server/pkg/errno" + "github.com/west2-online/fzuhelper-server/pkg/logger" + "github.com/west2-online/fzuhelper-server/pkg/utils" +) + +func InitVersionRPC() { + client, err := client.InitVersionRPC() + if err != nil { + logger.Fatalf("api.rpc.version InitVersionRPC failed, err %v", err) + } + versionClient = *client +} + +func LoginRPC(ctx context.Context, req *version.LoginRequest) (err error) { + resp, err := versionClient.Login(ctx, req) + if err != nil { + logger.Errorf("LoginRPC: RPC called failed: %v", err.Error()) + return errno.InternalServiceError.WithMessage(err.Error()) + } + if !utils.IsSuccess(resp.Base) { + return errno.NewErrNo(resp.Base.Code, resp.Base.Msg) + } + return nil +} + +func UploadVersionRPC(ctx context.Context, req *version.UploadRequest) (err error) { + resp, err := versionClient.UploadVersion(ctx, req) + if err != nil { + logger.Errorf("UploadVersionRPC: RPC called failed: %v", err.Error()) + return errno.InternalServiceError.WithMessage(err.Error()) + } + if !utils.IsSuccess(resp.Base) { + return errno.NewErrNo(resp.Base.Code, resp.Base.Msg) + } + return nil +} + +func UploadParamsRPC(ctx context.Context, req *version.UploadParamsRequest) (*string, *string, error) { + resp, err := versionClient.UploadParams(ctx, req) + if err != nil { + logger.Errorf("UploadParamsRPC: RPC called failed: %v", err.Error()) + return nil, nil, errno.InternalServiceError.WithMessage(err.Error()) + } + if !utils.IsSuccess(resp.Base) { + return nil, nil, errno.NewErrNo(resp.Base.Code, resp.Base.Msg) + } + return resp.Policy, resp.Authorization, nil +} + +func DownloadReleaseApkRPC(ctx context.Context, req *version.DownloadReleaseApkRequest) (*string, error) { + resp, err := versionClient.DownloadReleaseApk(ctx, req) + if err != nil { + logger.Errorf("DownloadReleaseApkRPC: RPC called failed: %v", err.Error()) + return nil, errno.InternalServiceError.WithMessage(err.Error()) + } + return &resp.RedirectUrl, nil +} + +func DownloadBetaApkRPC(ctx context.Context, req *version.DownloadBetaApkRequest) (*string, error) { + resp, err := versionClient.DownloadBetaApk(ctx, req) + if err != nil { + logger.Errorf("DownloadBetaApkRPC: RPC called failed: %v", err.Error()) + return nil, errno.InternalServiceError.WithMessage(err.Error()) + } + return &resp.RedirectUrl, nil +} + +func GetReleaseVersionRPC(ctx context.Context, req *version.GetReleaseVersionRequest) (*version.GetReleaseVersionResponse, error) { + resp, err := versionClient.GetReleaseVersion(ctx, req) + if err != nil { + logger.Errorf("GetReleaseVersionRPC: RPC called failed: %v", err.Error()) + return nil, errno.InternalServiceError.WithMessage(err.Error()) + } + return resp, nil +} + +func GetBetaVersionRPC(ctx context.Context, req *version.GetBetaVersionRequest) (*version.GetBetaVersionResponse, error) { + resp, err := versionClient.GetBetaVersion(ctx, req) + if err != nil { + logger.Errorf("GetBetaVersionRPC: RPC called failed: %v", err.Error()) + return nil, errno.InternalServiceError.WithMessage(err.Error()) + } + return resp, nil +} + +func GetSettingRPC(ctx context.Context, req *version.GetSettingRequest) (*version.GetSettingResponse, error) { + resp, err := versionClient.GetSetting(ctx, req) + if err != nil { + logger.Errorf("GetSettingRPC: RPC called failed: %v", err.Error()) + return nil, errno.InternalServiceError.WithMessage(err.Error()) + } + return resp, nil +} + +func GetTestRPC(ctx context.Context, req *version.GetTestRequest) (*version.GetTestResponse, error) { + resp, err := versionClient.GetTest(ctx, req) + if err != nil { + logger.Errorf("GetTestRPC: RPC called failed: %v", err.Error()) + return nil, errno.InternalServiceError.WithMessage(err.Error()) + } + if !utils.IsSuccess(resp.Base) { + return nil, errno.NewErrNo(resp.Base.Code, resp.Base.Msg) + } + return resp, nil +} + +func GetCloudRPC(ctx context.Context, req *version.GetCloudRequest) (*version.GetCloudResponse, error) { + resp, err := versionClient.GetCloud(ctx, req) + if err != nil { + logger.Errorf("GetCloudRPC: RPC called failed: %v", err.Error()) + return nil, errno.InternalServiceError.WithMessage(err.Error()) + } + return resp, nil +} + +func SetCloudRPC(ctx context.Context, req *version.SetCloudRequest) (err error) { + resp, err := versionClient.SetCloud(ctx, req) + if err != nil { + logger.Errorf("SetCloudRPC: RPC called failed: %v", err.Error()) + return errno.InternalServiceError.WithMessage(err.Error()) + } + if !utils.IsSuccess(resp.Base) { + return errno.NewErrNo(resp.Base.Code, resp.Base.Msg) + } + return nil +} + +func GetDumpRPC(ctx context.Context, req *version.GetDumpRequest) (*version.GetDumpResponse, error) { + resp, err := versionClient.GetDump(ctx, req) + if err != nil { + logger.Errorf("GetDumpRPC: RPC called failed: %v", err.Error()) + return nil, errno.InternalServiceError.WithMessage(err.Error()) + } + return resp, nil +} diff --git a/api/statistic/cloud_setting.json b/api/statistic/cloud_setting.json new file mode 100644 index 00000000..0f04cbb8 --- /dev/null +++ b/api/statistic/cloud_setting.json @@ -0,0 +1,98 @@ +{ + //前面的方案会覆盖后面的方案,请将优先级高的配置放在前面 + "plans": [ + { + "name": "ce", + "account": "03200510[123]|832101210|222000316|222100209|032002328", //匹配账户名(学号) + "plan": { + "features": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 17, 1000, 500, 501], + "notice": "aaaaaa", + "extendFeatures": [{ + "id": 500, //扩展功能id,不能与原有id重复 + "url": "http://www.baidu.com", // 扩展功能网址,如果下面jwch=true,这里可以用{id}代替网址当中的id + "title": "百度", //扩展功能名称 + "iconUrl": "https://img.zcool.cn/community/01ffaa593fc51ea8012193a3c0c057.png@1280w_1l_2o_100sh.png", //扩展功能图标url + "jwch": false //是否使用教务处cookie + },{ + "id": 501, + "url": "https://wechat.west2online.com/west2wechat/course.html#/", + "title": "选课指导", + "iconUrl": "https://www.emojicenter.com/wp-content/uploads/2019/06/face-with-finger-covering-closed-lips_1f92b-23.png", + "jwch": false + }] + } + }, + { + "name": "示例配置,以下过滤项均使用正则表达式配置!", + "account": "^123456789$", //匹配账户名(学号) + "version": "^52[2-9][0-9]{1,3}|[5-9][3-9][0-9][0-9]{1,3}$", //匹配版本号 + "beta": false, //是否打开beta通道 + "phone": "^MI .*|OPPO .*$", //手机型号 + "isLogin": true, //是否登录 + "loginType": "^[15]$", //登录方式,1:本科教务处,5:研究生 + "plan": { + "features": [1, 2, 3, 4], //列表,对应工具箱的Tool id + "extendFeatures": [{ + "id": 201, //扩展功能id,不能与原有id重复 + "url": "http://www.fzu.edu.cn/id={id}", // 扩展功能网址,如果下面jwch=true,这里可以用{id}代替网址当中的id + "title": "福州大学", //扩展功能名称 + "iconUrl": "http://www.fzu.edu.cn/icon.jpg", //扩展功能图标url + "jwch": true //是否使用教务处cookie + }] + } + }, + { + "name": "lw", + "account": "(032004142|061900209|031902321)", //匹配账户名(学号) + "plan": { + "trustAllCerts": true, + "features": [0,1, 2, 3, 4,5,6,7,9,10,13,11,12,1000, 202,16,17], //列表,对应工具箱的Tool id + "extendFeatures": [{ + "id": 201, //扩展功能id,不能与原有id重复 + "url": "https://welcome.fzuhelper.w2fzu.com/", // 扩展功能网址,如果下面jwch=true,这里可以用{id}代替网址当中的id + "title": "新生宝", //扩展功能名称 + "iconUrl": "http://www.fzu.edu.cn/icon.jpg", //扩展功能图标url + "jwch": false, //是否使用教务处cookie, + "user-agent": "this is a ua" + },{ + "id": 202, //扩展功能id,不能与原有id重复 + "url": "https://c.uyiban.com/#/", // 扩展功能网址,如果下面jwch=true,这里可以用{id}代替网址当中的id + "title": "yiban", //扩展功能名称 + "iconUrl": "http://www.fzu.edu.cn/icon.jpg", //扩展功能图标url + "jwch": false, //是否使用教务处cookie, + "user-agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 yiban_iOS/4.9.4" + }] + } + }, + { + "name": "示例配置表达式配置", + "account": "032005100$", //匹配账户名(学号) + "plan": { + "features": [0,1, 2, 3, 4,5,6,7,9,10,13,11,1000], //列表,对应工具箱的Tool id + "notice": "这是一个公告" + } + }, + { + "name": "本科", + "phone": "(12312iPhone|3213iPad)", + "plan": { + "exceptionInterceptors": [ + "java.lang.ArithmeticException: divide by zero" + ], + "trustAllCerts": false, + "accountMistakePlan2": true, + "features": [0,1, 2, 3, 4,5,6,7,9,10,13,11,12,1000] //列表,对应工具箱的Tool id + } + }, + { + "name": "通用方案", + "plan": { + "exceptionInterceptors": [ + "java.lang.ArithmeticException: divide by zero" + ], + "trustAllCerts": true, + "accountMistakePlan2": true + } + } + ] +} diff --git a/api/statistic/html/FZUHelper.css b/api/statistic/html/FZUHelper.css new file mode 100644 index 00000000..ef8ed5b5 --- /dev/null +++ b/api/statistic/html/FZUHelper.css @@ -0,0 +1,47 @@ +.container { + padding:5% 3%; +} + +.title { + text-align: center; +} + +.time { + text-indent: 2em; +} + +.des { + font-weight: bold; + text-indent: 2em; +} + +.section { + font-weight: bold; + font-size: 24px; + padding-left: 32px; + margin: 5px 0px; +} + +.content { + text-indent: 2em; +} + +.content-2 { + text-indent: 0em; + padding-left: 2em; +} + +.content-3 { + text-indent: 0em; + padding-left: 2em; +} + +.sdk { + text-indent: 0em; + padding-left: 2em; + margin-bottom: 2em; +} + +.bold { + font-weight: bold; +} \ No newline at end of file diff --git a/api/statistic/html/FZUHelper.html b/api/statistic/html/FZUHelper.html new file mode 100644 index 00000000..32389c35 --- /dev/null +++ b/api/statistic/html/FZUHelper.html @@ -0,0 +1,218 @@ + + + + + + + + + 福uu隐私政策 + + + +
+
+
+

福uu隐私政策

+
+
更新日期:2023年10月16日
+
生效日期:2023年10月23日
+
应用名称:福uu
+
开发者名称:福州西二在线网络有限公司
+
+
+
+
引言
+
+ (1)欢迎使用“西二在线”(指福州西二在线网络有限公司、其福uu工作室,以下称西二在线)提供的服务!我们深知个人信息对您的重要性,并庄严承诺保护使用福uu的用户的个人信息及隐私安全。您在使用福uu时,我们可能会收集和使用您的相关个人信息及用户信息(以下统称为“信息”)。我们希望通过《福uu隐私政策》(以下简称“《隐私政策》”或“本政策”)向您说明我们在收集和使用您的相关关个人信息时对应的处理规则等相关事宜,以便更好的保障您的权益。如果您有任何疑问、意见或建议,请通过第六节“如何联系我们”中所提供的联系方式与我们联系。 +
+
+ (2)针对涉及与您的权益(可能)存在重大关系的条款,我们在本隐私保护政策中将采用粗体或其他合理方式提示您重点阅读。 +
+
+ (3)您同意本隐私保护政策表示您已经了解并同意在相关场景下,为实现功能运行,我们将对您的相关个人信息进行处理。但这并不代表只要您开始使用我们的产品与/或服务,我们将处理本隐私保护政策中涉及的全部个人信息。仅当您使用特定功能时,我们才会根据“最小必要”原则,为实现向您提供服务的目的,处理您的相关个人信息。 +
+
+ (4)除本隐私保护政策外,在特定场景下,我们将以及时告知的方式(包括但不限于更新本隐私保护政策、重新签署文件、页面提示、弹窗或其他便于您获知的方式)另行向您详细说明对应信息的处理目的、方式、范围等规则,并在征得您的同意后处理。 +
+
+ 本隐私保护政策将帮助您了解以下内容:
+
1. 个人信息的收集和使用
+
2. Cookie等同类技术的使用
+
3. 信息存储与安全
+
4. 信息共享
+
5. 您的权利
+
6. 变更
+
7. 未成年人保护
+
8. 联系我们
+
+
+
一、我们如何收集和使用个人信息
+
+ 我们收集您的个人信息主要是为了您和其他用户能够更容易和更满意地使用福uu。我们的目标是向所有的互联网用户提供安全、有趣的上网经历。而这些信息有助于我们实现这一目标。 +
+ (一)我们将通过以下途径收集和获得您的个人信息: +
+ 1、您提供的信息。您在使用福uu时,向我们提供的信息。 +
+ 2、我们获取您的信息。您在使用福uu服务时,我们收集、汇总、记录的信息,例如日志信息、设备信息。 +
+
+
+ (二)我们会出于以下目的,收集和使用您以下类型的个人信息: +
+ 您理解并同意,我们希望提供给您的产品和服务是完善的,所以我们会不断改进我们的产品和服务,这意味着随着产品和服务的迭代、拓展、升级等,我们可能会经常推出新的服务或业务功能或重新划分业务功能,并可能需要收集新的个人信息或变更个人信息使用目的或方式。 + + 请您注意,如果我们要将您的个人信息用于本政策中未载明的其他用途或额外收集未提及的其他个人信息,我们会通过页面提示、交互流程、网站公告或其他方式另行征得您的同意。一旦您同意,该等额外用途将视为本政策的一部分,该等额外信息也将适用本政策。 + + 在此过程中,如您有任何疑问,您可通过本政策“如何联系我们”章节所列的反馈渠道联系我们,我们会尽快为您做出解答。 +
+ 1、当您使用福uu关于福大教务处的功能,如获取课程表,我们会将使用设备本地记录的账号密码,通过教务处认证并拉取课表。 +
+ 2、当您使用福uu的课程表、历年卷等功能,我们将收集包括但不限于历年卷搜索、课程表信息、使用功能次数、使用本软件次数等,有助于我们给您提供年度总结等个性化的和更优质的服务体验。 +
+ 3、当您使用福uu的成绩查询、课表查询等功能,我们将收集成绩、课程等信息,有助于我们给您提供成绩更新推送,课表变动通知等功能体验。 +
+ + 注意:您了解并同意,在收集您以上的个人信息后,我们会通过技术手段对数据进行去标识化和匿名化处理,去标识化处理的信息将无法识别您的身份,在此情况下我们有权使用已经去标识化的信息,对用户数据库进行分析并予以商业化的利用,而无需另行获得您的同意。 + +
+
+
+
+
+
二、我们如何使用Cookies或同类技术
+
+ 我们或我们的第三方合作伙伴可能通过Cookies或同类技术获取和使用您的信息,可能用于以下用途: +
+ 1、记住您的身份,用于快速使用某项需要身份认证的功能而无需用户重复登录 +
+
+
+
+
三、我们如何存储和保护个人信息
+
+ 1、我们会采用符合业界标准的安全防护措施,包括建立合理的制度规范、安全技术来防止您的信息遭到未经授权的访问使用、修改,避免数据的损坏或丢失。网络服务采取了多种加密技术,例如在某些服务中,我们将利用加密技术(例如SSL)来保护您的信息,采取加密技术对您的信息进行加密保存,并通过隔离技术进行隔离。 + 在信息使用时,例如信息展示、信息关联计算,我们会采用多种数据脱敏技术增强信息在使用中安全性。
+
+ 2、我们仅允许有必要知晓这些信息的西二在线员工、合作伙伴访问您的信息,并为此设置了严格的访问权限控制和监控机制。我们同时要求可能接触到您的信息的所有人员履行相应的保密义务。如果未能履行这些义务,可能会被追究法律责任或被中止与西二在线的合作关系。 +
+
+ 3、互联网并非绝对安全的环境,而且电子邮件、即时通讯、社交软件或其他服务软件等与其他用户的交流方式无法确定是否完全加密,我们建议您使用此类工具时请使用复杂密码,并注意保护您的信息安全。 +
+
+ 4、您的个人信息将全部被存储于中华人民共和国境内。 +
+
+
+
四、第三方服务与信息共享
+
+ 1、我们会与第三方软件工具开发包(SDK)或其他类似的应用程序类服务商分享您的个人信息,以保障平台的稳定运行、功能实现,具体接入信息如下: +
+
+ 第三方SDK名称:友盟消息推送SDK +
+ 用途:向用户推送成绩更新通知等消息 +
+ SDK服务商:友盟同欣(北京)科技有限公司 +
+ 收集的个人信息类型:设备信息(IMEI/MAC/Android + ID/IDFA/OAID/OpenUDID/GUID/SIM卡IMSI/ICCID)、位置信息、网络信息 +
+ 官网链接:https://www.umeng.com/push +
+ 隐私权政策链接:https://www.umeng.com/page/policy +
+
+ 第三方SDK名称:友盟统计分析SDK +
+ 用途:收集用户功能使用、留存分析信息 +
+ SDK服务商:友盟同欣(北京)科技有限公司 +
+ 收集的个人信息类型:设备信息(IMEI/MAC/Android + ID/IDFA/OAID/OpenUDID/GUID/SIM卡IMSI/ICCID)、位置信息、网络信息 +
+ 官网链接:https://www.umeng.com/analytics +
+ 隐私权政策链接:https://www.umeng.com/page/policy +
+
+ 第三方SDK名称:腾讯Bugly SDK +
+ 用途:APP程序异常、崩溃日志统计 +
+ 收集的个人信息类型:运⾏中进程信息、Crash信息及线程堆栈,ROM/RAM/SD卡容量、网络/语言等状态、包名、版本、所属进程名 +
+ 官网链接:https://bugly.qq.com/ +
+ 隐私权政策链接:https://static.bugly.qq.com/bugly-sdk-privacy-statement.pdf +
+
+
+ 2、因合并、分立、解散、被宣告破产等原因需要转移个人信息的,我们会告知您接收方的名称或者姓名和联系方式。接受方将继续受本隐私政策约束。接收方变更原先的处理目的、处理方式的,会重新向您征求同意。 +
+
+
+
五、您的权利
+
+ 在您使用福uu期间,为了更便捷地保障您撤销授权的权利,我们在产品设计中为您提供了相应的操作设置,您可参考下面的指引进行操作。此外,我们还设置了投诉举报渠道,您的意见将会得到及时的处理。如果您无法通过上述途径和方式行使您的个人信息主体权利,您可以通过本隐私保护政策中提供的联系方式提出您的请求,我们会按照法律法规的规定予以反馈。 +
+ +
+ 1、撤回授权 +
+
+ 您可通过下列路径:“我的-设置-隐私权限设置”撤回对各权限的授权。请您理解,每项业务功能需要一些必要的信息才能得以完成,当您撤回授权后,我们将无法继续为您提供该授权所对应的服务。 +
+
+ +
+ 2、获取本隐私保护政策的解释说明 +
+
您可以通过本隐私保护政策第六节提供的方式联系我们,要求我们对本隐私保护政策进行解释说明。 +
+
+ +
+ 3、响应您的上述请求 +
+
为保障安全,如您根据本隐私保护政策第六节向我们提出请求,我们将先验证您的个人信息主体身份,然后再处理您的请求。 + + 我们将在15个工作日或法律法规规定的期限内予以反馈。如您不满意或有任何问题,您可以通过本隐私保护政策第六节提供的方式联系我们。 + + 对于您合理的请求,我们原则上不收取费用,但对多次重复、超出合理限度的请求,我们将视情况收取一定成本费用。对于那些技术上难以实现、根据法律、行政法规的规定无需响应的请求或响应您的请求将违反法律、行政法规时,我们可能会予以拒绝,并向您说明理由。 +
+
+ + +
+
+
六、未成年人保护
+
+ 我们非常重视对未成年人个人信息的保护。若您是18周岁以下的未成年人,在取得您或您的监护人同意之前,我们不会处理您的个人信息。若您是未成年人的监护人,当您对您所监护的未成年人的个人信息有相关疑问时,请通过第9节中的联系方式与我们联系。 +
+
+
七、本政策如何更新
+
+ 福uu可能适时会对本隐私政策进行调整或变更,本隐私政策的任何更新将以标注更新时间的方式发布在福uu应用程序上,除法律法规或监管规定另有强制性规定外,经调整或变更的内容一经通知或公布后的7日内生效。如您在个人信息保护及隐私政策调整或变更后继续使用福uu的任一产品或服务,福uu相信这代表您已充分阅读、理解并接受修改后的个人信息保护及隐私政策并受其约束。 +
+
+
+
八、如何联系我们
+
+ 当您有其他的投诉、建议、或其它与本APP相关问题时,请通过 https://www.w2fzu.com/ + 与我们联系。您也可以将您的问题发送至 admin@w2fzu.com + 或寄到如下地址:福建省福州市闽侯县上街镇学园路2号福州大学科技园阳光科技大厦北910室,我们将尽快审核所涉问题,并在验证您的用户身份后的15个工作日之内予以回复。 +
+
+
+
+ + + \ No newline at end of file diff --git a/api/statistic/html/UserAgreement.html b/api/statistic/html/UserAgreement.html new file mode 100644 index 00000000..28e7c212 --- /dev/null +++ b/api/statistic/html/UserAgreement.html @@ -0,0 +1,252 @@ + + + + +福uu用户服务协议 + + + +
+

+福uu用户服务协议 +

+

+更新日期:2023年10月16日 +

+

+生效日期:2023年10月16日 +

+

+感谢您选择福uu应用程序(以下简称“福uu”)服务!福uu用户服务协议是由福州西二在线网络有限公司(以下简称“西二在线”)和您签订。 +

+

+一、声明 +

+

+福uu提供的各项服务所有权和运作权均归西二在线所有。 +

+

+服务协议由福uu用户与西二在线就福uu所提供的各项服务而签订的相关权利义务规范。西二在线作为福uu的运营者依据本协议条款为用户提供服务。请您务必审慎阅读、充分理解各条款内容。 +

+

+用户通过登录使用福uu所提供的相关软件服务,(用户在首次登录过程中通过勾选确认同意《福uu用户服务协议》)即表示接受并同意本协议的所有条件和条款,用户有权选择不接受本协议条款,不愿接受本协议条款的,不得访问、使用福uu提供的相关服务。 +

+

+西二在线有权对本协议条款进行修改,修改后的协议条款明确由您确认同意后即有效代替原来的协议条款。用户可随时查阅最新协议。 +

+

+如您为无民事行为能力人或为限制民事行为能力人,请告知您的监护人,并在您监护人的指导下阅读本协议和使用我们的服务。若您非中华人民共和国境内(为本协议之目的,不包括中华人民共和国香港特别行政区、中华人民共和国澳门特别行政区及中国台湾地区)用户,您还需同时遵守您所属国家或地区的法律,且您确认,订立并履行本协议不违反您所属、所居住或开展经营活动或其他业务的国家或地区的法律法规。 +

+

+二、服务内容 +

+

+福uu运用自己的软件系统,通过互联网络、移动手机软件等方式为用户提供多种网络服务。服务包含: +

+

+(1)课程表功能:您可以通过福uu将您的课表信息导入APP中或者手动添加您的课表信息,并对您的课程信息进行浏览、编辑、保存。 +

+

+(2)历年卷功能:您可以通过福uu上传/下载历年卷。 +

+

+(3)成绩查询/学分统计/选课:提供学校教务处上的官方成绩信息等。 +

+

+(4)空教室/考场查询:提供学校教务处上的空教室/个人考试考场信息。 +

+

+(5)作业:记录课程作业的工具,您可以使用该服务创建、编辑、保存作业。 +

+

+(6)应用程序中包含的其他服务。 +

+

+下文对以上服务简称“服务”。 +

+

+三、服务使用 +

+

+依照本服务条款中的条款和条件,福uu向您授予使用服务的有限、非独占许可,前提是: +

+

+(1)您已达到订立有约束力的合同的法定年龄或者取得监护人的授权同意。 +

+

+(2)中华人民共和国(为本服务条款之目的,不含中华人民共和国香港特别行政区、中华人民共和国澳门特别行政区及中国台湾地区,以下简称“中国”)法律未禁止您接受服务。为获取和(或)使用服务,您需要在登录或者使用服务的过程中,提供当前准确的识别、联系及其他信息,且您有责任保持该等信息的准确和完整,并对在您的帐户下进行的全部活动(包括您已向其提供您的帐户信息的其他人所进行的活动)负完全责任。对于因您未能提供准确信息或保持您的帐户信息安全而引起的任何损失或损害,福uu概不负责。 +

+

+(3)对于为获取服务而需取得的设备及电信服务,以及与之相关的全部费用(如计算设备及互联网服务提供商及国际漫游通话费等),由您自行负责。 +

+

+(4)在确认得到您的授权下,福uu通过非自营官方渠道查询所提供的成绩查询结果、课表信息(包括但不限于)仅作为参考,请您以官方渠道所提供的官方数据为准,福uu对此等信息的准确性、完整性、合法性或真实性均不承担责任。 +

+

+四、账户的登录和使用 +

+

+(1)您表示接受并同意本协议的所有条件和条款才能登录和使用福uu服务。您有权选择不接受本协议条款。 +

+

+(2)您在账户中设置的昵称、头像、个性签名等务必遵守法律法规、公序良俗、社会公德,且不会侵害其他第三方的合法权益,否则我们可能会取消您的昵称、头像、个性签名。 +

+

+用户账户是我们识别您身份的依据,请您务必妥善保管。使用用户账户进行的操作、发出的指令视为您本人做出。因您的原因造成的账户、密码等信息被冒用、盗用或非法使用,由此引起的风险和损失需要由您自行承担。您同意: +

+

+(1)福uu账户仅限您本人使用,请勿转让、借用、赠与、继承。 +

+

+(2)基于运行和服务安全的需要,我们可能会暂停或者限制福uu服务部分功能,或增加新的功能。 +

+

+(3)为了维护良好的网络环境,我们有时需要了解您使用福uu服务的真实背景及目的,如我们要求您提供相关信息或资料的,请您配合提供。 +

+

+五、注意事项 +

+

+为有效保障您使用我们服务时的合法权益,我们提醒您注意以下事项: +

+

(一)身份验证

+

+(1)您在登录、使用我们服务的过程中,请您提供合法、真实、有效、准确并完整的资料。 +

+

+(二)存在如下情形时,我们可能会对您福uu账户暂停或终止提供服务: +

+

+(1)您违反了法律法规的规定或本协议的约定; +

+

+(2)根据相关法律法规或有权机关的要求; +

+

+(3)您遭到他人投诉,且对方已经提供了一定证据,证明您存在违规行为的; +

+

+(三)您了解福uu上的部分信息系用户自行发布,由于海量信息的存在,我们无法彻底杜绝可能存在风险和瑕疵。您应谨慎判断确定相关信息的真实性、合法性和有效性,并注意保留相应的证据以利于维权,对您因依相关信息进行的交易、求职等相关行为而遭受的损失或损害的,我们将近极力协助您进行追究和挽救,但我们不承担任何责任。 +

+

+六、服务承诺 +

+

+1、您需要遵守中华人民共和国相关法律法规及您所属、所居住或开展经营活动或其他业务的国家或地区的法律法规,不得将我们的服务用于非法目的,也不得以非法方式使用我们的服务。 +

+

+2、您不得利用我们的服务从事侵害他人合法权益之行为或违反国家法律法规,否则我们有权进行调查、延迟或拒绝结算或停止提供服务,且您需要自行承担相关法律责任,如因此导致我们或其他方受损的,您需要承担赔偿责任。 +

+

+3、您不得利用我们的服务危害国家安全、泄露国家秘密,不得侵犯国家社会集体的和公民的合法权益,不得利用我们的服务制作、复制和传播下列信息: +

+

+(1)煽动抗拒、破坏宪法和法律、行政法规实施的; +

+

+(2)煽动颠覆国家政权,推翻社会主义制度的; +

+

+(3)煽动分裂国家、破坏国家统一的; +

+

+(4)煽动民族仇恨、民族歧视,破坏民族团结的; +

+

+(5)捏造或者歪曲事实,散布谣言,扰乱社会秩序的; +

+

+(6)宣扬封建迷信、淫秽、色情、赌博、暴力、凶杀、恐怖、教唆犯罪的; +

+

+(7)公然侮辱他人或者捏造事实诽谤他人的,或者进行其他恶意攻击的; +

+

+(8)损害国家机关信誉的; +

+

+(9)其他违反宪法和法律行政法规的; +

+

+(10)进行商业广告行为的。 +

+

+4、您不得通过任何手段恶意使用福uu帐号,包括但不限于以牟利、炒作、套现、获奖等。用户亦不得盗用其他用户帐号。 +

+

+5、您不得将福uu以任何形式作为从事各种非法活动的场所、平台或媒介。未经福uu的授权或许可,不得借用本站的名义从事任何商业活动,也不得以任何形式将福uu作为从事商业活动的场所、平台或媒介。如违反上述规定,则福uu有权直接采取一切必要的措施,包括但不限于删除您发布的内容,暂停或查封您的帐号,取消因违规所获利益,乃至通过诉讼形式追究用户法律责任等。 +

+

+6、您在福uu不得发布、传播法律、法规禁止的信息或实施其他任何违法法律法规的行为,否则福uu将封禁或者关闭有关账号、版块,涉嫌刑事犯罪的,我们将会向公安机关报案处理。 +

+

+七、用户信息保护 +

+

+我们重视对您信息的保护。关于您的个人信息依《福uu用户隐私协议》受到保护与规范。具体请查阅《福uu用户隐私政策》。 +

+

+八、不可抗力、免责及责任限制 +

+

+(一)免责条款 +

+

+您明示理解并同意因下列原因导致我们无法正常提供服务,我们免于承担责任: +

+

+1、我们的系统停机维护或升级; +

+

+2、因台风、地震、洪水、雷电或恐怖袭击等不可抗力原因; +

+

+3、您的电脑软硬件和通信线路、供电线路出现故障的; +

+

+4、因您操作不当或通过非经我们授权或认可的方式使用我们服务的;因病毒、木马、恶意程序攻击、网络拥堵、系统不稳定、系统或设备故障、通讯故障、电力故障、银行原因、第三方服务瑕疵或政府行为等原因。尽管有前款约定,我们将采取合理行动积极促使服务恢复正常。 +

+

+5、您使用成绩查询、导入课表信息等,均由您根据自行判断完成且由您自负风险。 +

+

+6、在确认得到您的授权下,福uu通过非自营官方渠道查询所提供的成绩查询结果、课表信息(包括但不限于)仅作为参考,请您以官方渠道所提供的官方数据为准,福uu对此等信息的准确性、完整性、合法性或真实性均不承担责任。 +

+

+九、知识产权的保护 +

+

+您已经明确阅读,并明确了解福uu如下的“知识产权声明”: +

+

+1、您接受本协议,即表您主动将其在任何时间段在本站发表的任何形式的合法信息的著作财产权,包括并不限于:复制权、发行权、出租权、展览权、表演权、放映权、广播权、信息网络传播权、摄制权、改编权、翻译权、汇编权等,以及应当由著作权人享有的其他可转让权利无偿独家转让给福uu运营商所有,同时表明您许可福uu网有权利就任何主体侵权而单独提起诉讼,并获得全部赔偿。本协议已经构成《著作权法》第二十五条所规定的书面协议,其效力及于用户在福uu发布的任何受著作权法保护的作品内容,无论该内容形成于本协议签订前还是本协议签订后。 +

+

+2、西二在线是福uu的制作者,拥有此应用程序内容及资源的版权,受国家知识产权保护,享有对本应用程序各种协议、声明的修改权;未经福uu的明确书面许可,任何第三方不得为任何非私人或商业目的获取或使用本应用程序的任何部分或通过本应用程序可直接或间接获得的任何内容、服务或资料。任何第三方违反本协议的规定以任何方式,和/或以任何文字对本应用程序的任何部分进行发表、复制、转载、更改、引用、链接、下载或以其他方式进行使用,或向任何其他第三方提供获取本应用程序任何内容的渠道,则对本应用程序的使用权将立即终止,且任何第三方必须按照本公司的要求,归还或销毁使用本应用程序任何部分的内容所创建的资料的任何副本。 +

+

+3、福uu未向任何第三方转让本应用程序或其中的任何内容所相关的任何权益或所有权,且一切未明确向任何第三方授予的权利均归福uu所有。未经本协议明确允许而擅自使用本应用程序任何内容、服务或资料的,构成对本协议的违约行为,且可能触犯著作权、商标、专利和/或其他方面的法律法规,福uu保留对任何违反本协议规定的第三方(包括单位或个人等)提起法律诉讼的权利。 +

+

+十、法律适用与管辖 +

+

+本协议之效力、解释、变更、执行与争议解决均适用中华人民共和国法律。因本协议产生的争议,均应依照中华人民共和国法律予以处理。 +

+

+十一、联系我们 +

+

+当您有其他的投诉、建议、未成年人个人信息相关问题或需要删除所有访问记录时,请通过本App制作工作室西二在线福uu网站反馈地址与我们联系: +https://www.w2fzu.com +

+

+我们将尽快审核所涉问题,并在验证您的用户身份后的十五天内予以回复。 +

+

+

西二在线福uu
+

+
+
+ + \ No newline at end of file diff --git a/api/statistic/version.json b/api/statistic/version.json new file mode 100644 index 00000000..b112cebd --- /dev/null +++ b/api/statistic/version.json @@ -0,0 +1 @@ +{"Version":"6.3.3","Code":"633001","Url":"https://download.w2fzu.com/apk/FzuHelper_6.3.1_2.apk","Feature":"1. \\u89e3\\u51b3\\u672c\\u79d1\\u751f\\u767b\\u5f55\\u63d0\\u793a\\u5bc6\\u7801\\u9519\\u8bef\\u95ee\\u9898\\uff1b\\r\\n2. \\u5bfc\\u51fa\\u65e5\\u5386\\u6587\\u4ef6\\u529f\\u80fd\\u4f18\\u5316\\u3002"} \ No newline at end of file diff --git a/api/statistic/versionbeta.json b/api/statistic/versionbeta.json new file mode 100644 index 00000000..10c13849 --- /dev/null +++ b/api/statistic/versionbeta.json @@ -0,0 +1 @@ +{"Version":"6.3.3","Code":"633001","Url":"https://download.w2fzu.com/apk/FzuHelper_6.3.1_2.apk","Feature":"1. \\u89e3\\u51b3\\u672c\\u79d1\\u751f\\u767b\\u5f55\\u63d0\\u793a\\u5bc6\\u7801\\u9519\\u8bef\\u95ee\\u9898\\uff1b\\r\\n2. \\u5bfc\\u51fa\\u65e5\\u5386\\u6587\\u4ef6\\u529f\\u80fd\\u4f18\\u5316\\u3002"} diff --git a/api/statistic/visits.json b/api/statistic/visits.json new file mode 100644 index 00000000..084bb620 --- /dev/null +++ b/api/statistic/visits.json @@ -0,0 +1 @@ +{"2024-07-14":6200,"2024-07-15":9567,"2024-07-16":8160,"2024-07-17":7629,"2024-07-18":1,"2024-09-24":1,"2024-09-25":1,"2024-11-05":1,"2024-11-16":1,"2024-11-17":13871,"2024-11-18":50384,"2024-11-19":50262,"2024-11-20":46854,"2024-11-21":40572,"2024-11-22":38888,"2024-11-23":25933,"2024-11-24":28349,"2024-11-25":49135,"2024-11-26":28631,"2024-11-28":69,"2024-12-08":6} \ No newline at end of file diff --git a/cmd/api/main.go b/cmd/api/main.go index de958d7b..15341519 100644 --- a/cmd/api/main.go +++ b/cmd/api/main.go @@ -33,11 +33,9 @@ import ( "github.com/hertz-contrib/gzip" "github.com/hertz-contrib/opensergo/sentinel/adapter" - "github.com/west2-online/fzuhelper-server/api/handler/api" "github.com/west2-online/fzuhelper-server/api/router" "github.com/west2-online/fzuhelper-server/api/rpc" "github.com/west2-online/fzuhelper-server/config" - "github.com/west2-online/fzuhelper-server/pkg/base" "github.com/west2-online/fzuhelper-server/pkg/constants" "github.com/west2-online/fzuhelper-server/pkg/logger" "github.com/west2-online/fzuhelper-server/pkg/utils" @@ -50,8 +48,6 @@ func init() { config.Init(serviceName) // eshook.InitLoggerWithHook(serviceName) rpc.Init() - - api.ClientSet = base.NewClientSet(base.WithHzClient()) } func main() { diff --git a/cmd/common/kitex_info.yaml b/cmd/common/kitex_info.yaml new file mode 100644 index 00000000..35192cf2 --- /dev/null +++ b/cmd/common/kitex_info.yaml @@ -0,0 +1,3 @@ +kitexinfo: + ServiceName: 'common' + ToolVersion: 'v0.11.3' diff --git a/cmd/common/main.go b/cmd/common/main.go new file mode 100644 index 00000000..3c9b8f1f --- /dev/null +++ b/cmd/common/main.go @@ -0,0 +1,78 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package main + +import ( + "net" + + "github.com/cloudwego/kitex/pkg/limit" + "github.com/cloudwego/kitex/pkg/rpcinfo" + "github.com/cloudwego/kitex/server" + etcd "github.com/kitex-contrib/registry-etcd" + + "github.com/west2-online/fzuhelper-server/config" + "github.com/west2-online/fzuhelper-server/internal/common" + "github.com/west2-online/fzuhelper-server/kitex_gen/common/commonservice" + "github.com/west2-online/fzuhelper-server/pkg/base" + "github.com/west2-online/fzuhelper-server/pkg/constants" + "github.com/west2-online/fzuhelper-server/pkg/logger" + "github.com/west2-online/fzuhelper-server/pkg/utils" +) + +var ( + serviceName = constants.CommonServiceName + clientSet *base.ClientSet +) + +func init() { + config.Init(serviceName) + // eshook.InitLoggerWithHook(serviceName) + clientSet = base.NewClientSet() +} + +func main() { + r, err := etcd.NewEtcdRegistry([]string{config.Etcd.Addr}) + if err != nil { + logger.Fatalf("Common: etcd registry failed, error: %v", err) + } + listenAddr, err := utils.GetAvailablePort() + if err != nil { + logger.Fatalf("Common: get available port failed: %v", err) + } + addr, err := net.ResolveTCPAddr("tcp", listenAddr) + if err != nil { + logger.Fatalf("Common: listen addr failed %v", err) + } + + svr := commonservice.NewServer( + common.NewCommonService(clientSet), + server.WithServerBasicInfo(&rpcinfo.EndpointBasicInfo{ + ServiceName: serviceName, + }), + server.WithMuxTransport(), + server.WithServiceAddr(addr), + server.WithRegistry(r), + server.WithLimit(&limit.Option{ + MaxConnections: constants.MaxConnections, + MaxQPS: constants.MaxQPS, + }), + ) + + if err = svr.Run(); err != nil { + logger.Fatalf("Common: server run failed: %v", err) + } +} diff --git a/cmd/version/kitex_info.yaml b/cmd/version/kitex_info.yaml new file mode 100644 index 00000000..54ebe896 --- /dev/null +++ b/cmd/version/kitex_info.yaml @@ -0,0 +1,3 @@ +kitexinfo: + ServiceName: 'version' + ToolVersion: 'v0.11.3' diff --git a/cmd/version/main.go b/cmd/version/main.go new file mode 100644 index 00000000..b27218a7 --- /dev/null +++ b/cmd/version/main.go @@ -0,0 +1,78 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package main + +import ( + "net" + + "github.com/cloudwego/kitex/pkg/limit" + "github.com/cloudwego/kitex/pkg/rpcinfo" + "github.com/cloudwego/kitex/server" + etcd "github.com/kitex-contrib/registry-etcd" + + "github.com/west2-online/fzuhelper-server/config" + "github.com/west2-online/fzuhelper-server/internal/version" + "github.com/west2-online/fzuhelper-server/kitex_gen/version/versionservice" + "github.com/west2-online/fzuhelper-server/pkg/base" + "github.com/west2-online/fzuhelper-server/pkg/constants" + "github.com/west2-online/fzuhelper-server/pkg/logger" + "github.com/west2-online/fzuhelper-server/pkg/utils" +) + +var ( + serviceName = constants.VersionServiceName + clientSet *base.ClientSet +) + +func init() { + config.Init(serviceName) + // eshook.InitLoggerWithHook(serviceName) + clientSet = base.NewClientSet() +} + +func main() { + r, err := etcd.NewEtcdRegistry([]string{config.Etcd.Addr}) + if err != nil { + logger.Fatalf("Version: etcd registry failed, error: %v", err) + } + listenAddr, err := utils.GetAvailablePort() + if err != nil { + logger.Fatalf("Version: get available port failed: %v", err) + } + addr, err := net.ResolveTCPAddr("tcp", listenAddr) + if err != nil { + logger.Fatalf("Version: listen addr failed %v", err) + } + + svr := versionservice.NewServer( + version.NewVersionService(clientSet), + server.WithServerBasicInfo(&rpcinfo.EndpointBasicInfo{ + ServiceName: serviceName, + }), + server.WithMuxTransport(), + server.WithServiceAddr(addr), + server.WithRegistry(r), + server.WithLimit(&limit.Option{ + MaxConnections: constants.MaxConnections, + MaxQPS: constants.MaxQPS, + }), + ) + + if err = svr.Run(); err != nil { + logger.Fatalf("Version: server run failed: %v", err) + } +} diff --git a/config/config.example.yaml b/config/config.example.yaml index 401e8228..0face5b8 100644 --- a/config/config.example.yaml +++ b/config/config.example.yaml @@ -10,6 +10,14 @@ defaultUser: account: "" password: "" +url: + password: "" + bucket: "" + operator: "" + pass: "" + token-timeout: 1800 + path: "" + snowflake: worker-id: 0 datancenter-id: 0 @@ -47,6 +55,18 @@ upyuns: uss-domain: "" download-domain: "" path: "/__Unchecked_adjowe/" + version: + bucket: "fzuhelper-filedown" + operator: "" + password: "" + token-timeout: 1800 + path: "/statistic/" + common: + bucket: "fzuhelper-filedown" + operator: "" + password: "" + token-timeout: 1800 + path: "/statistic/html/" elasticsearch: addr: 127.0.0.1:9200 @@ -113,3 +133,16 @@ services: load-balance: false addr: - 0.0.0.0:20007 + + version: + name: version + load-balance: false + addr: + - 0.0.0.0:20008 + + common: + name: common + load-balance: false + addr: + - 0.0.0.0:20009 + diff --git a/config/config.go b/config/config.go index 6db32042..6b7590fc 100644 --- a/config/config.go +++ b/config/config.go @@ -39,6 +39,7 @@ var ( Elasticsearch *elasticsearch Kafka *kafka UpYun *upyun + UrlService *url runtimeViper = viper.New() ) @@ -88,6 +89,7 @@ func configMapping(srv string) { Elasticsearch = &c.Elasticsearch Kafka = &c.Kafka DefaultUser = &c.DefaultUser + UrlService = &c.Url upy, ok := c.UpYuns[srv] if ok { UpYun = &upy diff --git a/config/types.go b/config/types.go index 988037d7..f4302eb9 100644 --- a/config/types.go +++ b/config/types.go @@ -33,6 +33,19 @@ type service struct { LB bool `mapstructure:"load-balance"` } +/* +for android +用于构造又拍云的上传参数 +*/ +type url struct { + Password string + Bucket string + Operator string + Pass string + TokenTimeout int64 `mapstructure:"token-timeout"` + Path string +} + type mySQL struct { Addr string Database string @@ -119,4 +132,5 @@ type config struct { Kafka kafka DefaultUser defaultUser UpYuns map[string]upyun + Url url } diff --git a/idl/api.thrift b/idl/api.thrift index 78c942ed..95197bd7 100644 --- a/idl/api.thrift +++ b/idl/api.thrift @@ -281,163 +281,168 @@ service AcademicService { GetUnifiedExamResponse GetUnifiedExam(1:GetUnifiedExamRequest req)(api.get="/api/v1/jwch/academic/unified-exam") } - - -// url - -struct APILoginRequest { - 1: required string password +// url_refactor->version +struct LoginRequest{ + 1: required string password, } -struct APILoginResponse { - +struct LoginResponse{ + 1: model.BaseResp base, } -struct UploadVersionInfoRequest { - 1: required string password - 2: required string type - 3: required string version - 4: required string code - 5: required string feature - 6: required string url +struct UploadRequest{ + 1: required string version, + 2: required string code, + 3: required string url, + 4: required string feature, + 5: required string type, + 6: required string password, } -struct UploadVersionInfoResponse { +struct UploadResponse{ + 1: model.BaseResp base, } -struct GetUploadParamsRequest { - 1: required string password +struct UploadParamsRequest{ + 1: required string password, } -struct GetUploadParamsResponse { - 1: required string policy, - 2: required string authorization, +struct UploadParamsResponse{ + 1: optional model.BaseResp base, + 2: optional string policy, + 3: optional string authorization, } - -struct GetDownloadReleaseRequest { - +struct DownloadReleaseApkRequest{ } -struct GetDownloadReleaseResponse { - +struct DownloadReleaseApkResponse{ + 1: optional binary file, } -struct GetDownloadBetaRequest { - +struct DownloadBetaApkRequest{ } -struct GetDownloadBetaResponse { - +struct DownloadBetaApkResponse{ + 1: optional binary file, } -struct GetReleaseVersionRequest { - +struct GetReleaseVersionRequest{ } -struct GetReleaseVersionResponse { - - +struct GetReleaseVersionResponse{ + 1: optional model.BaseResp base, + 2: optional string code, + 3: optional string feature, + 4: optional string url, + 5: optional string version, } -struct GetBetaVersionRequest { +struct GetBetaVersionRequest{ } struct GetBetaVersionResponse{ - + 1: optional model.BaseResp base, + 2: optional string code, + 3: optional string feature, + 4: optional string url, + 5: optional string version, } -struct GetCloudSettingRequest { +struct GetSettingRequest{ 1: optional string account, 2: optional string version, - 3: optional string beta, + 3: optional bool beta, 4: optional string phone, - 5: optional string isLogin, + 5: optional bool isLogin, 6: optional string loginType, } -struct GetCloudSettingResponse { - +struct GetSettingResponse{ + 1: optional model.BaseResp base, + 2: binary cloud_setting, } -struct GetAllCloudSettingRequest { - +struct GetTestRequest{ + 1: optional string account, + 2: optional string version, + 3: optional bool beta, + 4: optional string phone, + 5: optional bool isLogin, + 6: optional string loginType, + 7: optional string setting, } -struct GetAllCloudSettingResponse { - +struct GetTestResponse{ + 1: model.BaseResp base, + 2: binary cloud_setting, } -struct SetAllCloudSettingRequest { - 1: required string password - 2: required string setting +struct GetCloudRequest{ } -struct SetAllCloudSettingResponse { - +struct GetCloudResponse{ + 1: optional model.BaseResp base, + 2: binary cloud_setting, } -struct TestSettingRequest { - 1: required string setting - 2: required string account - 3: required string version - 4: required string beta - 5: required string phone - 6: required string isLogin - 7: required string loginType +struct SetCloudRequest{ + 1: required string password, + 2: required string setting, } -struct TestSettingResponse { - +struct SetCloudResponse{ + 1: model.BaseResp base, } -struct DumpVisitRequest { - +struct GetDumpRequest{ } -struct DumpVisitResponse { - +struct GetDumpResponse{ + 1: optional model.BaseResp base, + 2: string data, } -struct FZUHelperCSSRequest{ - +service VersionService{ + LoginResponse Login(1:LoginRequest req)(api.post="/api/v2/url/login") + UploadResponse UploadVersion(1:UploadRequest req)(api.post="/api/v2/url/upload") + UploadParamsResponse UploadParams(1:UploadParamsRequest req)(api.post="/api/v2/url/upload-params") + DownloadReleaseApkResponse DownloadReleaseApk(1:DownloadReleaseApkRequest req)(api.get="/api/v2/url/release.apk") + DownloadBetaApkResponse DownloadBetaApk(1:DownloadBetaApkRequest req)(api.get="/api/v2/url/beta.apk") + GetReleaseVersionResponse GetReleaseVersion(1:GetReleaseVersionRequest req)(api.get="/api/v2/url/version.json") + GetBetaVersionResponse GetBetaVersion(1:GetBetaVersionRequest req)(api.get="/api/v2/url/versionbeta.json") + GetSettingResponse GetSetting(1:GetSettingRequest req)(api.get="/api/v2/url/settings.php") + GetTestResponse GetTest(1:GetTestRequest req)(api.post="/api/v2/url/test") + GetCloudResponse GetCloud(1:GetCloudRequest req)(api.get="/api/v2/url/getcloud") + SetCloudResponse SetCloud(1:SetCloudRequest req)(api.post="/api/v2/url/setcloud") + GetDumpResponse GetDump(1:GetDumpRequest req)(api.get="/api/v2/url/dump") } -struct FZUHelperCSSResponse { - +// common +struct GetCSSRequest{ } -struct FZUHelperHTMLRequest { - +struct GetCSSResponse{ + 1: binary css, } -struct FZUHelperHTMLResponse { - +struct GetHtmlRequest{ } -struct UserAgreementHTMLRequest { - +struct GetHtmlResponse{ + 1: binary html, } -struct UserAgreementHTMLResponse { +struct GetUserAgreementRequest{ +} +struct GetUserAgreementResponse{ + 1: binary user_agreement, } -service UrlService { - APILoginResponse APILogin(1:APILoginRequest req) (api.post="/api/v1/url/login") - UploadVersionInfoResponse UploadVersionInfo(1:UploadVersionInfoRequest req) (api.post="/api/v1/url/upload") - GetUploadParamsResponse GetUploadParams(1:GetUploadParamsRequest req) (api.post="/api/v1/url/api/upload-params") - GetDownloadReleaseResponse GetDownloadRelease(1:GetDownloadReleaseRequest req) (api.get="/api/v1/url/release.apk") - GetDownloadBetaResponse GetDownloadBeta(1: GetDownloadBetaRequest req) (api.get="/api/v1/url/beta.apk") - GetReleaseVersionResponse GetReleaseVersion(1:GetReleaseVersionRequest req) (api.get="/api/v1/url/version.json") - GetBetaVersionResponse GetBetaVersion(1: GetBetaVersionRequest req) (api.get="/api/v1/url/versionbeta.json") - GetCloudSettingResponse GetCloudSetting(1: GetCloudSettingRequest req) (api.get="/api/v1/url/settings.php") - GetAllCloudSettingResponse GetAllCloudSetting(1: GetAllCloudSettingRequest req) (api.get="/api/v1/url/getcloud") - SetAllCloudSettingResponse SetAllCloudSetting(1: SetAllCloudSettingRequest req) (api.post="/api/v1/url/setcloud") - TestSettingResponse TestSetting(1: TestSettingRequest req) (api.post="/api/v1/url/test") - DumpVisitResponse DumpVisit(1: DumpVisitRequest req) (api.get="/api/v1/url/dump") - FZUHelperCSSResponse FZUHelperCSS(1: FZUHelperCSSRequest req) (api.get="/api/v1/url/onekey/fzu-helper.css") - FZUHelperHTMLResponse FZUHelperHTML(1: FZUHelperHTMLRequest req) (api.get="/api/v1/url/onekey/fzu-helper.html") - UserAgreementHTMLResponse UserAgreementHTML(1: UserAgreementHTMLRequest req) (api.get="/api/v1/url/onekey/user-agreement.html") +service CommonService { + GetCSSResponse GetCSS(1:GetCSSRequest req)(api.get="/api/v2/common/fzu-helper.css"), + GetHtmlResponse GetHtml(1:GetHtmlRequest req)(api.get="/api/v2/common/fzu-helper.html"), + GetUserAgreementResponse GetUserAgreement(1: GetUserAgreementRequest req) (api.get="/api/v2/common/user-agreement.html") } diff --git a/idl/common.thrift b/idl/common.thrift new file mode 100644 index 00000000..eeb6a283 --- /dev/null +++ b/idl/common.thrift @@ -0,0 +1,29 @@ +namespace go common +include "model.thrift" + +struct GetCSSRequest{ +} + +struct GetCSSResponse{ + 1: binary css, +} + +struct GetHtmlRequest{ +} + +struct GetHtmlResponse{ + 1: binary html, +} + +struct GetUserAgreementRequest{ +} + +struct GetUserAgreementResponse{ + 1: binary user_agreement, +} + +service CommonService { + GetCSSResponse GetCSS(1:GetCSSRequest req)(api.get="/api/v1/url/onekey/FZUHelper.css"), + GetHtmlResponse GetHtml(1:GetHtmlRequest req)(api.get="/api/v1/url/onekey/FZUHelper.html"), + GetUserAgreementResponse GetUserAgreement(1: GetUserAgreementRequest req) (api.get="/api/v1/url/onekey/UserAgreement.html") +} diff --git a/idl/model.thrift b/idl/model.thrift index d3698288..81ddd223 100644 --- a/idl/model.thrift +++ b/idl/model.thrift @@ -121,7 +121,22 @@ struct UnifiedExam { 3: required string term } +// ====== Common ====== +// 校历 +struct Term { + 1: required string term_id + 2: required string school_year + 3: required string term + 4: required string start_date + 5: required string end_date +} +struct TermEvent { + 1: required string name + 2: required string start_date + 3: required string end_date +} +// ====== END Common ====== struct PaperData { 1: required string base_path, diff --git a/idl/version.thrift b/idl/version.thrift new file mode 100644 index 00000000..d329fd42 --- /dev/null +++ b/idl/version.thrift @@ -0,0 +1,144 @@ +namespace go version +include"model.thrift" + +struct LoginRequest{ + 1: required string password, +} + +struct LoginResponse{ + 1: model.BaseResp base, +} + +struct UploadRequest{ + 1: required string version, + 2: required string code, + 3: required string url, + 4: required string feature, + 5: required string type, + 6: required string password, +} + +struct UploadResponse{ + 1: model.BaseResp base, + +} + +struct UploadParamsRequest{ + 1: required string password, +} + +struct UploadParamsResponse{ + 1: model.BaseResp base, + 2: optional string policy, + 3: optional string authorization, +} + +struct DownloadReleaseApkRequest{ +} + +struct DownloadReleaseApkResponse{ + 1: model.BaseResp base, + 2: string redirect_url, +} + +struct DownloadBetaApkRequest{ +} + +struct DownloadBetaApkResponse{ + 1: model.BaseResp base, + 2: string redirect_url, +} + +struct GetReleaseVersionRequest{ +} + +struct GetReleaseVersionResponse{ + 1: model.BaseResp base, + 2: optional string code, + 3: optional string feature, + 4: optional string url, + 5: optional string version, +} + +struct GetBetaVersionRequest{ +} + +struct GetBetaVersionResponse{ + 1: model.BaseResp base, + 2: optional string code, + 3: optional string feature, + 4: optional string url, + 5: optional string version, +} + +struct GetSettingRequest{ + 1: optional string account, + 2: optional string version, + 3: optional bool beta, + 4: optional string phone, + 5: optional bool isLogin, + 6: optional string loginType, +} + +struct GetSettingResponse{ + 1: optional model.BaseResp base, + 2: binary cloud_setting, +} + +struct GetTestRequest{ + 1: optional string account, + 2: optional string version, + 3: optional bool beta, + 4: optional string phone, + 5: optional bool isLogin, + 6: optional string loginType, + 7: optional string setting, +} +struct GetTestResponse{ + 1: model.BaseResp base, + 2: binary cloud_setting, +} + +struct GetCloudRequest{ +} + +struct GetCloudResponse{ + 1: model.BaseResp base, + 2: binary cloud_setting, +} + +struct SetCloudRequest{ + 1: required string password, + 2: required string setting, +} + +struct SetCloudResponse{ + 1: model.BaseResp base, +} + +struct GetDumpRequest{ +} + +struct GetDumpResponse{ + 1: model.BaseResp base, + 2: string data, +} + + + +service VersionService{ + LoginResponse Login(1:LoginRequest req)(api.post="/api/v1/url/login"), + UploadResponse UploadVersion(1:UploadRequest req)(api.post="/api/v1/url/api/upload"), + UploadParamsResponse UploadParams(1:UploadParamsRequest req)(api.post="/api/v1/url/api/uploadparams"), + DownloadReleaseApkResponse DownloadReleaseApk(1:DownloadReleaseApkRequest req)(api.get="/api/v1/url/release.apk"), + DownloadBetaApkResponse DownloadBetaApk(1:DownloadBetaApkRequest req)(api.get="/api/v1/url/beta.apk"), + GetReleaseVersionResponse GetReleaseVersion(1:GetReleaseVersionRequest req)(api.get="/api/v1/url/version.json"), + GetBetaVersionResponse GetBetaVersion(1:GetBetaVersionRequest req)(api.get="/api/v1/url/versionbeta.json"), + GetSettingResponse GetSetting(1:GetSettingRequest req)(api.get="/api/v1/url/settings.php"), + GetTestResponse GetTest(1:GetTestRequest req)(api.post="/api/v1/url/test"), + GetCloudResponse GetCloud(1:GetCloudRequest req)(api.get="/api/v1/url/getcloud"), + SetCloudResponse SetCloud(1:SetCloudRequest req)(api.post="/api/v1/url/setcloud"), + GetDumpResponse GetDump(1:GetDumpRequest req)(api.get="/api/v1/url/dump"), + +} + diff --git a/internal/common/handler.go b/internal/common/handler.go new file mode 100644 index 00000000..2970c3c3 --- /dev/null +++ b/internal/common/handler.go @@ -0,0 +1,73 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package common + +import ( + "context" + + "github.com/west2-online/fzuhelper-server/internal/common/service" + "github.com/west2-online/fzuhelper-server/kitex_gen/common" + "github.com/west2-online/fzuhelper-server/pkg/base" + "github.com/west2-online/fzuhelper-server/pkg/logger" +) + +// CommonServiceImpl implements the last service interface defined in the IDL. +type CommonServiceImpl struct { + ClientSet *base.ClientSet +} + +func NewCommonService(clientSet *base.ClientSet) *CommonServiceImpl { + return &CommonServiceImpl{ + ClientSet: clientSet, + } +} + +// GetCSS implements the CommonServiceImpl interface. +func (s *CommonServiceImpl) GetCSS(ctx context.Context, req *common.GetCSSRequest) (resp *common.GetCSSResponse, err error) { + resp = new(common.GetCSSResponse) + css, err := service.NewCommonService(ctx, s.ClientSet).GetCSS() + if err != nil { + logger.Infof("Common.GetCSS: %v", err) + return resp, nil + } + resp.Css = *css + return resp, nil +} + +// GetHtml implements the CommonServiceImpl interface. +func (s *CommonServiceImpl) GetHtml(ctx context.Context, req *common.GetHtmlRequest) (resp *common.GetHtmlResponse, err error) { + resp = new(common.GetHtmlResponse) + html, err := service.NewCommonService(ctx, s.ClientSet).GetHtml() + if err != nil { + logger.Infof("Common.GetHtml: %v", err) + return resp, nil + } + resp.Html = *html + return resp, nil +} + +// GetUserAgreement implements the CommonServiceImpl interface. +func (s *CommonServiceImpl) GetUserAgreement(ctx context.Context, req *common.GetUserAgreementRequest) (resp *common.GetUserAgreementResponse, err error) { + resp = new(common.GetUserAgreementResponse) + agreement, err := service.NewCommonService(ctx, s.ClientSet).GetUserAgreement() + if err != nil { + logger.Infof("Common.GetUserAgreement: %v", err) + return resp, nil + } + resp.UserAgreement = *agreement + return resp, nil +} diff --git a/internal/common/service/get_agreement.go b/internal/common/service/get_agreement.go new file mode 100644 index 00000000..bb3007d7 --- /dev/null +++ b/internal/common/service/get_agreement.go @@ -0,0 +1,31 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package service + +import ( + "fmt" + + "github.com/west2-online/fzuhelper-server/pkg/upyun" +) + +func (s *CommonService) GetUserAgreement() (*[]byte, error) { + jsonBytes, err := upyun.URlGetFile(upyun.JoinFileName(userAgreementFileName)) + if err != nil { + return nil, fmt.Errorf("CommonService.GetUserAgreement error:%w", err) + } + return jsonBytes, nil +} diff --git a/internal/common/service/get_css.go b/internal/common/service/get_css.go new file mode 100644 index 00000000..9a9b66c8 --- /dev/null +++ b/internal/common/service/get_css.go @@ -0,0 +1,31 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package service + +import ( + "fmt" + + "github.com/west2-online/fzuhelper-server/pkg/upyun" +) + +func (s *CommonService) GetCSS() (*[]byte, error) { + jsonBytes, err := upyun.URlGetFile(upyun.JoinFileName(cssFileName)) + if err != nil { + return nil, fmt.Errorf("CommonService.GetCSS error:%w", err) + } + return jsonBytes, nil +} diff --git a/internal/common/service/get_html.go b/internal/common/service/get_html.go new file mode 100644 index 00000000..667e5878 --- /dev/null +++ b/internal/common/service/get_html.go @@ -0,0 +1,31 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package service + +import ( + "fmt" + + "github.com/west2-online/fzuhelper-server/pkg/upyun" +) + +func (s *CommonService) GetHtml() (*[]byte, error) { + jsonBytes, err := upyun.URlGetFile(upyun.JoinFileName(htmlFileName)) + if err != nil { + return nil, fmt.Errorf("CommonService.GetHtml error:%w", err) + } + return jsonBytes, nil +} diff --git a/internal/common/service/service.go b/internal/common/service/service.go new file mode 100644 index 00000000..c2f60ede --- /dev/null +++ b/internal/common/service/service.go @@ -0,0 +1,39 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package service + +import ( + "context" + + "github.com/west2-online/fzuhelper-server/pkg/base" +) + +const ( + cssFileName = "FZUHelper.css" + htmlFileName = "FZUHelper.html" + userAgreementFileName = "UserAgreement.html" +) + +type CommonService struct { + ctx context.Context +} + +func NewCommonService(ctx context.Context, clientset *base.ClientSet) *CommonService { + return &CommonService{ + ctx: ctx, + } +} diff --git a/internal/launch_screen/service/create_image.go b/internal/launch_screen/service/create_image.go index bb33b5e1..4b68837e 100644 --- a/internal/launch_screen/service/create_image.go +++ b/internal/launch_screen/service/create_image.go @@ -64,6 +64,9 @@ func (s *LaunchScreenService) CreateImage(req *launch_screen.CreateImageRequest) return err }) eg.Go(func() error { + /* test stream + return utils.SaveImageFromBytes(req.Image, "jpg") + */ return upyun.UploadImg(req.Image, imgUrl) }) if err = eg.Wait(); err != nil { diff --git a/internal/version/handler.go b/internal/version/handler.go new file mode 100644 index 00000000..fc227897 --- /dev/null +++ b/internal/version/handler.go @@ -0,0 +1,185 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package version + +import ( + "context" + + "github.com/west2-online/fzuhelper-server/internal/version/service" + "github.com/west2-online/fzuhelper-server/kitex_gen/version" + "github.com/west2-online/fzuhelper-server/pkg/base" + "github.com/west2-online/fzuhelper-server/pkg/logger" +) + +// VersionServiceImpl implements the last service interface defined in the IDL. +type VersionServiceImpl struct { + ClientSet *base.ClientSet +} + +func NewVersionService(clientSet *base.ClientSet) *VersionServiceImpl { + return &VersionServiceImpl{ + ClientSet: clientSet, + } +} + +// Login implements the VersionServiceImpl interface. +func (s *VersionServiceImpl) Login(ctx context.Context, req *version.LoginRequest) (resp *version.LoginResponse, err error) { + resp = new(version.LoginResponse) + err = service.NewVersionService(ctx, s.ClientSet).Login(req) + resp.Base = base.BuildBaseResp(err) + return resp, nil +} + +// UploadVersion implements the VersionServiceImpl interface. +func (s *VersionServiceImpl) UploadVersion(ctx context.Context, req *version.UploadRequest) (resp *version.UploadResponse, err error) { + resp = new(version.UploadResponse) + err = service.NewVersionService(ctx, s.ClientSet).UploadVersion(req) + resp.Base = base.BuildBaseResp(err) + return resp, nil +} + +// UploadParams implements the VersionServiceImpl interface. +func (s *VersionServiceImpl) UploadParams(ctx context.Context, req *version.UploadParamsRequest) (resp *version.UploadParamsResponse, err error) { + resp = new(version.UploadParamsResponse) + policy, auth, err := service.NewVersionService(ctx, s.ClientSet).UploadParams(req) + resp.Base = base.BuildBaseResp(err) + if err != nil { + logger.Infof("Version.UploadParams: %v", err) + return resp, nil + } + resp.Policy = &policy + resp.Authorization = &auth + return resp, nil +} + +// DownloadReleaseApk implements the VersionServiceImpl interface. +func (s *VersionServiceImpl) DownloadReleaseApk(ctx context.Context, req *version.DownloadReleaseApkRequest) ( + resp *version.DownloadReleaseApkResponse, err error, +) { + resp = new(version.DownloadReleaseApkResponse) + redirectUrl, err := service.NewVersionService(ctx, s.ClientSet).DownloadReleaseApk() + resp.Base = base.BuildBaseResp(err) + if err != nil { + logger.Infof("Version.DownloadReleaseApk: %v", err) + return resp, nil + } + resp.RedirectUrl = redirectUrl + return resp, nil +} + +// DownloadBetaApk implements the VersionServiceImpl interface. +func (s *VersionServiceImpl) DownloadBetaApk(ctx context.Context, req *version.DownloadBetaApkRequest) ( + resp *version.DownloadBetaApkResponse, err error, +) { + resp = new(version.DownloadBetaApkResponse) + redirectUrl, err := service.NewVersionService(ctx, s.ClientSet).DownloadBetaApk() + resp.Base = base.BuildBaseResp(err) + if err != nil { + logger.Infof("Version.DownloadReleaseApk: %v", err) + } + resp.RedirectUrl = redirectUrl + return resp, nil +} + +// GetReleaseVersion implements the VersionServiceImpl interface. +func (s *VersionServiceImpl) GetReleaseVersion(ctx context.Context, req *version.GetReleaseVersionRequest) ( + resp *version.GetReleaseVersionResponse, err error, +) { + resp = new(version.GetReleaseVersionResponse) + v, err := service.NewVersionService(ctx, s.ClientSet).GetReleaseVersion() + resp.Base = base.BuildBaseResp(err) + if err != nil { + logger.Infof("Version.GetReleaseVersion: %v", err) + } + resp.Version = &v.Version + resp.Url = &v.Url + resp.Feature = &v.Feature + resp.Code = &v.Code + return resp, nil +} + +// GetBetaVersion implements the VersionServiceImpl interface. +func (s *VersionServiceImpl) GetBetaVersion(ctx context.Context, req *version.GetBetaVersionRequest) (resp *version.GetBetaVersionResponse, err error) { + resp = new(version.GetBetaVersionResponse) + v, err := service.NewVersionService(ctx, s.ClientSet).GetBetaVersion() + resp.Base = base.BuildBaseResp(err) + if err != nil { + logger.Infof("Version.GetBetaVersion: %v", err) + } + resp.Version = &v.Version + resp.Url = &v.Url + resp.Feature = &v.Feature + resp.Code = &v.Code + return resp, nil +} + +// GetSetting implements the VersionServiceImpl interface. +func (s *VersionServiceImpl) GetSetting(ctx context.Context, req *version.GetSettingRequest) (resp *version.GetSettingResponse, err error) { + resp = new(version.GetSettingResponse) + setting, err := service.NewVersionService(ctx, s.ClientSet).GetCloudSetting(req) + resp.Base = base.BuildBaseResp(err) + if err != nil { + logger.Infof("Version.GetSetting: %v", err) + } + resp.CloudSetting = *setting + return resp, nil +} + +// GetTest implements the VersionServiceImpl interface. +func (s *VersionServiceImpl) GetTest(ctx context.Context, req *version.GetTestRequest) (resp *version.GetTestResponse, err error) { + resp = new(version.GetTestResponse) + setting, err := service.NewVersionService(ctx, s.ClientSet).TestSetting(req) + resp.Base = base.BuildBaseResp(err) + if err != nil { + logger.Infof("Version.GetTest: %v", err) + } + resp.CloudSetting = *setting + return resp, nil +} + +// GetCloud implements the VersionServiceImpl interface. +func (s *VersionServiceImpl) GetCloud(ctx context.Context, req *version.GetCloudRequest) (resp *version.GetCloudResponse, err error) { + resp = new(version.GetCloudResponse) + setting, err := service.NewVersionService(ctx, s.ClientSet).GetAllCloudSetting() + resp.Base = base.BuildBaseResp(err) + if err != nil { + logger.Infof("Version.GetCloud: %v", err) + } + resp.CloudSetting = *setting + return resp, nil +} + +// SetCloud implements the VersionServiceImpl interface. +func (s *VersionServiceImpl) SetCloud(ctx context.Context, req *version.SetCloudRequest) (resp *version.SetCloudResponse, err error) { + resp = new(version.SetCloudResponse) + err = service.NewVersionService(ctx, s.ClientSet).SetSetting(req) + resp.Base = base.BuildBaseResp(err) + return resp, nil +} + +// GetDump implements the VersionServiceImpl interface. +func (s *VersionServiceImpl) GetDump(ctx context.Context, req *version.GetDumpRequest) (resp *version.GetDumpResponse, err error) { + resp = new(version.GetDumpResponse) + dump, err := service.NewVersionService(ctx, s.ClientSet).GetDump() + resp.Base = base.BuildBaseResp(err) + if err != nil { + logger.Infof("Version.GetDump: %v", err) + return resp, nil + } + resp.Data = *dump + return resp, nil +} diff --git a/internal/version/pack/cloud_setting.go b/internal/version/pack/cloud_setting.go new file mode 100644 index 00000000..95f9644c --- /dev/null +++ b/internal/version/pack/cloud_setting.go @@ -0,0 +1,33 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package pack + +import "encoding/json" + +type Plan struct { + Name *string + Account *string + Version *string + Beta *bool + Phone *string + IsLogin *bool + LoginType *string + Plan json.RawMessage +} +type CloudSetting struct { + Plans []Plan +} diff --git a/internal/version/pack/version.go b/internal/version/pack/version.go new file mode 100644 index 00000000..89a8c8c8 --- /dev/null +++ b/internal/version/pack/version.go @@ -0,0 +1,24 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package pack + +type Version struct { + Version string + Code string + Url string + Feature string +} diff --git a/internal/version/service/download_apk.go b/internal/version/service/download_apk.go new file mode 100644 index 00000000..f331905e --- /dev/null +++ b/internal/version/service/download_apk.go @@ -0,0 +1,52 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package service + +import ( + "fmt" + + "github.com/bytedance/sonic" + + "github.com/west2-online/fzuhelper-server/internal/version/pack" + "github.com/west2-online/fzuhelper-server/pkg/upyun" +) + +func (s *VersionService) DownloadReleaseApk() (string, error) { + jsonBytes, err := upyun.URlGetFile(upyun.JoinFileName(releaseVersionFileName)) + if err != nil { + return "", fmt.Errorf("VersionService.DownloadReleaseApk error:%w", err) + } + version := new(pack.Version) + err = sonic.Unmarshal(*jsonBytes, version) + if err != nil { + return "", fmt.Errorf("VersionService.DownloadReleaseApk error:%w", err) + } + return version.Url, nil +} + +func (s *VersionService) DownloadBetaApk() (string, error) { + jsonBytes, err := upyun.URlGetFile(upyun.JoinFileName(visitsFileName)) + if err != nil { + return "", fmt.Errorf("VersionService.DownloadBetaApk error:%w", err) + } + version := new(pack.Version) + err = sonic.Unmarshal(*jsonBytes, version) + if err != nil { + return "", fmt.Errorf("VersionService.DownloadBetaApk error:%w", err) + } + return version.Url, nil +} diff --git a/internal/version/service/download_apk_test.go b/internal/version/service/download_apk_test.go new file mode 100644 index 00000000..9f31cc69 --- /dev/null +++ b/internal/version/service/download_apk_test.go @@ -0,0 +1,163 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package service + +import ( + "fmt" + "testing" + + "github.com/bytedance/mockey" + "github.com/stretchr/testify/assert" + + "github.com/west2-online/fzuhelper-server/pkg/upyun" +) + +func TestDownloadBetaApk(t *testing.T) { + type testCase struct { + name string // 测试用例名称 + mockJsonBytes []byte // mock返回的json数据 + mockError error // mock返回的错误 + expectedUrl string // 期望返回的URL + expectingError bool // 是否期望抛出错误 + expectedErrorInfo string // 期望的错误信息 + } + + // 测试用例 + testCases := []testCase{ + { + name: "SuccessCase", + mockJsonBytes: []byte(`{"Url":"https://example.com/beta.apk"}`), + mockError: nil, + expectedUrl: "https://example.com/beta.apk", + expectingError: false, + expectedErrorInfo: "", + }, + { + name: "FileNotFound", + mockJsonBytes: nil, + mockError: fmt.Errorf("file not found"), + expectedUrl: "", + expectingError: true, + expectedErrorInfo: "VersionService.DownloadBetaApk error:file not found", + }, + { + name: "UnmarshalError", + mockJsonBytes: []byte(`invalid json`), + mockError: nil, + expectedUrl: "", + expectingError: true, + expectedErrorInfo: `VersionService.DownloadBetaApk error:"Syntax error at index 1: invalid char\n\n\tinvalid json\n\t.^..........\n"`, + }, + } + + defer mockey.UnPatchAll() // 清理所有mock + + for _, tc := range testCases { + mockey.PatchConvey(tc.name, t, func() { + // Mock upyun.URlGetFile 方法 + mockey.Mock(upyun.URlGetFile).To(func(url string) (*[]byte, error) { + return &tc.mockJsonBytes, tc.mockError + }).Build() + mockey.Mock(upyun.JoinFileName).To(func(filename string) string { + return filename + }).Build() + + // 初始化UrlService实例 + urlService := &VersionService{} + + // 调用方法 + result, err := urlService.DownloadBetaApk() + + if tc.expectingError { + // 如果期望抛错,检查错误信息 + assert.EqualError(t, err, tc.expectedErrorInfo) + } else { + // 如果不期望抛错,验证结果 + assert.NoError(t, err) + assert.Equal(t, tc.expectedUrl, result) + } + }) + } +} + +func TestDownloadReleaseApk(t *testing.T) { + type testCase struct { + name string // 测试用例名称 + mockJsonBytes []byte // mock返回的json数据 + mockError error // mock返回的错误 + expectedUrl string // 期望返回的URL + expectingError bool // 是否期望抛出错误 + expectedErrorInfo string // 期望的错误信息 + } + + // 测试用例 + testCases := []testCase{ + { + name: "SuccessCase", + mockJsonBytes: []byte(`{"Url":"https://example.com/release.apk"}`), + mockError: nil, + expectedUrl: "https://example.com/release.apk", + expectingError: false, + expectedErrorInfo: "", + }, + { + name: "FileNotFound", + mockJsonBytes: nil, + mockError: fmt.Errorf("file not found"), + expectedUrl: "", + expectingError: true, + expectedErrorInfo: "VersionService.DownloadReleaseApk error:file not found", + }, + { + name: "UnmarshalError", + mockJsonBytes: []byte(`invalid json`), + mockError: nil, + expectedUrl: "", + expectingError: true, + expectedErrorInfo: `VersionService.DownloadReleaseApk error:"Syntax error at index 1: invalid char\n\n\tinvalid json\n\t.^..........\n"`, + }, + } + + defer mockey.UnPatchAll() // 清理所有mock + + for _, tc := range testCases { + mockey.PatchConvey(tc.name, t, func() { + // Mock upyun.URlGetFile 方法 + mockey.Mock(upyun.URlGetFile).To(func(url string) (*[]byte, error) { + return &tc.mockJsonBytes, tc.mockError + }).Build() + mockey.Mock(upyun.JoinFileName).To(func(filename string) string { + return filename + }).Build() + + // 初始化UrlService实例 + urlService := &VersionService{} + + // 调用方法 + result, err := urlService.DownloadReleaseApk() + + if tc.expectingError { + // 如果期望抛错,检查错误信息 + assert.EqualError(t, err, tc.expectedErrorInfo) + } else { + // 如果不期望抛错,验证结果 + assert.NoError(t, err) + assert.Equal(t, tc.expectedUrl, result) + } + }) + } +} diff --git a/internal/version/service/get_all_setting.go b/internal/version/service/get_all_setting.go new file mode 100644 index 00000000..68d989b5 --- /dev/null +++ b/internal/version/service/get_all_setting.go @@ -0,0 +1,39 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package service + +import ( + "fmt" + + "github.com/west2-online/fzuhelper-server/pkg/upyun" +) + +func (s *VersionService) GetAllCloudSetting() (*[]byte, error) { + // 获得Json + settingJson, err := upyun.URlGetFile(upyun.JoinFileName(cloudSettingFileName)) + if err != nil { + return nil, fmt.Errorf("VersionService.GetAllCloudSetting error:%w", err) + } + noCommentSettingJson, err := getJSONWithoutComments(string(*settingJson)) + if err != nil { + return nil, fmt.Errorf("VersionService.GetAllCloudSetting error:%w", err) + } + + returnPlan := []byte(noCommentSettingJson) + + return &returnPlan, nil +} diff --git a/internal/version/service/get_dump.go b/internal/version/service/get_dump.go new file mode 100644 index 00000000..a233da63 --- /dev/null +++ b/internal/version/service/get_dump.go @@ -0,0 +1,32 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package service + +import ( + "fmt" + + "github.com/west2-online/fzuhelper-server/pkg/upyun" +) + +func (s *VersionService) GetDump() (*string, error) { + jsonBytes, err := upyun.URlGetFile(upyun.JoinFileName(visitsFileName)) + if err != nil { + return nil, fmt.Errorf("VersionService.GetDump error:%w", err) + } + dump := string(*jsonBytes) + return &dump, nil +} diff --git a/internal/version/service/get_dump_test.go b/internal/version/service/get_dump_test.go new file mode 100644 index 00000000..06b6327d --- /dev/null +++ b/internal/version/service/get_dump_test.go @@ -0,0 +1,94 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package service + +import ( + "fmt" + "testing" + + "github.com/bytedance/mockey" + "github.com/stretchr/testify/assert" + + "github.com/west2-online/fzuhelper-server/pkg/upyun" +) + +func TestGetDump(t *testing.T) { + type testCase struct { + name string // 测试用例名称 + mockJsonBytes *[]byte // mock返回的JSON数据 + mockError error // mock返回的错误 + expectedResult *string // 期望返回的结果 + expectingError bool // 是否期望抛出错误 + expectedErrorInfo string // 期望的错误信息 + } + mockJsonBytes := []byte(`{"key": "value"}`) + + // 测试用例 + testCases := []testCase{ + { + name: "SuccessCase", + mockJsonBytes: &mockJsonBytes, + mockError: nil, + expectedResult: toPointer(`{"key": "value"}`), + expectingError: false, + }, + { + name: "FileNotFound", + mockJsonBytes: nil, + mockError: fmt.Errorf("file not found"), + expectedResult: nil, + expectingError: true, + expectedErrorInfo: "VersionService.GetDump error:file not found", + }, + } + + defer mockey.UnPatchAll() // 清理所有mock + + for _, tc := range testCases { + mockey.PatchConvey(tc.name, t, func() { + // Mock upyun.URlGetFile 方法 + mockey.Mock(upyun.URlGetFile).To(func(filename string) (*[]byte, error) { + return tc.mockJsonBytes, tc.mockError + }).Build() + mockey.Mock(upyun.JoinFileName).To(func(filename string) string { + return filename + }).Build() + + // 初始化 VersionService 实例 + urlService := &VersionService{} + + // 调用方法 + result, err := urlService.GetDump() + + if tc.expectingError { + // 如果期望抛错,检查错误信息 + assert.NotNil(t, err) + assert.EqualError(t, err, tc.expectedErrorInfo) + assert.Nil(t, result) + } else { + // 如果不期望抛错,验证结果 + assert.NoError(t, err) + assert.Equal(t, tc.expectedResult, result) + } + }) + } +} + +// 工具方法,将字符串转换为指针 +func toPointer(value string) *string { + return &value +} diff --git a/internal/version/service/get_setting.go b/internal/version/service/get_setting.go new file mode 100644 index 00000000..1262fc8e --- /dev/null +++ b/internal/version/service/get_setting.go @@ -0,0 +1,178 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package service + +import ( + "encoding/json" + "fmt" + "regexp" + "strings" + "time" + + "github.com/west2-online/fzuhelper-server/internal/version/pack" + "github.com/west2-online/fzuhelper-server/kitex_gen/version" + "github.com/west2-online/fzuhelper-server/pkg/errno" + "github.com/west2-online/fzuhelper-server/pkg/upyun" +) + +func (s *VersionService) GetCloudSetting(req *version.GetSettingRequest) (*[]byte, error) { + data, err := upyun.URlGetFile(upyun.JoinFileName(visitsFileName)) + if err != nil { + return nil, fmt.Errorf("VersionService.GetCloudSetting error:%w", err) + } + visitsDict := make(map[string]int64) + err = json.Unmarshal(*data, &visitsDict) + if err != nil { + return nil, fmt.Errorf("VersionService.GetCloudSetting error:%w", err) + } + + date := time.Now().Format("2006-01-02") // 获取当前日期 + if count, exists := visitsDict[date]; exists { + visitsDict[date] = count + 1 + } else { + visitsDict[date] = 1 + } + saveData, err := json.Marshal(&visitsDict) + if err != nil { + return nil, fmt.Errorf("VersionService.GetCloudSetting error:%w", err) + } + err = upyun.URlUploadFile(saveData, upyun.JoinFileName(visitsFileName)) + if err != nil { + return nil, fmt.Errorf("VersionService.GetCloudSetting error:%w", err) + } + + // 获得Json + settingJson, err := upyun.URlGetFile(upyun.JoinFileName(cloudSettingFileName)) + if err != nil { + return nil, fmt.Errorf("VersionService.GetCloudSetting error:%w", err) + } + noCommentSettingJson, err := getJSONWithoutComments(string(*settingJson)) + if err != nil { + return nil, fmt.Errorf("VersionService.GetCloudSetting error:%w", err) + } + + // 绑定结构体 + cloudSettings := new(pack.CloudSetting) + err = json.Unmarshal([]byte(noCommentSettingJson), cloudSettings) + if err != nil { + return nil, fmt.Errorf("VersionService.GetCloudSetting error:%w", err) + } + + criteria := &pack.Plan{ + Account: req.Account, + Version: req.Version, + Beta: req.Beta, + Phone: req.Phone, + IsLogin: req.IsLogin, + LoginType: req.LoginType, + } + plan, err := findMatchingPlan(&cloudSettings.Plans, criteria) + if err != nil { + return nil, fmt.Errorf("VersionService.GetCloudSetting error:%w", err) + } + returnPlan := []byte(plan.Plan) + return &returnPlan, nil +} + +// findMatchingPlan 查找匹配的计划,若无传递字段则默认该字段为匹配状态,出现未匹配则直接查找下一计划 +func findMatchingPlan(planList *[]pack.Plan, criteria *pack.Plan) (*pack.Plan, error) { + for _, plan := range *planList { + if plan.Name != nil && criteria.Name != nil { + matched, _ := regexp.MatchString(*plan.Name, *criteria.Name) + if !matched { + continue + } + } + if plan.Account != nil && criteria.Account != nil { + matched, _ := regexp.MatchString(*plan.Account, *criteria.Account) + if !matched { + continue + } + } + if plan.Version != nil && criteria.Version != nil { + // matched, _ := regexp.MatchString(*criteria.Version, *plan.Version) + matched, _ := regexp.MatchString(*plan.Version, *criteria.Version) + if !matched { + continue + } + } + if plan.Phone != nil && criteria.Phone != nil { + matched, _ := regexp.MatchString(*plan.Phone, *criteria.Phone) + if !matched { + continue + } + } + if plan.LoginType != nil && criteria.LoginType != nil { + matched, _ := regexp.MatchString(*plan.LoginType, *criteria.LoginType) + if !matched { + continue + } + } + if plan.Beta != nil && criteria.Beta != nil { + if *plan.Beta != *criteria.Beta { + continue + } + } + if plan.IsLogin != nil && criteria.IsLogin != nil { + if *plan.IsLogin != *criteria.IsLogin { + continue + } + } + return &plan, nil + } + return nil, errno.NoMatchingPlanError +} + +// getJSONWithoutComments 获得没有注释的jsonStr +func getJSONWithoutComments(input string) (string, error) { + lines := strings.Split(input, "\n") + var cleanLines []string + + for _, line := range lines { + cleanLine := removeComments(line) + if cleanLine != "" { + cleanLines = append(cleanLines, cleanLine) + } + } + + jsonStr := strings.Join(cleanLines, "\n") + return jsonStr, nil +} + +// removeComments 用于去除JSON文件里的注释("//"且不会去掉url的"//") +func removeComments(line string) string { + inString := false + stringChar := "" + + for i := 0; i < len(line); i++ { + // 处理字符串边界 + if line[i] == '"' || line[i] == '\'' { + if !inString { + inString = true + stringChar = string(line[i]) + } else if stringChar == string(line[i]) { + inString = false + } + } + // 检查是否是注释 + if i+1 < len(line) && line[i:i+2] == "//" && !inString { + return line[:i] + } + } + + return line +} diff --git a/internal/version/service/get_version.go b/internal/version/service/get_version.go new file mode 100644 index 00000000..81c0a201 --- /dev/null +++ b/internal/version/service/get_version.go @@ -0,0 +1,52 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package service + +import ( + "fmt" + + "github.com/bytedance/sonic" + + "github.com/west2-online/fzuhelper-server/internal/version/pack" + "github.com/west2-online/fzuhelper-server/pkg/upyun" +) + +func (s *VersionService) GetReleaseVersion() (*pack.Version, error) { + jsonBytes, err := upyun.URlGetFile(upyun.JoinFileName(releaseVersionFileName)) + if err != nil { + return nil, fmt.Errorf("VersionService.GetReleaseVersion error:%w", err) + } + version := new(pack.Version) + err = sonic.Unmarshal(*jsonBytes, version) + if err != nil { + return nil, fmt.Errorf("VersionService.GetReleaseVersion error:%w", err) + } + return version, nil +} + +func (s *VersionService) GetBetaVersion() (*pack.Version, error) { + jsonBytes, err := upyun.URlGetFile(upyun.JoinFileName(betaVersionFileName)) + if err != nil { + return nil, fmt.Errorf("VersionService.GetBetaVersion error:%w", err) + } + version := new(pack.Version) + err = sonic.Unmarshal(*jsonBytes, version) + if err != nil { + return nil, fmt.Errorf("VersionService.GetBetaVersion error:%w", err) + } + return version, nil +} diff --git a/internal/version/service/get_version_release_test.go b/internal/version/service/get_version_release_test.go new file mode 100644 index 00000000..7ad56c29 --- /dev/null +++ b/internal/version/service/get_version_release_test.go @@ -0,0 +1,94 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package service + +import ( + "encoding/json" + "fmt" + "testing" + + "github.com/bytedance/mockey" + "github.com/stretchr/testify/assert" + + "github.com/west2-online/fzuhelper-server/internal/version/pack" + "github.com/west2-online/fzuhelper-server/pkg/upyun" +) + +func TestGetReleaseVersion(t *testing.T) { + type testCase struct { + name string // 测试用例名称 + mockJsonBytes *[]byte // mock返回的JSON数据 + mockError error // mock返回的错误 + expectedResult *pack.Version // 期望返回的结果 + expectingError bool // 是否期望抛出错误 + expectedErrorInfo string // 期望的错误信息 + } + + // 模拟数据 + mockVersion := &pack.Version{Url: "http://example.com/release.apk", Version: "1.0.0"} + mockVersionBytes, _ := json.Marshal(mockVersion) + + testCases := []testCase{ + { + name: "SuccessCase", + mockJsonBytes: &mockVersionBytes, + mockError: nil, + expectedResult: mockVersion, + expectingError: false, + expectedErrorInfo: "", + }, + { + name: "FileNotFound", + mockJsonBytes: nil, + mockError: fmt.Errorf("file not found"), + expectedResult: nil, + expectingError: true, + expectedErrorInfo: "VersionService.GetReleaseVersion error:file not found", + }, + } + + defer mockey.UnPatchAll() // 清理所有mock + + for _, tc := range testCases { + mockey.PatchConvey(tc.name, t, func() { + // Mock upyun.URlGetFile 方法 + mockey.Mock(upyun.URlGetFile).To(func(filename string) (*[]byte, error) { + return tc.mockJsonBytes, tc.mockError + }).Build() + mockey.Mock(upyun.JoinFileName).To(func(filename string) string { + return filename + }).Build() + + // 初始化 VersionService 实例 + urlService := &VersionService{} + + // 调用方法 + result, err := urlService.GetReleaseVersion() + + if tc.expectingError { + // 如果期望抛错,检查错误信息 + assert.NotNil(t, err) + assert.EqualError(t, err, tc.expectedErrorInfo) + assert.Nil(t, result) + } else { + // 如果不期望抛错,验证结果 + assert.Nil(t, err) + assert.Equal(t, tc.expectedResult, result) + } + }) + } +} diff --git a/internal/version/service/login.go b/internal/version/service/login.go new file mode 100644 index 00000000..be1e0189 --- /dev/null +++ b/internal/version/service/login.go @@ -0,0 +1,29 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package service + +import ( + "github.com/west2-online/fzuhelper-server/kitex_gen/version" + "github.com/west2-online/fzuhelper-server/pkg/utils" +) + +func (s *VersionService) Login(req *version.LoginRequest) error { + if !utils.CheckPwd(req.Password) { + return buildAuthFailedError() + } + return nil +} diff --git a/internal/version/service/service.go b/internal/version/service/service.go new file mode 100644 index 00000000..8c01e4e3 --- /dev/null +++ b/internal/version/service/service.go @@ -0,0 +1,52 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package service + +import ( + "context" + "net/http" + + "github.com/west2-online/fzuhelper-server/pkg/base" + "github.com/west2-online/fzuhelper-server/pkg/errno" +) + +const ( + cloudSettingFileName = "cloud_setting.json" + visitsFileName = "visits.json" + releaseVersionFileName = "version.json" + betaVersionFileName = "versionbeta.json" + + apkTypeRelease = "release" + apkTypeBeta = "beta" + + authFailedErrorMsg = "authorization failed" +) + +type VersionService struct { + ctx context.Context +} + +func NewVersionService(ctx context.Context, clientset *base.ClientSet) *VersionService { + return &VersionService{ + ctx: ctx, + } +} + +// buildAuthFailedError customize the client +func buildAuthFailedError() errno.ErrNo { + return errno.NewErrNo(http.StatusUnauthorized, authFailedErrorMsg) +} diff --git a/internal/version/service/set_setting.go b/internal/version/service/set_setting.go new file mode 100644 index 00000000..78c59474 --- /dev/null +++ b/internal/version/service/set_setting.go @@ -0,0 +1,30 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package service + +import ( + "github.com/west2-online/fzuhelper-server/kitex_gen/version" + "github.com/west2-online/fzuhelper-server/pkg/upyun" + "github.com/west2-online/fzuhelper-server/pkg/utils" +) + +func (s *VersionService) SetSetting(req *version.SetCloudRequest) error { + if !utils.CheckPwd(req.Password) { + return buildAuthFailedError() + } + return upyun.URlUploadFile([]byte(req.Setting), upyun.JoinFileName(cloudSettingFileName)) +} diff --git a/internal/version/service/test_get_setting.go b/internal/version/service/test_get_setting.go new file mode 100644 index 00000000..990b208e --- /dev/null +++ b/internal/version/service/test_get_setting.go @@ -0,0 +1,60 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package service + +import ( + "encoding/json" + "fmt" + + "github.com/west2-online/fzuhelper-server/internal/version/pack" + "github.com/west2-online/fzuhelper-server/kitex_gen/version" + "github.com/west2-online/fzuhelper-server/pkg/upyun" +) + +func (s *VersionService) TestSetting(req *version.GetTestRequest) (*[]byte, error) { + // 获得Json + settingJson, err := upyun.URlGetFile(upyun.JoinFileName(cloudSettingFileName)) + if err != nil { + return nil, fmt.Errorf("VersionService.TestSetting error:%w", err) + } + noCommentSettingJson, err := getJSONWithoutComments(string(*settingJson)) + if err != nil { + return nil, fmt.Errorf("VersionService.TestSetting error:%w", err) + } + + // 绑定结构体 + cloudSettings := new(pack.CloudSetting) + err = json.Unmarshal([]byte(noCommentSettingJson), cloudSettings) + if err != nil { + return nil, fmt.Errorf("VersionService.TestSetting error:%w", err) + } + + criteria := &pack.Plan{ + Account: req.Account, + Version: req.Version, + Beta: req.Beta, + Phone: req.Phone, + IsLogin: req.IsLogin, + LoginType: req.LoginType, + } + plan, err := findMatchingPlan(&cloudSettings.Plans, criteria) + if err != nil { + return nil, fmt.Errorf("VersionService.TestSetting error:%w", err) + } + returnPlan := []byte(plan.Plan) + return &returnPlan, nil +} diff --git a/internal/version/service/upload_params.go b/internal/version/service/upload_params.go new file mode 100644 index 00000000..780fe89a --- /dev/null +++ b/internal/version/service/upload_params.go @@ -0,0 +1,34 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package service + +import ( + "github.com/west2-online/fzuhelper-server/config" + "github.com/west2-online/fzuhelper-server/kitex_gen/version" + "github.com/west2-online/fzuhelper-server/pkg/upyun" + "github.com/west2-online/fzuhelper-server/pkg/utils" +) + +// UploadParams 实际上是获取上传参数给前端使用 +func (s *VersionService) UploadParams(req *version.UploadParamsRequest) (string, string, error) { + if !utils.CheckPwd(req.Password) { + return "", "", buildAuthFailedError() + } + policy := upyun.GetPolicy(config.UrlService.Bucket, config.UrlService.Path, int(config.UrlService.TokenTimeout)) + authorization := upyun.SignStr(config.UrlService.Operator, config.UrlService.Pass, config.UrlService.Bucket, policy) + return policy, authorization, nil +} diff --git a/internal/version/service/upload_version.go b/internal/version/service/upload_version.go new file mode 100644 index 00000000..e6055203 --- /dev/null +++ b/internal/version/service/upload_version.go @@ -0,0 +1,61 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package service + +import ( + "encoding/json" + "fmt" + + "github.com/west2-online/fzuhelper-server/internal/version/pack" + "github.com/west2-online/fzuhelper-server/kitex_gen/version" + "github.com/west2-online/fzuhelper-server/pkg/errno" + "github.com/west2-online/fzuhelper-server/pkg/upyun" + "github.com/west2-online/fzuhelper-server/pkg/utils" +) + +func (s *VersionService) UploadVersion(req *version.UploadRequest) error { + if !utils.CheckPwd(req.Password) { + return buildAuthFailedError() + } + v := &pack.Version{ + Version: req.Version, + Code: req.Code, + Url: req.Url, + Feature: req.Feature, + } + jsonBytes, err := json.Marshal(v) + if err != nil { + return fmt.Errorf("VersionService.UploadVersion json marshal err: %w", err) + } + + switch req.Type { + case apkTypeRelease: + err = upyun.URlUploadFile(jsonBytes, upyun.JoinFileName(releaseVersionFileName)) + if err != nil { + return fmt.Errorf("VersionService.UploadVersion json marshal err: %w", err) + } + return nil + case apkTypeBeta: + err = upyun.URlUploadFile(jsonBytes, upyun.JoinFileName(betaVersionFileName)) + if err != nil { + return fmt.Errorf("VersionService.UploadVersion json marshal err: %w", err) + } + return nil + default: + return errno.ParamError + } +} diff --git a/kitex_gen/common/common.go b/kitex_gen/common/common.go new file mode 100644 index 00000000..c9d404ae --- /dev/null +++ b/kitex_gen/common/common.go @@ -0,0 +1,1832 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by thriftgo (0.3.18). DO NOT EDIT. + +package common + +import ( + "bytes" + "context" + "fmt" + + thrift "github.com/cloudwego/kitex/pkg/protocol/bthrift/apache" +) + +type GetCSSRequest struct { +} + +func NewGetCSSRequest() *GetCSSRequest { + return &GetCSSRequest{} +} + +func (p *GetCSSRequest) InitDefault() { +} + +var fieldIDToName_GetCSSRequest = map[int16]string{} + +func (p *GetCSSRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldTypeError + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +SkipFieldTypeError: + return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *GetCSSRequest) Write(oprot thrift.TProtocol) (err error) { + + if err = oprot.WriteStructBegin("GetCSSRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *GetCSSRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetCSSRequest(%+v)", *p) + +} + +func (p *GetCSSRequest) DeepEqual(ano *GetCSSRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + return true +} + +type GetCSSResponse struct { + Css []byte `thrift:"css,1" frugal:"1,default,binary" json:"css"` +} + +func NewGetCSSResponse() *GetCSSResponse { + return &GetCSSResponse{} +} + +func (p *GetCSSResponse) InitDefault() { +} + +func (p *GetCSSResponse) GetCss() (v []byte) { + return p.Css +} +func (p *GetCSSResponse) SetCss(val []byte) { + p.Css = val +} + +var fieldIDToName_GetCSSResponse = map[int16]string{ + 1: "css", +} + +func (p *GetCSSResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetCSSResponse[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 *GetCSSResponse) ReadField1(iprot thrift.TProtocol) error { + + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { + return err + } else { + _field = []byte(v) + } + p.Css = _field + return nil +} + +func (p *GetCSSResponse) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetCSSResponse"); 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 *GetCSSResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("css", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBinary([]byte(p.Css)); 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 *GetCSSResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetCSSResponse(%+v)", *p) + +} + +func (p *GetCSSResponse) DeepEqual(ano *GetCSSResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Css) { + return false + } + return true +} + +func (p *GetCSSResponse) Field1DeepEqual(src []byte) bool { + + if bytes.Compare(p.Css, src) != 0 { + return false + } + return true +} + +type GetHtmlRequest struct { +} + +func NewGetHtmlRequest() *GetHtmlRequest { + return &GetHtmlRequest{} +} + +func (p *GetHtmlRequest) InitDefault() { +} + +var fieldIDToName_GetHtmlRequest = map[int16]string{} + +func (p *GetHtmlRequest) 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 *GetHtmlRequest) Write(oprot thrift.TProtocol) (err error) { + + if err = oprot.WriteStructBegin("GetHtmlRequest"); 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 *GetHtmlRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetHtmlRequest(%+v)", *p) + +} + +func (p *GetHtmlRequest) DeepEqual(ano *GetHtmlRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + return true +} + +type GetHtmlResponse struct { + Html []byte `thrift:"html,1" frugal:"1,default,binary" json:"html"` +} + +func NewGetHtmlResponse() *GetHtmlResponse { + return &GetHtmlResponse{} +} + +func (p *GetHtmlResponse) InitDefault() { +} + +func (p *GetHtmlResponse) GetHtml() (v []byte) { + return p.Html +} +func (p *GetHtmlResponse) SetHtml(val []byte) { + p.Html = val +} + +var fieldIDToName_GetHtmlResponse = map[int16]string{ + 1: "html", +} + +func (p *GetHtmlResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetHtmlResponse[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 *GetHtmlResponse) ReadField1(iprot thrift.TProtocol) error { + + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { + return err + } else { + _field = []byte(v) + } + p.Html = _field + return nil +} + +func (p *GetHtmlResponse) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetHtmlResponse"); 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 *GetHtmlResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("html", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBinary([]byte(p.Html)); err != nil { + 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 *GetHtmlResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetHtmlResponse(%+v)", *p) + +} + +func (p *GetHtmlResponse) DeepEqual(ano *GetHtmlResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Html) { + return false + } + return true +} + +func (p *GetHtmlResponse) Field1DeepEqual(src []byte) bool { + + if bytes.Compare(p.Html, src) != 0 { + return false + } + return true +} + +type GetUserAgreementRequest struct { +} + +func NewGetUserAgreementRequest() *GetUserAgreementRequest { + return &GetUserAgreementRequest{} +} + +func (p *GetUserAgreementRequest) InitDefault() { +} + +var fieldIDToName_GetUserAgreementRequest = map[int16]string{} + +func (p *GetUserAgreementRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + 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 *GetUserAgreementRequest) Write(oprot thrift.TProtocol) (err error) { + + if err = oprot.WriteStructBegin("GetUserAgreementRequest"); 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 *GetUserAgreementRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetUserAgreementRequest(%+v)", *p) + +} + +func (p *GetUserAgreementRequest) DeepEqual(ano *GetUserAgreementRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + return true +} + +type GetUserAgreementResponse struct { + UserAgreement []byte `thrift:"user_agreement,1" frugal:"1,default,binary" json:"user_agreement"` +} + +func NewGetUserAgreementResponse() *GetUserAgreementResponse { + return &GetUserAgreementResponse{} +} + +func (p *GetUserAgreementResponse) InitDefault() { +} + +func (p *GetUserAgreementResponse) GetUserAgreement() (v []byte) { + return p.UserAgreement +} +func (p *GetUserAgreementResponse) SetUserAgreement(val []byte) { + p.UserAgreement = val +} + +var fieldIDToName_GetUserAgreementResponse = map[int16]string{ + 1: "user_agreement", +} + +func (p *GetUserAgreementResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetUserAgreementResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *GetUserAgreementResponse) ReadField1(iprot thrift.TProtocol) error { + + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { + return err + } else { + _field = []byte(v) + } + p.UserAgreement = _field + return nil +} + +func (p *GetUserAgreementResponse) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetUserAgreementResponse"); 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 *GetUserAgreementResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("user_agreement", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBinary([]byte(p.UserAgreement)); 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 *GetUserAgreementResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetUserAgreementResponse(%+v)", *p) + +} + +func (p *GetUserAgreementResponse) DeepEqual(ano *GetUserAgreementResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.UserAgreement) { + return false + } + return true +} + +func (p *GetUserAgreementResponse) Field1DeepEqual(src []byte) bool { + + if bytes.Compare(p.UserAgreement, src) != 0 { + return false + } + return true +} + +type CommonService interface { + GetCSS(ctx context.Context, req *GetCSSRequest) (r *GetCSSResponse, err error) + + GetHtml(ctx context.Context, req *GetHtmlRequest) (r *GetHtmlResponse, err error) + + GetUserAgreement(ctx context.Context, req *GetUserAgreementRequest) (r *GetUserAgreementResponse, err error) +} + +type CommonServiceGetCSSArgs struct { + Req *GetCSSRequest `thrift:"req,1" frugal:"1,default,GetCSSRequest" json:"req"` +} + +func NewCommonServiceGetCSSArgs() *CommonServiceGetCSSArgs { + return &CommonServiceGetCSSArgs{} +} + +func (p *CommonServiceGetCSSArgs) InitDefault() { +} + +var CommonServiceGetCSSArgs_Req_DEFAULT *GetCSSRequest + +func (p *CommonServiceGetCSSArgs) GetReq() (v *GetCSSRequest) { + if !p.IsSetReq() { + return CommonServiceGetCSSArgs_Req_DEFAULT + } + return p.Req +} +func (p *CommonServiceGetCSSArgs) SetReq(val *GetCSSRequest) { + p.Req = val +} + +var fieldIDToName_CommonServiceGetCSSArgs = map[int16]string{ + 1: "req", +} + +func (p *CommonServiceGetCSSArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *CommonServiceGetCSSArgs) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetCSSArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *CommonServiceGetCSSArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetCSSRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *CommonServiceGetCSSArgs) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetCSS_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *CommonServiceGetCSSArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *CommonServiceGetCSSArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CommonServiceGetCSSArgs(%+v)", *p) + +} + +func (p *CommonServiceGetCSSArgs) DeepEqual(ano *CommonServiceGetCSSArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Req) { + return false + } + return true +} + +func (p *CommonServiceGetCSSArgs) Field1DeepEqual(src *GetCSSRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type CommonServiceGetCSSResult struct { + Success *GetCSSResponse `thrift:"success,0,optional" frugal:"0,optional,GetCSSResponse" json:"success,omitempty"` +} + +func NewCommonServiceGetCSSResult() *CommonServiceGetCSSResult { + return &CommonServiceGetCSSResult{} +} + +func (p *CommonServiceGetCSSResult) InitDefault() { +} + +var CommonServiceGetCSSResult_Success_DEFAULT *GetCSSResponse + +func (p *CommonServiceGetCSSResult) GetSuccess() (v *GetCSSResponse) { + if !p.IsSetSuccess() { + return CommonServiceGetCSSResult_Success_DEFAULT + } + return p.Success +} +func (p *CommonServiceGetCSSResult) SetSuccess(x interface{}) { + p.Success = x.(*GetCSSResponse) +} + +var fieldIDToName_CommonServiceGetCSSResult = map[int16]string{ + 0: "success", +} + +func (p *CommonServiceGetCSSResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *CommonServiceGetCSSResult) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetCSSResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *CommonServiceGetCSSResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetCSSResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *CommonServiceGetCSSResult) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetCSS_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *CommonServiceGetCSSResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *CommonServiceGetCSSResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CommonServiceGetCSSResult(%+v)", *p) + +} + +func (p *CommonServiceGetCSSResult) DeepEqual(ano *CommonServiceGetCSSResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field0DeepEqual(ano.Success) { + return false + } + return true +} + +func (p *CommonServiceGetCSSResult) Field0DeepEqual(src *GetCSSResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type CommonServiceGetHtmlArgs struct { + Req *GetHtmlRequest `thrift:"req,1" frugal:"1,default,GetHtmlRequest" json:"req"` +} + +func NewCommonServiceGetHtmlArgs() *CommonServiceGetHtmlArgs { + return &CommonServiceGetHtmlArgs{} +} + +func (p *CommonServiceGetHtmlArgs) InitDefault() { +} + +var CommonServiceGetHtmlArgs_Req_DEFAULT *GetHtmlRequest + +func (p *CommonServiceGetHtmlArgs) GetReq() (v *GetHtmlRequest) { + if !p.IsSetReq() { + return CommonServiceGetHtmlArgs_Req_DEFAULT + } + return p.Req +} +func (p *CommonServiceGetHtmlArgs) SetReq(val *GetHtmlRequest) { + p.Req = val +} + +var fieldIDToName_CommonServiceGetHtmlArgs = map[int16]string{ + 1: "req", +} + +func (p *CommonServiceGetHtmlArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *CommonServiceGetHtmlArgs) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetHtmlArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *CommonServiceGetHtmlArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetHtmlRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *CommonServiceGetHtmlArgs) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetHtml_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *CommonServiceGetHtmlArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *CommonServiceGetHtmlArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CommonServiceGetHtmlArgs(%+v)", *p) + +} + +func (p *CommonServiceGetHtmlArgs) DeepEqual(ano *CommonServiceGetHtmlArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Req) { + return false + } + return true +} + +func (p *CommonServiceGetHtmlArgs) Field1DeepEqual(src *GetHtmlRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type CommonServiceGetHtmlResult struct { + Success *GetHtmlResponse `thrift:"success,0,optional" frugal:"0,optional,GetHtmlResponse" json:"success,omitempty"` +} + +func NewCommonServiceGetHtmlResult() *CommonServiceGetHtmlResult { + return &CommonServiceGetHtmlResult{} +} + +func (p *CommonServiceGetHtmlResult) InitDefault() { +} + +var CommonServiceGetHtmlResult_Success_DEFAULT *GetHtmlResponse + +func (p *CommonServiceGetHtmlResult) GetSuccess() (v *GetHtmlResponse) { + if !p.IsSetSuccess() { + return CommonServiceGetHtmlResult_Success_DEFAULT + } + return p.Success +} +func (p *CommonServiceGetHtmlResult) SetSuccess(x interface{}) { + p.Success = x.(*GetHtmlResponse) +} + +var fieldIDToName_CommonServiceGetHtmlResult = map[int16]string{ + 0: "success", +} + +func (p *CommonServiceGetHtmlResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *CommonServiceGetHtmlResult) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetHtmlResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *CommonServiceGetHtmlResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetHtmlResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *CommonServiceGetHtmlResult) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetHtml_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *CommonServiceGetHtmlResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *CommonServiceGetHtmlResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CommonServiceGetHtmlResult(%+v)", *p) + +} + +func (p *CommonServiceGetHtmlResult) DeepEqual(ano *CommonServiceGetHtmlResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field0DeepEqual(ano.Success) { + return false + } + return true +} + +func (p *CommonServiceGetHtmlResult) Field0DeepEqual(src *GetHtmlResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type CommonServiceGetUserAgreementArgs struct { + Req *GetUserAgreementRequest `thrift:"req,1" frugal:"1,default,GetUserAgreementRequest" json:"req"` +} + +func NewCommonServiceGetUserAgreementArgs() *CommonServiceGetUserAgreementArgs { + return &CommonServiceGetUserAgreementArgs{} +} + +func (p *CommonServiceGetUserAgreementArgs) InitDefault() { +} + +var CommonServiceGetUserAgreementArgs_Req_DEFAULT *GetUserAgreementRequest + +func (p *CommonServiceGetUserAgreementArgs) GetReq() (v *GetUserAgreementRequest) { + if !p.IsSetReq() { + return CommonServiceGetUserAgreementArgs_Req_DEFAULT + } + return p.Req +} +func (p *CommonServiceGetUserAgreementArgs) SetReq(val *GetUserAgreementRequest) { + p.Req = val +} + +var fieldIDToName_CommonServiceGetUserAgreementArgs = map[int16]string{ + 1: "req", +} + +func (p *CommonServiceGetUserAgreementArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *CommonServiceGetUserAgreementArgs) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetUserAgreementArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *CommonServiceGetUserAgreementArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetUserAgreementRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *CommonServiceGetUserAgreementArgs) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetUserAgreement_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *CommonServiceGetUserAgreementArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *CommonServiceGetUserAgreementArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CommonServiceGetUserAgreementArgs(%+v)", *p) + +} + +func (p *CommonServiceGetUserAgreementArgs) DeepEqual(ano *CommonServiceGetUserAgreementArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Req) { + return false + } + return true +} + +func (p *CommonServiceGetUserAgreementArgs) Field1DeepEqual(src *GetUserAgreementRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type CommonServiceGetUserAgreementResult struct { + Success *GetUserAgreementResponse `thrift:"success,0,optional" frugal:"0,optional,GetUserAgreementResponse" json:"success,omitempty"` +} + +func NewCommonServiceGetUserAgreementResult() *CommonServiceGetUserAgreementResult { + return &CommonServiceGetUserAgreementResult{} +} + +func (p *CommonServiceGetUserAgreementResult) InitDefault() { +} + +var CommonServiceGetUserAgreementResult_Success_DEFAULT *GetUserAgreementResponse + +func (p *CommonServiceGetUserAgreementResult) GetSuccess() (v *GetUserAgreementResponse) { + if !p.IsSetSuccess() { + return CommonServiceGetUserAgreementResult_Success_DEFAULT + } + return p.Success +} +func (p *CommonServiceGetUserAgreementResult) SetSuccess(x interface{}) { + p.Success = x.(*GetUserAgreementResponse) +} + +var fieldIDToName_CommonServiceGetUserAgreementResult = map[int16]string{ + 0: "success", +} + +func (p *CommonServiceGetUserAgreementResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *CommonServiceGetUserAgreementResult) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetUserAgreementResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *CommonServiceGetUserAgreementResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetUserAgreementResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *CommonServiceGetUserAgreementResult) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetUserAgreement_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *CommonServiceGetUserAgreementResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *CommonServiceGetUserAgreementResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CommonServiceGetUserAgreementResult(%+v)", *p) + +} + +func (p *CommonServiceGetUserAgreementResult) DeepEqual(ano *CommonServiceGetUserAgreementResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field0DeepEqual(ano.Success) { + return false + } + return true +} + +func (p *CommonServiceGetUserAgreementResult) Field0DeepEqual(src *GetUserAgreementResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} diff --git a/kitex_gen/common/commonservice/client.go b/kitex_gen/common/commonservice/client.go new file mode 100644 index 00000000..0287247a --- /dev/null +++ b/kitex_gen/common/commonservice/client.go @@ -0,0 +1,79 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by Kitex v0.11.3. DO NOT EDIT. + +package commonservice + +import ( + "context" + + client "github.com/cloudwego/kitex/client" + callopt "github.com/cloudwego/kitex/client/callopt" + + common "github.com/west2-online/fzuhelper-server/kitex_gen/common" +) + +// Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework. +type Client interface { + GetCSS(ctx context.Context, req *common.GetCSSRequest, callOptions ...callopt.Option) (r *common.GetCSSResponse, err error) + GetHtml(ctx context.Context, req *common.GetHtmlRequest, callOptions ...callopt.Option) (r *common.GetHtmlResponse, err error) + GetUserAgreement(ctx context.Context, req *common.GetUserAgreementRequest, callOptions ...callopt.Option) (r *common.GetUserAgreementResponse, err error) +} + +// NewClient creates a client for the service defined in IDL. +func NewClient(destService string, opts ...client.Option) (Client, error) { + var options []client.Option + options = append(options, client.WithDestService(destService)) + + options = append(options, opts...) + + kc, err := client.NewClient(serviceInfoForClient(), options...) + if err != nil { + return nil, err + } + return &kCommonServiceClient{ + kClient: newServiceClient(kc), + }, nil +} + +// MustNewClient creates a client for the service defined in IDL. It panics if any error occurs. +func MustNewClient(destService string, opts ...client.Option) Client { + kc, err := NewClient(destService, opts...) + if err != nil { + panic(err) + } + return kc +} + +type kCommonServiceClient struct { + *kClient +} + +func (p *kCommonServiceClient) GetCSS(ctx context.Context, req *common.GetCSSRequest, callOptions ...callopt.Option) (r *common.GetCSSResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.GetCSS(ctx, req) +} + +func (p *kCommonServiceClient) GetHtml(ctx context.Context, req *common.GetHtmlRequest, callOptions ...callopt.Option) (r *common.GetHtmlResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.GetHtml(ctx, req) +} + +func (p *kCommonServiceClient) GetUserAgreement(ctx context.Context, req *common.GetUserAgreementRequest, callOptions ...callopt.Option) (r *common.GetUserAgreementResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.GetUserAgreement(ctx, req) +} diff --git a/kitex_gen/common/commonservice/commonservice.go b/kitex_gen/common/commonservice/commonservice.go new file mode 100644 index 00000000..811dd31c --- /dev/null +++ b/kitex_gen/common/commonservice/commonservice.go @@ -0,0 +1,213 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by Kitex v0.11.3. DO NOT EDIT. + +package commonservice + +import ( + "context" + "errors" + + client "github.com/cloudwego/kitex/client" + kitex "github.com/cloudwego/kitex/pkg/serviceinfo" + + common "github.com/west2-online/fzuhelper-server/kitex_gen/common" +) + +var errInvalidMessageType = errors.New("invalid message type for service method handler") + +var serviceMethods = map[string]kitex.MethodInfo{ + "GetCSS": kitex.NewMethodInfo( + getCSSHandler, + newCommonServiceGetCSSArgs, + newCommonServiceGetCSSResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "GetHtml": kitex.NewMethodInfo( + getHtmlHandler, + newCommonServiceGetHtmlArgs, + newCommonServiceGetHtmlResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "GetUserAgreement": kitex.NewMethodInfo( + getUserAgreementHandler, + newCommonServiceGetUserAgreementArgs, + newCommonServiceGetUserAgreementResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), +} + +var ( + commonServiceServiceInfo = NewServiceInfo() + commonServiceServiceInfoForClient = NewServiceInfoForClient() + commonServiceServiceInfoForStreamClient = NewServiceInfoForStreamClient() +) + +// for server +func serviceInfo() *kitex.ServiceInfo { + return commonServiceServiceInfo +} + +// for stream client +func serviceInfoForStreamClient() *kitex.ServiceInfo { + return commonServiceServiceInfoForStreamClient +} + +// for client +func serviceInfoForClient() *kitex.ServiceInfo { + return commonServiceServiceInfoForClient +} + +// NewServiceInfo creates a new ServiceInfo containing all methods +func NewServiceInfo() *kitex.ServiceInfo { + return newServiceInfo(false, true, true) +} + +// NewServiceInfo creates a new ServiceInfo containing non-streaming methods +func NewServiceInfoForClient() *kitex.ServiceInfo { + return newServiceInfo(false, false, true) +} +func NewServiceInfoForStreamClient() *kitex.ServiceInfo { + return newServiceInfo(true, true, false) +} + +func newServiceInfo(hasStreaming bool, keepStreamingMethods bool, keepNonStreamingMethods bool) *kitex.ServiceInfo { + serviceName := "CommonService" + handlerType := (*common.CommonService)(nil) + methods := map[string]kitex.MethodInfo{} + for name, m := range serviceMethods { + if m.IsStreaming() && !keepStreamingMethods { + continue + } + if !m.IsStreaming() && !keepNonStreamingMethods { + continue + } + methods[name] = m + } + extra := map[string]interface{}{ + "PackageName": "common", + } + if hasStreaming { + extra["streaming"] = hasStreaming + } + svcInfo := &kitex.ServiceInfo{ + ServiceName: serviceName, + HandlerType: handlerType, + Methods: methods, + PayloadCodec: kitex.Thrift, + KiteXGenVersion: "v0.11.3", + Extra: extra, + } + return svcInfo +} + +func getCSSHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*common.CommonServiceGetCSSArgs) + realResult := result.(*common.CommonServiceGetCSSResult) + success, err := handler.(common.CommonService).GetCSS(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newCommonServiceGetCSSArgs() interface{} { + return common.NewCommonServiceGetCSSArgs() +} + +func newCommonServiceGetCSSResult() interface{} { + return common.NewCommonServiceGetCSSResult() +} + +func getHtmlHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*common.CommonServiceGetHtmlArgs) + realResult := result.(*common.CommonServiceGetHtmlResult) + success, err := handler.(common.CommonService).GetHtml(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newCommonServiceGetHtmlArgs() interface{} { + return common.NewCommonServiceGetHtmlArgs() +} + +func newCommonServiceGetHtmlResult() interface{} { + return common.NewCommonServiceGetHtmlResult() +} + +func getUserAgreementHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*common.CommonServiceGetUserAgreementArgs) + realResult := result.(*common.CommonServiceGetUserAgreementResult) + success, err := handler.(common.CommonService).GetUserAgreement(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newCommonServiceGetUserAgreementArgs() interface{} { + return common.NewCommonServiceGetUserAgreementArgs() +} + +func newCommonServiceGetUserAgreementResult() interface{} { + return common.NewCommonServiceGetUserAgreementResult() +} + +type kClient struct { + c client.Client +} + +func newServiceClient(c client.Client) *kClient { + return &kClient{ + c: c, + } +} + +func (p *kClient) GetCSS(ctx context.Context, req *common.GetCSSRequest) (r *common.GetCSSResponse, err error) { + var _args common.CommonServiceGetCSSArgs + _args.Req = req + var _result common.CommonServiceGetCSSResult + if err = p.c.Call(ctx, "GetCSS", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) GetHtml(ctx context.Context, req *common.GetHtmlRequest) (r *common.GetHtmlResponse, err error) { + var _args common.CommonServiceGetHtmlArgs + _args.Req = req + var _result common.CommonServiceGetHtmlResult + if err = p.c.Call(ctx, "GetHtml", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) GetUserAgreement(ctx context.Context, req *common.GetUserAgreementRequest) (r *common.GetUserAgreementResponse, err error) { + var _args common.CommonServiceGetUserAgreementArgs + _args.Req = req + var _result common.CommonServiceGetUserAgreementResult + if err = p.c.Call(ctx, "GetUserAgreement", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} diff --git a/kitex_gen/common/commonservice/server.go b/kitex_gen/common/commonservice/server.go new file mode 100644 index 00000000..db4c3e91 --- /dev/null +++ b/kitex_gen/common/commonservice/server.go @@ -0,0 +1,42 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by Kitex v0.11.3. DO NOT EDIT. +package commonservice + +import ( + server "github.com/cloudwego/kitex/server" + + common "github.com/west2-online/fzuhelper-server/kitex_gen/common" +) + +// NewServer creates a server.Server with the given handler and options. +func NewServer(handler common.CommonService, opts ...server.Option) server.Server { + var options []server.Option + + options = append(options, opts...) + options = append(options, server.WithCompatibleMiddlewareForUnary()) + + svr := server.NewServer(options...) + if err := svr.RegisterService(serviceInfo(), handler); err != nil { + panic(err) + } + return svr +} + +func RegisterService(svr server.Server, handler common.CommonService, opts ...server.RegisterOption) error { + return svr.RegisterService(serviceInfo(), handler, opts...) +} diff --git a/kitex_gen/common/k-common.go b/kitex_gen/common/k-common.go new file mode 100644 index 00000000..b129a180 --- /dev/null +++ b/kitex_gen/common/k-common.go @@ -0,0 +1,1111 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by Kitex v0.11.3. DO NOT EDIT. + +package common + +import ( + "bytes" + "fmt" + "reflect" + "strings" + + "github.com/cloudwego/gopkg/protocol/thrift" + + "github.com/west2-online/fzuhelper-server/kitex_gen/model" +) + +var ( + _ = model.KitexUnusedProtection +) + +// unused protection +var ( + _ = fmt.Formatter(nil) + _ = (*bytes.Buffer)(nil) + _ = (*strings.Builder)(nil) + _ = reflect.Type(nil) + _ = thrift.STOP +) + +func (p *GetCSSRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +// for compatibility +func (p *GetCSSRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *GetCSSRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *GetCSSRequest) BLength() int { + l := 0 + if p != nil { + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *GetCSSResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetCSSResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *GetCSSResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field []byte + if v, l, err := thrift.Binary.ReadBinary(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + _field = []byte(v) + } + p.Css = _field + return offset, nil +} + +// for compatibility +func (p *GetCSSResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *GetCSSResponse) 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 *GetCSSResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *GetCSSResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteBinaryNocopy(buf[offset:], w, []byte(p.Css)) + return offset +} + +func (p *GetCSSResponse) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.BinaryLengthNocopy([]byte(p.Css)) + return l +} + +func (p *GetHtmlRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +// for compatibility +func (p *GetHtmlRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *GetHtmlRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *GetHtmlRequest) BLength() int { + l := 0 + if p != nil { + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *GetHtmlResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetHtmlResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *GetHtmlResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field []byte + if v, l, err := thrift.Binary.ReadBinary(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + _field = []byte(v) + } + p.Html = _field + return offset, nil +} + +// for compatibility +func (p *GetHtmlResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *GetHtmlResponse) 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 *GetHtmlResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *GetHtmlResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteBinaryNocopy(buf[offset:], w, []byte(p.Html)) + return offset +} + +func (p *GetHtmlResponse) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.BinaryLengthNocopy([]byte(p.Html)) + return l +} + +func (p *GetUserAgreementRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +// for compatibility +func (p *GetUserAgreementRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *GetUserAgreementRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *GetUserAgreementRequest) BLength() int { + l := 0 + if p != nil { + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *GetUserAgreementResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetUserAgreementResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *GetUserAgreementResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field []byte + if v, l, err := thrift.Binary.ReadBinary(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + _field = []byte(v) + } + p.UserAgreement = _field + return offset, nil +} + +// for compatibility +func (p *GetUserAgreementResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *GetUserAgreementResponse) 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 *GetUserAgreementResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *GetUserAgreementResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteBinaryNocopy(buf[offset:], w, []byte(p.UserAgreement)) + return offset +} + +func (p *GetUserAgreementResponse) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.BinaryLengthNocopy([]byte(p.UserAgreement)) + return l +} + +func (p *CommonServiceGetCSSArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetCSSArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *CommonServiceGetCSSArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewGetCSSRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = _field + return offset, nil +} + +// for compatibility +func (p *CommonServiceGetCSSArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *CommonServiceGetCSSArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *CommonServiceGetCSSArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *CommonServiceGetCSSArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *CommonServiceGetCSSArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Req.BLength() + return l +} + +func (p *CommonServiceGetCSSResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetCSSResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *CommonServiceGetCSSResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewGetCSSResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +// for compatibility +func (p *CommonServiceGetCSSResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *CommonServiceGetCSSResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *CommonServiceGetCSSResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *CommonServiceGetCSSResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *CommonServiceGetCSSResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *CommonServiceGetHtmlArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetHtmlArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *CommonServiceGetHtmlArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewGetHtmlRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = _field + return offset, nil +} + +// for compatibility +func (p *CommonServiceGetHtmlArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *CommonServiceGetHtmlArgs) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *CommonServiceGetHtmlArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *CommonServiceGetHtmlArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *CommonServiceGetHtmlArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Req.BLength() + return l +} + +func (p *CommonServiceGetHtmlResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetHtmlResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *CommonServiceGetHtmlResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewGetHtmlResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +// for compatibility +func (p *CommonServiceGetHtmlResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *CommonServiceGetHtmlResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *CommonServiceGetHtmlResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *CommonServiceGetHtmlResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *CommonServiceGetHtmlResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *CommonServiceGetUserAgreementArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetUserAgreementArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *CommonServiceGetUserAgreementArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewGetUserAgreementRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = _field + return offset, nil +} + +// for compatibility +func (p *CommonServiceGetUserAgreementArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *CommonServiceGetUserAgreementArgs) 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 *CommonServiceGetUserAgreementArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *CommonServiceGetUserAgreementArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *CommonServiceGetUserAgreementArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Req.BLength() + return l +} + +func (p *CommonServiceGetUserAgreementResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CommonServiceGetUserAgreementResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *CommonServiceGetUserAgreementResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewGetUserAgreementResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +// for compatibility +func (p *CommonServiceGetUserAgreementResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *CommonServiceGetUserAgreementResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *CommonServiceGetUserAgreementResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *CommonServiceGetUserAgreementResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *CommonServiceGetUserAgreementResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *CommonServiceGetCSSArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *CommonServiceGetCSSResult) GetResult() interface{} { + return p.Success +} + +func (p *CommonServiceGetHtmlArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *CommonServiceGetHtmlResult) GetResult() interface{} { + return p.Success +} + +func (p *CommonServiceGetUserAgreementArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *CommonServiceGetUserAgreementResult) GetResult() interface{} { + return p.Success +} diff --git a/kitex_gen/common/k-consts.go b/kitex_gen/common/k-consts.go new file mode 100644 index 00000000..3b40138f --- /dev/null +++ b/kitex_gen/common/k-consts.go @@ -0,0 +1,20 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package common + +// KitexUnusedProtection is used to prevent 'imported and not used' error. +var KitexUnusedProtection = struct{}{} diff --git a/kitex_gen/model/k-model.go b/kitex_gen/model/k-model.go index 78890e35..0cbb8012 100644 --- a/kitex_gen/model/k-model.go +++ b/kitex_gen/model/k-model.go @@ -4128,6 +4128,526 @@ func (p *UnifiedExam) field3Length() int { return l } +func (p *Term) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + var issetTermId bool = false + var issetSchoolYear bool = false + var issetTerm bool = false + var issetStartDate bool = false + var issetEndDate bool = false + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + 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 + } + issetTermId = true + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetSchoolYear = true + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetTerm = true + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetStartDate = true + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetEndDate = true + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + if !issetTermId { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetSchoolYear { + fieldId = 2 + goto RequiredFieldNotSetError + } + + if !issetTerm { + fieldId = 3 + goto RequiredFieldNotSetError + } + + if !issetStartDate { + fieldId = 4 + goto RequiredFieldNotSetError + } + + if !issetEndDate { + fieldId = 5 + goto RequiredFieldNotSetError + } + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Term[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +RequiredFieldNotSetError: + return offset, thrift.NewProtocolException(thrift.INVALID_DATA, fmt.Sprintf("required field %s is not set", fieldIDToName_Term[fieldId])) +} + +func (p *Term) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = v + } + p.TermId = _field + return offset, nil +} + +func (p *Term) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = v + } + p.SchoolYear = _field + return offset, nil +} + +func (p *Term) FastReadField3(buf []byte) (int, error) { + offset := 0 + + var _field string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = v + } + p.Term = _field + return offset, nil +} + +func (p *Term) FastReadField4(buf []byte) (int, error) { + offset := 0 + + var _field string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = v + } + p.StartDate = _field + return offset, nil +} + +func (p *Term) FastReadField5(buf []byte) (int, error) { + offset := 0 + + var _field string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = v + } + p.EndDate = _field + return offset, nil +} + +// for compatibility +func (p *Term) FastWrite(buf []byte) int { + return 0 +} + +func (p *Term) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField3(buf[offset:], w) + offset += p.fastWriteField4(buf[offset:], w) + offset += p.fastWriteField5(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *Term) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field4Length() + l += p.field5Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *Term) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.TermId) + return offset +} + +func (p *Term) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.SchoolYear) + return offset +} + +func (p *Term) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 3) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.Term) + return offset +} + +func (p *Term) fastWriteField4(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 4) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.StartDate) + return offset +} + +func (p *Term) fastWriteField5(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 5) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.EndDate) + return offset +} + +func (p *Term) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.TermId) + return l +} + +func (p *Term) field2Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.SchoolYear) + return l +} + +func (p *Term) field3Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.Term) + return l +} + +func (p *Term) field4Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.StartDate) + return l +} + +func (p *Term) field5Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.EndDate) + return l +} + +func (p *TermEvent) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + var issetName bool = false + var issetStartDate bool = false + var issetEndDate 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 + } + issetName = true + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetStartDate = true + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetEndDate = 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 !issetName { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetStartDate { + fieldId = 2 + goto RequiredFieldNotSetError + } + + if !issetEndDate { + fieldId = 3 + goto RequiredFieldNotSetError + } + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TermEvent[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +RequiredFieldNotSetError: + return offset, thrift.NewProtocolException(thrift.INVALID_DATA, fmt.Sprintf("required field %s is not set", fieldIDToName_TermEvent[fieldId])) +} + +func (p *TermEvent) FastReadField1(buf []byte) (int, error) { + offset := 0 + + var _field string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = v + } + p.Name = _field + return offset, nil +} + +func (p *TermEvent) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = v + } + p.StartDate = _field + return offset, nil +} + +func (p *TermEvent) FastReadField3(buf []byte) (int, error) { + offset := 0 + + var _field string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = v + } + p.EndDate = _field + return offset, nil +} + +// for compatibility +func (p *TermEvent) FastWrite(buf []byte) int { + return 0 +} + +func (p *TermEvent) 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 *TermEvent) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *TermEvent) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.Name) + return offset +} + +func (p *TermEvent) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.StartDate) + return offset +} + +func (p *TermEvent) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 3) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.EndDate) + return offset +} + +func (p *TermEvent) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.Name) + return l +} + +func (p *TermEvent) field2Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.StartDate) + return l +} + +func (p *TermEvent) field3Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.EndDate) + return l +} + func (p *PaperData) FastRead(buf []byte) (int, error) { var err error var offset int diff --git a/kitex_gen/model/model.go b/kitex_gen/model/model.go index 0cd437a5..c716fef4 100644 --- a/kitex_gen/model/model.go +++ b/kitex_gen/model/model.go @@ -5816,6 +5816,746 @@ func (p *UnifiedExam) Field3DeepEqual(src string) bool { return true } +type Term struct { + TermId string `thrift:"term_id,1,required" frugal:"1,required,string" json:"term_id"` + SchoolYear string `thrift:"school_year,2,required" frugal:"2,required,string" json:"school_year"` + Term string `thrift:"term,3,required" frugal:"3,required,string" json:"term"` + StartDate string `thrift:"start_date,4,required" frugal:"4,required,string" json:"start_date"` + EndDate string `thrift:"end_date,5,required" frugal:"5,required,string" json:"end_date"` +} + +func NewTerm() *Term { + return &Term{} +} + +func (p *Term) InitDefault() { +} + +func (p *Term) GetTermId() (v string) { + return p.TermId +} + +func (p *Term) GetSchoolYear() (v string) { + return p.SchoolYear +} + +func (p *Term) GetTerm() (v string) { + return p.Term +} + +func (p *Term) GetStartDate() (v string) { + return p.StartDate +} + +func (p *Term) GetEndDate() (v string) { + return p.EndDate +} +func (p *Term) SetTermId(val string) { + p.TermId = val +} +func (p *Term) SetSchoolYear(val string) { + p.SchoolYear = val +} +func (p *Term) SetTerm(val string) { + p.Term = val +} +func (p *Term) SetStartDate(val string) { + p.StartDate = val +} +func (p *Term) SetEndDate(val string) { + p.EndDate = val +} + +var fieldIDToName_Term = map[int16]string{ + 1: "term_id", + 2: "school_year", + 3: "term", + 4: "start_date", + 5: "end_date", +} + +func (p *Term) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetTermId bool = false + var issetSchoolYear bool = false + var issetTerm bool = false + var issetStartDate bool = false + var issetEndDate bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + 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 + } + issetTermId = 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 + } + issetSchoolYear = 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 + } + issetTerm = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRING { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + issetStartDate = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.STRING { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + issetEndDate = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + 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 !issetTermId { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetSchoolYear { + fieldId = 2 + goto RequiredFieldNotSetError + } + + if !issetTerm { + fieldId = 3 + goto RequiredFieldNotSetError + } + + if !issetStartDate { + fieldId = 4 + goto RequiredFieldNotSetError + } + + if !issetEndDate { + fieldId = 5 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_Term[fieldId]), err) +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_Term[fieldId])) +} + +func (p *Term) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.TermId = _field + return nil +} +func (p *Term) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.SchoolYear = _field + return nil +} +func (p *Term) ReadField3(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Term = _field + return nil +} +func (p *Term) ReadField4(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.StartDate = _field + return nil +} +func (p *Term) ReadField5(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.EndDate = _field + return nil +} + +func (p *Term) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("Term"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *Term) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("term_id", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.TermId); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *Term) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("school_year", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.SchoolYear); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *Term) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("term", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Term); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *Term) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("start_date", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.StartDate); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *Term) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("end_date", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.EndDate); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *Term) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Term(%+v)", *p) + +} + +func (p *Term) DeepEqual(ano *Term) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.TermId) { + return false + } + if !p.Field2DeepEqual(ano.SchoolYear) { + return false + } + if !p.Field3DeepEqual(ano.Term) { + return false + } + if !p.Field4DeepEqual(ano.StartDate) { + return false + } + if !p.Field5DeepEqual(ano.EndDate) { + return false + } + return true +} + +func (p *Term) Field1DeepEqual(src string) bool { + + if strings.Compare(p.TermId, src) != 0 { + return false + } + return true +} +func (p *Term) Field2DeepEqual(src string) bool { + + if strings.Compare(p.SchoolYear, src) != 0 { + return false + } + return true +} +func (p *Term) Field3DeepEqual(src string) bool { + + if strings.Compare(p.Term, src) != 0 { + return false + } + return true +} +func (p *Term) Field4DeepEqual(src string) bool { + + if strings.Compare(p.StartDate, src) != 0 { + return false + } + return true +} +func (p *Term) Field5DeepEqual(src string) bool { + + if strings.Compare(p.EndDate, src) != 0 { + return false + } + return true +} + +type TermEvent struct { + Name string `thrift:"name,1,required" frugal:"1,required,string" json:"name"` + StartDate string `thrift:"start_date,2,required" frugal:"2,required,string" json:"start_date"` + EndDate string `thrift:"end_date,3,required" frugal:"3,required,string" json:"end_date"` +} + +func NewTermEvent() *TermEvent { + return &TermEvent{} +} + +func (p *TermEvent) InitDefault() { +} + +func (p *TermEvent) GetName() (v string) { + return p.Name +} + +func (p *TermEvent) GetStartDate() (v string) { + return p.StartDate +} + +func (p *TermEvent) GetEndDate() (v string) { + return p.EndDate +} +func (p *TermEvent) SetName(val string) { + p.Name = val +} +func (p *TermEvent) SetStartDate(val string) { + p.StartDate = val +} +func (p *TermEvent) SetEndDate(val string) { + p.EndDate = val +} + +var fieldIDToName_TermEvent = map[int16]string{ + 1: "name", + 2: "start_date", + 3: "end_date", +} + +func (p *TermEvent) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetName bool = false + var issetStartDate bool = false + var issetEndDate bool = false + + 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 + } + issetName = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + issetStartDate = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + issetEndDate = true + } 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 !issetName { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetStartDate { + fieldId = 2 + goto RequiredFieldNotSetError + } + + if !issetEndDate { + fieldId = 3 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TermEvent[fieldId]), err) +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_TermEvent[fieldId])) +} + +func (p *TermEvent) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Name = _field + return nil +} +func (p *TermEvent) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.StartDate = _field + return nil +} +func (p *TermEvent) ReadField3(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.EndDate = _field + return nil +} + +func (p *TermEvent) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("TermEvent"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *TermEvent) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Name); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + 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 *TermEvent) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("start_date", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.StartDate); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *TermEvent) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("end_date", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.EndDate); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *TermEvent) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TermEvent(%+v)", *p) + +} + +func (p *TermEvent) DeepEqual(ano *TermEvent) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Name) { + return false + } + if !p.Field2DeepEqual(ano.StartDate) { + return false + } + if !p.Field3DeepEqual(ano.EndDate) { + return false + } + return true +} + +func (p *TermEvent) Field1DeepEqual(src string) bool { + + if strings.Compare(p.Name, src) != 0 { + return false + } + return true +} +func (p *TermEvent) Field2DeepEqual(src string) bool { + + if strings.Compare(p.StartDate, src) != 0 { + return false + } + return true +} +func (p *TermEvent) Field3DeepEqual(src string) bool { + + if strings.Compare(p.EndDate, src) != 0 { + return false + } + 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"` diff --git a/kitex_gen/version/k-consts.go b/kitex_gen/version/k-consts.go new file mode 100644 index 00000000..0848f37b --- /dev/null +++ b/kitex_gen/version/k-consts.go @@ -0,0 +1,20 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package version + +// KitexUnusedProtection is used to prevent 'imported and not used' error. +var KitexUnusedProtection = struct{}{} diff --git a/kitex_gen/version/k-version.go b/kitex_gen/version/k-version.go new file mode 100644 index 00000000..ab6d803d --- /dev/null +++ b/kitex_gen/version/k-version.go @@ -0,0 +1,6198 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by Kitex v0.11.3. DO NOT EDIT. + +package version + +import ( + "bytes" + "fmt" + "reflect" + "strings" + + "github.com/cloudwego/gopkg/protocol/thrift" + + "github.com/west2-online/fzuhelper-server/kitex_gen/model" +) + +var ( + _ = model.KitexUnusedProtection +) + +// unused protection +var ( + _ = fmt.Formatter(nil) + _ = (*bytes.Buffer)(nil) + _ = (*strings.Builder)(nil) + _ = reflect.Type(nil) + _ = thrift.STOP +) + +func (p *LoginRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + var issetPassword 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 + } + issetPassword = 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 !issetPassword { + 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_LoginRequest[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_LoginRequest[fieldId])) +} + +func (p *LoginRequest) 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.Password = _field + return offset, nil +} + +// for compatibility +func (p *LoginRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *LoginRequest) 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 *LoginRequest) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *LoginRequest) 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.Password) + return offset +} + +func (p *LoginRequest) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.Password) + return l +} + +func (p *LoginResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LoginResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *LoginResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := model.NewBaseResp() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = _field + return offset, nil +} + +// for compatibility +func (p *LoginResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *LoginResponse) 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 *LoginResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *LoginResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Base.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *LoginResponse) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Base.BLength() + return l +} + +func (p *UploadRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + var issetVersion bool = false + var issetCode bool = false + var issetUrl bool = false + var issetFeature bool = false + var issetType bool = false + var issetPassword bool = false + 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 + } + issetVersion = true + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetCode = true + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetUrl = true + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetFeature = true + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetType = true + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 6: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField6(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetPassword = 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 !issetVersion { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetCode { + fieldId = 2 + goto RequiredFieldNotSetError + } + + if !issetUrl { + fieldId = 3 + goto RequiredFieldNotSetError + } + + if !issetFeature { + fieldId = 4 + goto RequiredFieldNotSetError + } + + if !issetType { + fieldId = 5 + goto RequiredFieldNotSetError + } + + if !issetPassword { + fieldId = 6 + goto RequiredFieldNotSetError + } + return 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_UploadRequest[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_UploadRequest[fieldId])) +} + +func (p *UploadRequest) 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.Version = _field + return offset, nil +} + +func (p *UploadRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = v + } + p.Code = _field + return offset, nil +} + +func (p *UploadRequest) FastReadField3(buf []byte) (int, error) { + offset := 0 + + var _field string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = v + } + p.Url = _field + return offset, nil +} + +func (p *UploadRequest) FastReadField4(buf []byte) (int, error) { + offset := 0 + + var _field string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = v + } + p.Feature = _field + return offset, nil +} + +func (p *UploadRequest) FastReadField5(buf []byte) (int, error) { + offset := 0 + + var _field string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = v + } + p.Type = _field + return offset, nil +} + +func (p *UploadRequest) FastReadField6(buf []byte) (int, error) { + offset := 0 + + var _field string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = v + } + p.Password = _field + return offset, nil +} + +// for compatibility +func (p *UploadRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *UploadRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField3(buf[offset:], w) + offset += p.fastWriteField4(buf[offset:], w) + offset += p.fastWriteField5(buf[offset:], w) + offset += p.fastWriteField6(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *UploadRequest) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field4Length() + l += p.field5Length() + l += p.field6Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *UploadRequest) 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.Version) + return offset +} + +func (p *UploadRequest) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.Code) + return offset +} + +func (p *UploadRequest) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 3) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.Url) + return offset +} + +func (p *UploadRequest) fastWriteField4(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 4) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.Feature) + return offset +} + +func (p *UploadRequest) fastWriteField5(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 5) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.Type) + return offset +} + +func (p *UploadRequest) fastWriteField6(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 6) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.Password) + return offset +} + +func (p *UploadRequest) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.Version) + return l +} + +func (p *UploadRequest) field2Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.Code) + return l +} + +func (p *UploadRequest) field3Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.Url) + return l +} + +func (p *UploadRequest) field4Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.Feature) + return l +} + +func (p *UploadRequest) field5Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.Type) + return l +} + +func (p *UploadRequest) field6Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.Password) + return l +} + +func (p *UploadResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UploadResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *UploadResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := model.NewBaseResp() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = _field + return offset, nil +} + +// for compatibility +func (p *UploadResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *UploadResponse) 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 *UploadResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *UploadResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Base.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *UploadResponse) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Base.BLength() + return l +} + +func (p *UploadParamsRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + var issetPassword 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 + } + issetPassword = 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 !issetPassword { + 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_UploadParamsRequest[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_UploadParamsRequest[fieldId])) +} + +func (p *UploadParamsRequest) 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.Password = _field + return offset, nil +} + +// for compatibility +func (p *UploadParamsRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *UploadParamsRequest) 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 *UploadParamsRequest) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *UploadParamsRequest) 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.Password) + return offset +} + +func (p *UploadParamsRequest) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.Password) + return l +} + +func (p *UploadParamsResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UploadParamsResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *UploadParamsResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := model.NewBaseResp() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = _field + return offset, nil +} + +func (p *UploadParamsResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Policy = _field + return offset, nil +} + +func (p *UploadParamsResponse) FastReadField3(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Authorization = _field + return offset, nil +} + +// for compatibility +func (p *UploadParamsResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *UploadParamsResponse) 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 *UploadParamsResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *UploadParamsResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Base.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *UploadParamsResponse) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetPolicy() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Policy) + } + return offset +} + +func (p *UploadParamsResponse) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetAuthorization() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 3) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Authorization) + } + return offset +} + +func (p *UploadParamsResponse) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Base.BLength() + return l +} + +func (p *UploadParamsResponse) field2Length() int { + l := 0 + if p.IsSetPolicy() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Policy) + } + return l +} + +func (p *UploadParamsResponse) field3Length() int { + l := 0 + if p.IsSetAuthorization() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Authorization) + } + return l +} + +func (p *DownloadReleaseApkRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +// for compatibility +func (p *DownloadReleaseApkRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *DownloadReleaseApkRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *DownloadReleaseApkRequest) BLength() int { + l := 0 + if p != nil { + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *DownloadReleaseApkResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DownloadReleaseApkResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *DownloadReleaseApkResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := model.NewBaseResp() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = _field + return offset, nil +} + +func (p *DownloadReleaseApkResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = v + } + p.RedirectUrl = _field + return offset, nil +} + +// for compatibility +func (p *DownloadReleaseApkResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *DownloadReleaseApkResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *DownloadReleaseApkResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *DownloadReleaseApkResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Base.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *DownloadReleaseApkResponse) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.RedirectUrl) + return offset +} + +func (p *DownloadReleaseApkResponse) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Base.BLength() + return l +} + +func (p *DownloadReleaseApkResponse) field2Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.RedirectUrl) + return l +} + +func (p *DownloadBetaApkRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +// for compatibility +func (p *DownloadBetaApkRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *DownloadBetaApkRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *DownloadBetaApkRequest) BLength() int { + l := 0 + if p != nil { + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *DownloadBetaApkResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DownloadBetaApkResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *DownloadBetaApkResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := model.NewBaseResp() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = _field + return offset, nil +} + +func (p *DownloadBetaApkResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = v + } + p.RedirectUrl = _field + return offset, nil +} + +// for compatibility +func (p *DownloadBetaApkResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *DownloadBetaApkResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *DownloadBetaApkResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *DownloadBetaApkResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Base.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *DownloadBetaApkResponse) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.RedirectUrl) + return offset +} + +func (p *DownloadBetaApkResponse) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Base.BLength() + return l +} + +func (p *DownloadBetaApkResponse) field2Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.RedirectUrl) + return l +} + +func (p *GetReleaseVersionRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +// for compatibility +func (p *GetReleaseVersionRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *GetReleaseVersionRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *GetReleaseVersionRequest) BLength() int { + l := 0 + if p != nil { + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *GetReleaseVersionResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetReleaseVersionResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *GetReleaseVersionResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := model.NewBaseResp() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = _field + return offset, nil +} + +func (p *GetReleaseVersionResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Code = _field + return offset, nil +} + +func (p *GetReleaseVersionResponse) FastReadField3(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Feature = _field + return offset, nil +} + +func (p *GetReleaseVersionResponse) FastReadField4(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Url = _field + return offset, nil +} + +func (p *GetReleaseVersionResponse) FastReadField5(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Version = _field + return offset, nil +} + +// for compatibility +func (p *GetReleaseVersionResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *GetReleaseVersionResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField3(buf[offset:], w) + offset += p.fastWriteField4(buf[offset:], w) + offset += p.fastWriteField5(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *GetReleaseVersionResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field4Length() + l += p.field5Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *GetReleaseVersionResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Base.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *GetReleaseVersionResponse) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetCode() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Code) + } + return offset +} + +func (p *GetReleaseVersionResponse) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetFeature() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 3) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Feature) + } + return offset +} + +func (p *GetReleaseVersionResponse) fastWriteField4(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetUrl() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 4) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Url) + } + return offset +} + +func (p *GetReleaseVersionResponse) fastWriteField5(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetVersion() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 5) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Version) + } + return offset +} + +func (p *GetReleaseVersionResponse) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Base.BLength() + return l +} + +func (p *GetReleaseVersionResponse) field2Length() int { + l := 0 + if p.IsSetCode() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Code) + } + return l +} + +func (p *GetReleaseVersionResponse) field3Length() int { + l := 0 + if p.IsSetFeature() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Feature) + } + return l +} + +func (p *GetReleaseVersionResponse) field4Length() int { + l := 0 + if p.IsSetUrl() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Url) + } + return l +} + +func (p *GetReleaseVersionResponse) field5Length() int { + l := 0 + if p.IsSetVersion() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Version) + } + return l +} + +func (p *GetBetaVersionRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +// for compatibility +func (p *GetBetaVersionRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *GetBetaVersionRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *GetBetaVersionRequest) BLength() int { + l := 0 + if p != nil { + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *GetBetaVersionResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetBetaVersionResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *GetBetaVersionResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := model.NewBaseResp() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = _field + return offset, nil +} + +func (p *GetBetaVersionResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Code = _field + return offset, nil +} + +func (p *GetBetaVersionResponse) FastReadField3(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Feature = _field + return offset, nil +} + +func (p *GetBetaVersionResponse) FastReadField4(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Url = _field + return offset, nil +} + +func (p *GetBetaVersionResponse) FastReadField5(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Version = _field + return offset, nil +} + +// for compatibility +func (p *GetBetaVersionResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *GetBetaVersionResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField3(buf[offset:], w) + offset += p.fastWriteField4(buf[offset:], w) + offset += p.fastWriteField5(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *GetBetaVersionResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field4Length() + l += p.field5Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *GetBetaVersionResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Base.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *GetBetaVersionResponse) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetCode() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Code) + } + return offset +} + +func (p *GetBetaVersionResponse) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetFeature() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 3) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Feature) + } + return offset +} + +func (p *GetBetaVersionResponse) fastWriteField4(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetUrl() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 4) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Url) + } + return offset +} + +func (p *GetBetaVersionResponse) fastWriteField5(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetVersion() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 5) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Version) + } + return offset +} + +func (p *GetBetaVersionResponse) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Base.BLength() + return l +} + +func (p *GetBetaVersionResponse) field2Length() int { + l := 0 + if p.IsSetCode() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Code) + } + return l +} + +func (p *GetBetaVersionResponse) field3Length() int { + l := 0 + if p.IsSetFeature() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Feature) + } + return l +} + +func (p *GetBetaVersionResponse) field4Length() int { + l := 0 + if p.IsSetUrl() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Url) + } + return l +} + +func (p *GetBetaVersionResponse) field5Length() int { + l := 0 + if p.IsSetVersion() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Version) + } + return l +} + +func (p *GetSettingRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.BOOL { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.BOOL { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 6: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField6(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetSettingRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *GetSettingRequest) 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.Account = _field + return offset, nil +} + +func (p *GetSettingRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Version = _field + return offset, nil +} + +func (p *GetSettingRequest) FastReadField3(buf []byte) (int, error) { + offset := 0 + + var _field *bool + if v, l, err := thrift.Binary.ReadBool(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Beta = _field + return offset, nil +} + +func (p *GetSettingRequest) FastReadField4(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Phone = _field + return offset, nil +} + +func (p *GetSettingRequest) FastReadField5(buf []byte) (int, error) { + offset := 0 + + var _field *bool + if v, l, err := thrift.Binary.ReadBool(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.IsLogin = _field + return offset, nil +} + +func (p *GetSettingRequest) FastReadField6(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.LoginType = _field + return offset, nil +} + +// for compatibility +func (p *GetSettingRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *GetSettingRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField3(buf[offset:], w) + offset += p.fastWriteField5(buf[offset:], w) + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField4(buf[offset:], w) + offset += p.fastWriteField6(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *GetSettingRequest) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field4Length() + l += p.field5Length() + l += p.field6Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *GetSettingRequest) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetAccount() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Account) + } + return offset +} + +func (p *GetSettingRequest) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetVersion() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Version) + } + return offset +} + +func (p *GetSettingRequest) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetBeta() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.BOOL, 3) + offset += thrift.Binary.WriteBool(buf[offset:], *p.Beta) + } + return offset +} + +func (p *GetSettingRequest) fastWriteField4(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetPhone() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 4) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Phone) + } + return offset +} + +func (p *GetSettingRequest) fastWriteField5(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetIsLogin() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.BOOL, 5) + offset += thrift.Binary.WriteBool(buf[offset:], *p.IsLogin) + } + return offset +} + +func (p *GetSettingRequest) fastWriteField6(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetLoginType() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 6) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.LoginType) + } + return offset +} + +func (p *GetSettingRequest) field1Length() int { + l := 0 + if p.IsSetAccount() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Account) + } + return l +} + +func (p *GetSettingRequest) field2Length() int { + l := 0 + if p.IsSetVersion() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Version) + } + return l +} + +func (p *GetSettingRequest) field3Length() int { + l := 0 + if p.IsSetBeta() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.BoolLength() + } + return l +} + +func (p *GetSettingRequest) field4Length() int { + l := 0 + if p.IsSetPhone() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Phone) + } + return l +} + +func (p *GetSettingRequest) field5Length() int { + l := 0 + if p.IsSetIsLogin() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.BoolLength() + } + return l +} + +func (p *GetSettingRequest) field6Length() int { + l := 0 + if p.IsSetLoginType() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.LoginType) + } + return l +} + +func (p *GetSettingResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetSettingResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *GetSettingResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := model.NewBaseResp() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = _field + return offset, nil +} + +func (p *GetSettingResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field []byte + if v, l, err := thrift.Binary.ReadBinary(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + _field = []byte(v) + } + p.CloudSetting = _field + return offset, nil +} + +// for compatibility +func (p *GetSettingResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *GetSettingResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *GetSettingResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *GetSettingResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetBase() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Base.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *GetSettingResponse) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteBinaryNocopy(buf[offset:], w, []byte(p.CloudSetting)) + return offset +} + +func (p *GetSettingResponse) field1Length() int { + l := 0 + if p.IsSetBase() { + l += thrift.Binary.FieldBeginLength() + l += p.Base.BLength() + } + return l +} + +func (p *GetSettingResponse) field2Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.BinaryLengthNocopy([]byte(p.CloudSetting)) + return l +} + +func (p *GetTestRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.BOOL { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.BOOL { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 6: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField6(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 7: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField7(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetTestRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *GetTestRequest) 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.Account = _field + return offset, nil +} + +func (p *GetTestRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Version = _field + return offset, nil +} + +func (p *GetTestRequest) FastReadField3(buf []byte) (int, error) { + offset := 0 + + var _field *bool + if v, l, err := thrift.Binary.ReadBool(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Beta = _field + return offset, nil +} + +func (p *GetTestRequest) FastReadField4(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Phone = _field + return offset, nil +} + +func (p *GetTestRequest) FastReadField5(buf []byte) (int, error) { + offset := 0 + + var _field *bool + if v, l, err := thrift.Binary.ReadBool(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.IsLogin = _field + return offset, nil +} + +func (p *GetTestRequest) FastReadField6(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.LoginType = _field + return offset, nil +} + +func (p *GetTestRequest) FastReadField7(buf []byte) (int, error) { + offset := 0 + + var _field *string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = &v + } + p.Setting = _field + return offset, nil +} + +// for compatibility +func (p *GetTestRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *GetTestRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField3(buf[offset:], w) + offset += p.fastWriteField5(buf[offset:], w) + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + offset += p.fastWriteField4(buf[offset:], w) + offset += p.fastWriteField6(buf[offset:], w) + offset += p.fastWriteField7(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *GetTestRequest) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field4Length() + l += p.field5Length() + l += p.field6Length() + l += p.field7Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *GetTestRequest) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetAccount() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 1) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Account) + } + return offset +} + +func (p *GetTestRequest) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetVersion() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Version) + } + return offset +} + +func (p *GetTestRequest) fastWriteField3(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetBeta() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.BOOL, 3) + offset += thrift.Binary.WriteBool(buf[offset:], *p.Beta) + } + return offset +} + +func (p *GetTestRequest) fastWriteField4(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetPhone() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 4) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Phone) + } + return offset +} + +func (p *GetTestRequest) fastWriteField5(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetIsLogin() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.BOOL, 5) + offset += thrift.Binary.WriteBool(buf[offset:], *p.IsLogin) + } + return offset +} + +func (p *GetTestRequest) fastWriteField6(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetLoginType() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 6) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.LoginType) + } + return offset +} + +func (p *GetTestRequest) fastWriteField7(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSetting() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 7) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, *p.Setting) + } + return offset +} + +func (p *GetTestRequest) field1Length() int { + l := 0 + if p.IsSetAccount() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Account) + } + return l +} + +func (p *GetTestRequest) field2Length() int { + l := 0 + if p.IsSetVersion() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Version) + } + return l +} + +func (p *GetTestRequest) field3Length() int { + l := 0 + if p.IsSetBeta() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.BoolLength() + } + return l +} + +func (p *GetTestRequest) field4Length() int { + l := 0 + if p.IsSetPhone() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Phone) + } + return l +} + +func (p *GetTestRequest) field5Length() int { + l := 0 + if p.IsSetIsLogin() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.BoolLength() + } + return l +} + +func (p *GetTestRequest) field6Length() int { + l := 0 + if p.IsSetLoginType() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.LoginType) + } + return l +} + +func (p *GetTestRequest) field7Length() int { + l := 0 + if p.IsSetSetting() { + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(*p.Setting) + } + return l +} + +func (p *GetTestResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetTestResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *GetTestResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := model.NewBaseResp() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = _field + return offset, nil +} + +func (p *GetTestResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field []byte + if v, l, err := thrift.Binary.ReadBinary(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + _field = []byte(v) + } + p.CloudSetting = _field + return offset, nil +} + +// for compatibility +func (p *GetTestResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *GetTestResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *GetTestResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *GetTestResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Base.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *GetTestResponse) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteBinaryNocopy(buf[offset:], w, []byte(p.CloudSetting)) + return offset +} + +func (p *GetTestResponse) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Base.BLength() + return l +} + +func (p *GetTestResponse) field2Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.BinaryLengthNocopy([]byte(p.CloudSetting)) + return l +} + +func (p *GetCloudRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +// for compatibility +func (p *GetCloudRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *GetCloudRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *GetCloudRequest) BLength() int { + l := 0 + if p != nil { + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *GetCloudResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetCloudResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *GetCloudResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := model.NewBaseResp() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = _field + return offset, nil +} + +func (p *GetCloudResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field []byte + if v, l, err := thrift.Binary.ReadBinary(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + _field = []byte(v) + } + p.CloudSetting = _field + return offset, nil +} + +// for compatibility +func (p *GetCloudResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *GetCloudResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *GetCloudResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *GetCloudResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Base.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *GetCloudResponse) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteBinaryNocopy(buf[offset:], w, []byte(p.CloudSetting)) + return offset +} + +func (p *GetCloudResponse) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Base.BLength() + return l +} + +func (p *GetCloudResponse) field2Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.BinaryLengthNocopy([]byte(p.CloudSetting)) + return l +} + +func (p *SetCloudRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + var issetPassword bool = false + var issetSetting 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 + } + issetPassword = true + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetSetting = 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 !issetPassword { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetSetting { + fieldId = 2 + goto RequiredFieldNotSetError + } + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SetCloudRequest[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_SetCloudRequest[fieldId])) +} + +func (p *SetCloudRequest) 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.Password = _field + return offset, nil +} + +func (p *SetCloudRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = v + } + p.Setting = _field + return offset, nil +} + +// for compatibility +func (p *SetCloudRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *SetCloudRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *SetCloudRequest) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *SetCloudRequest) 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.Password) + return offset +} + +func (p *SetCloudRequest) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.Setting) + return offset +} + +func (p *SetCloudRequest) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.Password) + return l +} + +func (p *SetCloudRequest) field2Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.Setting) + return l +} + +func (p *SetCloudResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SetCloudResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *SetCloudResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := model.NewBaseResp() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = _field + return offset, nil +} + +// for compatibility +func (p *SetCloudResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *SetCloudResponse) 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 *SetCloudResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *SetCloudResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Base.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *SetCloudResponse) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Base.BLength() + return l +} + +func (p *GetDumpRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +// for compatibility +func (p *GetDumpRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *GetDumpRequest) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *GetDumpRequest) BLength() int { + l := 0 + if p != nil { + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *GetDumpResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetDumpResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *GetDumpResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := model.NewBaseResp() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = _field + return offset, nil +} + +func (p *GetDumpResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 + + var _field string + if v, l, err := thrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + _field = v + } + p.Data = _field + return offset, nil +} + +// for compatibility +func (p *GetDumpResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *GetDumpResponse) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField1(buf[offset:], w) + offset += p.fastWriteField2(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *GetDumpResponse) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *GetDumpResponse) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Base.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *GetDumpResponse) fastWriteField2(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRING, 2) + offset += thrift.Binary.WriteStringNocopy(buf[offset:], w, p.Data) + return offset +} + +func (p *GetDumpResponse) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Base.BLength() + return l +} + +func (p *GetDumpResponse) field2Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += thrift.Binary.StringLengthNocopy(p.Data) + return l +} + +func (p *VersionServiceLoginArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceLoginArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *VersionServiceLoginArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewLoginRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = _field + return offset, nil +} + +// for compatibility +func (p *VersionServiceLoginArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *VersionServiceLoginArgs) 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 *VersionServiceLoginArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *VersionServiceLoginArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *VersionServiceLoginArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Req.BLength() + return l +} + +func (p *VersionServiceLoginResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceLoginResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *VersionServiceLoginResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewLoginResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +// for compatibility +func (p *VersionServiceLoginResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *VersionServiceLoginResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *VersionServiceLoginResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *VersionServiceLoginResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *VersionServiceLoginResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *VersionServiceUploadVersionArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceUploadVersionArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *VersionServiceUploadVersionArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewUploadRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = _field + return offset, nil +} + +// for compatibility +func (p *VersionServiceUploadVersionArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *VersionServiceUploadVersionArgs) 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 *VersionServiceUploadVersionArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *VersionServiceUploadVersionArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *VersionServiceUploadVersionArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Req.BLength() + return l +} + +func (p *VersionServiceUploadVersionResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceUploadVersionResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *VersionServiceUploadVersionResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewUploadResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +// for compatibility +func (p *VersionServiceUploadVersionResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *VersionServiceUploadVersionResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *VersionServiceUploadVersionResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *VersionServiceUploadVersionResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *VersionServiceUploadVersionResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *VersionServiceUploadParamsArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceUploadParamsArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *VersionServiceUploadParamsArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewUploadParamsRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = _field + return offset, nil +} + +// for compatibility +func (p *VersionServiceUploadParamsArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *VersionServiceUploadParamsArgs) 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 *VersionServiceUploadParamsArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *VersionServiceUploadParamsArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *VersionServiceUploadParamsArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Req.BLength() + return l +} + +func (p *VersionServiceUploadParamsResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceUploadParamsResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *VersionServiceUploadParamsResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewUploadParamsResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +// for compatibility +func (p *VersionServiceUploadParamsResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *VersionServiceUploadParamsResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *VersionServiceUploadParamsResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *VersionServiceUploadParamsResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *VersionServiceUploadParamsResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *VersionServiceDownloadReleaseApkArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceDownloadReleaseApkArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *VersionServiceDownloadReleaseApkArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewDownloadReleaseApkRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = _field + return offset, nil +} + +// for compatibility +func (p *VersionServiceDownloadReleaseApkArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *VersionServiceDownloadReleaseApkArgs) 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 *VersionServiceDownloadReleaseApkArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *VersionServiceDownloadReleaseApkArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *VersionServiceDownloadReleaseApkArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Req.BLength() + return l +} + +func (p *VersionServiceDownloadReleaseApkResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceDownloadReleaseApkResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *VersionServiceDownloadReleaseApkResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewDownloadReleaseApkResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +// for compatibility +func (p *VersionServiceDownloadReleaseApkResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *VersionServiceDownloadReleaseApkResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *VersionServiceDownloadReleaseApkResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *VersionServiceDownloadReleaseApkResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *VersionServiceDownloadReleaseApkResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *VersionServiceDownloadBetaApkArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceDownloadBetaApkArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *VersionServiceDownloadBetaApkArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewDownloadBetaApkRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = _field + return offset, nil +} + +// for compatibility +func (p *VersionServiceDownloadBetaApkArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *VersionServiceDownloadBetaApkArgs) 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 *VersionServiceDownloadBetaApkArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *VersionServiceDownloadBetaApkArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *VersionServiceDownloadBetaApkArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Req.BLength() + return l +} + +func (p *VersionServiceDownloadBetaApkResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceDownloadBetaApkResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *VersionServiceDownloadBetaApkResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewDownloadBetaApkResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +// for compatibility +func (p *VersionServiceDownloadBetaApkResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *VersionServiceDownloadBetaApkResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *VersionServiceDownloadBetaApkResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *VersionServiceDownloadBetaApkResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *VersionServiceDownloadBetaApkResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *VersionServiceGetReleaseVersionArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetReleaseVersionArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *VersionServiceGetReleaseVersionArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewGetReleaseVersionRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = _field + return offset, nil +} + +// for compatibility +func (p *VersionServiceGetReleaseVersionArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *VersionServiceGetReleaseVersionArgs) 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 *VersionServiceGetReleaseVersionArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *VersionServiceGetReleaseVersionArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *VersionServiceGetReleaseVersionArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Req.BLength() + return l +} + +func (p *VersionServiceGetReleaseVersionResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetReleaseVersionResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *VersionServiceGetReleaseVersionResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewGetReleaseVersionResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +// for compatibility +func (p *VersionServiceGetReleaseVersionResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *VersionServiceGetReleaseVersionResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *VersionServiceGetReleaseVersionResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *VersionServiceGetReleaseVersionResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *VersionServiceGetReleaseVersionResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *VersionServiceGetBetaVersionArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetBetaVersionArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *VersionServiceGetBetaVersionArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewGetBetaVersionRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = _field + return offset, nil +} + +// for compatibility +func (p *VersionServiceGetBetaVersionArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *VersionServiceGetBetaVersionArgs) 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 *VersionServiceGetBetaVersionArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *VersionServiceGetBetaVersionArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *VersionServiceGetBetaVersionArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Req.BLength() + return l +} + +func (p *VersionServiceGetBetaVersionResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetBetaVersionResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *VersionServiceGetBetaVersionResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewGetBetaVersionResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +// for compatibility +func (p *VersionServiceGetBetaVersionResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *VersionServiceGetBetaVersionResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *VersionServiceGetBetaVersionResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *VersionServiceGetBetaVersionResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *VersionServiceGetBetaVersionResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *VersionServiceGetSettingArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetSettingArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *VersionServiceGetSettingArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewGetSettingRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = _field + return offset, nil +} + +// for compatibility +func (p *VersionServiceGetSettingArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *VersionServiceGetSettingArgs) 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 *VersionServiceGetSettingArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *VersionServiceGetSettingArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *VersionServiceGetSettingArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Req.BLength() + return l +} + +func (p *VersionServiceGetSettingResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetSettingResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *VersionServiceGetSettingResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewGetSettingResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +// for compatibility +func (p *VersionServiceGetSettingResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *VersionServiceGetSettingResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *VersionServiceGetSettingResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *VersionServiceGetSettingResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *VersionServiceGetSettingResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *VersionServiceGetTestArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetTestArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *VersionServiceGetTestArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewGetTestRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = _field + return offset, nil +} + +// for compatibility +func (p *VersionServiceGetTestArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *VersionServiceGetTestArgs) 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 *VersionServiceGetTestArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *VersionServiceGetTestArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *VersionServiceGetTestArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Req.BLength() + return l +} + +func (p *VersionServiceGetTestResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetTestResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *VersionServiceGetTestResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewGetTestResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +// for compatibility +func (p *VersionServiceGetTestResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *VersionServiceGetTestResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *VersionServiceGetTestResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *VersionServiceGetTestResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *VersionServiceGetTestResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *VersionServiceGetCloudArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetCloudArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *VersionServiceGetCloudArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewGetCloudRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = _field + return offset, nil +} + +// for compatibility +func (p *VersionServiceGetCloudArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *VersionServiceGetCloudArgs) 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 *VersionServiceGetCloudArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *VersionServiceGetCloudArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *VersionServiceGetCloudArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Req.BLength() + return l +} + +func (p *VersionServiceGetCloudResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetCloudResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *VersionServiceGetCloudResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewGetCloudResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +// for compatibility +func (p *VersionServiceGetCloudResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *VersionServiceGetCloudResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *VersionServiceGetCloudResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *VersionServiceGetCloudResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *VersionServiceGetCloudResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *VersionServiceSetCloudArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceSetCloudArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *VersionServiceSetCloudArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewSetCloudRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = _field + return offset, nil +} + +// for compatibility +func (p *VersionServiceSetCloudArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *VersionServiceSetCloudArgs) 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 *VersionServiceSetCloudArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *VersionServiceSetCloudArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *VersionServiceSetCloudArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Req.BLength() + return l +} + +func (p *VersionServiceSetCloudResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceSetCloudResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *VersionServiceSetCloudResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewSetCloudResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +// for compatibility +func (p *VersionServiceSetCloudResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *VersionServiceSetCloudResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *VersionServiceSetCloudResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *VersionServiceSetCloudResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *VersionServiceSetCloudResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *VersionServiceGetDumpArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetDumpArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *VersionServiceGetDumpArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + _field := NewGetDumpRequest() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = _field + return offset, nil +} + +// for compatibility +func (p *VersionServiceGetDumpArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *VersionServiceGetDumpArgs) 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 *VersionServiceGetDumpArgs) BLength() int { + l := 0 + if p != nil { + l += p.field1Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *VersionServiceGetDumpArgs) fastWriteField1(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], w) + return offset +} + +func (p *VersionServiceGetDumpArgs) field1Length() int { + l := 0 + l += thrift.Binary.FieldBeginLength() + l += p.Req.BLength() + return l +} + +func (p *VersionServiceGetDumpResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + for { + fieldTypeId, fieldId, l, err = thrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = thrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + } + + return offset, nil +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceGetDumpResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +} + +func (p *VersionServiceGetDumpResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + _field := NewGetDumpResponse() + if l, err := _field.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = _field + return offset, nil +} + +// for compatibility +func (p *VersionServiceGetDumpResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *VersionServiceGetDumpResult) FastWriteNocopy(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p != nil { + offset += p.fastWriteField0(buf[offset:], w) + } + offset += thrift.Binary.WriteFieldStop(buf[offset:]) + return offset +} + +func (p *VersionServiceGetDumpResult) BLength() int { + l := 0 + if p != nil { + l += p.field0Length() + } + l += thrift.Binary.FieldStopLength() + return l +} + +func (p *VersionServiceGetDumpResult) fastWriteField0(buf []byte, w thrift.NocopyWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += thrift.Binary.WriteFieldBegin(buf[offset:], thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], w) + } + return offset +} + +func (p *VersionServiceGetDumpResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += thrift.Binary.FieldBeginLength() + l += p.Success.BLength() + } + return l +} + +func (p *VersionServiceLoginArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *VersionServiceLoginResult) GetResult() interface{} { + return p.Success +} + +func (p *VersionServiceUploadVersionArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *VersionServiceUploadVersionResult) GetResult() interface{} { + return p.Success +} + +func (p *VersionServiceUploadParamsArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *VersionServiceUploadParamsResult) GetResult() interface{} { + return p.Success +} + +func (p *VersionServiceDownloadReleaseApkArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *VersionServiceDownloadReleaseApkResult) GetResult() interface{} { + return p.Success +} + +func (p *VersionServiceDownloadBetaApkArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *VersionServiceDownloadBetaApkResult) GetResult() interface{} { + return p.Success +} + +func (p *VersionServiceGetReleaseVersionArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *VersionServiceGetReleaseVersionResult) GetResult() interface{} { + return p.Success +} + +func (p *VersionServiceGetBetaVersionArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *VersionServiceGetBetaVersionResult) GetResult() interface{} { + return p.Success +} + +func (p *VersionServiceGetSettingArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *VersionServiceGetSettingResult) GetResult() interface{} { + return p.Success +} + +func (p *VersionServiceGetTestArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *VersionServiceGetTestResult) GetResult() interface{} { + return p.Success +} + +func (p *VersionServiceGetCloudArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *VersionServiceGetCloudResult) GetResult() interface{} { + return p.Success +} + +func (p *VersionServiceSetCloudArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *VersionServiceSetCloudResult) GetResult() interface{} { + return p.Success +} + +func (p *VersionServiceGetDumpArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *VersionServiceGetDumpResult) GetResult() interface{} { + return p.Success +} diff --git a/kitex_gen/version/version.go b/kitex_gen/version/version.go new file mode 100644 index 00000000..f71304bc --- /dev/null +++ b/kitex_gen/version/version.go @@ -0,0 +1,10133 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by thriftgo (0.3.18). DO NOT EDIT. + +package version + +import ( + "bytes" + "context" + "fmt" + "strings" + + thrift "github.com/cloudwego/kitex/pkg/protocol/bthrift/apache" + + "github.com/west2-online/fzuhelper-server/kitex_gen/model" +) + +type LoginRequest struct { + Password string `thrift:"password,1,required" frugal:"1,required,string" json:"password"` +} + +func NewLoginRequest() *LoginRequest { + return &LoginRequest{} +} + +func (p *LoginRequest) InitDefault() { +} + +func (p *LoginRequest) GetPassword() (v string) { + return p.Password +} +func (p *LoginRequest) SetPassword(val string) { + p.Password = val +} + +var fieldIDToName_LoginRequest = map[int16]string{ + 1: "password", +} + +func (p *LoginRequest) 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 + } + + 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 + } + 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_LoginRequest[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_LoginRequest[fieldId])) +} + +func (p *LoginRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Password = _field + return nil +} + +func (p *LoginRequest) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("LoginRequest"); 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 *LoginRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("password", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Password); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *LoginRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LoginRequest(%+v)", *p) + +} + +func (p *LoginRequest) DeepEqual(ano *LoginRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Password) { + return false + } + return true +} + +func (p *LoginRequest) Field1DeepEqual(src string) bool { + + if strings.Compare(p.Password, src) != 0 { + return false + } + return true +} + +type LoginResponse struct { + Base *model.BaseResp `thrift:"base,1" frugal:"1,default,model.BaseResp" json:"base"` +} + +func NewLoginResponse() *LoginResponse { + return &LoginResponse{} +} + +func (p *LoginResponse) InitDefault() { +} + +var LoginResponse_Base_DEFAULT *model.BaseResp + +func (p *LoginResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return LoginResponse_Base_DEFAULT + } + return p.Base +} +func (p *LoginResponse) SetBase(val *model.BaseResp) { + p.Base = val +} + +var fieldIDToName_LoginResponse = map[int16]string{ + 1: "base", +} + +func (p *LoginResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *LoginResponse) 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_LoginResponse[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 *LoginResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} + +func (p *LoginResponse) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("LoginResponse"); err != nil { + 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 *LoginResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + 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 *LoginResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LoginResponse(%+v)", *p) + +} + +func (p *LoginResponse) DeepEqual(ano *LoginResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Base) { + return false + } + return true +} + +func (p *LoginResponse) Field1DeepEqual(src *model.BaseResp) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} + +type UploadRequest struct { + Version string `thrift:"version,1,required" frugal:"1,required,string" json:"version"` + Code string `thrift:"code,2,required" frugal:"2,required,string" json:"code"` + Url string `thrift:"url,3,required" frugal:"3,required,string" json:"url"` + Feature string `thrift:"feature,4,required" frugal:"4,required,string" json:"feature"` + Type string `thrift:"type,5,required" frugal:"5,required,string" json:"type"` + Password string `thrift:"password,6,required" frugal:"6,required,string" json:"password"` +} + +func NewUploadRequest() *UploadRequest { + return &UploadRequest{} +} + +func (p *UploadRequest) InitDefault() { +} + +func (p *UploadRequest) GetVersion() (v string) { + return p.Version +} + +func (p *UploadRequest) GetCode() (v string) { + return p.Code +} + +func (p *UploadRequest) GetUrl() (v string) { + return p.Url +} + +func (p *UploadRequest) GetFeature() (v string) { + return p.Feature +} + +func (p *UploadRequest) GetType() (v string) { + return p.Type +} + +func (p *UploadRequest) GetPassword() (v string) { + return p.Password +} +func (p *UploadRequest) SetVersion(val string) { + p.Version = val +} +func (p *UploadRequest) SetCode(val string) { + p.Code = val +} +func (p *UploadRequest) SetUrl(val string) { + p.Url = val +} +func (p *UploadRequest) SetFeature(val string) { + p.Feature = val +} +func (p *UploadRequest) SetType(val string) { + p.Type = val +} +func (p *UploadRequest) SetPassword(val string) { + p.Password = val +} + +var fieldIDToName_UploadRequest = map[int16]string{ + 1: "version", + 2: "code", + 3: "url", + 4: "feature", + 5: "type", + 6: "password", +} + +func (p *UploadRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetVersion bool = false + var issetCode bool = false + var issetUrl bool = false + var issetFeature bool = false + var issetType bool = false + var issetPassword bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + 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 + } + issetVersion = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + issetCode = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + issetUrl = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRING { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + issetFeature = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.STRING { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + issetType = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.STRING { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + issetPassword = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + 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 !issetVersion { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetCode { + fieldId = 2 + goto RequiredFieldNotSetError + } + + if !issetUrl { + fieldId = 3 + goto RequiredFieldNotSetError + } + + if !issetFeature { + fieldId = 4 + goto RequiredFieldNotSetError + } + + if !issetType { + fieldId = 5 + goto RequiredFieldNotSetError + } + + if !issetPassword { + fieldId = 6 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UploadRequest[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_UploadRequest[fieldId])) +} + +func (p *UploadRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Version = _field + return nil +} +func (p *UploadRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Code = _field + return nil +} +func (p *UploadRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Url = _field + return nil +} +func (p *UploadRequest) ReadField4(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Feature = _field + return nil +} +func (p *UploadRequest) ReadField5(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Type = _field + return nil +} +func (p *UploadRequest) ReadField6(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Password = _field + return nil +} + +func (p *UploadRequest) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("UploadRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +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 *UploadRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("version", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Version); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + 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 *UploadRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("code", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Code); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *UploadRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("url", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Url); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *UploadRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("feature", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Feature); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *UploadRequest) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("type", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Type); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *UploadRequest) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("password", thrift.STRING, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Password); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *UploadRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UploadRequest(%+v)", *p) + +} + +func (p *UploadRequest) DeepEqual(ano *UploadRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Version) { + return false + } + if !p.Field2DeepEqual(ano.Code) { + return false + } + if !p.Field3DeepEqual(ano.Url) { + return false + } + if !p.Field4DeepEqual(ano.Feature) { + return false + } + if !p.Field5DeepEqual(ano.Type) { + return false + } + if !p.Field6DeepEqual(ano.Password) { + return false + } + return true +} + +func (p *UploadRequest) Field1DeepEqual(src string) bool { + + if strings.Compare(p.Version, src) != 0 { + return false + } + return true +} +func (p *UploadRequest) Field2DeepEqual(src string) bool { + + if strings.Compare(p.Code, src) != 0 { + return false + } + return true +} +func (p *UploadRequest) Field3DeepEqual(src string) bool { + + if strings.Compare(p.Url, src) != 0 { + return false + } + return true +} +func (p *UploadRequest) Field4DeepEqual(src string) bool { + + if strings.Compare(p.Feature, src) != 0 { + return false + } + return true +} +func (p *UploadRequest) Field5DeepEqual(src string) bool { + + if strings.Compare(p.Type, src) != 0 { + return false + } + return true +} +func (p *UploadRequest) Field6DeepEqual(src string) bool { + + if strings.Compare(p.Password, src) != 0 { + return false + } + return true +} + +type UploadResponse struct { + Base *model.BaseResp `thrift:"base,1" frugal:"1,default,model.BaseResp" json:"base"` +} + +func NewUploadResponse() *UploadResponse { + return &UploadResponse{} +} + +func (p *UploadResponse) InitDefault() { +} + +var UploadResponse_Base_DEFAULT *model.BaseResp + +func (p *UploadResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return UploadResponse_Base_DEFAULT + } + return p.Base +} +func (p *UploadResponse) SetBase(val *model.BaseResp) { + p.Base = val +} + +var fieldIDToName_UploadResponse = map[int16]string{ + 1: "base", +} + +func (p *UploadResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *UploadResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + 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_UploadResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *UploadResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} + +func (p *UploadResponse) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("UploadResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *UploadResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *UploadResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UploadResponse(%+v)", *p) + +} + +func (p *UploadResponse) DeepEqual(ano *UploadResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Base) { + return false + } + return true +} + +func (p *UploadResponse) Field1DeepEqual(src *model.BaseResp) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} + +type UploadParamsRequest struct { + Password string `thrift:"password,1,required" frugal:"1,required,string" json:"password"` +} + +func NewUploadParamsRequest() *UploadParamsRequest { + return &UploadParamsRequest{} +} + +func (p *UploadParamsRequest) InitDefault() { +} + +func (p *UploadParamsRequest) GetPassword() (v string) { + return p.Password +} +func (p *UploadParamsRequest) SetPassword(val string) { + p.Password = val +} + +var fieldIDToName_UploadParamsRequest = map[int16]string{ + 1: "password", +} + +func (p *UploadParamsRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetPassword bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + 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 + } + 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_UploadParamsRequest[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_UploadParamsRequest[fieldId])) +} + +func (p *UploadParamsRequest) 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 *UploadParamsRequest) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("UploadParamsRequest"); 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 *UploadParamsRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("password", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Password); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + 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 *UploadParamsRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UploadParamsRequest(%+v)", *p) + +} + +func (p *UploadParamsRequest) DeepEqual(ano *UploadParamsRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Password) { + return false + } + return true +} + +func (p *UploadParamsRequest) Field1DeepEqual(src string) bool { + + if strings.Compare(p.Password, src) != 0 { + return false + } + return true +} + +type UploadParamsResponse struct { + Base *model.BaseResp `thrift:"base,1" frugal:"1,default,model.BaseResp" json:"base"` + Policy *string `thrift:"policy,2,optional" frugal:"2,optional,string" json:"policy,omitempty"` + Authorization *string `thrift:"authorization,3,optional" frugal:"3,optional,string" json:"authorization,omitempty"` +} + +func NewUploadParamsResponse() *UploadParamsResponse { + return &UploadParamsResponse{} +} + +func (p *UploadParamsResponse) InitDefault() { +} + +var UploadParamsResponse_Base_DEFAULT *model.BaseResp + +func (p *UploadParamsResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return UploadParamsResponse_Base_DEFAULT + } + return p.Base +} + +var UploadParamsResponse_Policy_DEFAULT string + +func (p *UploadParamsResponse) GetPolicy() (v string) { + if !p.IsSetPolicy() { + return UploadParamsResponse_Policy_DEFAULT + } + return *p.Policy +} + +var UploadParamsResponse_Authorization_DEFAULT string + +func (p *UploadParamsResponse) GetAuthorization() (v string) { + if !p.IsSetAuthorization() { + return UploadParamsResponse_Authorization_DEFAULT + } + return *p.Authorization +} +func (p *UploadParamsResponse) SetBase(val *model.BaseResp) { + p.Base = val +} +func (p *UploadParamsResponse) SetPolicy(val *string) { + p.Policy = val +} +func (p *UploadParamsResponse) SetAuthorization(val *string) { + p.Authorization = val +} + +var fieldIDToName_UploadParamsResponse = map[int16]string{ + 1: "base", + 2: "policy", + 3: "authorization", +} + +func (p *UploadParamsResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *UploadParamsResponse) IsSetPolicy() bool { + return p.Policy != nil +} + +func (p *UploadParamsResponse) IsSetAuthorization() bool { + return p.Authorization != nil +} + +func (p *UploadParamsResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + 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_UploadParamsResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *UploadParamsResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *UploadParamsResponse) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Policy = _field + return nil +} +func (p *UploadParamsResponse) ReadField3(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Authorization = _field + return nil +} + +func (p *UploadParamsResponse) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("UploadParamsResponse"); 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 *UploadParamsResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *UploadParamsResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPolicy() { + if err = oprot.WriteFieldBegin("policy", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Policy); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + 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 *UploadParamsResponse) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetAuthorization() { + if err = oprot.WriteFieldBegin("authorization", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Authorization); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *UploadParamsResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UploadParamsResponse(%+v)", *p) + +} + +func (p *UploadParamsResponse) DeepEqual(ano *UploadParamsResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Base) { + return false + } + if !p.Field2DeepEqual(ano.Policy) { + return false + } + if !p.Field3DeepEqual(ano.Authorization) { + return false + } + return true +} + +func (p *UploadParamsResponse) Field1DeepEqual(src *model.BaseResp) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} +func (p *UploadParamsResponse) Field2DeepEqual(src *string) bool { + + if p.Policy == src { + return true + } else if p.Policy == nil || src == nil { + return false + } + if strings.Compare(*p.Policy, *src) != 0 { + return false + } + return true +} +func (p *UploadParamsResponse) Field3DeepEqual(src *string) bool { + + if p.Authorization == src { + return true + } else if p.Authorization == nil || src == nil { + return false + } + if strings.Compare(*p.Authorization, *src) != 0 { + return false + } + return true +} + +type DownloadReleaseApkRequest struct { +} + +func NewDownloadReleaseApkRequest() *DownloadReleaseApkRequest { + return &DownloadReleaseApkRequest{} +} + +func (p *DownloadReleaseApkRequest) InitDefault() { +} + +var fieldIDToName_DownloadReleaseApkRequest = map[int16]string{} + +func (p *DownloadReleaseApkRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldTypeError + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +SkipFieldTypeError: + return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *DownloadReleaseApkRequest) Write(oprot thrift.TProtocol) (err error) { + + if err = oprot.WriteStructBegin("DownloadReleaseApkRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *DownloadReleaseApkRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DownloadReleaseApkRequest(%+v)", *p) + +} + +func (p *DownloadReleaseApkRequest) DeepEqual(ano *DownloadReleaseApkRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + return true +} + +type DownloadReleaseApkResponse struct { + Base *model.BaseResp `thrift:"base,1" frugal:"1,default,model.BaseResp" json:"base"` + RedirectUrl string `thrift:"redirect_url,2" frugal:"2,default,string" json:"redirect_url"` +} + +func NewDownloadReleaseApkResponse() *DownloadReleaseApkResponse { + return &DownloadReleaseApkResponse{} +} + +func (p *DownloadReleaseApkResponse) InitDefault() { +} + +var DownloadReleaseApkResponse_Base_DEFAULT *model.BaseResp + +func (p *DownloadReleaseApkResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return DownloadReleaseApkResponse_Base_DEFAULT + } + return p.Base +} + +func (p *DownloadReleaseApkResponse) GetRedirectUrl() (v string) { + return p.RedirectUrl +} +func (p *DownloadReleaseApkResponse) SetBase(val *model.BaseResp) { + p.Base = val +} +func (p *DownloadReleaseApkResponse) SetRedirectUrl(val string) { + p.RedirectUrl = val +} + +var fieldIDToName_DownloadReleaseApkResponse = map[int16]string{ + 1: "base", + 2: "redirect_url", +} + +func (p *DownloadReleaseApkResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *DownloadReleaseApkResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + 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_DownloadReleaseApkResponse[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 *DownloadReleaseApkResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *DownloadReleaseApkResponse) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.RedirectUrl = _field + return nil +} + +func (p *DownloadReleaseApkResponse) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("DownloadReleaseApkResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *DownloadReleaseApkResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *DownloadReleaseApkResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("redirect_url", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.RedirectUrl); 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 *DownloadReleaseApkResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DownloadReleaseApkResponse(%+v)", *p) + +} + +func (p *DownloadReleaseApkResponse) DeepEqual(ano *DownloadReleaseApkResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Base) { + return false + } + if !p.Field2DeepEqual(ano.RedirectUrl) { + return false + } + return true +} + +func (p *DownloadReleaseApkResponse) Field1DeepEqual(src *model.BaseResp) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} +func (p *DownloadReleaseApkResponse) Field2DeepEqual(src string) bool { + + if strings.Compare(p.RedirectUrl, src) != 0 { + return false + } + return true +} + +type DownloadBetaApkRequest struct { +} + +func NewDownloadBetaApkRequest() *DownloadBetaApkRequest { + return &DownloadBetaApkRequest{} +} + +func (p *DownloadBetaApkRequest) InitDefault() { +} + +var fieldIDToName_DownloadBetaApkRequest = map[int16]string{} + +func (p *DownloadBetaApkRequest) 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 *DownloadBetaApkRequest) Write(oprot thrift.TProtocol) (err error) { + + if err = oprot.WriteStructBegin("DownloadBetaApkRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + 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 *DownloadBetaApkRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DownloadBetaApkRequest(%+v)", *p) + +} + +func (p *DownloadBetaApkRequest) DeepEqual(ano *DownloadBetaApkRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + return true +} + +type DownloadBetaApkResponse struct { + Base *model.BaseResp `thrift:"base,1" frugal:"1,default,model.BaseResp" json:"base"` + RedirectUrl string `thrift:"redirect_url,2" frugal:"2,default,string" json:"redirect_url"` +} + +func NewDownloadBetaApkResponse() *DownloadBetaApkResponse { + return &DownloadBetaApkResponse{} +} + +func (p *DownloadBetaApkResponse) InitDefault() { +} + +var DownloadBetaApkResponse_Base_DEFAULT *model.BaseResp + +func (p *DownloadBetaApkResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return DownloadBetaApkResponse_Base_DEFAULT + } + return p.Base +} + +func (p *DownloadBetaApkResponse) GetRedirectUrl() (v string) { + return p.RedirectUrl +} +func (p *DownloadBetaApkResponse) SetBase(val *model.BaseResp) { + p.Base = val +} +func (p *DownloadBetaApkResponse) SetRedirectUrl(val string) { + p.RedirectUrl = val +} + +var fieldIDToName_DownloadBetaApkResponse = map[int16]string{ + 1: "base", + 2: "redirect_url", +} + +func (p *DownloadBetaApkResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *DownloadBetaApkResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + 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_DownloadBetaApkResponse[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 *DownloadBetaApkResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *DownloadBetaApkResponse) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.RedirectUrl = _field + return nil +} + +func (p *DownloadBetaApkResponse) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("DownloadBetaApkResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *DownloadBetaApkResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *DownloadBetaApkResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("redirect_url", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.RedirectUrl); 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 *DownloadBetaApkResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DownloadBetaApkResponse(%+v)", *p) + +} + +func (p *DownloadBetaApkResponse) DeepEqual(ano *DownloadBetaApkResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Base) { + return false + } + if !p.Field2DeepEqual(ano.RedirectUrl) { + return false + } + return true +} + +func (p *DownloadBetaApkResponse) Field1DeepEqual(src *model.BaseResp) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} +func (p *DownloadBetaApkResponse) Field2DeepEqual(src string) bool { + + if strings.Compare(p.RedirectUrl, src) != 0 { + return false + } + return true +} + +type GetReleaseVersionRequest struct { +} + +func NewGetReleaseVersionRequest() *GetReleaseVersionRequest { + return &GetReleaseVersionRequest{} +} + +func (p *GetReleaseVersionRequest) InitDefault() { +} + +var fieldIDToName_GetReleaseVersionRequest = map[int16]string{} + +func (p *GetReleaseVersionRequest) 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 *GetReleaseVersionRequest) Write(oprot thrift.TProtocol) (err error) { + + if err = oprot.WriteStructBegin("GetReleaseVersionRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + 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 *GetReleaseVersionRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetReleaseVersionRequest(%+v)", *p) + +} + +func (p *GetReleaseVersionRequest) DeepEqual(ano *GetReleaseVersionRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + return true +} + +type GetReleaseVersionResponse struct { + Base *model.BaseResp `thrift:"base,1" frugal:"1,default,model.BaseResp" json:"base"` + Code *string `thrift:"code,2,optional" frugal:"2,optional,string" json:"code,omitempty"` + Feature *string `thrift:"feature,3,optional" frugal:"3,optional,string" json:"feature,omitempty"` + Url *string `thrift:"url,4,optional" frugal:"4,optional,string" json:"url,omitempty"` + Version *string `thrift:"version,5,optional" frugal:"5,optional,string" json:"version,omitempty"` +} + +func NewGetReleaseVersionResponse() *GetReleaseVersionResponse { + return &GetReleaseVersionResponse{} +} + +func (p *GetReleaseVersionResponse) InitDefault() { +} + +var GetReleaseVersionResponse_Base_DEFAULT *model.BaseResp + +func (p *GetReleaseVersionResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return GetReleaseVersionResponse_Base_DEFAULT + } + return p.Base +} + +var GetReleaseVersionResponse_Code_DEFAULT string + +func (p *GetReleaseVersionResponse) GetCode() (v string) { + if !p.IsSetCode() { + return GetReleaseVersionResponse_Code_DEFAULT + } + return *p.Code +} + +var GetReleaseVersionResponse_Feature_DEFAULT string + +func (p *GetReleaseVersionResponse) GetFeature() (v string) { + if !p.IsSetFeature() { + return GetReleaseVersionResponse_Feature_DEFAULT + } + return *p.Feature +} + +var GetReleaseVersionResponse_Url_DEFAULT string + +func (p *GetReleaseVersionResponse) GetUrl() (v string) { + if !p.IsSetUrl() { + return GetReleaseVersionResponse_Url_DEFAULT + } + return *p.Url +} + +var GetReleaseVersionResponse_Version_DEFAULT string + +func (p *GetReleaseVersionResponse) GetVersion() (v string) { + if !p.IsSetVersion() { + return GetReleaseVersionResponse_Version_DEFAULT + } + return *p.Version +} +func (p *GetReleaseVersionResponse) SetBase(val *model.BaseResp) { + p.Base = val +} +func (p *GetReleaseVersionResponse) SetCode(val *string) { + p.Code = val +} +func (p *GetReleaseVersionResponse) SetFeature(val *string) { + p.Feature = val +} +func (p *GetReleaseVersionResponse) SetUrl(val *string) { + p.Url = val +} +func (p *GetReleaseVersionResponse) SetVersion(val *string) { + p.Version = val +} + +var fieldIDToName_GetReleaseVersionResponse = map[int16]string{ + 1: "base", + 2: "code", + 3: "feature", + 4: "url", + 5: "version", +} + +func (p *GetReleaseVersionResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *GetReleaseVersionResponse) IsSetCode() bool { + return p.Code != nil +} + +func (p *GetReleaseVersionResponse) IsSetFeature() bool { + return p.Feature != nil +} + +func (p *GetReleaseVersionResponse) IsSetUrl() bool { + return p.Url != nil +} + +func (p *GetReleaseVersionResponse) IsSetVersion() bool { + return p.Version != nil +} + +func (p *GetReleaseVersionResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRING { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.STRING { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetReleaseVersionResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *GetReleaseVersionResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *GetReleaseVersionResponse) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Code = _field + return nil +} +func (p *GetReleaseVersionResponse) ReadField3(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Feature = _field + return nil +} +func (p *GetReleaseVersionResponse) ReadField4(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Url = _field + return nil +} +func (p *GetReleaseVersionResponse) ReadField5(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Version = _field + return nil +} + +func (p *GetReleaseVersionResponse) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetReleaseVersionResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + } + if err = 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 *GetReleaseVersionResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *GetReleaseVersionResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetCode() { + if err = oprot.WriteFieldBegin("code", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Code); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *GetReleaseVersionResponse) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetFeature() { + if err = oprot.WriteFieldBegin("feature", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Feature); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *GetReleaseVersionResponse) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetUrl() { + if err = oprot.WriteFieldBegin("url", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Url); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *GetReleaseVersionResponse) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetVersion() { + if err = oprot.WriteFieldBegin("version", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Version); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *GetReleaseVersionResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetReleaseVersionResponse(%+v)", *p) + +} + +func (p *GetReleaseVersionResponse) DeepEqual(ano *GetReleaseVersionResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Base) { + return false + } + if !p.Field2DeepEqual(ano.Code) { + return false + } + if !p.Field3DeepEqual(ano.Feature) { + return false + } + if !p.Field4DeepEqual(ano.Url) { + return false + } + if !p.Field5DeepEqual(ano.Version) { + return false + } + return true +} + +func (p *GetReleaseVersionResponse) Field1DeepEqual(src *model.BaseResp) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} +func (p *GetReleaseVersionResponse) Field2DeepEqual(src *string) bool { + + if p.Code == src { + return true + } else if p.Code == nil || src == nil { + return false + } + if strings.Compare(*p.Code, *src) != 0 { + return false + } + return true +} +func (p *GetReleaseVersionResponse) Field3DeepEqual(src *string) bool { + + if p.Feature == src { + return true + } else if p.Feature == nil || src == nil { + return false + } + if strings.Compare(*p.Feature, *src) != 0 { + return false + } + return true +} +func (p *GetReleaseVersionResponse) Field4DeepEqual(src *string) bool { + + if p.Url == src { + return true + } else if p.Url == nil || src == nil { + return false + } + if strings.Compare(*p.Url, *src) != 0 { + return false + } + return true +} +func (p *GetReleaseVersionResponse) Field5DeepEqual(src *string) bool { + + if p.Version == src { + return true + } else if p.Version == nil || src == nil { + return false + } + if strings.Compare(*p.Version, *src) != 0 { + return false + } + return true +} + +type GetBetaVersionRequest struct { +} + +func NewGetBetaVersionRequest() *GetBetaVersionRequest { + return &GetBetaVersionRequest{} +} + +func (p *GetBetaVersionRequest) InitDefault() { +} + +var fieldIDToName_GetBetaVersionRequest = map[int16]string{} + +func (p *GetBetaVersionRequest) 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 *GetBetaVersionRequest) Write(oprot thrift.TProtocol) (err error) { + + if err = oprot.WriteStructBegin("GetBetaVersionRequest"); 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 *GetBetaVersionRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetBetaVersionRequest(%+v)", *p) + +} + +func (p *GetBetaVersionRequest) DeepEqual(ano *GetBetaVersionRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + return true +} + +type GetBetaVersionResponse struct { + Base *model.BaseResp `thrift:"base,1" frugal:"1,default,model.BaseResp" json:"base"` + Code *string `thrift:"code,2,optional" frugal:"2,optional,string" json:"code,omitempty"` + Feature *string `thrift:"feature,3,optional" frugal:"3,optional,string" json:"feature,omitempty"` + Url *string `thrift:"url,4,optional" frugal:"4,optional,string" json:"url,omitempty"` + Version *string `thrift:"version,5,optional" frugal:"5,optional,string" json:"version,omitempty"` +} + +func NewGetBetaVersionResponse() *GetBetaVersionResponse { + return &GetBetaVersionResponse{} +} + +func (p *GetBetaVersionResponse) InitDefault() { +} + +var GetBetaVersionResponse_Base_DEFAULT *model.BaseResp + +func (p *GetBetaVersionResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return GetBetaVersionResponse_Base_DEFAULT + } + return p.Base +} + +var GetBetaVersionResponse_Code_DEFAULT string + +func (p *GetBetaVersionResponse) GetCode() (v string) { + if !p.IsSetCode() { + return GetBetaVersionResponse_Code_DEFAULT + } + return *p.Code +} + +var GetBetaVersionResponse_Feature_DEFAULT string + +func (p *GetBetaVersionResponse) GetFeature() (v string) { + if !p.IsSetFeature() { + return GetBetaVersionResponse_Feature_DEFAULT + } + return *p.Feature +} + +var GetBetaVersionResponse_Url_DEFAULT string + +func (p *GetBetaVersionResponse) GetUrl() (v string) { + if !p.IsSetUrl() { + return GetBetaVersionResponse_Url_DEFAULT + } + return *p.Url +} + +var GetBetaVersionResponse_Version_DEFAULT string + +func (p *GetBetaVersionResponse) GetVersion() (v string) { + if !p.IsSetVersion() { + return GetBetaVersionResponse_Version_DEFAULT + } + return *p.Version +} +func (p *GetBetaVersionResponse) SetBase(val *model.BaseResp) { + p.Base = val +} +func (p *GetBetaVersionResponse) SetCode(val *string) { + p.Code = val +} +func (p *GetBetaVersionResponse) SetFeature(val *string) { + p.Feature = val +} +func (p *GetBetaVersionResponse) SetUrl(val *string) { + p.Url = val +} +func (p *GetBetaVersionResponse) SetVersion(val *string) { + p.Version = val +} + +var fieldIDToName_GetBetaVersionResponse = map[int16]string{ + 1: "base", + 2: "code", + 3: "feature", + 4: "url", + 5: "version", +} + +func (p *GetBetaVersionResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *GetBetaVersionResponse) IsSetCode() bool { + return p.Code != nil +} + +func (p *GetBetaVersionResponse) IsSetFeature() bool { + return p.Feature != nil +} + +func (p *GetBetaVersionResponse) IsSetUrl() bool { + return p.Url != nil +} + +func (p *GetBetaVersionResponse) IsSetVersion() bool { + return p.Version != nil +} + +func (p *GetBetaVersionResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRING { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.STRING { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetBetaVersionResponse[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 *GetBetaVersionResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *GetBetaVersionResponse) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Code = _field + return nil +} +func (p *GetBetaVersionResponse) ReadField3(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Feature = _field + return nil +} +func (p *GetBetaVersionResponse) ReadField4(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Url = _field + return nil +} +func (p *GetBetaVersionResponse) ReadField5(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Version = _field + return nil +} + +func (p *GetBetaVersionResponse) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetBetaVersionResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *GetBetaVersionResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *GetBetaVersionResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetCode() { + if err = oprot.WriteFieldBegin("code", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Code); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *GetBetaVersionResponse) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetFeature() { + if err = oprot.WriteFieldBegin("feature", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Feature); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *GetBetaVersionResponse) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetUrl() { + if err = oprot.WriteFieldBegin("url", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Url); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *GetBetaVersionResponse) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetVersion() { + if err = oprot.WriteFieldBegin("version", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Version); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *GetBetaVersionResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetBetaVersionResponse(%+v)", *p) + +} + +func (p *GetBetaVersionResponse) DeepEqual(ano *GetBetaVersionResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Base) { + return false + } + if !p.Field2DeepEqual(ano.Code) { + return false + } + if !p.Field3DeepEqual(ano.Feature) { + return false + } + if !p.Field4DeepEqual(ano.Url) { + return false + } + if !p.Field5DeepEqual(ano.Version) { + return false + } + return true +} + +func (p *GetBetaVersionResponse) Field1DeepEqual(src *model.BaseResp) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} +func (p *GetBetaVersionResponse) Field2DeepEqual(src *string) bool { + + if p.Code == src { + return true + } else if p.Code == nil || src == nil { + return false + } + if strings.Compare(*p.Code, *src) != 0 { + return false + } + return true +} +func (p *GetBetaVersionResponse) Field3DeepEqual(src *string) bool { + + if p.Feature == src { + return true + } else if p.Feature == nil || src == nil { + return false + } + if strings.Compare(*p.Feature, *src) != 0 { + return false + } + return true +} +func (p *GetBetaVersionResponse) Field4DeepEqual(src *string) bool { + + if p.Url == src { + return true + } else if p.Url == nil || src == nil { + return false + } + if strings.Compare(*p.Url, *src) != 0 { + return false + } + return true +} +func (p *GetBetaVersionResponse) Field5DeepEqual(src *string) bool { + + if p.Version == src { + return true + } else if p.Version == nil || src == nil { + return false + } + if strings.Compare(*p.Version, *src) != 0 { + return false + } + return true +} + +type GetSettingRequest struct { + Account *string `thrift:"account,1,optional" frugal:"1,optional,string" json:"account,omitempty"` + Version *string `thrift:"version,2,optional" frugal:"2,optional,string" json:"version,omitempty"` + Beta *bool `thrift:"beta,3,optional" frugal:"3,optional,bool" json:"beta,omitempty"` + Phone *string `thrift:"phone,4,optional" frugal:"4,optional,string" json:"phone,omitempty"` + IsLogin *bool `thrift:"isLogin,5,optional" frugal:"5,optional,bool" json:"isLogin,omitempty"` + LoginType *string `thrift:"loginType,6,optional" frugal:"6,optional,string" json:"loginType,omitempty"` +} + +func NewGetSettingRequest() *GetSettingRequest { + return &GetSettingRequest{} +} + +func (p *GetSettingRequest) InitDefault() { +} + +var GetSettingRequest_Account_DEFAULT string + +func (p *GetSettingRequest) GetAccount() (v string) { + if !p.IsSetAccount() { + return GetSettingRequest_Account_DEFAULT + } + return *p.Account +} + +var GetSettingRequest_Version_DEFAULT string + +func (p *GetSettingRequest) GetVersion() (v string) { + if !p.IsSetVersion() { + return GetSettingRequest_Version_DEFAULT + } + return *p.Version +} + +var GetSettingRequest_Beta_DEFAULT bool + +func (p *GetSettingRequest) GetBeta() (v bool) { + if !p.IsSetBeta() { + return GetSettingRequest_Beta_DEFAULT + } + return *p.Beta +} + +var GetSettingRequest_Phone_DEFAULT string + +func (p *GetSettingRequest) GetPhone() (v string) { + if !p.IsSetPhone() { + return GetSettingRequest_Phone_DEFAULT + } + return *p.Phone +} + +var GetSettingRequest_IsLogin_DEFAULT bool + +func (p *GetSettingRequest) GetIsLogin() (v bool) { + if !p.IsSetIsLogin() { + return GetSettingRequest_IsLogin_DEFAULT + } + return *p.IsLogin +} + +var GetSettingRequest_LoginType_DEFAULT string + +func (p *GetSettingRequest) GetLoginType() (v string) { + if !p.IsSetLoginType() { + return GetSettingRequest_LoginType_DEFAULT + } + return *p.LoginType +} +func (p *GetSettingRequest) SetAccount(val *string) { + p.Account = val +} +func (p *GetSettingRequest) SetVersion(val *string) { + p.Version = val +} +func (p *GetSettingRequest) SetBeta(val *bool) { + p.Beta = val +} +func (p *GetSettingRequest) SetPhone(val *string) { + p.Phone = val +} +func (p *GetSettingRequest) SetIsLogin(val *bool) { + p.IsLogin = val +} +func (p *GetSettingRequest) SetLoginType(val *string) { + p.LoginType = val +} + +var fieldIDToName_GetSettingRequest = map[int16]string{ + 1: "account", + 2: "version", + 3: "beta", + 4: "phone", + 5: "isLogin", + 6: "loginType", +} + +func (p *GetSettingRequest) IsSetAccount() bool { + return p.Account != nil +} + +func (p *GetSettingRequest) IsSetVersion() bool { + return p.Version != nil +} + +func (p *GetSettingRequest) IsSetBeta() bool { + return p.Beta != nil +} + +func (p *GetSettingRequest) IsSetPhone() bool { + return p.Phone != nil +} + +func (p *GetSettingRequest) IsSetIsLogin() bool { + return p.IsLogin != nil +} + +func (p *GetSettingRequest) IsSetLoginType() bool { + return p.LoginType != nil +} + +func (p *GetSettingRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRING { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.STRING { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + 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_GetSettingRequest[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 *GetSettingRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Account = _field + return nil +} +func (p *GetSettingRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Version = _field + return nil +} +func (p *GetSettingRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field *bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = &v + } + p.Beta = _field + return nil +} +func (p *GetSettingRequest) ReadField4(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Phone = _field + return nil +} +func (p *GetSettingRequest) ReadField5(iprot thrift.TProtocol) error { + + var _field *bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = &v + } + p.IsLogin = _field + return nil +} +func (p *GetSettingRequest) ReadField6(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.LoginType = _field + return nil +} + +func (p *GetSettingRequest) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetSettingRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *GetSettingRequest) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetAccount() { + if err = oprot.WriteFieldBegin("account", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Account); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + 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 *GetSettingRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetVersion() { + if err = oprot.WriteFieldBegin("version", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Version); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *GetSettingRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetBeta() { + if err = oprot.WriteFieldBegin("beta", thrift.BOOL, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(*p.Beta); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *GetSettingRequest) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetPhone() { + if err = oprot.WriteFieldBegin("phone", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Phone); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *GetSettingRequest) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetIsLogin() { + if err = oprot.WriteFieldBegin("isLogin", thrift.BOOL, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(*p.IsLogin); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *GetSettingRequest) writeField6(oprot thrift.TProtocol) (err error) { + if p.IsSetLoginType() { + if err = oprot.WriteFieldBegin("loginType", thrift.STRING, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.LoginType); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *GetSettingRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetSettingRequest(%+v)", *p) + +} + +func (p *GetSettingRequest) DeepEqual(ano *GetSettingRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Account) { + return false + } + if !p.Field2DeepEqual(ano.Version) { + return false + } + if !p.Field3DeepEqual(ano.Beta) { + return false + } + if !p.Field4DeepEqual(ano.Phone) { + return false + } + if !p.Field5DeepEqual(ano.IsLogin) { + return false + } + if !p.Field6DeepEqual(ano.LoginType) { + return false + } + return true +} + +func (p *GetSettingRequest) Field1DeepEqual(src *string) bool { + + if p.Account == src { + return true + } else if p.Account == nil || src == nil { + return false + } + if strings.Compare(*p.Account, *src) != 0 { + return false + } + return true +} +func (p *GetSettingRequest) Field2DeepEqual(src *string) bool { + + if p.Version == src { + return true + } else if p.Version == nil || src == nil { + return false + } + if strings.Compare(*p.Version, *src) != 0 { + return false + } + return true +} +func (p *GetSettingRequest) Field3DeepEqual(src *bool) bool { + + if p.Beta == src { + return true + } else if p.Beta == nil || src == nil { + return false + } + if *p.Beta != *src { + return false + } + return true +} +func (p *GetSettingRequest) Field4DeepEqual(src *string) bool { + + if p.Phone == src { + return true + } else if p.Phone == nil || src == nil { + return false + } + if strings.Compare(*p.Phone, *src) != 0 { + return false + } + return true +} +func (p *GetSettingRequest) Field5DeepEqual(src *bool) bool { + + if p.IsLogin == src { + return true + } else if p.IsLogin == nil || src == nil { + return false + } + if *p.IsLogin != *src { + return false + } + return true +} +func (p *GetSettingRequest) Field6DeepEqual(src *string) bool { + + if p.LoginType == src { + return true + } else if p.LoginType == nil || src == nil { + return false + } + if strings.Compare(*p.LoginType, *src) != 0 { + return false + } + return true +} + +type GetSettingResponse struct { + Base *model.BaseResp `thrift:"base,1,optional" frugal:"1,optional,model.BaseResp" json:"base,omitempty"` + CloudSetting []byte `thrift:"cloud_setting,2" frugal:"2,default,binary" json:"cloud_setting"` +} + +func NewGetSettingResponse() *GetSettingResponse { + return &GetSettingResponse{} +} + +func (p *GetSettingResponse) InitDefault() { +} + +var GetSettingResponse_Base_DEFAULT *model.BaseResp + +func (p *GetSettingResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return GetSettingResponse_Base_DEFAULT + } + return p.Base +} + +func (p *GetSettingResponse) GetCloudSetting() (v []byte) { + return p.CloudSetting +} +func (p *GetSettingResponse) SetBase(val *model.BaseResp) { + p.Base = val +} +func (p *GetSettingResponse) SetCloudSetting(val []byte) { + p.CloudSetting = val +} + +var fieldIDToName_GetSettingResponse = map[int16]string{ + 1: "base", + 2: "cloud_setting", +} + +func (p *GetSettingResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *GetSettingResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + 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_GetSettingResponse[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 *GetSettingResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *GetSettingResponse) ReadField2(iprot thrift.TProtocol) error { + + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { + return err + } else { + _field = []byte(v) + } + p.CloudSetting = _field + return nil +} + +func (p *GetSettingResponse) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetSettingResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *GetSettingResponse) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetBase() { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *GetSettingResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("cloud_setting", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBinary([]byte(p.CloudSetting)); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *GetSettingResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetSettingResponse(%+v)", *p) + +} + +func (p *GetSettingResponse) DeepEqual(ano *GetSettingResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Base) { + return false + } + if !p.Field2DeepEqual(ano.CloudSetting) { + return false + } + return true +} + +func (p *GetSettingResponse) Field1DeepEqual(src *model.BaseResp) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} +func (p *GetSettingResponse) Field2DeepEqual(src []byte) bool { + + if bytes.Compare(p.CloudSetting, src) != 0 { + return false + } + return true +} + +type GetTestRequest struct { + Account *string `thrift:"account,1,optional" frugal:"1,optional,string" json:"account,omitempty"` + Version *string `thrift:"version,2,optional" frugal:"2,optional,string" json:"version,omitempty"` + Beta *bool `thrift:"beta,3,optional" frugal:"3,optional,bool" json:"beta,omitempty"` + Phone *string `thrift:"phone,4,optional" frugal:"4,optional,string" json:"phone,omitempty"` + IsLogin *bool `thrift:"isLogin,5,optional" frugal:"5,optional,bool" json:"isLogin,omitempty"` + LoginType *string `thrift:"loginType,6,optional" frugal:"6,optional,string" json:"loginType,omitempty"` + Setting *string `thrift:"setting,7,optional" frugal:"7,optional,string" json:"setting,omitempty"` +} + +func NewGetTestRequest() *GetTestRequest { + return &GetTestRequest{} +} + +func (p *GetTestRequest) InitDefault() { +} + +var GetTestRequest_Account_DEFAULT string + +func (p *GetTestRequest) GetAccount() (v string) { + if !p.IsSetAccount() { + return GetTestRequest_Account_DEFAULT + } + return *p.Account +} + +var GetTestRequest_Version_DEFAULT string + +func (p *GetTestRequest) GetVersion() (v string) { + if !p.IsSetVersion() { + return GetTestRequest_Version_DEFAULT + } + return *p.Version +} + +var GetTestRequest_Beta_DEFAULT bool + +func (p *GetTestRequest) GetBeta() (v bool) { + if !p.IsSetBeta() { + return GetTestRequest_Beta_DEFAULT + } + return *p.Beta +} + +var GetTestRequest_Phone_DEFAULT string + +func (p *GetTestRequest) GetPhone() (v string) { + if !p.IsSetPhone() { + return GetTestRequest_Phone_DEFAULT + } + return *p.Phone +} + +var GetTestRequest_IsLogin_DEFAULT bool + +func (p *GetTestRequest) GetIsLogin() (v bool) { + if !p.IsSetIsLogin() { + return GetTestRequest_IsLogin_DEFAULT + } + return *p.IsLogin +} + +var GetTestRequest_LoginType_DEFAULT string + +func (p *GetTestRequest) GetLoginType() (v string) { + if !p.IsSetLoginType() { + return GetTestRequest_LoginType_DEFAULT + } + return *p.LoginType +} + +var GetTestRequest_Setting_DEFAULT string + +func (p *GetTestRequest) GetSetting() (v string) { + if !p.IsSetSetting() { + return GetTestRequest_Setting_DEFAULT + } + return *p.Setting +} +func (p *GetTestRequest) SetAccount(val *string) { + p.Account = val +} +func (p *GetTestRequest) SetVersion(val *string) { + p.Version = val +} +func (p *GetTestRequest) SetBeta(val *bool) { + p.Beta = val +} +func (p *GetTestRequest) SetPhone(val *string) { + p.Phone = val +} +func (p *GetTestRequest) SetIsLogin(val *bool) { + p.IsLogin = val +} +func (p *GetTestRequest) SetLoginType(val *string) { + p.LoginType = val +} +func (p *GetTestRequest) SetSetting(val *string) { + p.Setting = val +} + +var fieldIDToName_GetTestRequest = map[int16]string{ + 1: "account", + 2: "version", + 3: "beta", + 4: "phone", + 5: "isLogin", + 6: "loginType", + 7: "setting", +} + +func (p *GetTestRequest) IsSetAccount() bool { + return p.Account != nil +} + +func (p *GetTestRequest) IsSetVersion() bool { + return p.Version != nil +} + +func (p *GetTestRequest) IsSetBeta() bool { + return p.Beta != nil +} + +func (p *GetTestRequest) IsSetPhone() bool { + return p.Phone != nil +} + +func (p *GetTestRequest) IsSetIsLogin() bool { + return p.IsLogin != nil +} + +func (p *GetTestRequest) IsSetLoginType() bool { + return p.LoginType != nil +} + +func (p *GetTestRequest) IsSetSetting() bool { + return p.Setting != nil +} + +func (p *GetTestRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRING { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.STRING { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.STRING { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + 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_GetTestRequest[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 *GetTestRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Account = _field + return nil +} +func (p *GetTestRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Version = _field + return nil +} +func (p *GetTestRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field *bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = &v + } + p.Beta = _field + return nil +} +func (p *GetTestRequest) ReadField4(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Phone = _field + return nil +} +func (p *GetTestRequest) ReadField5(iprot thrift.TProtocol) error { + + var _field *bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = &v + } + p.IsLogin = _field + return nil +} +func (p *GetTestRequest) ReadField6(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.LoginType = _field + return nil +} +func (p *GetTestRequest) ReadField7(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Setting = _field + return nil +} + +func (p *GetTestRequest) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetTestRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *GetTestRequest) 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 *GetTestRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetVersion() { + if err = oprot.WriteFieldBegin("version", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Version); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + 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 *GetTestRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetBeta() { + if err = oprot.WriteFieldBegin("beta", thrift.BOOL, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(*p.Beta); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return 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 *GetTestRequest) 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 *GetTestRequest) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetIsLogin() { + if err = oprot.WriteFieldBegin("isLogin", thrift.BOOL, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(*p.IsLogin); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *GetTestRequest) writeField6(oprot thrift.TProtocol) (err error) { + if p.IsSetLoginType() { + if err = oprot.WriteFieldBegin("loginType", thrift.STRING, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.LoginType); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *GetTestRequest) writeField7(oprot thrift.TProtocol) (err error) { + if p.IsSetSetting() { + if err = oprot.WriteFieldBegin("setting", thrift.STRING, 7); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Setting); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} + +func (p *GetTestRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetTestRequest(%+v)", *p) + +} + +func (p *GetTestRequest) DeepEqual(ano *GetTestRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Account) { + return false + } + if !p.Field2DeepEqual(ano.Version) { + return false + } + if !p.Field3DeepEqual(ano.Beta) { + return false + } + if !p.Field4DeepEqual(ano.Phone) { + return false + } + if !p.Field5DeepEqual(ano.IsLogin) { + return false + } + if !p.Field6DeepEqual(ano.LoginType) { + return false + } + if !p.Field7DeepEqual(ano.Setting) { + return false + } + return true +} + +func (p *GetTestRequest) Field1DeepEqual(src *string) bool { + + if p.Account == src { + return true + } else if p.Account == nil || src == nil { + return false + } + if strings.Compare(*p.Account, *src) != 0 { + return false + } + return true +} +func (p *GetTestRequest) Field2DeepEqual(src *string) bool { + + if p.Version == src { + return true + } else if p.Version == nil || src == nil { + return false + } + if strings.Compare(*p.Version, *src) != 0 { + return false + } + return true +} +func (p *GetTestRequest) Field3DeepEqual(src *bool) bool { + + if p.Beta == src { + return true + } else if p.Beta == nil || src == nil { + return false + } + if *p.Beta != *src { + return false + } + return true +} +func (p *GetTestRequest) Field4DeepEqual(src *string) bool { + + if p.Phone == src { + return true + } else if p.Phone == nil || src == nil { + return false + } + if strings.Compare(*p.Phone, *src) != 0 { + return false + } + return true +} +func (p *GetTestRequest) Field5DeepEqual(src *bool) bool { + + if p.IsLogin == src { + return true + } else if p.IsLogin == nil || src == nil { + return false + } + if *p.IsLogin != *src { + return false + } + return true +} +func (p *GetTestRequest) Field6DeepEqual(src *string) bool { + + if p.LoginType == src { + return true + } else if p.LoginType == nil || src == nil { + return false + } + if strings.Compare(*p.LoginType, *src) != 0 { + return false + } + return true +} +func (p *GetTestRequest) Field7DeepEqual(src *string) bool { + + if p.Setting == src { + return true + } else if p.Setting == nil || src == nil { + return false + } + if strings.Compare(*p.Setting, *src) != 0 { + return false + } + return true +} + +type GetTestResponse struct { + Base *model.BaseResp `thrift:"base,1" frugal:"1,default,model.BaseResp" json:"base"` + CloudSetting []byte `thrift:"cloud_setting,2" frugal:"2,default,binary" json:"cloud_setting"` +} + +func NewGetTestResponse() *GetTestResponse { + return &GetTestResponse{} +} + +func (p *GetTestResponse) InitDefault() { +} + +var GetTestResponse_Base_DEFAULT *model.BaseResp + +func (p *GetTestResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return GetTestResponse_Base_DEFAULT + } + return p.Base +} + +func (p *GetTestResponse) GetCloudSetting() (v []byte) { + return p.CloudSetting +} +func (p *GetTestResponse) SetBase(val *model.BaseResp) { + p.Base = val +} +func (p *GetTestResponse) SetCloudSetting(val []byte) { + p.CloudSetting = val +} + +var fieldIDToName_GetTestResponse = map[int16]string{ + 1: "base", + 2: "cloud_setting", +} + +func (p *GetTestResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *GetTestResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + 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_GetTestResponse[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 *GetTestResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *GetTestResponse) ReadField2(iprot thrift.TProtocol) error { + + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { + return err + } else { + _field = []byte(v) + } + p.CloudSetting = _field + return nil +} + +func (p *GetTestResponse) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetTestResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *GetTestResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *GetTestResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("cloud_setting", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBinary([]byte(p.CloudSetting)); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *GetTestResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetTestResponse(%+v)", *p) + +} + +func (p *GetTestResponse) DeepEqual(ano *GetTestResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Base) { + return false + } + if !p.Field2DeepEqual(ano.CloudSetting) { + return false + } + return true +} + +func (p *GetTestResponse) Field1DeepEqual(src *model.BaseResp) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} +func (p *GetTestResponse) Field2DeepEqual(src []byte) bool { + + if bytes.Compare(p.CloudSetting, src) != 0 { + return false + } + return true +} + +type GetCloudRequest struct { +} + +func NewGetCloudRequest() *GetCloudRequest { + return &GetCloudRequest{} +} + +func (p *GetCloudRequest) InitDefault() { +} + +var fieldIDToName_GetCloudRequest = map[int16]string{} + +func (p *GetCloudRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + 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 *GetCloudRequest) Write(oprot thrift.TProtocol) (err error) { + + if err = oprot.WriteStructBegin("GetCloudRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + 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 *GetCloudRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetCloudRequest(%+v)", *p) + +} + +func (p *GetCloudRequest) DeepEqual(ano *GetCloudRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + return true +} + +type GetCloudResponse struct { + Base *model.BaseResp `thrift:"base,1" frugal:"1,default,model.BaseResp" json:"base"` + CloudSetting []byte `thrift:"cloud_setting,2" frugal:"2,default,binary" json:"cloud_setting"` +} + +func NewGetCloudResponse() *GetCloudResponse { + return &GetCloudResponse{} +} + +func (p *GetCloudResponse) InitDefault() { +} + +var GetCloudResponse_Base_DEFAULT *model.BaseResp + +func (p *GetCloudResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return GetCloudResponse_Base_DEFAULT + } + return p.Base +} + +func (p *GetCloudResponse) GetCloudSetting() (v []byte) { + return p.CloudSetting +} +func (p *GetCloudResponse) SetBase(val *model.BaseResp) { + p.Base = val +} +func (p *GetCloudResponse) SetCloudSetting(val []byte) { + p.CloudSetting = val +} + +var fieldIDToName_GetCloudResponse = map[int16]string{ + 1: "base", + 2: "cloud_setting", +} + +func (p *GetCloudResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *GetCloudResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + 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_GetCloudResponse[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 *GetCloudResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *GetCloudResponse) ReadField2(iprot thrift.TProtocol) error { + + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { + return err + } else { + _field = []byte(v) + } + p.CloudSetting = _field + return nil +} + +func (p *GetCloudResponse) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetCloudResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + 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 *GetCloudResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *GetCloudResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("cloud_setting", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBinary([]byte(p.CloudSetting)); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + 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 *GetCloudResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetCloudResponse(%+v)", *p) + +} + +func (p *GetCloudResponse) DeepEqual(ano *GetCloudResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Base) { + return false + } + if !p.Field2DeepEqual(ano.CloudSetting) { + return false + } + return true +} + +func (p *GetCloudResponse) Field1DeepEqual(src *model.BaseResp) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} +func (p *GetCloudResponse) Field2DeepEqual(src []byte) bool { + + if bytes.Compare(p.CloudSetting, src) != 0 { + return false + } + return true +} + +type SetCloudRequest struct { + Password string `thrift:"password,1,required" frugal:"1,required,string" json:"password"` + Setting string `thrift:"setting,2,required" frugal:"2,required,string" json:"setting"` +} + +func NewSetCloudRequest() *SetCloudRequest { + return &SetCloudRequest{} +} + +func (p *SetCloudRequest) InitDefault() { +} + +func (p *SetCloudRequest) GetPassword() (v string) { + return p.Password +} + +func (p *SetCloudRequest) GetSetting() (v string) { + return p.Setting +} +func (p *SetCloudRequest) SetPassword(val string) { + p.Password = val +} +func (p *SetCloudRequest) SetSetting(val string) { + p.Setting = val +} + +var fieldIDToName_SetCloudRequest = map[int16]string{ + 1: "password", + 2: "setting", +} + +func (p *SetCloudRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetPassword bool = false + var issetSetting bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + 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 + } + issetPassword = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + issetSetting = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + if !issetPassword { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetSetting { + fieldId = 2 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_SetCloudRequest[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_SetCloudRequest[fieldId])) +} + +func (p *SetCloudRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Password = _field + return nil +} +func (p *SetCloudRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Setting = _field + return nil +} + +func (p *SetCloudRequest) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("SetCloudRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + 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 *SetCloudRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("password", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Password); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *SetCloudRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("setting", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Setting); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *SetCloudRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SetCloudRequest(%+v)", *p) + +} + +func (p *SetCloudRequest) DeepEqual(ano *SetCloudRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Password) { + return false + } + if !p.Field2DeepEqual(ano.Setting) { + return false + } + return true +} + +func (p *SetCloudRequest) Field1DeepEqual(src string) bool { + + if strings.Compare(p.Password, src) != 0 { + return false + } + return true +} +func (p *SetCloudRequest) Field2DeepEqual(src string) bool { + + if strings.Compare(p.Setting, src) != 0 { + return false + } + return true +} + +type SetCloudResponse struct { + Base *model.BaseResp `thrift:"base,1" frugal:"1,default,model.BaseResp" json:"base"` +} + +func NewSetCloudResponse() *SetCloudResponse { + return &SetCloudResponse{} +} + +func (p *SetCloudResponse) InitDefault() { +} + +var SetCloudResponse_Base_DEFAULT *model.BaseResp + +func (p *SetCloudResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return SetCloudResponse_Base_DEFAULT + } + return p.Base +} +func (p *SetCloudResponse) SetBase(val *model.BaseResp) { + p.Base = val +} + +var fieldIDToName_SetCloudResponse = map[int16]string{ + 1: "base", +} + +func (p *SetCloudResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *SetCloudResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + 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_SetCloudResponse[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 *SetCloudResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} + +func (p *SetCloudResponse) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("SetCloudResponse"); 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 *SetCloudResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *SetCloudResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SetCloudResponse(%+v)", *p) + +} + +func (p *SetCloudResponse) DeepEqual(ano *SetCloudResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Base) { + return false + } + return true +} + +func (p *SetCloudResponse) Field1DeepEqual(src *model.BaseResp) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} + +type GetDumpRequest struct { +} + +func NewGetDumpRequest() *GetDumpRequest { + return &GetDumpRequest{} +} + +func (p *GetDumpRequest) InitDefault() { +} + +var fieldIDToName_GetDumpRequest = map[int16]string{} + +func (p *GetDumpRequest) 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 *GetDumpRequest) Write(oprot thrift.TProtocol) (err error) { + + if err = oprot.WriteStructBegin("GetDumpRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + 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 *GetDumpRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetDumpRequest(%+v)", *p) + +} + +func (p *GetDumpRequest) DeepEqual(ano *GetDumpRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + return true +} + +type GetDumpResponse struct { + Base *model.BaseResp `thrift:"base,1" frugal:"1,default,model.BaseResp" json:"base"` + Data string `thrift:"data,2" frugal:"2,default,string" json:"data"` +} + +func NewGetDumpResponse() *GetDumpResponse { + return &GetDumpResponse{} +} + +func (p *GetDumpResponse) InitDefault() { +} + +var GetDumpResponse_Base_DEFAULT *model.BaseResp + +func (p *GetDumpResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return GetDumpResponse_Base_DEFAULT + } + return p.Base +} + +func (p *GetDumpResponse) GetData() (v string) { + return p.Data +} +func (p *GetDumpResponse) SetBase(val *model.BaseResp) { + p.Base = val +} +func (p *GetDumpResponse) SetData(val string) { + p.Data = val +} + +var fieldIDToName_GetDumpResponse = map[int16]string{ + 1: "base", + 2: "data", +} + +func (p *GetDumpResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *GetDumpResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + 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_GetDumpResponse[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 *GetDumpResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *GetDumpResponse) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Data = _field + return nil +} + +func (p *GetDumpResponse) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetDumpResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *GetDumpResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *GetDumpResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("data", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Data); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + 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 *GetDumpResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetDumpResponse(%+v)", *p) + +} + +func (p *GetDumpResponse) DeepEqual(ano *GetDumpResponse) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Base) { + return false + } + if !p.Field2DeepEqual(ano.Data) { + return false + } + return true +} + +func (p *GetDumpResponse) Field1DeepEqual(src *model.BaseResp) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} +func (p *GetDumpResponse) Field2DeepEqual(src string) bool { + + if strings.Compare(p.Data, src) != 0 { + return false + } + return true +} + +type VersionService interface { + Login(ctx context.Context, req *LoginRequest) (r *LoginResponse, err error) + + UploadVersion(ctx context.Context, req *UploadRequest) (r *UploadResponse, err error) + + UploadParams(ctx context.Context, req *UploadParamsRequest) (r *UploadParamsResponse, err error) + + DownloadReleaseApk(ctx context.Context, req *DownloadReleaseApkRequest) (r *DownloadReleaseApkResponse, err error) + + DownloadBetaApk(ctx context.Context, req *DownloadBetaApkRequest) (r *DownloadBetaApkResponse, err error) + + GetReleaseVersion(ctx context.Context, req *GetReleaseVersionRequest) (r *GetReleaseVersionResponse, err error) + + GetBetaVersion(ctx context.Context, req *GetBetaVersionRequest) (r *GetBetaVersionResponse, err error) + + GetSetting(ctx context.Context, req *GetSettingRequest) (r *GetSettingResponse, err error) + + GetTest(ctx context.Context, req *GetTestRequest) (r *GetTestResponse, err error) + + GetCloud(ctx context.Context, req *GetCloudRequest) (r *GetCloudResponse, err error) + + SetCloud(ctx context.Context, req *SetCloudRequest) (r *SetCloudResponse, err error) + + GetDump(ctx context.Context, req *GetDumpRequest) (r *GetDumpResponse, err error) +} + +type VersionServiceLoginArgs struct { + Req *LoginRequest `thrift:"req,1" frugal:"1,default,LoginRequest" json:"req"` +} + +func NewVersionServiceLoginArgs() *VersionServiceLoginArgs { + return &VersionServiceLoginArgs{} +} + +func (p *VersionServiceLoginArgs) InitDefault() { +} + +var VersionServiceLoginArgs_Req_DEFAULT *LoginRequest + +func (p *VersionServiceLoginArgs) GetReq() (v *LoginRequest) { + if !p.IsSetReq() { + return VersionServiceLoginArgs_Req_DEFAULT + } + return p.Req +} +func (p *VersionServiceLoginArgs) SetReq(val *LoginRequest) { + p.Req = val +} + +var fieldIDToName_VersionServiceLoginArgs = map[int16]string{ + 1: "req", +} + +func (p *VersionServiceLoginArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *VersionServiceLoginArgs) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceLoginArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *VersionServiceLoginArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewLoginRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *VersionServiceLoginArgs) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("Login_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *VersionServiceLoginArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *VersionServiceLoginArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VersionServiceLoginArgs(%+v)", *p) + +} + +func (p *VersionServiceLoginArgs) DeepEqual(ano *VersionServiceLoginArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Req) { + return false + } + return true +} + +func (p *VersionServiceLoginArgs) Field1DeepEqual(src *LoginRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type VersionServiceLoginResult struct { + Success *LoginResponse `thrift:"success,0,optional" frugal:"0,optional,LoginResponse" json:"success,omitempty"` +} + +func NewVersionServiceLoginResult() *VersionServiceLoginResult { + return &VersionServiceLoginResult{} +} + +func (p *VersionServiceLoginResult) InitDefault() { +} + +var VersionServiceLoginResult_Success_DEFAULT *LoginResponse + +func (p *VersionServiceLoginResult) GetSuccess() (v *LoginResponse) { + if !p.IsSetSuccess() { + return VersionServiceLoginResult_Success_DEFAULT + } + return p.Success +} +func (p *VersionServiceLoginResult) SetSuccess(x interface{}) { + p.Success = x.(*LoginResponse) +} + +var fieldIDToName_VersionServiceLoginResult = map[int16]string{ + 0: "success", +} + +func (p *VersionServiceLoginResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *VersionServiceLoginResult) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_VersionServiceLoginResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *VersionServiceLoginResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewLoginResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *VersionServiceLoginResult) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("Login_result"); err != nil { + goto WriteStructBeginError + } + if 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 *VersionServiceLoginResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *VersionServiceLoginResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VersionServiceLoginResult(%+v)", *p) + +} + +func (p *VersionServiceLoginResult) DeepEqual(ano *VersionServiceLoginResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field0DeepEqual(ano.Success) { + return false + } + return true +} + +func (p *VersionServiceLoginResult) Field0DeepEqual(src *LoginResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type VersionServiceUploadVersionArgs struct { + Req *UploadRequest `thrift:"req,1" frugal:"1,default,UploadRequest" json:"req"` +} + +func NewVersionServiceUploadVersionArgs() *VersionServiceUploadVersionArgs { + return &VersionServiceUploadVersionArgs{} +} + +func (p *VersionServiceUploadVersionArgs) InitDefault() { +} + +var VersionServiceUploadVersionArgs_Req_DEFAULT *UploadRequest + +func (p *VersionServiceUploadVersionArgs) GetReq() (v *UploadRequest) { + if !p.IsSetReq() { + return VersionServiceUploadVersionArgs_Req_DEFAULT + } + return p.Req +} +func (p *VersionServiceUploadVersionArgs) SetReq(val *UploadRequest) { + p.Req = val +} + +var fieldIDToName_VersionServiceUploadVersionArgs = map[int16]string{ + 1: "req", +} + +func (p *VersionServiceUploadVersionArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *VersionServiceUploadVersionArgs) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + 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_VersionServiceUploadVersionArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *VersionServiceUploadVersionArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewUploadRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *VersionServiceUploadVersionArgs) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("UploadVersion_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *VersionServiceUploadVersionArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if 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 *VersionServiceUploadVersionArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VersionServiceUploadVersionArgs(%+v)", *p) + +} + +func (p *VersionServiceUploadVersionArgs) DeepEqual(ano *VersionServiceUploadVersionArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Req) { + return false + } + return true +} + +func (p *VersionServiceUploadVersionArgs) Field1DeepEqual(src *UploadRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type VersionServiceUploadVersionResult struct { + Success *UploadResponse `thrift:"success,0,optional" frugal:"0,optional,UploadResponse" json:"success,omitempty"` +} + +func NewVersionServiceUploadVersionResult() *VersionServiceUploadVersionResult { + return &VersionServiceUploadVersionResult{} +} + +func (p *VersionServiceUploadVersionResult) InitDefault() { +} + +var VersionServiceUploadVersionResult_Success_DEFAULT *UploadResponse + +func (p *VersionServiceUploadVersionResult) GetSuccess() (v *UploadResponse) { + if !p.IsSetSuccess() { + return VersionServiceUploadVersionResult_Success_DEFAULT + } + return p.Success +} +func (p *VersionServiceUploadVersionResult) SetSuccess(x interface{}) { + p.Success = x.(*UploadResponse) +} + +var fieldIDToName_VersionServiceUploadVersionResult = map[int16]string{ + 0: "success", +} + +func (p *VersionServiceUploadVersionResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *VersionServiceUploadVersionResult) 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_VersionServiceUploadVersionResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *VersionServiceUploadVersionResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewUploadResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *VersionServiceUploadVersionResult) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("UploadVersion_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 *VersionServiceUploadVersionResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *VersionServiceUploadVersionResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VersionServiceUploadVersionResult(%+v)", *p) + +} + +func (p *VersionServiceUploadVersionResult) DeepEqual(ano *VersionServiceUploadVersionResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field0DeepEqual(ano.Success) { + return false + } + return true +} + +func (p *VersionServiceUploadVersionResult) Field0DeepEqual(src *UploadResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type VersionServiceUploadParamsArgs struct { + Req *UploadParamsRequest `thrift:"req,1" frugal:"1,default,UploadParamsRequest" json:"req"` +} + +func NewVersionServiceUploadParamsArgs() *VersionServiceUploadParamsArgs { + return &VersionServiceUploadParamsArgs{} +} + +func (p *VersionServiceUploadParamsArgs) InitDefault() { +} + +var VersionServiceUploadParamsArgs_Req_DEFAULT *UploadParamsRequest + +func (p *VersionServiceUploadParamsArgs) GetReq() (v *UploadParamsRequest) { + if !p.IsSetReq() { + return VersionServiceUploadParamsArgs_Req_DEFAULT + } + return p.Req +} +func (p *VersionServiceUploadParamsArgs) SetReq(val *UploadParamsRequest) { + p.Req = val +} + +var fieldIDToName_VersionServiceUploadParamsArgs = map[int16]string{ + 1: "req", +} + +func (p *VersionServiceUploadParamsArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *VersionServiceUploadParamsArgs) 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_VersionServiceUploadParamsArgs[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 *VersionServiceUploadParamsArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewUploadParamsRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *VersionServiceUploadParamsArgs) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("UploadParams_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 *VersionServiceUploadParamsArgs) 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 *VersionServiceUploadParamsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VersionServiceUploadParamsArgs(%+v)", *p) + +} + +func (p *VersionServiceUploadParamsArgs) DeepEqual(ano *VersionServiceUploadParamsArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Req) { + return false + } + return true +} + +func (p *VersionServiceUploadParamsArgs) Field1DeepEqual(src *UploadParamsRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type VersionServiceUploadParamsResult struct { + Success *UploadParamsResponse `thrift:"success,0,optional" frugal:"0,optional,UploadParamsResponse" json:"success,omitempty"` +} + +func NewVersionServiceUploadParamsResult() *VersionServiceUploadParamsResult { + return &VersionServiceUploadParamsResult{} +} + +func (p *VersionServiceUploadParamsResult) InitDefault() { +} + +var VersionServiceUploadParamsResult_Success_DEFAULT *UploadParamsResponse + +func (p *VersionServiceUploadParamsResult) GetSuccess() (v *UploadParamsResponse) { + if !p.IsSetSuccess() { + return VersionServiceUploadParamsResult_Success_DEFAULT + } + return p.Success +} +func (p *VersionServiceUploadParamsResult) SetSuccess(x interface{}) { + p.Success = x.(*UploadParamsResponse) +} + +var fieldIDToName_VersionServiceUploadParamsResult = map[int16]string{ + 0: "success", +} + +func (p *VersionServiceUploadParamsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *VersionServiceUploadParamsResult) 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_VersionServiceUploadParamsResult[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 *VersionServiceUploadParamsResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewUploadParamsResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *VersionServiceUploadParamsResult) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("UploadParams_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 *VersionServiceUploadParamsResult) 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 *VersionServiceUploadParamsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VersionServiceUploadParamsResult(%+v)", *p) + +} + +func (p *VersionServiceUploadParamsResult) DeepEqual(ano *VersionServiceUploadParamsResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field0DeepEqual(ano.Success) { + return false + } + return true +} + +func (p *VersionServiceUploadParamsResult) Field0DeepEqual(src *UploadParamsResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type VersionServiceDownloadReleaseApkArgs struct { + Req *DownloadReleaseApkRequest `thrift:"req,1" frugal:"1,default,DownloadReleaseApkRequest" json:"req"` +} + +func NewVersionServiceDownloadReleaseApkArgs() *VersionServiceDownloadReleaseApkArgs { + return &VersionServiceDownloadReleaseApkArgs{} +} + +func (p *VersionServiceDownloadReleaseApkArgs) InitDefault() { +} + +var VersionServiceDownloadReleaseApkArgs_Req_DEFAULT *DownloadReleaseApkRequest + +func (p *VersionServiceDownloadReleaseApkArgs) GetReq() (v *DownloadReleaseApkRequest) { + if !p.IsSetReq() { + return VersionServiceDownloadReleaseApkArgs_Req_DEFAULT + } + return p.Req +} +func (p *VersionServiceDownloadReleaseApkArgs) SetReq(val *DownloadReleaseApkRequest) { + p.Req = val +} + +var fieldIDToName_VersionServiceDownloadReleaseApkArgs = map[int16]string{ + 1: "req", +} + +func (p *VersionServiceDownloadReleaseApkArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *VersionServiceDownloadReleaseApkArgs) 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_VersionServiceDownloadReleaseApkArgs[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 *VersionServiceDownloadReleaseApkArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewDownloadReleaseApkRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *VersionServiceDownloadReleaseApkArgs) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("DownloadReleaseApk_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 *VersionServiceDownloadReleaseApkArgs) 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 *VersionServiceDownloadReleaseApkArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VersionServiceDownloadReleaseApkArgs(%+v)", *p) + +} + +func (p *VersionServiceDownloadReleaseApkArgs) DeepEqual(ano *VersionServiceDownloadReleaseApkArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Req) { + return false + } + return true +} + +func (p *VersionServiceDownloadReleaseApkArgs) Field1DeepEqual(src *DownloadReleaseApkRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type VersionServiceDownloadReleaseApkResult struct { + Success *DownloadReleaseApkResponse `thrift:"success,0,optional" frugal:"0,optional,DownloadReleaseApkResponse" json:"success,omitempty"` +} + +func NewVersionServiceDownloadReleaseApkResult() *VersionServiceDownloadReleaseApkResult { + return &VersionServiceDownloadReleaseApkResult{} +} + +func (p *VersionServiceDownloadReleaseApkResult) InitDefault() { +} + +var VersionServiceDownloadReleaseApkResult_Success_DEFAULT *DownloadReleaseApkResponse + +func (p *VersionServiceDownloadReleaseApkResult) GetSuccess() (v *DownloadReleaseApkResponse) { + if !p.IsSetSuccess() { + return VersionServiceDownloadReleaseApkResult_Success_DEFAULT + } + return p.Success +} +func (p *VersionServiceDownloadReleaseApkResult) SetSuccess(x interface{}) { + p.Success = x.(*DownloadReleaseApkResponse) +} + +var fieldIDToName_VersionServiceDownloadReleaseApkResult = map[int16]string{ + 0: "success", +} + +func (p *VersionServiceDownloadReleaseApkResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *VersionServiceDownloadReleaseApkResult) 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_VersionServiceDownloadReleaseApkResult[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 *VersionServiceDownloadReleaseApkResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewDownloadReleaseApkResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *VersionServiceDownloadReleaseApkResult) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("DownloadReleaseApk_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 *VersionServiceDownloadReleaseApkResult) 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 *VersionServiceDownloadReleaseApkResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VersionServiceDownloadReleaseApkResult(%+v)", *p) + +} + +func (p *VersionServiceDownloadReleaseApkResult) DeepEqual(ano *VersionServiceDownloadReleaseApkResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field0DeepEqual(ano.Success) { + return false + } + return true +} + +func (p *VersionServiceDownloadReleaseApkResult) Field0DeepEqual(src *DownloadReleaseApkResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type VersionServiceDownloadBetaApkArgs struct { + Req *DownloadBetaApkRequest `thrift:"req,1" frugal:"1,default,DownloadBetaApkRequest" json:"req"` +} + +func NewVersionServiceDownloadBetaApkArgs() *VersionServiceDownloadBetaApkArgs { + return &VersionServiceDownloadBetaApkArgs{} +} + +func (p *VersionServiceDownloadBetaApkArgs) InitDefault() { +} + +var VersionServiceDownloadBetaApkArgs_Req_DEFAULT *DownloadBetaApkRequest + +func (p *VersionServiceDownloadBetaApkArgs) GetReq() (v *DownloadBetaApkRequest) { + if !p.IsSetReq() { + return VersionServiceDownloadBetaApkArgs_Req_DEFAULT + } + return p.Req +} +func (p *VersionServiceDownloadBetaApkArgs) SetReq(val *DownloadBetaApkRequest) { + p.Req = val +} + +var fieldIDToName_VersionServiceDownloadBetaApkArgs = map[int16]string{ + 1: "req", +} + +func (p *VersionServiceDownloadBetaApkArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *VersionServiceDownloadBetaApkArgs) 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_VersionServiceDownloadBetaApkArgs[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 *VersionServiceDownloadBetaApkArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewDownloadBetaApkRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *VersionServiceDownloadBetaApkArgs) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("DownloadBetaApk_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 *VersionServiceDownloadBetaApkArgs) 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 *VersionServiceDownloadBetaApkArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VersionServiceDownloadBetaApkArgs(%+v)", *p) + +} + +func (p *VersionServiceDownloadBetaApkArgs) DeepEqual(ano *VersionServiceDownloadBetaApkArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Req) { + return false + } + return true +} + +func (p *VersionServiceDownloadBetaApkArgs) Field1DeepEqual(src *DownloadBetaApkRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type VersionServiceDownloadBetaApkResult struct { + Success *DownloadBetaApkResponse `thrift:"success,0,optional" frugal:"0,optional,DownloadBetaApkResponse" json:"success,omitempty"` +} + +func NewVersionServiceDownloadBetaApkResult() *VersionServiceDownloadBetaApkResult { + return &VersionServiceDownloadBetaApkResult{} +} + +func (p *VersionServiceDownloadBetaApkResult) InitDefault() { +} + +var VersionServiceDownloadBetaApkResult_Success_DEFAULT *DownloadBetaApkResponse + +func (p *VersionServiceDownloadBetaApkResult) GetSuccess() (v *DownloadBetaApkResponse) { + if !p.IsSetSuccess() { + return VersionServiceDownloadBetaApkResult_Success_DEFAULT + } + return p.Success +} +func (p *VersionServiceDownloadBetaApkResult) SetSuccess(x interface{}) { + p.Success = x.(*DownloadBetaApkResponse) +} + +var fieldIDToName_VersionServiceDownloadBetaApkResult = map[int16]string{ + 0: "success", +} + +func (p *VersionServiceDownloadBetaApkResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *VersionServiceDownloadBetaApkResult) 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_VersionServiceDownloadBetaApkResult[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 *VersionServiceDownloadBetaApkResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewDownloadBetaApkResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *VersionServiceDownloadBetaApkResult) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("DownloadBetaApk_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 *VersionServiceDownloadBetaApkResult) 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 *VersionServiceDownloadBetaApkResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VersionServiceDownloadBetaApkResult(%+v)", *p) + +} + +func (p *VersionServiceDownloadBetaApkResult) DeepEqual(ano *VersionServiceDownloadBetaApkResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field0DeepEqual(ano.Success) { + return false + } + return true +} + +func (p *VersionServiceDownloadBetaApkResult) Field0DeepEqual(src *DownloadBetaApkResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type VersionServiceGetReleaseVersionArgs struct { + Req *GetReleaseVersionRequest `thrift:"req,1" frugal:"1,default,GetReleaseVersionRequest" json:"req"` +} + +func NewVersionServiceGetReleaseVersionArgs() *VersionServiceGetReleaseVersionArgs { + return &VersionServiceGetReleaseVersionArgs{} +} + +func (p *VersionServiceGetReleaseVersionArgs) InitDefault() { +} + +var VersionServiceGetReleaseVersionArgs_Req_DEFAULT *GetReleaseVersionRequest + +func (p *VersionServiceGetReleaseVersionArgs) GetReq() (v *GetReleaseVersionRequest) { + if !p.IsSetReq() { + return VersionServiceGetReleaseVersionArgs_Req_DEFAULT + } + return p.Req +} +func (p *VersionServiceGetReleaseVersionArgs) SetReq(val *GetReleaseVersionRequest) { + p.Req = val +} + +var fieldIDToName_VersionServiceGetReleaseVersionArgs = map[int16]string{ + 1: "req", +} + +func (p *VersionServiceGetReleaseVersionArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *VersionServiceGetReleaseVersionArgs) 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_VersionServiceGetReleaseVersionArgs[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 *VersionServiceGetReleaseVersionArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetReleaseVersionRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *VersionServiceGetReleaseVersionArgs) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetReleaseVersion_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 *VersionServiceGetReleaseVersionArgs) 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 *VersionServiceGetReleaseVersionArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VersionServiceGetReleaseVersionArgs(%+v)", *p) + +} + +func (p *VersionServiceGetReleaseVersionArgs) DeepEqual(ano *VersionServiceGetReleaseVersionArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Req) { + return false + } + return true +} + +func (p *VersionServiceGetReleaseVersionArgs) Field1DeepEqual(src *GetReleaseVersionRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type VersionServiceGetReleaseVersionResult struct { + Success *GetReleaseVersionResponse `thrift:"success,0,optional" frugal:"0,optional,GetReleaseVersionResponse" json:"success,omitempty"` +} + +func NewVersionServiceGetReleaseVersionResult() *VersionServiceGetReleaseVersionResult { + return &VersionServiceGetReleaseVersionResult{} +} + +func (p *VersionServiceGetReleaseVersionResult) InitDefault() { +} + +var VersionServiceGetReleaseVersionResult_Success_DEFAULT *GetReleaseVersionResponse + +func (p *VersionServiceGetReleaseVersionResult) GetSuccess() (v *GetReleaseVersionResponse) { + if !p.IsSetSuccess() { + return VersionServiceGetReleaseVersionResult_Success_DEFAULT + } + return p.Success +} +func (p *VersionServiceGetReleaseVersionResult) SetSuccess(x interface{}) { + p.Success = x.(*GetReleaseVersionResponse) +} + +var fieldIDToName_VersionServiceGetReleaseVersionResult = map[int16]string{ + 0: "success", +} + +func (p *VersionServiceGetReleaseVersionResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *VersionServiceGetReleaseVersionResult) 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_VersionServiceGetReleaseVersionResult[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 *VersionServiceGetReleaseVersionResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetReleaseVersionResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *VersionServiceGetReleaseVersionResult) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetReleaseVersion_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 *VersionServiceGetReleaseVersionResult) 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 *VersionServiceGetReleaseVersionResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VersionServiceGetReleaseVersionResult(%+v)", *p) + +} + +func (p *VersionServiceGetReleaseVersionResult) DeepEqual(ano *VersionServiceGetReleaseVersionResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field0DeepEqual(ano.Success) { + return false + } + return true +} + +func (p *VersionServiceGetReleaseVersionResult) Field0DeepEqual(src *GetReleaseVersionResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type VersionServiceGetBetaVersionArgs struct { + Req *GetBetaVersionRequest `thrift:"req,1" frugal:"1,default,GetBetaVersionRequest" json:"req"` +} + +func NewVersionServiceGetBetaVersionArgs() *VersionServiceGetBetaVersionArgs { + return &VersionServiceGetBetaVersionArgs{} +} + +func (p *VersionServiceGetBetaVersionArgs) InitDefault() { +} + +var VersionServiceGetBetaVersionArgs_Req_DEFAULT *GetBetaVersionRequest + +func (p *VersionServiceGetBetaVersionArgs) GetReq() (v *GetBetaVersionRequest) { + if !p.IsSetReq() { + return VersionServiceGetBetaVersionArgs_Req_DEFAULT + } + return p.Req +} +func (p *VersionServiceGetBetaVersionArgs) SetReq(val *GetBetaVersionRequest) { + p.Req = val +} + +var fieldIDToName_VersionServiceGetBetaVersionArgs = map[int16]string{ + 1: "req", +} + +func (p *VersionServiceGetBetaVersionArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *VersionServiceGetBetaVersionArgs) 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_VersionServiceGetBetaVersionArgs[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 *VersionServiceGetBetaVersionArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetBetaVersionRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *VersionServiceGetBetaVersionArgs) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetBetaVersion_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 *VersionServiceGetBetaVersionArgs) 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 *VersionServiceGetBetaVersionArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VersionServiceGetBetaVersionArgs(%+v)", *p) + +} + +func (p *VersionServiceGetBetaVersionArgs) DeepEqual(ano *VersionServiceGetBetaVersionArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Req) { + return false + } + return true +} + +func (p *VersionServiceGetBetaVersionArgs) Field1DeepEqual(src *GetBetaVersionRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type VersionServiceGetBetaVersionResult struct { + Success *GetBetaVersionResponse `thrift:"success,0,optional" frugal:"0,optional,GetBetaVersionResponse" json:"success,omitempty"` +} + +func NewVersionServiceGetBetaVersionResult() *VersionServiceGetBetaVersionResult { + return &VersionServiceGetBetaVersionResult{} +} + +func (p *VersionServiceGetBetaVersionResult) InitDefault() { +} + +var VersionServiceGetBetaVersionResult_Success_DEFAULT *GetBetaVersionResponse + +func (p *VersionServiceGetBetaVersionResult) GetSuccess() (v *GetBetaVersionResponse) { + if !p.IsSetSuccess() { + return VersionServiceGetBetaVersionResult_Success_DEFAULT + } + return p.Success +} +func (p *VersionServiceGetBetaVersionResult) SetSuccess(x interface{}) { + p.Success = x.(*GetBetaVersionResponse) +} + +var fieldIDToName_VersionServiceGetBetaVersionResult = map[int16]string{ + 0: "success", +} + +func (p *VersionServiceGetBetaVersionResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *VersionServiceGetBetaVersionResult) 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_VersionServiceGetBetaVersionResult[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 *VersionServiceGetBetaVersionResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetBetaVersionResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *VersionServiceGetBetaVersionResult) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetBetaVersion_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 *VersionServiceGetBetaVersionResult) 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 *VersionServiceGetBetaVersionResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VersionServiceGetBetaVersionResult(%+v)", *p) + +} + +func (p *VersionServiceGetBetaVersionResult) DeepEqual(ano *VersionServiceGetBetaVersionResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field0DeepEqual(ano.Success) { + return false + } + return true +} + +func (p *VersionServiceGetBetaVersionResult) Field0DeepEqual(src *GetBetaVersionResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type VersionServiceGetSettingArgs struct { + Req *GetSettingRequest `thrift:"req,1" frugal:"1,default,GetSettingRequest" json:"req"` +} + +func NewVersionServiceGetSettingArgs() *VersionServiceGetSettingArgs { + return &VersionServiceGetSettingArgs{} +} + +func (p *VersionServiceGetSettingArgs) InitDefault() { +} + +var VersionServiceGetSettingArgs_Req_DEFAULT *GetSettingRequest + +func (p *VersionServiceGetSettingArgs) GetReq() (v *GetSettingRequest) { + if !p.IsSetReq() { + return VersionServiceGetSettingArgs_Req_DEFAULT + } + return p.Req +} +func (p *VersionServiceGetSettingArgs) SetReq(val *GetSettingRequest) { + p.Req = val +} + +var fieldIDToName_VersionServiceGetSettingArgs = map[int16]string{ + 1: "req", +} + +func (p *VersionServiceGetSettingArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *VersionServiceGetSettingArgs) 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_VersionServiceGetSettingArgs[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 *VersionServiceGetSettingArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetSettingRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *VersionServiceGetSettingArgs) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetSetting_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 *VersionServiceGetSettingArgs) 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 *VersionServiceGetSettingArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VersionServiceGetSettingArgs(%+v)", *p) + +} + +func (p *VersionServiceGetSettingArgs) DeepEqual(ano *VersionServiceGetSettingArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Req) { + return false + } + return true +} + +func (p *VersionServiceGetSettingArgs) Field1DeepEqual(src *GetSettingRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type VersionServiceGetSettingResult struct { + Success *GetSettingResponse `thrift:"success,0,optional" frugal:"0,optional,GetSettingResponse" json:"success,omitempty"` +} + +func NewVersionServiceGetSettingResult() *VersionServiceGetSettingResult { + return &VersionServiceGetSettingResult{} +} + +func (p *VersionServiceGetSettingResult) InitDefault() { +} + +var VersionServiceGetSettingResult_Success_DEFAULT *GetSettingResponse + +func (p *VersionServiceGetSettingResult) GetSuccess() (v *GetSettingResponse) { + if !p.IsSetSuccess() { + return VersionServiceGetSettingResult_Success_DEFAULT + } + return p.Success +} +func (p *VersionServiceGetSettingResult) SetSuccess(x interface{}) { + p.Success = x.(*GetSettingResponse) +} + +var fieldIDToName_VersionServiceGetSettingResult = map[int16]string{ + 0: "success", +} + +func (p *VersionServiceGetSettingResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *VersionServiceGetSettingResult) 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_VersionServiceGetSettingResult[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 *VersionServiceGetSettingResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetSettingResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *VersionServiceGetSettingResult) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetSetting_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 *VersionServiceGetSettingResult) 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 *VersionServiceGetSettingResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VersionServiceGetSettingResult(%+v)", *p) + +} + +func (p *VersionServiceGetSettingResult) DeepEqual(ano *VersionServiceGetSettingResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field0DeepEqual(ano.Success) { + return false + } + return true +} + +func (p *VersionServiceGetSettingResult) Field0DeepEqual(src *GetSettingResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type VersionServiceGetTestArgs struct { + Req *GetTestRequest `thrift:"req,1" frugal:"1,default,GetTestRequest" json:"req"` +} + +func NewVersionServiceGetTestArgs() *VersionServiceGetTestArgs { + return &VersionServiceGetTestArgs{} +} + +func (p *VersionServiceGetTestArgs) InitDefault() { +} + +var VersionServiceGetTestArgs_Req_DEFAULT *GetTestRequest + +func (p *VersionServiceGetTestArgs) GetReq() (v *GetTestRequest) { + if !p.IsSetReq() { + return VersionServiceGetTestArgs_Req_DEFAULT + } + return p.Req +} +func (p *VersionServiceGetTestArgs) SetReq(val *GetTestRequest) { + p.Req = val +} + +var fieldIDToName_VersionServiceGetTestArgs = map[int16]string{ + 1: "req", +} + +func (p *VersionServiceGetTestArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *VersionServiceGetTestArgs) 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_VersionServiceGetTestArgs[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 *VersionServiceGetTestArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetTestRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *VersionServiceGetTestArgs) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetTest_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 *VersionServiceGetTestArgs) 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 *VersionServiceGetTestArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VersionServiceGetTestArgs(%+v)", *p) + +} + +func (p *VersionServiceGetTestArgs) DeepEqual(ano *VersionServiceGetTestArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Req) { + return false + } + return true +} + +func (p *VersionServiceGetTestArgs) Field1DeepEqual(src *GetTestRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type VersionServiceGetTestResult struct { + Success *GetTestResponse `thrift:"success,0,optional" frugal:"0,optional,GetTestResponse" json:"success,omitempty"` +} + +func NewVersionServiceGetTestResult() *VersionServiceGetTestResult { + return &VersionServiceGetTestResult{} +} + +func (p *VersionServiceGetTestResult) InitDefault() { +} + +var VersionServiceGetTestResult_Success_DEFAULT *GetTestResponse + +func (p *VersionServiceGetTestResult) GetSuccess() (v *GetTestResponse) { + if !p.IsSetSuccess() { + return VersionServiceGetTestResult_Success_DEFAULT + } + return p.Success +} +func (p *VersionServiceGetTestResult) SetSuccess(x interface{}) { + p.Success = x.(*GetTestResponse) +} + +var fieldIDToName_VersionServiceGetTestResult = map[int16]string{ + 0: "success", +} + +func (p *VersionServiceGetTestResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *VersionServiceGetTestResult) 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_VersionServiceGetTestResult[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 *VersionServiceGetTestResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetTestResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *VersionServiceGetTestResult) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetTest_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 *VersionServiceGetTestResult) 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 *VersionServiceGetTestResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VersionServiceGetTestResult(%+v)", *p) + +} + +func (p *VersionServiceGetTestResult) DeepEqual(ano *VersionServiceGetTestResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field0DeepEqual(ano.Success) { + return false + } + return true +} + +func (p *VersionServiceGetTestResult) Field0DeepEqual(src *GetTestResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type VersionServiceGetCloudArgs struct { + Req *GetCloudRequest `thrift:"req,1" frugal:"1,default,GetCloudRequest" json:"req"` +} + +func NewVersionServiceGetCloudArgs() *VersionServiceGetCloudArgs { + return &VersionServiceGetCloudArgs{} +} + +func (p *VersionServiceGetCloudArgs) InitDefault() { +} + +var VersionServiceGetCloudArgs_Req_DEFAULT *GetCloudRequest + +func (p *VersionServiceGetCloudArgs) GetReq() (v *GetCloudRequest) { + if !p.IsSetReq() { + return VersionServiceGetCloudArgs_Req_DEFAULT + } + return p.Req +} +func (p *VersionServiceGetCloudArgs) SetReq(val *GetCloudRequest) { + p.Req = val +} + +var fieldIDToName_VersionServiceGetCloudArgs = map[int16]string{ + 1: "req", +} + +func (p *VersionServiceGetCloudArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *VersionServiceGetCloudArgs) 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_VersionServiceGetCloudArgs[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 *VersionServiceGetCloudArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetCloudRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *VersionServiceGetCloudArgs) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetCloud_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 *VersionServiceGetCloudArgs) 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 *VersionServiceGetCloudArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VersionServiceGetCloudArgs(%+v)", *p) + +} + +func (p *VersionServiceGetCloudArgs) DeepEqual(ano *VersionServiceGetCloudArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Req) { + return false + } + return true +} + +func (p *VersionServiceGetCloudArgs) Field1DeepEqual(src *GetCloudRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type VersionServiceGetCloudResult struct { + Success *GetCloudResponse `thrift:"success,0,optional" frugal:"0,optional,GetCloudResponse" json:"success,omitempty"` +} + +func NewVersionServiceGetCloudResult() *VersionServiceGetCloudResult { + return &VersionServiceGetCloudResult{} +} + +func (p *VersionServiceGetCloudResult) InitDefault() { +} + +var VersionServiceGetCloudResult_Success_DEFAULT *GetCloudResponse + +func (p *VersionServiceGetCloudResult) GetSuccess() (v *GetCloudResponse) { + if !p.IsSetSuccess() { + return VersionServiceGetCloudResult_Success_DEFAULT + } + return p.Success +} +func (p *VersionServiceGetCloudResult) SetSuccess(x interface{}) { + p.Success = x.(*GetCloudResponse) +} + +var fieldIDToName_VersionServiceGetCloudResult = map[int16]string{ + 0: "success", +} + +func (p *VersionServiceGetCloudResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *VersionServiceGetCloudResult) 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_VersionServiceGetCloudResult[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 *VersionServiceGetCloudResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetCloudResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *VersionServiceGetCloudResult) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetCloud_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 *VersionServiceGetCloudResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *VersionServiceGetCloudResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VersionServiceGetCloudResult(%+v)", *p) + +} + +func (p *VersionServiceGetCloudResult) DeepEqual(ano *VersionServiceGetCloudResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field0DeepEqual(ano.Success) { + return false + } + return true +} + +func (p *VersionServiceGetCloudResult) Field0DeepEqual(src *GetCloudResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type VersionServiceSetCloudArgs struct { + Req *SetCloudRequest `thrift:"req,1" frugal:"1,default,SetCloudRequest" json:"req"` +} + +func NewVersionServiceSetCloudArgs() *VersionServiceSetCloudArgs { + return &VersionServiceSetCloudArgs{} +} + +func (p *VersionServiceSetCloudArgs) InitDefault() { +} + +var VersionServiceSetCloudArgs_Req_DEFAULT *SetCloudRequest + +func (p *VersionServiceSetCloudArgs) GetReq() (v *SetCloudRequest) { + if !p.IsSetReq() { + return VersionServiceSetCloudArgs_Req_DEFAULT + } + return p.Req +} +func (p *VersionServiceSetCloudArgs) SetReq(val *SetCloudRequest) { + p.Req = val +} + +var fieldIDToName_VersionServiceSetCloudArgs = map[int16]string{ + 1: "req", +} + +func (p *VersionServiceSetCloudArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *VersionServiceSetCloudArgs) 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_VersionServiceSetCloudArgs[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 *VersionServiceSetCloudArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewSetCloudRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *VersionServiceSetCloudArgs) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("SetCloud_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 *VersionServiceSetCloudArgs) 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 *VersionServiceSetCloudArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VersionServiceSetCloudArgs(%+v)", *p) + +} + +func (p *VersionServiceSetCloudArgs) DeepEqual(ano *VersionServiceSetCloudArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Req) { + return false + } + return true +} + +func (p *VersionServiceSetCloudArgs) Field1DeepEqual(src *SetCloudRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type VersionServiceSetCloudResult struct { + Success *SetCloudResponse `thrift:"success,0,optional" frugal:"0,optional,SetCloudResponse" json:"success,omitempty"` +} + +func NewVersionServiceSetCloudResult() *VersionServiceSetCloudResult { + return &VersionServiceSetCloudResult{} +} + +func (p *VersionServiceSetCloudResult) InitDefault() { +} + +var VersionServiceSetCloudResult_Success_DEFAULT *SetCloudResponse + +func (p *VersionServiceSetCloudResult) GetSuccess() (v *SetCloudResponse) { + if !p.IsSetSuccess() { + return VersionServiceSetCloudResult_Success_DEFAULT + } + return p.Success +} +func (p *VersionServiceSetCloudResult) SetSuccess(x interface{}) { + p.Success = x.(*SetCloudResponse) +} + +var fieldIDToName_VersionServiceSetCloudResult = map[int16]string{ + 0: "success", +} + +func (p *VersionServiceSetCloudResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *VersionServiceSetCloudResult) 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_VersionServiceSetCloudResult[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 *VersionServiceSetCloudResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewSetCloudResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *VersionServiceSetCloudResult) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("SetCloud_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 *VersionServiceSetCloudResult) 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 *VersionServiceSetCloudResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VersionServiceSetCloudResult(%+v)", *p) + +} + +func (p *VersionServiceSetCloudResult) DeepEqual(ano *VersionServiceSetCloudResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field0DeepEqual(ano.Success) { + return false + } + return true +} + +func (p *VersionServiceSetCloudResult) Field0DeepEqual(src *SetCloudResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type VersionServiceGetDumpArgs struct { + Req *GetDumpRequest `thrift:"req,1" frugal:"1,default,GetDumpRequest" json:"req"` +} + +func NewVersionServiceGetDumpArgs() *VersionServiceGetDumpArgs { + return &VersionServiceGetDumpArgs{} +} + +func (p *VersionServiceGetDumpArgs) InitDefault() { +} + +var VersionServiceGetDumpArgs_Req_DEFAULT *GetDumpRequest + +func (p *VersionServiceGetDumpArgs) GetReq() (v *GetDumpRequest) { + if !p.IsSetReq() { + return VersionServiceGetDumpArgs_Req_DEFAULT + } + return p.Req +} +func (p *VersionServiceGetDumpArgs) SetReq(val *GetDumpRequest) { + p.Req = val +} + +var fieldIDToName_VersionServiceGetDumpArgs = map[int16]string{ + 1: "req", +} + +func (p *VersionServiceGetDumpArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *VersionServiceGetDumpArgs) 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_VersionServiceGetDumpArgs[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 *VersionServiceGetDumpArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetDumpRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *VersionServiceGetDumpArgs) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetDump_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 *VersionServiceGetDumpArgs) 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 *VersionServiceGetDumpArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VersionServiceGetDumpArgs(%+v)", *p) + +} + +func (p *VersionServiceGetDumpArgs) DeepEqual(ano *VersionServiceGetDumpArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Req) { + return false + } + return true +} + +func (p *VersionServiceGetDumpArgs) Field1DeepEqual(src *GetDumpRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type VersionServiceGetDumpResult struct { + Success *GetDumpResponse `thrift:"success,0,optional" frugal:"0,optional,GetDumpResponse" json:"success,omitempty"` +} + +func NewVersionServiceGetDumpResult() *VersionServiceGetDumpResult { + return &VersionServiceGetDumpResult{} +} + +func (p *VersionServiceGetDumpResult) InitDefault() { +} + +var VersionServiceGetDumpResult_Success_DEFAULT *GetDumpResponse + +func (p *VersionServiceGetDumpResult) GetSuccess() (v *GetDumpResponse) { + if !p.IsSetSuccess() { + return VersionServiceGetDumpResult_Success_DEFAULT + } + return p.Success +} +func (p *VersionServiceGetDumpResult) SetSuccess(x interface{}) { + p.Success = x.(*GetDumpResponse) +} + +var fieldIDToName_VersionServiceGetDumpResult = map[int16]string{ + 0: "success", +} + +func (p *VersionServiceGetDumpResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *VersionServiceGetDumpResult) 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_VersionServiceGetDumpResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *VersionServiceGetDumpResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetDumpResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *VersionServiceGetDumpResult) Write(oprot thrift.TProtocol) (err error) { + + var fieldId int16 + if err = oprot.WriteStructBegin("GetDump_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *VersionServiceGetDumpResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *VersionServiceGetDumpResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VersionServiceGetDumpResult(%+v)", *p) + +} + +func (p *VersionServiceGetDumpResult) DeepEqual(ano *VersionServiceGetDumpResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field0DeepEqual(ano.Success) { + return false + } + return true +} + +func (p *VersionServiceGetDumpResult) Field0DeepEqual(src *GetDumpResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} diff --git a/kitex_gen/version/versionservice/client.go b/kitex_gen/version/versionservice/client.go new file mode 100644 index 00000000..9aff4336 --- /dev/null +++ b/kitex_gen/version/versionservice/client.go @@ -0,0 +1,133 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by Kitex v0.11.3. DO NOT EDIT. + +package versionservice + +import ( + "context" + + client "github.com/cloudwego/kitex/client" + callopt "github.com/cloudwego/kitex/client/callopt" + + version "github.com/west2-online/fzuhelper-server/kitex_gen/version" +) + +// Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework. +type Client interface { + Login(ctx context.Context, req *version.LoginRequest, callOptions ...callopt.Option) (r *version.LoginResponse, err error) + UploadVersion(ctx context.Context, req *version.UploadRequest, callOptions ...callopt.Option) (r *version.UploadResponse, err error) + UploadParams(ctx context.Context, req *version.UploadParamsRequest, callOptions ...callopt.Option) (r *version.UploadParamsResponse, err error) + DownloadReleaseApk(ctx context.Context, req *version.DownloadReleaseApkRequest, callOptions ...callopt.Option) (r *version.DownloadReleaseApkResponse, err error) + DownloadBetaApk(ctx context.Context, req *version.DownloadBetaApkRequest, callOptions ...callopt.Option) (r *version.DownloadBetaApkResponse, err error) + GetReleaseVersion(ctx context.Context, req *version.GetReleaseVersionRequest, callOptions ...callopt.Option) (r *version.GetReleaseVersionResponse, err error) + GetBetaVersion(ctx context.Context, req *version.GetBetaVersionRequest, callOptions ...callopt.Option) (r *version.GetBetaVersionResponse, err error) + GetSetting(ctx context.Context, req *version.GetSettingRequest, callOptions ...callopt.Option) (r *version.GetSettingResponse, err error) + GetTest(ctx context.Context, req *version.GetTestRequest, callOptions ...callopt.Option) (r *version.GetTestResponse, err error) + GetCloud(ctx context.Context, req *version.GetCloudRequest, callOptions ...callopt.Option) (r *version.GetCloudResponse, err error) + SetCloud(ctx context.Context, req *version.SetCloudRequest, callOptions ...callopt.Option) (r *version.SetCloudResponse, err error) + GetDump(ctx context.Context, req *version.GetDumpRequest, callOptions ...callopt.Option) (r *version.GetDumpResponse, err error) +} + +// NewClient creates a client for the service defined in IDL. +func NewClient(destService string, opts ...client.Option) (Client, error) { + var options []client.Option + options = append(options, client.WithDestService(destService)) + + options = append(options, opts...) + + kc, err := client.NewClient(serviceInfoForClient(), options...) + if err != nil { + return nil, err + } + return &kVersionServiceClient{ + kClient: newServiceClient(kc), + }, nil +} + +// MustNewClient creates a client for the service defined in IDL. It panics if any error occurs. +func MustNewClient(destService string, opts ...client.Option) Client { + kc, err := NewClient(destService, opts...) + if err != nil { + panic(err) + } + return kc +} + +type kVersionServiceClient struct { + *kClient +} + +func (p *kVersionServiceClient) Login(ctx context.Context, req *version.LoginRequest, callOptions ...callopt.Option) (r *version.LoginResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.Login(ctx, req) +} + +func (p *kVersionServiceClient) UploadVersion(ctx context.Context, req *version.UploadRequest, callOptions ...callopt.Option) (r *version.UploadResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.UploadVersion(ctx, req) +} + +func (p *kVersionServiceClient) UploadParams(ctx context.Context, req *version.UploadParamsRequest, callOptions ...callopt.Option) (r *version.UploadParamsResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.UploadParams(ctx, req) +} + +func (p *kVersionServiceClient) DownloadReleaseApk(ctx context.Context, req *version.DownloadReleaseApkRequest, callOptions ...callopt.Option) (r *version.DownloadReleaseApkResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.DownloadReleaseApk(ctx, req) +} + +func (p *kVersionServiceClient) DownloadBetaApk(ctx context.Context, req *version.DownloadBetaApkRequest, callOptions ...callopt.Option) (r *version.DownloadBetaApkResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.DownloadBetaApk(ctx, req) +} + +func (p *kVersionServiceClient) GetReleaseVersion(ctx context.Context, req *version.GetReleaseVersionRequest, callOptions ...callopt.Option) (r *version.GetReleaseVersionResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.GetReleaseVersion(ctx, req) +} + +func (p *kVersionServiceClient) GetBetaVersion(ctx context.Context, req *version.GetBetaVersionRequest, callOptions ...callopt.Option) (r *version.GetBetaVersionResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.GetBetaVersion(ctx, req) +} + +func (p *kVersionServiceClient) GetSetting(ctx context.Context, req *version.GetSettingRequest, callOptions ...callopt.Option) (r *version.GetSettingResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.GetSetting(ctx, req) +} + +func (p *kVersionServiceClient) GetTest(ctx context.Context, req *version.GetTestRequest, callOptions ...callopt.Option) (r *version.GetTestResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.GetTest(ctx, req) +} + +func (p *kVersionServiceClient) GetCloud(ctx context.Context, req *version.GetCloudRequest, callOptions ...callopt.Option) (r *version.GetCloudResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.GetCloud(ctx, req) +} + +func (p *kVersionServiceClient) SetCloud(ctx context.Context, req *version.SetCloudRequest, callOptions ...callopt.Option) (r *version.SetCloudResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.SetCloud(ctx, req) +} + +func (p *kVersionServiceClient) GetDump(ctx context.Context, req *version.GetDumpRequest, callOptions ...callopt.Option) (r *version.GetDumpResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.GetDump(ctx, req) +} diff --git a/kitex_gen/version/versionservice/server.go b/kitex_gen/version/versionservice/server.go new file mode 100644 index 00000000..0c9f4420 --- /dev/null +++ b/kitex_gen/version/versionservice/server.go @@ -0,0 +1,42 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by Kitex v0.11.3. DO NOT EDIT. +package versionservice + +import ( + server "github.com/cloudwego/kitex/server" + + version "github.com/west2-online/fzuhelper-server/kitex_gen/version" +) + +// NewServer creates a server.Server with the given handler and options. +func NewServer(handler version.VersionService, opts ...server.Option) server.Server { + var options []server.Option + + options = append(options, opts...) + options = append(options, server.WithCompatibleMiddlewareForUnary()) + + svr := server.NewServer(options...) + if err := svr.RegisterService(serviceInfo(), handler); err != nil { + panic(err) + } + return svr +} + +func RegisterService(svr server.Server, handler version.VersionService, opts ...server.RegisterOption) error { + return svr.RegisterService(serviceInfo(), handler, opts...) +} diff --git a/kitex_gen/version/versionservice/versionservice.go b/kitex_gen/version/versionservice/versionservice.go new file mode 100644 index 00000000..9763f84a --- /dev/null +++ b/kitex_gen/version/versionservice/versionservice.go @@ -0,0 +1,528 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by Kitex v0.11.3. DO NOT EDIT. + +package versionservice + +import ( + "context" + "errors" + + client "github.com/cloudwego/kitex/client" + kitex "github.com/cloudwego/kitex/pkg/serviceinfo" + + version "github.com/west2-online/fzuhelper-server/kitex_gen/version" +) + +var errInvalidMessageType = errors.New("invalid message type for service method handler") + +var serviceMethods = map[string]kitex.MethodInfo{ + "Login": kitex.NewMethodInfo( + loginHandler, + newVersionServiceLoginArgs, + newVersionServiceLoginResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "UploadVersion": kitex.NewMethodInfo( + uploadVersionHandler, + newVersionServiceUploadVersionArgs, + newVersionServiceUploadVersionResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "UploadParams": kitex.NewMethodInfo( + uploadParamsHandler, + newVersionServiceUploadParamsArgs, + newVersionServiceUploadParamsResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "DownloadReleaseApk": kitex.NewMethodInfo( + downloadReleaseApkHandler, + newVersionServiceDownloadReleaseApkArgs, + newVersionServiceDownloadReleaseApkResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "DownloadBetaApk": kitex.NewMethodInfo( + downloadBetaApkHandler, + newVersionServiceDownloadBetaApkArgs, + newVersionServiceDownloadBetaApkResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "GetReleaseVersion": kitex.NewMethodInfo( + getReleaseVersionHandler, + newVersionServiceGetReleaseVersionArgs, + newVersionServiceGetReleaseVersionResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "GetBetaVersion": kitex.NewMethodInfo( + getBetaVersionHandler, + newVersionServiceGetBetaVersionArgs, + newVersionServiceGetBetaVersionResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "GetSetting": kitex.NewMethodInfo( + getSettingHandler, + newVersionServiceGetSettingArgs, + newVersionServiceGetSettingResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "GetTest": kitex.NewMethodInfo( + getTestHandler, + newVersionServiceGetTestArgs, + newVersionServiceGetTestResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "GetCloud": kitex.NewMethodInfo( + getCloudHandler, + newVersionServiceGetCloudArgs, + newVersionServiceGetCloudResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "SetCloud": kitex.NewMethodInfo( + setCloudHandler, + newVersionServiceSetCloudArgs, + newVersionServiceSetCloudResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "GetDump": kitex.NewMethodInfo( + getDumpHandler, + newVersionServiceGetDumpArgs, + newVersionServiceGetDumpResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), +} + +var ( + versionServiceServiceInfo = NewServiceInfo() + versionServiceServiceInfoForClient = NewServiceInfoForClient() + versionServiceServiceInfoForStreamClient = NewServiceInfoForStreamClient() +) + +// for server +func serviceInfo() *kitex.ServiceInfo { + return versionServiceServiceInfo +} + +// for stream client +func serviceInfoForStreamClient() *kitex.ServiceInfo { + return versionServiceServiceInfoForStreamClient +} + +// for client +func serviceInfoForClient() *kitex.ServiceInfo { + return versionServiceServiceInfoForClient +} + +// NewServiceInfo creates a new ServiceInfo containing all methods +func NewServiceInfo() *kitex.ServiceInfo { + return newServiceInfo(false, true, true) +} + +// NewServiceInfo creates a new ServiceInfo containing non-streaming methods +func NewServiceInfoForClient() *kitex.ServiceInfo { + return newServiceInfo(false, false, true) +} +func NewServiceInfoForStreamClient() *kitex.ServiceInfo { + return newServiceInfo(true, true, false) +} + +func newServiceInfo(hasStreaming bool, keepStreamingMethods bool, keepNonStreamingMethods bool) *kitex.ServiceInfo { + serviceName := "VersionService" + handlerType := (*version.VersionService)(nil) + methods := map[string]kitex.MethodInfo{} + for name, m := range serviceMethods { + if m.IsStreaming() && !keepStreamingMethods { + continue + } + if !m.IsStreaming() && !keepNonStreamingMethods { + continue + } + methods[name] = m + } + extra := map[string]interface{}{ + "PackageName": "version", + } + if hasStreaming { + extra["streaming"] = hasStreaming + } + svcInfo := &kitex.ServiceInfo{ + ServiceName: serviceName, + HandlerType: handlerType, + Methods: methods, + PayloadCodec: kitex.Thrift, + KiteXGenVersion: "v0.11.3", + Extra: extra, + } + return svcInfo +} + +func loginHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*version.VersionServiceLoginArgs) + realResult := result.(*version.VersionServiceLoginResult) + success, err := handler.(version.VersionService).Login(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newVersionServiceLoginArgs() interface{} { + return version.NewVersionServiceLoginArgs() +} + +func newVersionServiceLoginResult() interface{} { + return version.NewVersionServiceLoginResult() +} + +func uploadVersionHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*version.VersionServiceUploadVersionArgs) + realResult := result.(*version.VersionServiceUploadVersionResult) + success, err := handler.(version.VersionService).UploadVersion(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newVersionServiceUploadVersionArgs() interface{} { + return version.NewVersionServiceUploadVersionArgs() +} + +func newVersionServiceUploadVersionResult() interface{} { + return version.NewVersionServiceUploadVersionResult() +} + +func uploadParamsHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*version.VersionServiceUploadParamsArgs) + realResult := result.(*version.VersionServiceUploadParamsResult) + success, err := handler.(version.VersionService).UploadParams(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newVersionServiceUploadParamsArgs() interface{} { + return version.NewVersionServiceUploadParamsArgs() +} + +func newVersionServiceUploadParamsResult() interface{} { + return version.NewVersionServiceUploadParamsResult() +} + +func downloadReleaseApkHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*version.VersionServiceDownloadReleaseApkArgs) + realResult := result.(*version.VersionServiceDownloadReleaseApkResult) + success, err := handler.(version.VersionService).DownloadReleaseApk(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newVersionServiceDownloadReleaseApkArgs() interface{} { + return version.NewVersionServiceDownloadReleaseApkArgs() +} + +func newVersionServiceDownloadReleaseApkResult() interface{} { + return version.NewVersionServiceDownloadReleaseApkResult() +} + +func downloadBetaApkHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*version.VersionServiceDownloadBetaApkArgs) + realResult := result.(*version.VersionServiceDownloadBetaApkResult) + success, err := handler.(version.VersionService).DownloadBetaApk(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newVersionServiceDownloadBetaApkArgs() interface{} { + return version.NewVersionServiceDownloadBetaApkArgs() +} + +func newVersionServiceDownloadBetaApkResult() interface{} { + return version.NewVersionServiceDownloadBetaApkResult() +} + +func getReleaseVersionHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*version.VersionServiceGetReleaseVersionArgs) + realResult := result.(*version.VersionServiceGetReleaseVersionResult) + success, err := handler.(version.VersionService).GetReleaseVersion(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newVersionServiceGetReleaseVersionArgs() interface{} { + return version.NewVersionServiceGetReleaseVersionArgs() +} + +func newVersionServiceGetReleaseVersionResult() interface{} { + return version.NewVersionServiceGetReleaseVersionResult() +} + +func getBetaVersionHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*version.VersionServiceGetBetaVersionArgs) + realResult := result.(*version.VersionServiceGetBetaVersionResult) + success, err := handler.(version.VersionService).GetBetaVersion(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newVersionServiceGetBetaVersionArgs() interface{} { + return version.NewVersionServiceGetBetaVersionArgs() +} + +func newVersionServiceGetBetaVersionResult() interface{} { + return version.NewVersionServiceGetBetaVersionResult() +} + +func getSettingHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*version.VersionServiceGetSettingArgs) + realResult := result.(*version.VersionServiceGetSettingResult) + success, err := handler.(version.VersionService).GetSetting(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newVersionServiceGetSettingArgs() interface{} { + return version.NewVersionServiceGetSettingArgs() +} + +func newVersionServiceGetSettingResult() interface{} { + return version.NewVersionServiceGetSettingResult() +} + +func getTestHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*version.VersionServiceGetTestArgs) + realResult := result.(*version.VersionServiceGetTestResult) + success, err := handler.(version.VersionService).GetTest(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newVersionServiceGetTestArgs() interface{} { + return version.NewVersionServiceGetTestArgs() +} + +func newVersionServiceGetTestResult() interface{} { + return version.NewVersionServiceGetTestResult() +} + +func getCloudHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*version.VersionServiceGetCloudArgs) + realResult := result.(*version.VersionServiceGetCloudResult) + success, err := handler.(version.VersionService).GetCloud(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newVersionServiceGetCloudArgs() interface{} { + return version.NewVersionServiceGetCloudArgs() +} + +func newVersionServiceGetCloudResult() interface{} { + return version.NewVersionServiceGetCloudResult() +} + +func setCloudHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*version.VersionServiceSetCloudArgs) + realResult := result.(*version.VersionServiceSetCloudResult) + success, err := handler.(version.VersionService).SetCloud(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newVersionServiceSetCloudArgs() interface{} { + return version.NewVersionServiceSetCloudArgs() +} + +func newVersionServiceSetCloudResult() interface{} { + return version.NewVersionServiceSetCloudResult() +} + +func getDumpHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*version.VersionServiceGetDumpArgs) + realResult := result.(*version.VersionServiceGetDumpResult) + success, err := handler.(version.VersionService).GetDump(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newVersionServiceGetDumpArgs() interface{} { + return version.NewVersionServiceGetDumpArgs() +} + +func newVersionServiceGetDumpResult() interface{} { + return version.NewVersionServiceGetDumpResult() +} + +type kClient struct { + c client.Client +} + +func newServiceClient(c client.Client) *kClient { + return &kClient{ + c: c, + } +} + +func (p *kClient) Login(ctx context.Context, req *version.LoginRequest) (r *version.LoginResponse, err error) { + var _args version.VersionServiceLoginArgs + _args.Req = req + var _result version.VersionServiceLoginResult + if err = p.c.Call(ctx, "Login", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) UploadVersion(ctx context.Context, req *version.UploadRequest) (r *version.UploadResponse, err error) { + var _args version.VersionServiceUploadVersionArgs + _args.Req = req + var _result version.VersionServiceUploadVersionResult + if err = p.c.Call(ctx, "UploadVersion", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) UploadParams(ctx context.Context, req *version.UploadParamsRequest) (r *version.UploadParamsResponse, err error) { + var _args version.VersionServiceUploadParamsArgs + _args.Req = req + var _result version.VersionServiceUploadParamsResult + if err = p.c.Call(ctx, "UploadParams", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) DownloadReleaseApk(ctx context.Context, req *version.DownloadReleaseApkRequest) (r *version.DownloadReleaseApkResponse, err error) { + var _args version.VersionServiceDownloadReleaseApkArgs + _args.Req = req + var _result version.VersionServiceDownloadReleaseApkResult + if err = p.c.Call(ctx, "DownloadReleaseApk", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) DownloadBetaApk(ctx context.Context, req *version.DownloadBetaApkRequest) (r *version.DownloadBetaApkResponse, err error) { + var _args version.VersionServiceDownloadBetaApkArgs + _args.Req = req + var _result version.VersionServiceDownloadBetaApkResult + if err = p.c.Call(ctx, "DownloadBetaApk", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) GetReleaseVersion(ctx context.Context, req *version.GetReleaseVersionRequest) (r *version.GetReleaseVersionResponse, err error) { + var _args version.VersionServiceGetReleaseVersionArgs + _args.Req = req + var _result version.VersionServiceGetReleaseVersionResult + if err = p.c.Call(ctx, "GetReleaseVersion", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) GetBetaVersion(ctx context.Context, req *version.GetBetaVersionRequest) (r *version.GetBetaVersionResponse, err error) { + var _args version.VersionServiceGetBetaVersionArgs + _args.Req = req + var _result version.VersionServiceGetBetaVersionResult + if err = p.c.Call(ctx, "GetBetaVersion", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) GetSetting(ctx context.Context, req *version.GetSettingRequest) (r *version.GetSettingResponse, err error) { + var _args version.VersionServiceGetSettingArgs + _args.Req = req + var _result version.VersionServiceGetSettingResult + if err = p.c.Call(ctx, "GetSetting", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) GetTest(ctx context.Context, req *version.GetTestRequest) (r *version.GetTestResponse, err error) { + var _args version.VersionServiceGetTestArgs + _args.Req = req + var _result version.VersionServiceGetTestResult + if err = p.c.Call(ctx, "GetTest", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) GetCloud(ctx context.Context, req *version.GetCloudRequest) (r *version.GetCloudResponse, err error) { + var _args version.VersionServiceGetCloudArgs + _args.Req = req + var _result version.VersionServiceGetCloudResult + if err = p.c.Call(ctx, "GetCloud", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) SetCloud(ctx context.Context, req *version.SetCloudRequest) (r *version.SetCloudResponse, err error) { + var _args version.VersionServiceSetCloudArgs + _args.Req = req + var _result version.VersionServiceSetCloudResult + if err = p.c.Call(ctx, "SetCloud", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) GetDump(ctx context.Context, req *version.GetDumpRequest) (r *version.GetDumpResponse, err error) { + var _args version.VersionServiceGetDumpArgs + _args.Req = req + var _result version.VersionServiceGetDumpResult + if err = p.c.Call(ctx, "GetDump", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} diff --git a/pkg/base/client/rpc.go b/pkg/base/client/rpc.go index 24901521..b7bbf205 100644 --- a/pkg/base/client/rpc.go +++ b/pkg/base/client/rpc.go @@ -27,10 +27,12 @@ import ( "github.com/west2-online/fzuhelper-server/config" "github.com/west2-online/fzuhelper-server/kitex_gen/academic/academicservice" "github.com/west2-online/fzuhelper-server/kitex_gen/classroom/classroomservice" + "github.com/west2-online/fzuhelper-server/kitex_gen/common/commonservice" "github.com/west2-online/fzuhelper-server/kitex_gen/course/courseservice" "github.com/west2-online/fzuhelper-server/kitex_gen/launch_screen/launchscreenservice" "github.com/west2-online/fzuhelper-server/kitex_gen/paper/paperservice" "github.com/west2-online/fzuhelper-server/kitex_gen/user/userservice" + "github.com/west2-online/fzuhelper-server/kitex_gen/version/versionservice" "github.com/west2-online/fzuhelper-server/pkg/constants" ) @@ -99,3 +101,11 @@ func InitPaperRPC() (*paperservice.Client, error) { func InitAcademicRPC() (*academicservice.Client, error) { return initRPCClient(constants.AcademicServiceName, academicservice.NewClient) } + +func InitVersionRPC() (*versionservice.Client, error) { + return initRPCClient(constants.VersionServiceName, versionservice.NewClient) +} + +func InitCommonRPC() (*commonservice.Client, error) { + return initRPCClient(constants.CommonServiceName, commonservice.NewClient) +} diff --git a/pkg/constants/service.go b/pkg/constants/service.go index 16d2f1ef..dbf896bd 100644 --- a/pkg/constants/service.go +++ b/pkg/constants/service.go @@ -24,7 +24,8 @@ const ( ApiServiceName = "api" LaunchScreenServiceName = "launch_screen" PaperServiceName = "paper" - URLServiceName = "url" + VersionServiceName = "version" AcademicServiceName = "academic" LaunchScreenTableName = "launch_screen" + CommonServiceName = "common" ) diff --git a/pkg/errno/default.go b/pkg/errno/default.go index 9551f42a..5ba71718 100644 --- a/pkg/errno/default.go +++ b/pkg/errno/default.go @@ -37,7 +37,9 @@ var ( InternalServiceError = NewErrNo(InternalServiceErrorCode, "internal service error") SuffixError = NewErrNo(ParamErrorCode, "invalid file") + NoAccessError = NewErrNo(AuthErrorCode, "user don't have authority to this biz") NoRunningPictureError = NewErrNo(BizErrorCode, "no valid picture") + NoMatchingPlanError = NewErrNo(BizErrorCode, "no matching plan") // internal error UpcloudError = NewErrNo(BizFileUploadErrorCode, "upload to upcloud error") diff --git a/pkg/upyun/url.go b/pkg/upyun/url.go new file mode 100644 index 00000000..a2644bdb --- /dev/null +++ b/pkg/upyun/url.go @@ -0,0 +1,131 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package upyun + +import ( + "bytes" + "crypto/hmac" + "crypto/md5" + "crypto/sha1" + "encoding/base64" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "strings" + "time" + + "github.com/west2-online/fzuhelper-server/config" + "github.com/west2-online/fzuhelper-server/pkg/errno" +) + +// gmtDate returns the current date and time in GMT format. +func gmtDate() string { + return time.Now().UTC().Format("Mon, 02 Jan 2006 15:04:05 GMT") +} + +// SignStr generates the signature string for authentication. +func SignStr(opename, opepass, bucket, policy string) string { + // Generate MD5 hash of the password + md5Hasher := md5.New() + md5Hasher.Write([]byte(opepass)) + key := fmt.Sprintf("%x", md5Hasher.Sum(nil)) + + gmtdate := gmtDate() + var msg string + if policy == "" { + msg = "POST" + "&/" + bucket + "&" + gmtdate + } else { + msg = "POST" + "&/" + bucket + "&" + gmtdate + "&" + policy + } + + // Generate HMAC-SHA1 hash + hmacHasher := hmac.New(sha1.New, []byte(key)) + hmacHasher.Write([]byte(msg)) + signature := base64.StdEncoding.EncodeToString(hmacHasher.Sum(nil)) + + return "UPYUN " + opename + ":" + signature +} + +// GetPolicy generates the policy string for requests. +func GetPolicy(bucket, savepath string, timeout int) string { + gmtdate := gmtDate() + expiration := time.Now().Unix() + int64(timeout) + // expiration := timeout + policy := map[string]interface{}{ + "bucket": bucket, + "save-key": savepath, + "expiration": expiration, + "date": gmtdate, + } + + policyJSON, _ := json.Marshal(policy) + return base64.StdEncoding.EncodeToString(policyJSON) +} + +// URlUploadFile 又拍云上传文件 +func URlUploadFile(file []byte, url string) error { + body := bytes.NewReader(file) + req, err := http.NewRequest("PUT", url, body) + if err != nil { + return err + } + req.SetBasicAuth(config.UpYun.Operator, config.UpYun.Password) + req.Header.Add("Date", time.Now().UTC().Format(http.TimeFormat)) + res, err := http.DefaultClient.Do(req) + if err != nil { + return err + } + defer res.Body.Close() + if res.StatusCode != http.StatusOK { + return errno.UpcloudError + } + return nil +} + +// URlGetFile 又拍云下载文件 +func URlGetFile(url string) (*[]byte, error) { + req, err := http.NewRequest("GET", url, nil) + if err != nil { + return nil, err + } + req.SetBasicAuth(config.UpYun.Operator, config.UpYun.Password) + req.Header.Add("Date", time.Now().UTC().Format(http.TimeFormat)) + res, err := http.DefaultClient.Do(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + + if res.StatusCode != http.StatusOK { + return nil, errno.UpcloudError + } + + file, err := ioutil.ReadAll(res.Body) + if err != nil { + return nil, errno.UpcloudError + } + return &file, nil +} + +// JoinFileName 生成文件名字 +func JoinFileName(fileName string) string { + return strings.Join([]string{ + config.UpYun.UssDomain, config.UpYun.Path, + fileName, + }, "") +} diff --git a/pkg/utils/check_pwd.go b/pkg/utils/check_pwd.go new file mode 100644 index 00000000..0ba87c33 --- /dev/null +++ b/pkg/utils/check_pwd.go @@ -0,0 +1,27 @@ +/* +Copyright 2024 The west2-online Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package utils + +import ( + "strings" + + "github.com/west2-online/fzuhelper-server/config" +) + +func CheckPwd(pwd string) bool { + return strings.Compare(pwd, config.UrlService.Password) == 0 +} diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 78e390e1..823deb8b 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -24,6 +24,7 @@ import ( "image/jpeg" "image/png" "io" + "io/ioutil" "mime/multipart" "net" "net/http" @@ -276,3 +277,29 @@ func SaveImageFromBytes(imgBytes []byte, format string) error { return nil } + +// SaveJSON 保存 JSON 数据到文件 +func SaveJSON(fileName string, saveJson []byte) error { + // 写入操作,可以覆盖文件 + if err := ioutil.WriteFile(fileName, saveJson, DefaultFilePermissions); err != nil { + return fmt.Errorf("failed to write file: %w", err) + } + return nil +} + +// GetJSON 从 JSON 文件读取数据 +func GetJSON(fileName string) ([]byte, error) { + file, err := os.Open(fileName) + if err != nil { + return nil, fmt.Errorf("failed to open file %s: %w", fileName, err) + } + defer file.Close() + + // 读取文件内容 + data, err := ioutil.ReadAll(file) + if err != nil { + return nil, fmt.Errorf("failed to read file %s: %w", fileName, err) + } + + return data, nil +}