From ccdc0e36fdd9cd9cb2f5c9d7f49486582c06ca76 Mon Sep 17 00:00:00 2001 From: FantasyRL <1845983502@qq.com> Date: Sat, 28 Sep 2024 15:35:38 +0800 Subject: [PATCH 1/2] add:idl --- idl/api.thrift | 53 ++++++++++++++++++++++++++++++++++++++ idl/launch_screen.thrift | 36 ++++++++++++++++++++++++++ idl/model.thrift | 25 ++++++++++++++++++ idl/user.thrift | 31 ++++++++++++++++++++++ pkg/constants/constants.go | 1 + 5 files changed, 146 insertions(+) create mode 100644 idl/api.thrift create mode 100644 idl/launch_screen.thrift create mode 100644 idl/model.thrift create mode 100644 idl/user.thrift diff --git a/idl/api.thrift b/idl/api.thrift new file mode 100644 index 0000000..094b30f --- /dev/null +++ b/idl/api.thrift @@ -0,0 +1,53 @@ +namespace go api + +struct BaseResp { + 1: i64 code, + 2: string msg, +} + +struct User{ + 1:i64 id, + 2:string account, + 3:string name, +} + +struct Picture{ + 1:i64 id, + 2:string url, + 3:string href, + 4:string text, + 5:i64 pic_type, + 6:i64 show_times, + 7:i64 point_times, + 8:i64 duration, + 9:i64 s_type, + 10:i64 frequency, +} + +struct RegisterRequest { + 1: required string account, + 2: required string name, + 3: required string password, +} + +struct RegisterResponse { + 1: BaseResp base, + 2: optional i64 user_id, +} + +struct LoginRequest { + 1: string account, + 2: string password, +} + +struct LoginResponse { + 1: BaseResp base, + 2: optional string data, +} + +service UserService { + LoginResponse Login(1: LoginRequest req)(api.post="/launch_screen/api/login"), + + //test for backend + RegisterResponse Register(1: RegisterRequest req)(api.post="/launch_screen/api/register"), +} diff --git a/idl/launch_screen.thrift b/idl/launch_screen.thrift new file mode 100644 index 0000000..cb14890 --- /dev/null +++ b/idl/launch_screen.thrift @@ -0,0 +1,36 @@ +namespace go launch_screen +include"model.thrift" + +struct CreateImageRequest { + 1: required i64 pic_type,//1为空,2为页面跳转,3为app跳转 + 2: optional i64 duration, + 3: optional string href,//连接 + 4: required binary image, + 5: required string start_at, + 6: required string end_at, + 7: required i64 s_type, + 8: required i64 frequency, + 9: required i64 start_time,//比如6表示6点 + 10:required i64 end_time, + 11:required string text,//描述图片 + 12:string regex,//正则匹配项 + + 13:i64 user_id,//get by token +} + +struct CreateImageResponse{ + 1:model.BaseResp base, + 2:optional model.Picture picture, +} + +struct GetImageRequest{ + 1:required i64 picture_id, + + 2:i64 user_id, +} + +struct GetImageResponse{ + 1:required i64 picture_id, + + 2:i64 user_id, +} diff --git a/idl/model.thrift b/idl/model.thrift new file mode 100644 index 0000000..0211693 --- /dev/null +++ b/idl/model.thrift @@ -0,0 +1,25 @@ +namespace go model + +struct BaseResp { + 1: i64 code, + 2: string msg, +} + +struct User{ + 1:i64 id, + 2:string account, + 3:string name, +} + +struct Picture{ + 1:i64 id, + 2:string url, + 3:string href, + 4:string text, + 5:i64 pic_type, + 6:i64 show_times, + 7:i64 point_times, + 8:i64 duration, + 9:i64 s_type, + 10:i64 frequency, +} diff --git a/idl/user.thrift b/idl/user.thrift new file mode 100644 index 0000000..a277473 --- /dev/null +++ b/idl/user.thrift @@ -0,0 +1,31 @@ +namespace go user + +include"model.thrift" + +struct RegisterRequest { + 1: required string account, + 2: required string name, + 3: required string password, +} + +struct RegisterResponse { + 1: model.BaseResp base, + 2: optional i64 user_id, +} + +struct LoginRequest { + 1: string account, + 2: string password, +} + +struct LoginResponse { + 1: model.BaseResp base, + 2: optional string token, +} + +service UserService { + LoginResponse Login(1: LoginRequest req)(api.post="/launch_screen/api/login"), + + //test for backend + RegisterResponse Register(1: RegisterRequest req)(api.post="/launch_screen/api/register"), +} diff --git a/pkg/constants/constants.go b/pkg/constants/constants.go index c4234bd..01eb205 100644 --- a/pkg/constants/constants.go +++ b/pkg/constants/constants.go @@ -15,6 +15,7 @@ const ( // service name TemplateServiceName = "template" EmptyRoomService = "empty_room" + LaunchScreenService = "launch_screen" // db table name TemplateServiceTableName = "template" From 46e21594819917bb859aedfefbcf747c9415fbf3 Mon Sep 17 00:00:00 2001 From: FantasyRL <1845983502@qq.com> Date: Thu, 3 Oct 2024 13:45:15 +0800 Subject: [PATCH 2/2] feat:user_service and create image --- Makefile | 28 +- cmd/api/.gitignore | 37 + cmd/api/.hz | 6 + .../biz/handler/api/launch_screen_service.go | 198 + cmd/api/biz/handler/api/user_service.go | 80 + cmd/api/biz/handler/ping.go | 18 + cmd/api/biz/model/api/api.go | 10137 ++++++++++++++++ cmd/api/biz/pack/base.go | 75 + cmd/api/biz/pack/convert.go | 25 + cmd/api/biz/pack/tracer/jaeger.go | 35 + cmd/api/biz/pack/utils.go | 29 + cmd/api/biz/router/api/api.go | 38 + cmd/api/biz/router/api/middleware.go | 82 + cmd/api/biz/router/register.go | 14 + cmd/api/biz/rpc/init.go | 16 + cmd/api/biz/rpc/launch_screen.go | 32 + cmd/api/biz/rpc/user.go | 39 + cmd/api/build.sh | 6 + cmd/api/docs/docs.go | 232 + cmd/api/docs/swagger.json | 203 + cmd/api/docs/swagger.yaml | 137 + cmd/api/main.go | 65 + cmd/api/router.go | 15 + cmd/api/router_gen.go | 16 + cmd/api/script/bootstrap.sh | 5 + cmd/launch_screen/build.sh | 12 + cmd/launch_screen/dal/db/init.go | 41 + cmd/launch_screen/dal/db/mysql.go | 35 + cmd/launch_screen/dal/init.go | 7 + cmd/launch_screen/handler.go | 116 + cmd/launch_screen/kitex_info.yaml | 3 + cmd/launch_screen/main.go | 119 + cmd/launch_screen/pack/upcloud.go | 36 + cmd/launch_screen/script/bootstrap.sh | 21 + cmd/launch_screen/service/create.go | 29 + cmd/launch_screen/service/service.go | 30 + cmd/user/build.sh | 12 + cmd/user/dal/db/init.go | 42 + cmd/user/dal/db/mysql.go | 48 + cmd/user/dal/init.go | 9 + cmd/user/handler.go | 53 + cmd/user/kitex_info.yaml | 3 + cmd/user/main.go | 122 + cmd/user/pack/pwd/pwd.go | 18 + cmd/user/script/bootstrap.sh | 21 + cmd/user/service/login.go | 20 + cmd/user/service/register.go | 17 + cmd/user/service/service.go | 23 + config/config.go | 2 + config/config.yaml | 27 +- config/sql/init.sql | 41 +- config/types.go | 8 + docker/etcd-monitor.sh | 10 +- entrypoint.sh | 2 +- go.mod | 67 +- go.sum | 236 +- idl/api.thrift | 143 +- idl/launch_screen.thrift | 96 +- idl/model.thrift | 23 +- kitex_gen/launch_screen/k-consts.go | 4 + kitex_gen/launch_screen/k-launch_screen.go | 6270 ++++++++++ kitex_gen/launch_screen/launch_screen.go | 8525 +++++++++++++ .../launchscreenservice/client.go | 91 + .../launchscreenservice/invoker.go | 24 + .../launchscreenservice.go | 370 + .../launchscreenservice/server.go | 25 + kitex_gen/model/k-consts.go | 4 + kitex_gen/model/k-model.go | 1239 ++ kitex_gen/model/model.go | 1549 +++ kitex_gen/user/k-consts.go | 4 + kitex_gen/user/k-user.go | 1341 ++ kitex_gen/user/user.go | 1893 +++ kitex_gen/user/userservice/client.go | 55 + kitex_gen/user/userservice/invoker.go | 24 + kitex_gen/user/userservice/server.go | 25 + kitex_gen/user/userservice/userservice.go | 160 + pkg/constants/constants.go | 10 +- pkg/errno/default.go | 5 + pkg/logger/logger.go | 43 + pkg/utils/base_resp.go | 28 + pkg/utils/jwt.go | 2 + pkg/utils/rpc.go | 21 + 82 files changed, 34580 insertions(+), 192 deletions(-) create mode 100755 cmd/api/.gitignore create mode 100644 cmd/api/.hz create mode 100644 cmd/api/biz/handler/api/launch_screen_service.go create mode 100644 cmd/api/biz/handler/api/user_service.go create mode 100755 cmd/api/biz/handler/ping.go create mode 100644 cmd/api/biz/model/api/api.go create mode 100644 cmd/api/biz/pack/base.go create mode 100644 cmd/api/biz/pack/convert.go create mode 100644 cmd/api/biz/pack/tracer/jaeger.go create mode 100644 cmd/api/biz/pack/utils.go create mode 100644 cmd/api/biz/router/api/api.go create mode 100644 cmd/api/biz/router/api/middleware.go create mode 100644 cmd/api/biz/router/register.go create mode 100644 cmd/api/biz/rpc/init.go create mode 100644 cmd/api/biz/rpc/launch_screen.go create mode 100644 cmd/api/biz/rpc/user.go create mode 100755 cmd/api/build.sh create mode 100644 cmd/api/docs/docs.go create mode 100644 cmd/api/docs/swagger.json create mode 100644 cmd/api/docs/swagger.yaml create mode 100755 cmd/api/main.go create mode 100755 cmd/api/router.go create mode 100755 cmd/api/router_gen.go create mode 100755 cmd/api/script/bootstrap.sh create mode 100644 cmd/launch_screen/build.sh create mode 100644 cmd/launch_screen/dal/db/init.go create mode 100644 cmd/launch_screen/dal/db/mysql.go create mode 100644 cmd/launch_screen/dal/init.go create mode 100644 cmd/launch_screen/handler.go create mode 100644 cmd/launch_screen/kitex_info.yaml create mode 100644 cmd/launch_screen/main.go create mode 100644 cmd/launch_screen/pack/upcloud.go create mode 100644 cmd/launch_screen/script/bootstrap.sh create mode 100644 cmd/launch_screen/service/create.go create mode 100644 cmd/launch_screen/service/service.go create mode 100644 cmd/user/build.sh create mode 100644 cmd/user/dal/db/init.go create mode 100644 cmd/user/dal/db/mysql.go create mode 100644 cmd/user/dal/init.go create mode 100644 cmd/user/handler.go create mode 100644 cmd/user/kitex_info.yaml create mode 100644 cmd/user/main.go create mode 100644 cmd/user/pack/pwd/pwd.go create mode 100644 cmd/user/script/bootstrap.sh create mode 100644 cmd/user/service/login.go create mode 100644 cmd/user/service/register.go create mode 100644 cmd/user/service/service.go create mode 100644 kitex_gen/launch_screen/k-consts.go create mode 100644 kitex_gen/launch_screen/k-launch_screen.go create mode 100644 kitex_gen/launch_screen/launch_screen.go create mode 100644 kitex_gen/launch_screen/launchscreenservice/client.go create mode 100644 kitex_gen/launch_screen/launchscreenservice/invoker.go create mode 100644 kitex_gen/launch_screen/launchscreenservice/launchscreenservice.go create mode 100644 kitex_gen/launch_screen/launchscreenservice/server.go create mode 100644 kitex_gen/model/k-consts.go create mode 100644 kitex_gen/model/k-model.go create mode 100644 kitex_gen/model/model.go create mode 100644 kitex_gen/user/k-consts.go create mode 100644 kitex_gen/user/k-user.go create mode 100644 kitex_gen/user/user.go create mode 100644 kitex_gen/user/userservice/client.go create mode 100644 kitex_gen/user/userservice/invoker.go create mode 100644 kitex_gen/user/userservice/server.go create mode 100644 kitex_gen/user/userservice/userservice.go create mode 100644 pkg/logger/logger.go create mode 100644 pkg/utils/base_resp.go create mode 100644 pkg/utils/rpc.go diff --git a/Makefile b/Makefile index 46f2fd6..140c7c3 100644 --- a/Makefile +++ b/Makefile @@ -3,14 +3,19 @@ CMD = $(DIR)/cmd CONFIG_PATH = $(DIR)/config IDL_PATH = $(DIR)/idl OUTPUT_PATH = $(DIR)/output - -SERVICES := template empty_room +SERVICES := template empty_room user api launch_screen service = $(word 1, $@) # mock gen MOCKS := user_mock mock = $(word 1, $@) +# hz&kitex +RPC = $(DIR)/cmd +API_PATH= $(DIR)/cmd/api +MODULE=github.com/west2-online/fzuhelper-server +KITEX_GEN_PATH=$(DIR)/kitex_gen + PERFIX = "[Makefile]" .PHONY: env-up @@ -55,4 +60,21 @@ build-all: # use docker instead to run projects .PHONY: docker docker: - docker build -t fzuhelper . \ No newline at end of file + docker build -t fzuhelper . + +KSERVICES := user launch_screen +.PHONY: kgen +kgen: + @for kservice in $(KSERVICES); do \ + kitex -module ${MODULE} ${IDL_PATH}/$$kservice.thrift; \ + cd ${RPC};cd $$kservice;kitex -module ${MODULE} -service $$kservice -use ${KITEX_GEN_PATH} ${IDL_PATH}/$$kservice.thrift; \ + cd ../../; \ + done \ + + +.PHONY: hzgen +hzgen: + cd ${API_PATH}; \ + hz update -idl ${IDL_PATH}/api.thrift; \ + swag init; \ + diff --git a/cmd/api/.gitignore b/cmd/api/.gitignore new file mode 100755 index 0000000..101ea87 --- /dev/null +++ b/cmd/api/.gitignore @@ -0,0 +1,37 @@ +*.o +*.a +*.so +_obj +_test +*.[568vq] +[568vq].out +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* +_testmain.go +*.exe +*.exe~ +*.test +*.prof +*.rar +*.zip +*.gz +*.psd +*.bmd +*.cfg +*.pptx +*.log +*nohup.out +*settings.pyc +*.sublime-project +*.sublime-workspace +!.gitkeep +.DS_Store +/.idea +/.vscode +/output +*.local.yml +dumped_hertz_remote_config.json + \ No newline at end of file diff --git a/cmd/api/.hz b/cmd/api/.hz new file mode 100644 index 0000000..2d32537 --- /dev/null +++ b/cmd/api/.hz @@ -0,0 +1,6 @@ +// Code generated by hz. DO NOT EDIT. + +hz version: v0.8.0 +handlerDir: "" +modelDir: "" +routerDir: "" diff --git a/cmd/api/biz/handler/api/launch_screen_service.go b/cmd/api/biz/handler/api/launch_screen_service.go new file mode 100644 index 0000000..183f868 --- /dev/null +++ b/cmd/api/biz/handler/api/launch_screen_service.go @@ -0,0 +1,198 @@ +// Code generated by hertz generator. + +package api + +import ( + "context" + "github.com/west2-online/fzuhelper-server/cmd/api/biz/pack" + "github.com/west2-online/fzuhelper-server/cmd/api/biz/rpc" + "github.com/west2-online/fzuhelper-server/kitex_gen/launch_screen" + "github.com/west2-online/fzuhelper-server/pkg/errno" + + "github.com/cloudwego/hertz/pkg/app" + "github.com/cloudwego/hertz/pkg/protocol/consts" + api "github.com/west2-online/fzuhelper-server/cmd/api/biz/model/api" +) + +// CreateImage . +// @Summary CreateImage +// @Description create launch_screen image +// @Accept json/form +// @Produce json +// @Param pic_type query int true "1为空,2为页面跳转,3为app跳转" +// @Param duration query int false "展示时间" +// @Param href query string false "链接" +// @Param image form_data file true "图片" +// @Param start_at query int true "开始time(时间戳)" +// @Param end_at query int true "结束time(时间戳)" +// @Param s_type query int true "类型" +// @Param frequency query int false "一天展示次数" +// @Param start_time query int true "每日起始hour" +// @Param end_time query int true "每日结束hour" +// @Param authorization header string false "token" +// @Param text query string true "描述" +// @Param regex query string false "json类型,正则匹配项" +// @router /launch_screen/api/image [POST] +func CreateImage(ctx context.Context, c *app.RequestContext) { + var err error + var req api.CreateImageRequest + err = c.BindAndValidate(&req) + if err != nil { + c.String(consts.StatusBadRequest, err.Error()) + return + } + token := c.GetHeader("authorization") + imageFile, err := c.FormFile("image") + if err != nil { + c.String(consts.StatusBadRequest, err.Error()) + return + } + + resp := new(api.CreateImageResponse) + + if !pack.IsAllowImageExt(imageFile.Filename) { + pack.RespError(c, errno.SuffixError) + return + } + + imageByte, err := pack.FileToByte(imageFile) + if err != nil { + pack.RespError(c, errno.BizError) + return + } + + respImage, err := rpc.CreateImageRPC(ctx, &launch_screen.CreateImageRequest{ + PicType: req.PicType, + Duration: req.Duration, + Href: req.Href, + Image: imageByte, + StartAt: req.StartAt, + EndAt: req.EndAt, + SType: req.SType, + Frequency: req.Frequency, + StartTime: req.StartTime, + EndTime: req.EndTime, + Text: req.Text, + Regex: req.Regex, + Token: string(token), + }) + if err != nil { + pack.RespError(c, err) + return + } + resp.Base = pack.BuildSuccessResp() + resp.Picture = pack.ModelImageToAPI(respImage) + c.JSON(consts.StatusOK, resp) +} + +// GetImage . +// @router /launch_screen/api/image [GET] +func GetImage(ctx context.Context, c *app.RequestContext) { + var err error + var req api.GetImageRequest + err = c.BindAndValidate(&req) + if err != nil { + c.String(consts.StatusBadRequest, err.Error()) + return + } + + resp := new(api.GetImagesByUserIdResponse) + + c.JSON(consts.StatusOK, resp) +} + +// GetImagesByUserId . +// @router /launch_screen/api/images [GET] +func GetImagesByUserId(ctx context.Context, c *app.RequestContext) { + var err error + var req api.GetImagesByUserIdRequest + err = c.BindAndValidate(&req) + if err != nil { + c.String(consts.StatusBadRequest, err.Error()) + return + } + + resp := new(api.GetImagesByUserIdResponse) + + c.JSON(consts.StatusOK, resp) +} + +// ChangeImageProperty . +// @router /launch_screen/api/image [PUT] +func ChangeImageProperty(ctx context.Context, c *app.RequestContext) { + var err error + var req api.ChangeImagePropertyRequest + err = c.BindAndValidate(&req) + if err != nil { + c.String(consts.StatusBadRequest, err.Error()) + return + } + + resp := new(api.ChangeImagePropertyResponse) + + c.JSON(consts.StatusOK, resp) +} + +// ChangeImage . +// @router /launch_screen/api/image/img [PUT] +func ChangeImage(ctx context.Context, c *app.RequestContext) { + var err error + var req api.ChangeImageRequest + err = c.BindAndValidate(&req) + if err != nil { + c.String(consts.StatusBadRequest, err.Error()) + return + } + + resp := new(api.ChangeImageResponse) + + c.JSON(consts.StatusOK, resp) +} + +// DeleteImage . +// @router /launch_screen/api/image [DELETE] +func DeleteImage(ctx context.Context, c *app.RequestContext) { + var err error + var req api.DeleteImageRequest + err = c.BindAndValidate(&req) + if err != nil { + c.String(consts.StatusBadRequest, err.Error()) + return + } + + resp := new(api.DeleteImageResponse) + + c.JSON(consts.StatusOK, resp) +} + +// MobileGetImage . +// @router /launch_screen/api/screen [GET] +func MobileGetImage(ctx context.Context, c *app.RequestContext) { + var err error + var req api.MobileGetImageRequest + err = c.BindAndValidate(&req) + if err != nil { + c.String(consts.StatusBadRequest, err.Error()) + return + } + + resp := new(api.MobileGetImageResponse) + + c.JSON(consts.StatusOK, resp) +} + +// AddImagePointTime . +// @router /launch_screen/api/image/point [GET] +func AddImagePointTime(ctx context.Context, c *app.RequestContext) { + var err error + var req api.AddImagePointTimeRequest + err = c.BindAndValidate(&req) + if err != nil { + c.String(consts.StatusBadRequest, err.Error()) + return + } + + resp := new(api.AddImagePointTimeResponse) + + c.JSON(consts.StatusOK, resp) +} diff --git a/cmd/api/biz/handler/api/user_service.go b/cmd/api/biz/handler/api/user_service.go new file mode 100644 index 0000000..6dc5658 --- /dev/null +++ b/cmd/api/biz/handler/api/user_service.go @@ -0,0 +1,80 @@ +// Code generated by hertz generator. + +package api + +import ( + "context" + "github.com/west2-online/fzuhelper-server/cmd/api/biz/pack" + "github.com/west2-online/fzuhelper-server/cmd/api/biz/rpc" + "github.com/west2-online/fzuhelper-server/kitex_gen/user" + + "github.com/cloudwego/hertz/pkg/app" + "github.com/cloudwego/hertz/pkg/protocol/consts" + api "github.com/west2-online/fzuhelper-server/cmd/api/biz/model/api" +) + +// Login . +// @Summary Login +// @Description login to get token +// @Accept json/form +// @Produce json +// @Param account query string true "account" +// @Param password query string true "密码" +// @router /launch_screen/api/login [POST] +func Login(ctx context.Context, c *app.RequestContext) { + var err error + var req api.LoginRequest + err = c.BindAndValidate(&req) + if err != nil { + c.String(consts.StatusBadRequest, err.Error()) + return + } + + resp := new(api.LoginResponse) + token, err := rpc.LoginRPC(ctx, &user.LoginRequest{ + Account: req.Account, + Password: req.Password, + }) + if err != nil { + pack.RespError(c, err) + return + } + + resp.Base = pack.BuildSuccessResp() + resp.Token = token + c.JSON(consts.StatusOK, resp) +} + +// Register . +// @Summary Register +// @Description userRegister +// @Accept json/form +// @Produce json +// @Param account query string true "account" +// @Param name query string true "name" +// @Param password query string true "密码" +// @router /launch_screen/api/register [POST] +func Register(ctx context.Context, c *app.RequestContext) { + var err error + var req api.RegisterRequest + err = c.BindAndValidate(&req) + if err != nil { + c.String(consts.StatusBadRequest, err.Error()) + return + } + + resp := new(api.RegisterResponse) + uid, err := rpc.RegisterRPC(ctx, &user.RegisterRequest{ + Account: req.Account, + Name: req.Name, + Password: req.Password, + }) + if err != nil { + pack.RespError(c, err) + return + } + + resp.Base = pack.BuildSuccessResp() + resp.UserID = uid + c.JSON(consts.StatusOK, resp) +} diff --git a/cmd/api/biz/handler/ping.go b/cmd/api/biz/handler/ping.go new file mode 100755 index 0000000..950d476 --- /dev/null +++ b/cmd/api/biz/handler/ping.go @@ -0,0 +1,18 @@ +// Code generated by hertz generator. + +package handler + +import ( + "context" + + "github.com/cloudwego/hertz/pkg/app" + "github.com/cloudwego/hertz/pkg/common/utils" + "github.com/cloudwego/hertz/pkg/protocol/consts" +) + +// Ping . +func Ping(ctx context.Context, c *app.RequestContext) { + c.JSON(consts.StatusOK, utils.H{ + "message": "pong", + }) +} diff --git a/cmd/api/biz/model/api/api.go b/cmd/api/biz/model/api/api.go new file mode 100644 index 0000000..bfca97d --- /dev/null +++ b/cmd/api/biz/model/api/api.go @@ -0,0 +1,10137 @@ +// Code generated by thriftgo (0.3.13). DO NOT EDIT. + +package api + +import ( + "context" + "fmt" + "github.com/apache/thrift/lib/go/thrift" +) + +type BaseResp struct { + Code int64 `thrift:"code,1" form:"code" json:"code" query:"code"` + Msg string `thrift:"msg,2" form:"msg" json:"msg" query:"msg"` +} + +func NewBaseResp() *BaseResp { + return &BaseResp{} +} + +func (p *BaseResp) InitDefault() { +} + +func (p *BaseResp) GetCode() (v int64) { + return p.Code +} + +func (p *BaseResp) GetMsg() (v string) { + return p.Msg +} + +var fieldIDToName_BaseResp = map[int16]string{ + 1: "code", + 2: "msg", +} + +func (p *BaseResp) 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.I64 { + 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_BaseResp[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 *BaseResp) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Code = _field + return nil +} +func (p *BaseResp) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Msg = _field + return nil +} + +func (p *BaseResp) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("BaseResp"); 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 *BaseResp) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("code", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(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 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *BaseResp) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("msg", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Msg); 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 *BaseResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BaseResp(%+v)", *p) + +} + +type User struct { + ID int64 `thrift:"id,1" form:"id" json:"id" query:"id"` + Account string `thrift:"account,2" form:"account" json:"account" query:"account"` + Name string `thrift:"name,3" form:"name" json:"name" query:"name"` +} + +func NewUser() *User { + return &User{} +} + +func (p *User) InitDefault() { +} + +func (p *User) GetID() (v int64) { + return p.ID +} + +func (p *User) GetAccount() (v string) { + return p.Account +} + +func (p *User) GetName() (v string) { + return p.Name +} + +var fieldIDToName_User = map[int16]string{ + 1: "id", + 2: "account", + 3: "name", +} + +func (p *User) 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.I64 { + 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_User[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 *User) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.ID = _field + return nil +} +func (p *User) 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 *User) ReadField3(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 *User) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("User"); 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 *User) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.ID); 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 *User) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("account", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Account); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *User) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 3); 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 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *User) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("User(%+v)", *p) + +} + +type Picture struct { + ID int64 `thrift:"id,1" form:"id" json:"id" query:"id"` + UserID int64 `thrift:"user_id,2" form:"user_id" json:"user_id" query:"user_id"` + URL string `thrift:"url,3" form:"url" json:"url" query:"url"` + Href string `thrift:"href,4" form:"href" json:"href" query:"href"` + Text string `thrift:"text,5" form:"text" json:"text" query:"text"` + PicType int64 `thrift:"pic_type,6" form:"pic_type" json:"pic_type" query:"pic_type"` + ShowTimes *int64 `thrift:"show_times,7,optional" form:"show_times" json:"show_times,omitempty" query:"show_times"` + PointTimes *int64 `thrift:"point_times,8,optional" form:"point_times" json:"point_times,omitempty" query:"point_times"` + Duration int64 `thrift:"duration,9" form:"duration" json:"duration" query:"duration"` + SType *int64 `thrift:"s_type,10,optional" form:"s_type" json:"s_type,omitempty" query:"s_type"` + Frequency int64 `thrift:"frequency,11" form:"frequency" json:"frequency" query:"frequency"` + StartAt int64 `thrift:"start_at,12" form:"start_at" json:"start_at" query:"start_at"` + EndAt int64 `thrift:"end_at,13" form:"end_at" json:"end_at" query:"end_at"` + StartTime int64 `thrift:"start_time,14" form:"start_time" json:"start_time" query:"start_time"` + EndTime int64 `thrift:"end_time,15" form:"end_time" json:"end_time" query:"end_time"` +} + +func NewPicture() *Picture { + return &Picture{} +} + +func (p *Picture) InitDefault() { +} + +func (p *Picture) GetID() (v int64) { + return p.ID +} + +func (p *Picture) GetUserID() (v int64) { + return p.UserID +} + +func (p *Picture) GetURL() (v string) { + return p.URL +} + +func (p *Picture) GetHref() (v string) { + return p.Href +} + +func (p *Picture) GetText() (v string) { + return p.Text +} + +func (p *Picture) GetPicType() (v int64) { + return p.PicType +} + +var Picture_ShowTimes_DEFAULT int64 + +func (p *Picture) GetShowTimes() (v int64) { + if !p.IsSetShowTimes() { + return Picture_ShowTimes_DEFAULT + } + return *p.ShowTimes +} + +var Picture_PointTimes_DEFAULT int64 + +func (p *Picture) GetPointTimes() (v int64) { + if !p.IsSetPointTimes() { + return Picture_PointTimes_DEFAULT + } + return *p.PointTimes +} + +func (p *Picture) GetDuration() (v int64) { + return p.Duration +} + +var Picture_SType_DEFAULT int64 + +func (p *Picture) GetSType() (v int64) { + if !p.IsSetSType() { + return Picture_SType_DEFAULT + } + return *p.SType +} + +func (p *Picture) GetFrequency() (v int64) { + return p.Frequency +} + +func (p *Picture) GetStartAt() (v int64) { + return p.StartAt +} + +func (p *Picture) GetEndAt() (v int64) { + return p.EndAt +} + +func (p *Picture) GetStartTime() (v int64) { + return p.StartTime +} + +func (p *Picture) GetEndTime() (v int64) { + return p.EndTime +} + +var fieldIDToName_Picture = map[int16]string{ + 1: "id", + 2: "user_id", + 3: "url", + 4: "href", + 5: "text", + 6: "pic_type", + 7: "show_times", + 8: "point_times", + 9: "duration", + 10: "s_type", + 11: "frequency", + 12: "start_at", + 13: "end_at", + 14: "start_time", + 15: "end_time", +} + +func (p *Picture) IsSetShowTimes() bool { + return p.ShowTimes != nil +} + +func (p *Picture) IsSetPointTimes() bool { + return p.PointTimes != nil +} + +func (p *Picture) IsSetSType() bool { + return p.SType != nil +} + +func (p *Picture) 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.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.I64 { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRING { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.STRING { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.I64 { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.I64 { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 8: + if fieldTypeId == thrift.I64 { + if err = p.ReadField8(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 9: + if fieldTypeId == thrift.I64 { + if err = p.ReadField9(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 10: + if fieldTypeId == thrift.I64 { + if err = p.ReadField10(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 11: + if fieldTypeId == thrift.I64 { + if err = p.ReadField11(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 12: + if fieldTypeId == thrift.I64 { + if err = p.ReadField12(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 13: + if fieldTypeId == thrift.I64 { + if err = p.ReadField13(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 14: + if fieldTypeId == thrift.I64 { + if err = p.ReadField14(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 15: + if fieldTypeId == thrift.I64 { + if err = p.ReadField15(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_Picture[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 *Picture) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.ID = _field + return nil +} +func (p *Picture) ReadField2(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.UserID = _field + return nil +} +func (p *Picture) 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 *Picture) ReadField4(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Href = _field + return nil +} +func (p *Picture) ReadField5(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Text = _field + return nil +} +func (p *Picture) ReadField6(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.PicType = _field + return nil +} +func (p *Picture) ReadField7(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.ShowTimes = _field + return nil +} +func (p *Picture) ReadField8(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.PointTimes = _field + return nil +} +func (p *Picture) ReadField9(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Duration = _field + return nil +} +func (p *Picture) ReadField10(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.SType = _field + return nil +} +func (p *Picture) ReadField11(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Frequency = _field + return nil +} +func (p *Picture) ReadField12(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.StartAt = _field + return nil +} +func (p *Picture) ReadField13(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.EndAt = _field + return nil +} +func (p *Picture) ReadField14(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.StartTime = _field + return nil +} +func (p *Picture) ReadField15(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.EndTime = _field + return nil +} + +func (p *Picture) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Picture"); 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 = p.writeField8(oprot); err != nil { + fieldId = 8 + goto WriteFieldError + } + if err = p.writeField9(oprot); err != nil { + fieldId = 9 + goto WriteFieldError + } + if err = p.writeField10(oprot); err != nil { + fieldId = 10 + goto WriteFieldError + } + if err = p.writeField11(oprot); err != nil { + fieldId = 11 + goto WriteFieldError + } + if err = p.writeField12(oprot); err != nil { + fieldId = 12 + goto WriteFieldError + } + if err = p.writeField13(oprot); err != nil { + fieldId = 13 + goto WriteFieldError + } + if err = p.writeField14(oprot); err != nil { + fieldId = 14 + goto WriteFieldError + } + if err = p.writeField15(oprot); err != nil { + fieldId = 15 + 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 *Picture) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.ID); 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 *Picture) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("user_id", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.UserID); 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 *Picture) 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 *Picture) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("href", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Href); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *Picture) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("text", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Text); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *Picture) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("pic_type", thrift.I64, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.PicType); 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 *Picture) writeField7(oprot thrift.TProtocol) (err error) { + if p.IsSetShowTimes() { + if err = oprot.WriteFieldBegin("show_times", thrift.I64, 7); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.ShowTimes); 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 *Picture) writeField8(oprot thrift.TProtocol) (err error) { + if p.IsSetPointTimes() { + if err = oprot.WriteFieldBegin("point_times", thrift.I64, 8); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.PointTimes); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) +} + +func (p *Picture) writeField9(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("duration", thrift.I64, 9); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.Duration); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) +} + +func (p *Picture) writeField10(oprot thrift.TProtocol) (err error) { + if p.IsSetSType() { + if err = oprot.WriteFieldBegin("s_type", thrift.I64, 10); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.SType); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) +} + +func (p *Picture) writeField11(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("frequency", thrift.I64, 11); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.Frequency); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) +} + +func (p *Picture) writeField12(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("start_at", thrift.I64, 12); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.StartAt); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) +} + +func (p *Picture) writeField13(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("end_at", thrift.I64, 13); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.EndAt); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 13 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 13 end error: ", p), err) +} + +func (p *Picture) writeField14(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("start_time", thrift.I64, 14); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.StartTime); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 14 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 14 end error: ", p), err) +} + +func (p *Picture) writeField15(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("end_time", thrift.I64, 15); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.EndTime); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 15 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 15 end error: ", p), err) +} + +func (p *Picture) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Picture(%+v)", *p) + +} + +type RegisterRequest struct { + Account string `thrift:"account,1,required" form:"account,required" json:"account,required" query:"account,required"` + Name string `thrift:"name,2,required" form:"name,required" json:"name,required" query:"name,required"` + Password string `thrift:"password,3,required" form:"password,required" json:"password,required" query:"password,required"` +} + +func NewRegisterRequest() *RegisterRequest { + return &RegisterRequest{} +} + +func (p *RegisterRequest) InitDefault() { +} + +func (p *RegisterRequest) GetAccount() (v string) { + return p.Account +} + +func (p *RegisterRequest) GetName() (v string) { + return p.Name +} + +func (p *RegisterRequest) GetPassword() (v string) { + return p.Password +} + +var fieldIDToName_RegisterRequest = map[int16]string{ + 1: "account", + 2: "name", + 3: "password", +} + +func (p *RegisterRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetAccount bool = false + var issetName 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 + } + issetAccount = 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 + } + issetName = 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 + } + 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 !issetAccount { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetName { + fieldId = 2 + goto RequiredFieldNotSetError + } + + if !issetPassword { + 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_RegisterRequest[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_RegisterRequest[fieldId])) +} + +func (p *RegisterRequest) 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 *RegisterRequest) ReadField2(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 *RegisterRequest) ReadField3(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 *RegisterRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("RegisterRequest"); 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 *RegisterRequest) writeField1(oprot thrift.TProtocol) (err error) { + 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 *RegisterRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 2); 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 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *RegisterRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("password", thrift.STRING, 3); 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 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *RegisterRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RegisterRequest(%+v)", *p) + +} + +type RegisterResponse struct { + Base *BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` + UserID *int64 `thrift:"user_id,2,optional" form:"user_id" json:"user_id,omitempty" query:"user_id"` +} + +func NewRegisterResponse() *RegisterResponse { + return &RegisterResponse{} +} + +func (p *RegisterResponse) InitDefault() { +} + +var RegisterResponse_Base_DEFAULT *BaseResp + +func (p *RegisterResponse) GetBase() (v *BaseResp) { + if !p.IsSetBase() { + return RegisterResponse_Base_DEFAULT + } + return p.Base +} + +var RegisterResponse_UserID_DEFAULT int64 + +func (p *RegisterResponse) GetUserID() (v int64) { + if !p.IsSetUserID() { + return RegisterResponse_UserID_DEFAULT + } + return *p.UserID +} + +var fieldIDToName_RegisterResponse = map[int16]string{ + 1: "base", + 2: "user_id", +} + +func (p *RegisterResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *RegisterResponse) IsSetUserID() bool { + return p.UserID != nil +} + +func (p *RegisterResponse) 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.I64 { + 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_RegisterResponse[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 *RegisterResponse) ReadField1(iprot thrift.TProtocol) error { + _field := NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *RegisterResponse) ReadField2(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.UserID = _field + return nil +} + +func (p *RegisterResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("RegisterResponse"); 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 *RegisterResponse) 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 *RegisterResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetUserID() { + if err = oprot.WriteFieldBegin("user_id", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.UserID); 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 *RegisterResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RegisterResponse(%+v)", *p) + +} + +type LoginRequest struct { + Account string `thrift:"account,1" form:"account" json:"account" query:"account"` + Password string `thrift:"password,2" form:"password" json:"password" query:"password"` +} + +func NewLoginRequest() *LoginRequest { + return &LoginRequest{} +} + +func (p *LoginRequest) InitDefault() { +} + +func (p *LoginRequest) GetAccount() (v string) { + return p.Account +} + +func (p *LoginRequest) GetPassword() (v string) { + return p.Password +} + +var fieldIDToName_LoginRequest = map[int16]string{ + 1: "account", + 2: "password", +} + +func (p *LoginRequest) 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 + } + 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_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) +} + +func (p *LoginRequest) 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 *LoginRequest) ReadField2(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 = 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 *LoginRequest) writeField1(oprot thrift.TProtocol) (err error) { + 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 *LoginRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("password", thrift.STRING, 2); 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 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *LoginRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LoginRequest(%+v)", *p) + +} + +type LoginResponse struct { + Base *BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` + Token *string `thrift:"token,2,optional" form:"token" json:"token,omitempty" query:"token"` +} + +func NewLoginResponse() *LoginResponse { + return &LoginResponse{} +} + +func (p *LoginResponse) InitDefault() { +} + +var LoginResponse_Base_DEFAULT *BaseResp + +func (p *LoginResponse) GetBase() (v *BaseResp) { + if !p.IsSetBase() { + return LoginResponse_Base_DEFAULT + } + return p.Base +} + +var LoginResponse_Token_DEFAULT string + +func (p *LoginResponse) GetToken() (v string) { + if !p.IsSetToken() { + return LoginResponse_Token_DEFAULT + } + return *p.Token +} + +var fieldIDToName_LoginResponse = map[int16]string{ + 1: "base", + 2: "token", +} + +func (p *LoginResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *LoginResponse) IsSetToken() bool { + return p.Token != 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 + } + 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_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 := NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *LoginResponse) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Token = _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 = 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 *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) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetToken() { + if err = oprot.WriteFieldBegin("token", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Token); 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 *LoginResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LoginResponse(%+v)", *p) + +} + +type CreateImageRequest struct { + //1为空,2为页面跳转,3为app跳转 + PicType int64 `thrift:"pic_type,1,required" form:"pic_type,required" json:"pic_type,required" query:"pic_type,required"` + Duration *int64 `thrift:"duration,2,optional" form:"duration" json:"duration,omitempty" query:"duration"` + //连接 + Href *string `thrift:"href,3,optional" form:"href" json:"href,omitempty" query:"href"` + Image []byte `thrift:"image,4" form:"image" json:"image" query:"image"` + StartAt int64 `thrift:"start_at,5,required" form:"start_at,required" json:"start_at,required" query:"start_at,required"` + EndAt int64 `thrift:"end_at,6,required" form:"end_at,required" json:"end_at,required" query:"end_at,required"` + SType int64 `thrift:"s_type,7,required" form:"s_type,required" json:"s_type,required" query:"s_type,required"` + //单日最大展示次数 + Frequency int64 `thrift:"frequency,8,required" form:"frequency,required" json:"frequency,required" query:"frequency,required"` + //比如6表示6点 + StartTime int64 `thrift:"start_time,9,required" form:"start_time,required" json:"start_time,required" query:"start_time,required"` + EndTime int64 `thrift:"end_time,10,required" form:"end_time,required" json:"end_time,required" query:"end_time,required"` + //描述图片 + Text string `thrift:"text,11,required" form:"text,required" json:"text,required" query:"text,required"` + //正则匹配项 + Regex string `thrift:"regex,12" form:"regex" json:"regex" query:"regex"` + //get by token + UserID int64 `thrift:"user_id,13" form:"user_id" json:"user_id" query:"user_id"` +} + +func NewCreateImageRequest() *CreateImageRequest { + return &CreateImageRequest{} +} + +func (p *CreateImageRequest) InitDefault() { +} + +func (p *CreateImageRequest) GetPicType() (v int64) { + return p.PicType +} + +var CreateImageRequest_Duration_DEFAULT int64 + +func (p *CreateImageRequest) GetDuration() (v int64) { + if !p.IsSetDuration() { + return CreateImageRequest_Duration_DEFAULT + } + return *p.Duration +} + +var CreateImageRequest_Href_DEFAULT string + +func (p *CreateImageRequest) GetHref() (v string) { + if !p.IsSetHref() { + return CreateImageRequest_Href_DEFAULT + } + return *p.Href +} + +func (p *CreateImageRequest) GetImage() (v []byte) { + return p.Image +} + +func (p *CreateImageRequest) GetStartAt() (v int64) { + return p.StartAt +} + +func (p *CreateImageRequest) GetEndAt() (v int64) { + return p.EndAt +} + +func (p *CreateImageRequest) GetSType() (v int64) { + return p.SType +} + +func (p *CreateImageRequest) GetFrequency() (v int64) { + return p.Frequency +} + +func (p *CreateImageRequest) GetStartTime() (v int64) { + return p.StartTime +} + +func (p *CreateImageRequest) GetEndTime() (v int64) { + return p.EndTime +} + +func (p *CreateImageRequest) GetText() (v string) { + return p.Text +} + +func (p *CreateImageRequest) GetRegex() (v string) { + return p.Regex +} + +func (p *CreateImageRequest) GetUserID() (v int64) { + return p.UserID +} + +var fieldIDToName_CreateImageRequest = map[int16]string{ + 1: "pic_type", + 2: "duration", + 3: "href", + 4: "image", + 5: "start_at", + 6: "end_at", + 7: "s_type", + 8: "frequency", + 9: "start_time", + 10: "end_time", + 11: "text", + 12: "regex", + 13: "user_id", +} + +func (p *CreateImageRequest) IsSetDuration() bool { + return p.Duration != nil +} + +func (p *CreateImageRequest) IsSetHref() bool { + return p.Href != nil +} + +func (p *CreateImageRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetPicType bool = false + var issetImage bool = false + var issetStartAt bool = false + var issetEndAt bool = false + var issetSType bool = false + var issetFrequency bool = false + var issetStartTime bool = false + var issetEndTime bool = false + var issetText bool = false + + 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.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetPicType = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.I64 { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRING { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + issetImage = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.I64 { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + issetStartAt = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.I64 { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + issetEndAt = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.I64 { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + issetSType = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 8: + if fieldTypeId == thrift.I64 { + if err = p.ReadField8(iprot); err != nil { + goto ReadFieldError + } + issetFrequency = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 9: + if fieldTypeId == thrift.I64 { + if err = p.ReadField9(iprot); err != nil { + goto ReadFieldError + } + issetStartTime = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 10: + if fieldTypeId == thrift.I64 { + if err = p.ReadField10(iprot); err != nil { + goto ReadFieldError + } + issetEndTime = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 11: + if fieldTypeId == thrift.STRING { + if err = p.ReadField11(iprot); err != nil { + goto ReadFieldError + } + issetText = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 12: + if fieldTypeId == thrift.STRING { + if err = p.ReadField12(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 13: + if fieldTypeId == thrift.I64 { + if err = p.ReadField13(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + if !issetPicType { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetImage { + fieldId = 4 + goto RequiredFieldNotSetError + } + + if !issetStartAt { + fieldId = 5 + goto RequiredFieldNotSetError + } + + if !issetEndAt { + fieldId = 6 + goto RequiredFieldNotSetError + } + + if !issetSType { + fieldId = 7 + goto RequiredFieldNotSetError + } + + if !issetFrequency { + fieldId = 8 + goto RequiredFieldNotSetError + } + + if !issetStartTime { + fieldId = 9 + goto RequiredFieldNotSetError + } + + if !issetEndTime { + fieldId = 10 + goto RequiredFieldNotSetError + } + + if !issetText { + fieldId = 11 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CreateImageRequest[fieldId]), err) +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_CreateImageRequest[fieldId])) +} + +func (p *CreateImageRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.PicType = _field + return nil +} +func (p *CreateImageRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.Duration = _field + return nil +} +func (p *CreateImageRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Href = _field + return nil +} +func (p *CreateImageRequest) ReadField4(iprot thrift.TProtocol) error { + + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { + return err + } else { + _field = []byte(v) + } + p.Image = _field + return nil +} +func (p *CreateImageRequest) ReadField5(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.StartAt = _field + return nil +} +func (p *CreateImageRequest) ReadField6(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.EndAt = _field + return nil +} +func (p *CreateImageRequest) ReadField7(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.SType = _field + return nil +} +func (p *CreateImageRequest) ReadField8(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Frequency = _field + return nil +} +func (p *CreateImageRequest) ReadField9(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.StartTime = _field + return nil +} +func (p *CreateImageRequest) ReadField10(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.EndTime = _field + return nil +} +func (p *CreateImageRequest) ReadField11(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Text = _field + return nil +} +func (p *CreateImageRequest) ReadField12(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Regex = _field + return nil +} +func (p *CreateImageRequest) ReadField13(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.UserID = _field + return nil +} + +func (p *CreateImageRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("CreateImageRequest"); 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 = p.writeField8(oprot); err != nil { + fieldId = 8 + goto WriteFieldError + } + if err = p.writeField9(oprot); err != nil { + fieldId = 9 + goto WriteFieldError + } + if err = p.writeField10(oprot); err != nil { + fieldId = 10 + goto WriteFieldError + } + if err = p.writeField11(oprot); err != nil { + fieldId = 11 + goto WriteFieldError + } + if err = p.writeField12(oprot); err != nil { + fieldId = 12 + goto WriteFieldError + } + if err = p.writeField13(oprot); err != nil { + fieldId = 13 + 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 *CreateImageRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("pic_type", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.PicType); 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 *CreateImageRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetDuration() { + if err = oprot.WriteFieldBegin("duration", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.Duration); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetHref() { + if err = oprot.WriteFieldBegin("href", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Href); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("image", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBinary([]byte(p.Image)); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("start_at", thrift.I64, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.StartAt); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("end_at", thrift.I64, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.EndAt); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField7(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("s_type", thrift.I64, 7); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.SType); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField8(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("frequency", thrift.I64, 8); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.Frequency); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField9(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("start_time", thrift.I64, 9); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.StartTime); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField10(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("end_time", thrift.I64, 10); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.EndTime); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField11(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("text", thrift.STRING, 11); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Text); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField12(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("regex", thrift.STRING, 12); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Regex); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField13(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("user_id", thrift.I64, 13); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.UserID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 13 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 13 end error: ", p), err) +} + +func (p *CreateImageRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateImageRequest(%+v)", *p) + +} + +type CreateImageResponse struct { + Base *BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` + Picture *Picture `thrift:"picture,2,optional" form:"picture" json:"picture,omitempty" query:"picture"` +} + +func NewCreateImageResponse() *CreateImageResponse { + return &CreateImageResponse{} +} + +func (p *CreateImageResponse) InitDefault() { +} + +var CreateImageResponse_Base_DEFAULT *BaseResp + +func (p *CreateImageResponse) GetBase() (v *BaseResp) { + if !p.IsSetBase() { + return CreateImageResponse_Base_DEFAULT + } + return p.Base +} + +var CreateImageResponse_Picture_DEFAULT *Picture + +func (p *CreateImageResponse) GetPicture() (v *Picture) { + if !p.IsSetPicture() { + return CreateImageResponse_Picture_DEFAULT + } + return p.Picture +} + +var fieldIDToName_CreateImageResponse = map[int16]string{ + 1: "base", + 2: "picture", +} + +func (p *CreateImageResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *CreateImageResponse) IsSetPicture() bool { + return p.Picture != nil +} + +func (p *CreateImageResponse) 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.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CreateImageResponse[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 *CreateImageResponse) ReadField1(iprot thrift.TProtocol) error { + _field := NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *CreateImageResponse) ReadField2(iprot thrift.TProtocol) error { + _field := NewPicture() + if err := _field.Read(iprot); err != nil { + return err + } + p.Picture = _field + return nil +} + +func (p *CreateImageResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("CreateImageResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + 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 *CreateImageResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + 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 *CreateImageResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPicture() { + if err = oprot.WriteFieldBegin("picture", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Picture.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + 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 *CreateImageResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateImageResponse(%+v)", *p) + +} + +type GetImageRequest struct { + PictureID int64 `thrift:"picture_id,1,required" form:"picture_id,required" json:"picture_id,required" query:"picture_id,required"` + UserID int64 `thrift:"user_id,2" form:"user_id" json:"user_id" query:"user_id"` +} + +func NewGetImageRequest() *GetImageRequest { + return &GetImageRequest{} +} + +func (p *GetImageRequest) InitDefault() { +} + +func (p *GetImageRequest) GetPictureID() (v int64) { + return p.PictureID +} + +func (p *GetImageRequest) GetUserID() (v int64) { + return p.UserID +} + +var fieldIDToName_GetImageRequest = map[int16]string{ + 1: "picture_id", + 2: "user_id", +} + +func (p *GetImageRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetPictureID bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetPictureID = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.I64 { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + if !issetPictureID { + 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_GetImageRequest[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetImageRequest[fieldId])) +} + +func (p *GetImageRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.PictureID = _field + return nil +} +func (p *GetImageRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.UserID = _field + return nil +} + +func (p *GetImageRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetImageRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = 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 *GetImageRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("picture_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.PictureID); err != nil { + return err + } + 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 *GetImageRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("user_id", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.UserID); 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 *GetImageRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetImageRequest(%+v)", *p) + +} + +type GetImageResponse struct { + Base *BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` + Picture *Picture `thrift:"picture,2,optional" form:"picture" json:"picture,omitempty" query:"picture"` +} + +func NewGetImageResponse() *GetImageResponse { + return &GetImageResponse{} +} + +func (p *GetImageResponse) InitDefault() { +} + +var GetImageResponse_Base_DEFAULT *BaseResp + +func (p *GetImageResponse) GetBase() (v *BaseResp) { + if !p.IsSetBase() { + return GetImageResponse_Base_DEFAULT + } + return p.Base +} + +var GetImageResponse_Picture_DEFAULT *Picture + +func (p *GetImageResponse) GetPicture() (v *Picture) { + if !p.IsSetPicture() { + return GetImageResponse_Picture_DEFAULT + } + return p.Picture +} + +var fieldIDToName_GetImageResponse = map[int16]string{ + 1: "base", + 2: "picture", +} + +func (p *GetImageResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *GetImageResponse) IsSetPicture() bool { + return p.Picture != nil +} + +func (p *GetImageResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetImageResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *GetImageResponse) ReadField1(iprot thrift.TProtocol) error { + _field := NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *GetImageResponse) ReadField2(iprot thrift.TProtocol) error { + _field := NewPicture() + if err := _field.Read(iprot); err != nil { + return err + } + p.Picture = _field + return nil +} + +func (p *GetImageResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetImageResponse"); 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 *GetImageResponse) 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 *GetImageResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPicture() { + if err = oprot.WriteFieldBegin("picture", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Picture.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *GetImageResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetImageResponse(%+v)", *p) + +} + +type GetImagesByUserIdRequest struct { + UserID int64 `thrift:"user_id,1" form:"user_id" json:"user_id" query:"user_id"` +} + +func NewGetImagesByUserIdRequest() *GetImagesByUserIdRequest { + return &GetImagesByUserIdRequest{} +} + +func (p *GetImagesByUserIdRequest) InitDefault() { +} + +func (p *GetImagesByUserIdRequest) GetUserID() (v int64) { + return p.UserID +} + +var fieldIDToName_GetImagesByUserIdRequest = map[int16]string{ + 1: "user_id", +} + +func (p *GetImagesByUserIdRequest) 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.I64 { + 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_GetImagesByUserIdRequest[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 *GetImagesByUserIdRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.UserID = _field + return nil +} + +func (p *GetImagesByUserIdRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetImagesByUserIdRequest"); 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 *GetImagesByUserIdRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("user_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.UserID); 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 *GetImagesByUserIdRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetImagesByUserIdRequest(%+v)", *p) + +} + +type GetImagesByUserIdResponse struct { + Base *BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` + PictureList []*Picture `thrift:"picture_list,2,optional" form:"picture_list" json:"picture_list,omitempty" query:"picture_list"` +} + +func NewGetImagesByUserIdResponse() *GetImagesByUserIdResponse { + return &GetImagesByUserIdResponse{} +} + +func (p *GetImagesByUserIdResponse) InitDefault() { +} + +var GetImagesByUserIdResponse_Base_DEFAULT *BaseResp + +func (p *GetImagesByUserIdResponse) GetBase() (v *BaseResp) { + if !p.IsSetBase() { + return GetImagesByUserIdResponse_Base_DEFAULT + } + return p.Base +} + +var GetImagesByUserIdResponse_PictureList_DEFAULT []*Picture + +func (p *GetImagesByUserIdResponse) GetPictureList() (v []*Picture) { + if !p.IsSetPictureList() { + return GetImagesByUserIdResponse_PictureList_DEFAULT + } + return p.PictureList +} + +var fieldIDToName_GetImagesByUserIdResponse = map[int16]string{ + 1: "base", + 2: "picture_list", +} + +func (p *GetImagesByUserIdResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *GetImagesByUserIdResponse) IsSetPictureList() bool { + return p.PictureList != nil +} + +func (p *GetImagesByUserIdResponse) 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.LIST { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetImagesByUserIdResponse[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 *GetImagesByUserIdResponse) ReadField1(iprot thrift.TProtocol) error { + _field := NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *GetImagesByUserIdResponse) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*Picture, 0, size) + values := make([]Picture, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.PictureList = _field + return nil +} + +func (p *GetImagesByUserIdResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetImagesByUserIdResponse"); 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 *GetImagesByUserIdResponse) 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 *GetImagesByUserIdResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPictureList() { + if err = oprot.WriteFieldBegin("picture_list", thrift.LIST, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.PictureList)); err != nil { + return err + } + for _, v := range p.PictureList { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *GetImagesByUserIdResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetImagesByUserIdResponse(%+v)", *p) + +} + +type ChangeImagePropertyRequest struct { + //1为空,2为页面跳转,3为app跳转 + PicType int64 `thrift:"pic_type,1,required" form:"pic_type,required" json:"pic_type,required" query:"pic_type,required"` + Duration *int64 `thrift:"duration,2,optional" form:"duration" json:"duration,omitempty" query:"duration"` + //连接 + Href *string `thrift:"href,3,optional" form:"href" json:"href,omitempty" query:"href"` + StartAt int64 `thrift:"start_at,4,required" form:"start_at,required" json:"start_at,required" query:"start_at,required"` + EndAt int64 `thrift:"end_at,5,required" form:"end_at,required" json:"end_at,required" query:"end_at,required"` + SType int64 `thrift:"s_type,6,required" form:"s_type,required" json:"s_type,required" query:"s_type,required"` + Frequency int64 `thrift:"frequency,7,required" form:"frequency,required" json:"frequency,required" query:"frequency,required"` + //比如6表示6点 + StartTime int64 `thrift:"start_time,8,required" form:"start_time,required" json:"start_time,required" query:"start_time,required"` + EndTime int64 `thrift:"end_time,9,required" form:"end_time,required" json:"end_time,required" query:"end_time,required"` + //描述图片 + Text string `thrift:"text,10,required" form:"text,required" json:"text,required" query:"text,required"` + //正则匹配项 + Regex string `thrift:"regex,11" form:"regex" json:"regex" query:"regex"` + //get by token + UserID int64 `thrift:"user_id,12" form:"user_id" json:"user_id" query:"user_id"` +} + +func NewChangeImagePropertyRequest() *ChangeImagePropertyRequest { + return &ChangeImagePropertyRequest{} +} + +func (p *ChangeImagePropertyRequest) InitDefault() { +} + +func (p *ChangeImagePropertyRequest) GetPicType() (v int64) { + return p.PicType +} + +var ChangeImagePropertyRequest_Duration_DEFAULT int64 + +func (p *ChangeImagePropertyRequest) GetDuration() (v int64) { + if !p.IsSetDuration() { + return ChangeImagePropertyRequest_Duration_DEFAULT + } + return *p.Duration +} + +var ChangeImagePropertyRequest_Href_DEFAULT string + +func (p *ChangeImagePropertyRequest) GetHref() (v string) { + if !p.IsSetHref() { + return ChangeImagePropertyRequest_Href_DEFAULT + } + return *p.Href +} + +func (p *ChangeImagePropertyRequest) GetStartAt() (v int64) { + return p.StartAt +} + +func (p *ChangeImagePropertyRequest) GetEndAt() (v int64) { + return p.EndAt +} + +func (p *ChangeImagePropertyRequest) GetSType() (v int64) { + return p.SType +} + +func (p *ChangeImagePropertyRequest) GetFrequency() (v int64) { + return p.Frequency +} + +func (p *ChangeImagePropertyRequest) GetStartTime() (v int64) { + return p.StartTime +} + +func (p *ChangeImagePropertyRequest) GetEndTime() (v int64) { + return p.EndTime +} + +func (p *ChangeImagePropertyRequest) GetText() (v string) { + return p.Text +} + +func (p *ChangeImagePropertyRequest) GetRegex() (v string) { + return p.Regex +} + +func (p *ChangeImagePropertyRequest) GetUserID() (v int64) { + return p.UserID +} + +var fieldIDToName_ChangeImagePropertyRequest = map[int16]string{ + 1: "pic_type", + 2: "duration", + 3: "href", + 4: "start_at", + 5: "end_at", + 6: "s_type", + 7: "frequency", + 8: "start_time", + 9: "end_time", + 10: "text", + 11: "regex", + 12: "user_id", +} + +func (p *ChangeImagePropertyRequest) IsSetDuration() bool { + return p.Duration != nil +} + +func (p *ChangeImagePropertyRequest) IsSetHref() bool { + return p.Href != nil +} + +func (p *ChangeImagePropertyRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetPicType bool = false + var issetStartAt bool = false + var issetEndAt bool = false + var issetSType bool = false + var issetFrequency bool = false + var issetStartTime bool = false + var issetEndTime bool = false + var issetText bool = false + + 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.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetPicType = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.I64 { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.I64 { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + issetStartAt = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.I64 { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + issetEndAt = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.I64 { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + issetSType = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.I64 { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + issetFrequency = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 8: + if fieldTypeId == thrift.I64 { + if err = p.ReadField8(iprot); err != nil { + goto ReadFieldError + } + issetStartTime = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 9: + if fieldTypeId == thrift.I64 { + if err = p.ReadField9(iprot); err != nil { + goto ReadFieldError + } + issetEndTime = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 10: + if fieldTypeId == thrift.STRING { + if err = p.ReadField10(iprot); err != nil { + goto ReadFieldError + } + issetText = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 11: + if fieldTypeId == thrift.STRING { + if err = p.ReadField11(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 12: + if fieldTypeId == thrift.I64 { + if err = p.ReadField12(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + if !issetPicType { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetStartAt { + fieldId = 4 + goto RequiredFieldNotSetError + } + + if !issetEndAt { + fieldId = 5 + goto RequiredFieldNotSetError + } + + if !issetSType { + fieldId = 6 + goto RequiredFieldNotSetError + } + + if !issetFrequency { + fieldId = 7 + goto RequiredFieldNotSetError + } + + if !issetStartTime { + fieldId = 8 + goto RequiredFieldNotSetError + } + + if !issetEndTime { + fieldId = 9 + goto RequiredFieldNotSetError + } + + if !issetText { + fieldId = 10 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(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_ChangeImagePropertyRequest[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_ChangeImagePropertyRequest[fieldId])) +} + +func (p *ChangeImagePropertyRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.PicType = _field + return nil +} +func (p *ChangeImagePropertyRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.Duration = _field + return nil +} +func (p *ChangeImagePropertyRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Href = _field + return nil +} +func (p *ChangeImagePropertyRequest) ReadField4(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.StartAt = _field + return nil +} +func (p *ChangeImagePropertyRequest) ReadField5(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.EndAt = _field + return nil +} +func (p *ChangeImagePropertyRequest) ReadField6(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.SType = _field + return nil +} +func (p *ChangeImagePropertyRequest) ReadField7(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Frequency = _field + return nil +} +func (p *ChangeImagePropertyRequest) ReadField8(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.StartTime = _field + return nil +} +func (p *ChangeImagePropertyRequest) ReadField9(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.EndTime = _field + return nil +} +func (p *ChangeImagePropertyRequest) ReadField10(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Text = _field + return nil +} +func (p *ChangeImagePropertyRequest) ReadField11(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Regex = _field + return nil +} +func (p *ChangeImagePropertyRequest) ReadField12(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.UserID = _field + return nil +} + +func (p *ChangeImagePropertyRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ChangeImagePropertyRequest"); 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 = p.writeField8(oprot); err != nil { + fieldId = 8 + goto WriteFieldError + } + if err = p.writeField9(oprot); err != nil { + fieldId = 9 + goto WriteFieldError + } + if err = p.writeField10(oprot); err != nil { + fieldId = 10 + goto WriteFieldError + } + if err = p.writeField11(oprot); err != nil { + fieldId = 11 + goto WriteFieldError + } + if err = p.writeField12(oprot); err != nil { + fieldId = 12 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + 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 *ChangeImagePropertyRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("pic_type", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.PicType); 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 *ChangeImagePropertyRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetDuration() { + if err = oprot.WriteFieldBegin("duration", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.Duration); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetHref() { + if err = oprot.WriteFieldBegin("href", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Href); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("start_at", thrift.I64, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.StartAt); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("end_at", thrift.I64, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.EndAt); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("s_type", thrift.I64, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.SType); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) writeField7(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("frequency", thrift.I64, 7); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.Frequency); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) writeField8(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("start_time", thrift.I64, 8); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.StartTime); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) writeField9(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("end_time", thrift.I64, 9); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.EndTime); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) writeField10(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("text", thrift.STRING, 10); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Text); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) writeField11(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("regex", thrift.STRING, 11); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Regex); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) writeField12(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("user_id", thrift.I64, 12); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.UserID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ChangeImagePropertyRequest(%+v)", *p) + +} + +type ChangeImagePropertyResponse struct { + Base *BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` + Picture *Picture `thrift:"picture,2,optional" form:"picture" json:"picture,omitempty" query:"picture"` +} + +func NewChangeImagePropertyResponse() *ChangeImagePropertyResponse { + return &ChangeImagePropertyResponse{} +} + +func (p *ChangeImagePropertyResponse) InitDefault() { +} + +var ChangeImagePropertyResponse_Base_DEFAULT *BaseResp + +func (p *ChangeImagePropertyResponse) GetBase() (v *BaseResp) { + if !p.IsSetBase() { + return ChangeImagePropertyResponse_Base_DEFAULT + } + return p.Base +} + +var ChangeImagePropertyResponse_Picture_DEFAULT *Picture + +func (p *ChangeImagePropertyResponse) GetPicture() (v *Picture) { + if !p.IsSetPicture() { + return ChangeImagePropertyResponse_Picture_DEFAULT + } + return p.Picture +} + +var fieldIDToName_ChangeImagePropertyResponse = map[int16]string{ + 1: "base", + 2: "picture", +} + +func (p *ChangeImagePropertyResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *ChangeImagePropertyResponse) IsSetPicture() bool { + return p.Picture != nil +} + +func (p *ChangeImagePropertyResponse) 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.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ChangeImagePropertyResponse[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 *ChangeImagePropertyResponse) ReadField1(iprot thrift.TProtocol) error { + _field := NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *ChangeImagePropertyResponse) ReadField2(iprot thrift.TProtocol) error { + _field := NewPicture() + if err := _field.Read(iprot); err != nil { + return err + } + p.Picture = _field + return nil +} + +func (p *ChangeImagePropertyResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ChangeImagePropertyResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + 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 *ChangeImagePropertyResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + 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 *ChangeImagePropertyResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPicture() { + if err = oprot.WriteFieldBegin("picture", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Picture.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + 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 *ChangeImagePropertyResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ChangeImagePropertyResponse(%+v)", *p) + +} + +type ChangeImageRequest struct { + PictureID int64 `thrift:"picture_id,1,required" form:"picture_id,required" json:"picture_id,required" query:"picture_id,required"` + Image []byte `thrift:"image,2,required" form:"image,required" json:"image,required" query:"image,required"` + UserID int64 `thrift:"user_id,3" form:"user_id" json:"user_id" query:"user_id"` +} + +func NewChangeImageRequest() *ChangeImageRequest { + return &ChangeImageRequest{} +} + +func (p *ChangeImageRequest) InitDefault() { +} + +func (p *ChangeImageRequest) GetPictureID() (v int64) { + return p.PictureID +} + +func (p *ChangeImageRequest) GetImage() (v []byte) { + return p.Image +} + +func (p *ChangeImageRequest) GetUserID() (v int64) { + return p.UserID +} + +var fieldIDToName_ChangeImageRequest = map[int16]string{ + 1: "picture_id", + 2: "image", + 3: "user_id", +} + +func (p *ChangeImageRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetPictureID bool = false + var issetImage 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.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetPictureID = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + issetImage = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.I64 { + 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 + } + + if !issetPictureID { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetImage { + 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_ChangeImageRequest[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_ChangeImageRequest[fieldId])) +} + +func (p *ChangeImageRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.PictureID = _field + return nil +} +func (p *ChangeImageRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { + return err + } else { + _field = []byte(v) + } + p.Image = _field + return nil +} +func (p *ChangeImageRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.UserID = _field + return nil +} + +func (p *ChangeImageRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ChangeImageRequest"); 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 *ChangeImageRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("picture_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.PictureID); err != nil { + return err + } + 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 *ChangeImageRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("image", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBinary([]byte(p.Image)); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *ChangeImageRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("user_id", thrift.I64, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.UserID); 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 *ChangeImageRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ChangeImageRequest(%+v)", *p) + +} + +type ChangeImageResponse struct { + Base *BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` + Picture *Picture `thrift:"picture,2,optional" form:"picture" json:"picture,omitempty" query:"picture"` +} + +func NewChangeImageResponse() *ChangeImageResponse { + return &ChangeImageResponse{} +} + +func (p *ChangeImageResponse) InitDefault() { +} + +var ChangeImageResponse_Base_DEFAULT *BaseResp + +func (p *ChangeImageResponse) GetBase() (v *BaseResp) { + if !p.IsSetBase() { + return ChangeImageResponse_Base_DEFAULT + } + return p.Base +} + +var ChangeImageResponse_Picture_DEFAULT *Picture + +func (p *ChangeImageResponse) GetPicture() (v *Picture) { + if !p.IsSetPicture() { + return ChangeImageResponse_Picture_DEFAULT + } + return p.Picture +} + +var fieldIDToName_ChangeImageResponse = map[int16]string{ + 1: "base", + 2: "picture", +} + +func (p *ChangeImageResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *ChangeImageResponse) IsSetPicture() bool { + return p.Picture != nil +} + +func (p *ChangeImageResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + 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.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ChangeImageResponse[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 *ChangeImageResponse) ReadField1(iprot thrift.TProtocol) error { + _field := NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *ChangeImageResponse) ReadField2(iprot thrift.TProtocol) error { + _field := NewPicture() + if err := _field.Read(iprot); err != nil { + return err + } + p.Picture = _field + return nil +} + +func (p *ChangeImageResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ChangeImageResponse"); 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 *ChangeImageResponse) 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 *ChangeImageResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPicture() { + if err = oprot.WriteFieldBegin("picture", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Picture.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return 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 *ChangeImageResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ChangeImageResponse(%+v)", *p) + +} + +type DeleteImageRequest struct { + PictureID int64 `thrift:"picture_id,1,required" form:"picture_id,required" json:"picture_id,required" query:"picture_id,required"` + UserID int64 `thrift:"user_id,2" form:"user_id" json:"user_id" query:"user_id"` +} + +func NewDeleteImageRequest() *DeleteImageRequest { + return &DeleteImageRequest{} +} + +func (p *DeleteImageRequest) InitDefault() { +} + +func (p *DeleteImageRequest) GetPictureID() (v int64) { + return p.PictureID +} + +func (p *DeleteImageRequest) GetUserID() (v int64) { + return p.UserID +} + +var fieldIDToName_DeleteImageRequest = map[int16]string{ + 1: "picture_id", + 2: "user_id", +} + +func (p *DeleteImageRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetPictureID bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetPictureID = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.I64 { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + if !issetPictureID { + 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_DeleteImageRequest[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_DeleteImageRequest[fieldId])) +} + +func (p *DeleteImageRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.PictureID = _field + return nil +} +func (p *DeleteImageRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.UserID = _field + return nil +} + +func (p *DeleteImageRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("DeleteImageRequest"); 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 *DeleteImageRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("picture_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.PictureID); 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 *DeleteImageRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("user_id", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.UserID); 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 *DeleteImageRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DeleteImageRequest(%+v)", *p) + +} + +type DeleteImageResponse struct { + Base *BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` + Picture *Picture `thrift:"picture,2,optional" form:"picture" json:"picture,omitempty" query:"picture"` +} + +func NewDeleteImageResponse() *DeleteImageResponse { + return &DeleteImageResponse{} +} + +func (p *DeleteImageResponse) InitDefault() { +} + +var DeleteImageResponse_Base_DEFAULT *BaseResp + +func (p *DeleteImageResponse) GetBase() (v *BaseResp) { + if !p.IsSetBase() { + return DeleteImageResponse_Base_DEFAULT + } + return p.Base +} + +var DeleteImageResponse_Picture_DEFAULT *Picture + +func (p *DeleteImageResponse) GetPicture() (v *Picture) { + if !p.IsSetPicture() { + return DeleteImageResponse_Picture_DEFAULT + } + return p.Picture +} + +var fieldIDToName_DeleteImageResponse = map[int16]string{ + 1: "base", + 2: "picture", +} + +func (p *DeleteImageResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *DeleteImageResponse) IsSetPicture() bool { + return p.Picture != nil +} + +func (p *DeleteImageResponse) 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.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DeleteImageResponse[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 *DeleteImageResponse) ReadField1(iprot thrift.TProtocol) error { + _field := NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *DeleteImageResponse) ReadField2(iprot thrift.TProtocol) error { + _field := NewPicture() + if err := _field.Read(iprot); err != nil { + return err + } + p.Picture = _field + return nil +} + +func (p *DeleteImageResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("DeleteImageResponse"); 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 *DeleteImageResponse) 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 *DeleteImageResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPicture() { + if err = oprot.WriteFieldBegin("picture", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Picture.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return 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 *DeleteImageResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DeleteImageResponse(%+v)", *p) + +} + +type MobileGetImageRequest struct { + Type int64 `thrift:"type,1,required" form:"type,required" json:"type,required" query:"type,required"` + StudentID int64 `thrift:"student_id,2,required" form:"student_id,required" json:"student_id,required" query:"student_id,required"` + College string `thrift:"college,3,required" form:"college,required" json:"college,required" query:"college,required"` + Device string `thrift:"device,4,required" form:"device,required" json:"device,required" query:"device,required"` +} + +func NewMobileGetImageRequest() *MobileGetImageRequest { + return &MobileGetImageRequest{} +} + +func (p *MobileGetImageRequest) InitDefault() { +} + +func (p *MobileGetImageRequest) GetType() (v int64) { + return p.Type +} + +func (p *MobileGetImageRequest) GetStudentID() (v int64) { + return p.StudentID +} + +func (p *MobileGetImageRequest) GetCollege() (v string) { + return p.College +} + +func (p *MobileGetImageRequest) GetDevice() (v string) { + return p.Device +} + +var fieldIDToName_MobileGetImageRequest = map[int16]string{ + 1: "type", + 2: "student_id", + 3: "college", + 4: "device", +} + +func (p *MobileGetImageRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetType bool = false + var issetStudentID bool = false + var issetCollege bool = false + var issetDevice 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.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetType = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.I64 { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + issetStudentID = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + issetCollege = 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 + } + issetDevice = 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 !issetType { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetStudentID { + fieldId = 2 + goto RequiredFieldNotSetError + } + + if !issetCollege { + fieldId = 3 + goto RequiredFieldNotSetError + } + + if !issetDevice { + fieldId = 4 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MobileGetImageRequest[fieldId]), err) +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_MobileGetImageRequest[fieldId])) +} + +func (p *MobileGetImageRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Type = _field + return nil +} +func (p *MobileGetImageRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.StudentID = _field + return nil +} +func (p *MobileGetImageRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.College = _field + return nil +} +func (p *MobileGetImageRequest) ReadField4(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Device = _field + return nil +} + +func (p *MobileGetImageRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("MobileGetImageRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *MobileGetImageRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("type", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(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 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *MobileGetImageRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("student_id", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.StudentID); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *MobileGetImageRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("college", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.College); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *MobileGetImageRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("device", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Device); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *MobileGetImageRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MobileGetImageRequest(%+v)", *p) + +} + +type MobileGetImageResponse struct { + Base *BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` + Picture *Picture `thrift:"picture,2,optional" form:"picture" json:"picture,omitempty" query:"picture"` +} + +func NewMobileGetImageResponse() *MobileGetImageResponse { + return &MobileGetImageResponse{} +} + +func (p *MobileGetImageResponse) InitDefault() { +} + +var MobileGetImageResponse_Base_DEFAULT *BaseResp + +func (p *MobileGetImageResponse) GetBase() (v *BaseResp) { + if !p.IsSetBase() { + return MobileGetImageResponse_Base_DEFAULT + } + return p.Base +} + +var MobileGetImageResponse_Picture_DEFAULT *Picture + +func (p *MobileGetImageResponse) GetPicture() (v *Picture) { + if !p.IsSetPicture() { + return MobileGetImageResponse_Picture_DEFAULT + } + return p.Picture +} + +var fieldIDToName_MobileGetImageResponse = map[int16]string{ + 1: "base", + 2: "picture", +} + +func (p *MobileGetImageResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *MobileGetImageResponse) IsSetPicture() bool { + return p.Picture != nil +} + +func (p *MobileGetImageResponse) 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.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MobileGetImageResponse[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 *MobileGetImageResponse) ReadField1(iprot thrift.TProtocol) error { + _field := NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *MobileGetImageResponse) ReadField2(iprot thrift.TProtocol) error { + _field := NewPicture() + if err := _field.Read(iprot); err != nil { + return err + } + p.Picture = _field + return nil +} + +func (p *MobileGetImageResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("MobileGetImageResponse"); 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 *MobileGetImageResponse) 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 *MobileGetImageResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPicture() { + if err = oprot.WriteFieldBegin("picture", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Picture.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *MobileGetImageResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MobileGetImageResponse(%+v)", *p) + +} + +type AddImagePointTimeRequest struct { + PictureID int64 `thrift:"picture_id,1,required" form:"picture_id,required" json:"picture_id,required" query:"picture_id,required"` +} + +func NewAddImagePointTimeRequest() *AddImagePointTimeRequest { + return &AddImagePointTimeRequest{} +} + +func (p *AddImagePointTimeRequest) InitDefault() { +} + +func (p *AddImagePointTimeRequest) GetPictureID() (v int64) { + return p.PictureID +} + +var fieldIDToName_AddImagePointTimeRequest = map[int16]string{ + 1: "picture_id", +} + +func (p *AddImagePointTimeRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetPictureID bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetPictureID = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + if !issetPictureID { + 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_AddImagePointTimeRequest[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_AddImagePointTimeRequest[fieldId])) +} + +func (p *AddImagePointTimeRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.PictureID = _field + return nil +} + +func (p *AddImagePointTimeRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("AddImagePointTimeRequest"); 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 *AddImagePointTimeRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("picture_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.PictureID); err != nil { + return err + } + 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 *AddImagePointTimeRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AddImagePointTimeRequest(%+v)", *p) + +} + +type AddImagePointTimeResponse struct { + Base *BaseResp `thrift:"base,1" form:"base" json:"base" query:"base"` + Picture *Picture `thrift:"picture,2,optional" form:"picture" json:"picture,omitempty" query:"picture"` +} + +func NewAddImagePointTimeResponse() *AddImagePointTimeResponse { + return &AddImagePointTimeResponse{} +} + +func (p *AddImagePointTimeResponse) InitDefault() { +} + +var AddImagePointTimeResponse_Base_DEFAULT *BaseResp + +func (p *AddImagePointTimeResponse) GetBase() (v *BaseResp) { + if !p.IsSetBase() { + return AddImagePointTimeResponse_Base_DEFAULT + } + return p.Base +} + +var AddImagePointTimeResponse_Picture_DEFAULT *Picture + +func (p *AddImagePointTimeResponse) GetPicture() (v *Picture) { + if !p.IsSetPicture() { + return AddImagePointTimeResponse_Picture_DEFAULT + } + return p.Picture +} + +var fieldIDToName_AddImagePointTimeResponse = map[int16]string{ + 1: "base", + 2: "picture", +} + +func (p *AddImagePointTimeResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *AddImagePointTimeResponse) IsSetPicture() bool { + return p.Picture != nil +} + +func (p *AddImagePointTimeResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + 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.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AddImagePointTimeResponse[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 *AddImagePointTimeResponse) ReadField1(iprot thrift.TProtocol) error { + _field := NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *AddImagePointTimeResponse) ReadField2(iprot thrift.TProtocol) error { + _field := NewPicture() + if err := _field.Read(iprot); err != nil { + return err + } + p.Picture = _field + return nil +} + +func (p *AddImagePointTimeResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("AddImagePointTimeResponse"); 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 *AddImagePointTimeResponse) 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 *AddImagePointTimeResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPicture() { + if err = oprot.WriteFieldBegin("picture", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Picture.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return 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 *AddImagePointTimeResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AddImagePointTimeResponse(%+v)", *p) + +} + +type UserService interface { + Login(ctx context.Context, req *LoginRequest) (r *LoginResponse, err error) + //test for backend + Register(ctx context.Context, req *RegisterRequest) (r *RegisterResponse, err error) +} + +type UserServiceClient struct { + c thrift.TClient +} + +func NewUserServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *UserServiceClient { + return &UserServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewUserServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *UserServiceClient { + return &UserServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewUserServiceClient(c thrift.TClient) *UserServiceClient { + return &UserServiceClient{ + c: c, + } +} + +func (p *UserServiceClient) Client_() thrift.TClient { + return p.c +} + +func (p *UserServiceClient) Login(ctx context.Context, req *LoginRequest) (r *LoginResponse, err error) { + var _args UserServiceLoginArgs + _args.Req = req + var _result UserServiceLoginResult + if err = p.Client_().Call(ctx, "Login", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *UserServiceClient) Register(ctx context.Context, req *RegisterRequest) (r *RegisterResponse, err error) { + var _args UserServiceRegisterArgs + _args.Req = req + var _result UserServiceRegisterResult + if err = p.Client_().Call(ctx, "Register", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +type LaunchScreenService interface { + CreateImage(ctx context.Context, req *CreateImageRequest) (r *CreateImageResponse, err error) + + GetImage(ctx context.Context, req *GetImageRequest) (r *GetImagesByUserIdResponse, err error) + + GetImagesByUserId(ctx context.Context, req *GetImagesByUserIdRequest) (r *GetImagesByUserIdResponse, err error) + + ChangeImageProperty(ctx context.Context, req *ChangeImagePropertyRequest) (r *ChangeImagePropertyResponse, err error) + + ChangeImage(ctx context.Context, req *ChangeImageRequest) (r *ChangeImageResponse, err error) + + DeleteImage(ctx context.Context, req *DeleteImageRequest) (r *DeleteImageResponse, err error) + + MobileGetImage(ctx context.Context, req *MobileGetImageRequest) (r *MobileGetImageResponse, err error) + + AddImagePointTime(ctx context.Context, req *AddImagePointTimeRequest) (r *AddImagePointTimeResponse, err error) +} + +type LaunchScreenServiceClient struct { + c thrift.TClient +} + +func NewLaunchScreenServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *LaunchScreenServiceClient { + return &LaunchScreenServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewLaunchScreenServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *LaunchScreenServiceClient { + return &LaunchScreenServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewLaunchScreenServiceClient(c thrift.TClient) *LaunchScreenServiceClient { + return &LaunchScreenServiceClient{ + c: c, + } +} + +func (p *LaunchScreenServiceClient) Client_() thrift.TClient { + return p.c +} + +func (p *LaunchScreenServiceClient) CreateImage(ctx context.Context, req *CreateImageRequest) (r *CreateImageResponse, err error) { + var _args LaunchScreenServiceCreateImageArgs + _args.Req = req + var _result LaunchScreenServiceCreateImageResult + if err = p.Client_().Call(ctx, "CreateImage", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *LaunchScreenServiceClient) GetImage(ctx context.Context, req *GetImageRequest) (r *GetImagesByUserIdResponse, err error) { + var _args LaunchScreenServiceGetImageArgs + _args.Req = req + var _result LaunchScreenServiceGetImageResult + if err = p.Client_().Call(ctx, "GetImage", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *LaunchScreenServiceClient) GetImagesByUserId(ctx context.Context, req *GetImagesByUserIdRequest) (r *GetImagesByUserIdResponse, err error) { + var _args LaunchScreenServiceGetImagesByUserIdArgs + _args.Req = req + var _result LaunchScreenServiceGetImagesByUserIdResult + if err = p.Client_().Call(ctx, "GetImagesByUserId", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *LaunchScreenServiceClient) ChangeImageProperty(ctx context.Context, req *ChangeImagePropertyRequest) (r *ChangeImagePropertyResponse, err error) { + var _args LaunchScreenServiceChangeImagePropertyArgs + _args.Req = req + var _result LaunchScreenServiceChangeImagePropertyResult + if err = p.Client_().Call(ctx, "ChangeImageProperty", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *LaunchScreenServiceClient) ChangeImage(ctx context.Context, req *ChangeImageRequest) (r *ChangeImageResponse, err error) { + var _args LaunchScreenServiceChangeImageArgs + _args.Req = req + var _result LaunchScreenServiceChangeImageResult + if err = p.Client_().Call(ctx, "ChangeImage", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *LaunchScreenServiceClient) DeleteImage(ctx context.Context, req *DeleteImageRequest) (r *DeleteImageResponse, err error) { + var _args LaunchScreenServiceDeleteImageArgs + _args.Req = req + var _result LaunchScreenServiceDeleteImageResult + if err = p.Client_().Call(ctx, "DeleteImage", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *LaunchScreenServiceClient) MobileGetImage(ctx context.Context, req *MobileGetImageRequest) (r *MobileGetImageResponse, err error) { + var _args LaunchScreenServiceMobileGetImageArgs + _args.Req = req + var _result LaunchScreenServiceMobileGetImageResult + if err = p.Client_().Call(ctx, "MobileGetImage", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *LaunchScreenServiceClient) AddImagePointTime(ctx context.Context, req *AddImagePointTimeRequest) (r *AddImagePointTimeResponse, err error) { + var _args LaunchScreenServiceAddImagePointTimeArgs + _args.Req = req + var _result LaunchScreenServiceAddImagePointTimeResult + if err = p.Client_().Call(ctx, "AddImagePointTime", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +type UserServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler UserService +} + +func (p *UserServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *UserServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *UserServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewUserServiceProcessor(handler UserService) *UserServiceProcessor { + self := &UserServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self.AddToProcessorMap("Login", &userServiceProcessorLogin{handler: handler}) + self.AddToProcessorMap("Register", &userServiceProcessorRegister{handler: handler}) + return self +} +func (p *UserServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + name, _, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return false, err + } + 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 userServiceProcessorLogin struct { + handler UserService +} + +func (p *userServiceProcessorLogin) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := UserServiceLoginArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("Login", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := UserServiceLoginResult{} + var retval *LoginResponse + if retval, err2 = p.handler.Login(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing Login: "+err2.Error()) + oprot.WriteMessageBegin("Login", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("Login", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type userServiceProcessorRegister struct { + handler UserService +} + +func (p *userServiceProcessorRegister) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := UserServiceRegisterArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("Register", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := UserServiceRegisterResult{} + var retval *RegisterResponse + if retval, err2 = p.handler.Register(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing Register: "+err2.Error()) + oprot.WriteMessageBegin("Register", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("Register", 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 UserServiceLoginArgs struct { + Req *LoginRequest `thrift:"req,1"` +} + +func NewUserServiceLoginArgs() *UserServiceLoginArgs { + return &UserServiceLoginArgs{} +} + +func (p *UserServiceLoginArgs) InitDefault() { +} + +var UserServiceLoginArgs_Req_DEFAULT *LoginRequest + +func (p *UserServiceLoginArgs) GetReq() (v *LoginRequest) { + if !p.IsSetReq() { + return UserServiceLoginArgs_Req_DEFAULT + } + return p.Req +} + +var fieldIDToName_UserServiceLoginArgs = map[int16]string{ + 1: "req", +} + +func (p *UserServiceLoginArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *UserServiceLoginArgs) 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_UserServiceLoginArgs[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 *UserServiceLoginArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewLoginRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *UserServiceLoginArgs) 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 *UserServiceLoginArgs) 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 *UserServiceLoginArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UserServiceLoginArgs(%+v)", *p) + +} + +type UserServiceLoginResult struct { + Success *LoginResponse `thrift:"success,0,optional"` +} + +func NewUserServiceLoginResult() *UserServiceLoginResult { + return &UserServiceLoginResult{} +} + +func (p *UserServiceLoginResult) InitDefault() { +} + +var UserServiceLoginResult_Success_DEFAULT *LoginResponse + +func (p *UserServiceLoginResult) GetSuccess() (v *LoginResponse) { + if !p.IsSetSuccess() { + return UserServiceLoginResult_Success_DEFAULT + } + return p.Success +} + +var fieldIDToName_UserServiceLoginResult = map[int16]string{ + 0: "success", +} + +func (p *UserServiceLoginResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *UserServiceLoginResult) 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_UserServiceLoginResult[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 *UserServiceLoginResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewLoginResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *UserServiceLoginResult) 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 *UserServiceLoginResult) 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 *UserServiceLoginResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UserServiceLoginResult(%+v)", *p) + +} + +type UserServiceRegisterArgs struct { + Req *RegisterRequest `thrift:"req,1"` +} + +func NewUserServiceRegisterArgs() *UserServiceRegisterArgs { + return &UserServiceRegisterArgs{} +} + +func (p *UserServiceRegisterArgs) InitDefault() { +} + +var UserServiceRegisterArgs_Req_DEFAULT *RegisterRequest + +func (p *UserServiceRegisterArgs) GetReq() (v *RegisterRequest) { + if !p.IsSetReq() { + return UserServiceRegisterArgs_Req_DEFAULT + } + return p.Req +} + +var fieldIDToName_UserServiceRegisterArgs = map[int16]string{ + 1: "req", +} + +func (p *UserServiceRegisterArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *UserServiceRegisterArgs) 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_UserServiceRegisterArgs[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 *UserServiceRegisterArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewRegisterRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *UserServiceRegisterArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Register_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 *UserServiceRegisterArgs) 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 *UserServiceRegisterArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UserServiceRegisterArgs(%+v)", *p) + +} + +type UserServiceRegisterResult struct { + Success *RegisterResponse `thrift:"success,0,optional"` +} + +func NewUserServiceRegisterResult() *UserServiceRegisterResult { + return &UserServiceRegisterResult{} +} + +func (p *UserServiceRegisterResult) InitDefault() { +} + +var UserServiceRegisterResult_Success_DEFAULT *RegisterResponse + +func (p *UserServiceRegisterResult) GetSuccess() (v *RegisterResponse) { + if !p.IsSetSuccess() { + return UserServiceRegisterResult_Success_DEFAULT + } + return p.Success +} + +var fieldIDToName_UserServiceRegisterResult = map[int16]string{ + 0: "success", +} + +func (p *UserServiceRegisterResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *UserServiceRegisterResult) 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_UserServiceRegisterResult[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 *UserServiceRegisterResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewRegisterResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *UserServiceRegisterResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Register_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 *UserServiceRegisterResult) 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 *UserServiceRegisterResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UserServiceRegisterResult(%+v)", *p) + +} + +type LaunchScreenServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler LaunchScreenService +} + +func (p *LaunchScreenServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *LaunchScreenServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *LaunchScreenServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewLaunchScreenServiceProcessor(handler LaunchScreenService) *LaunchScreenServiceProcessor { + self := &LaunchScreenServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self.AddToProcessorMap("CreateImage", &launchScreenServiceProcessorCreateImage{handler: handler}) + self.AddToProcessorMap("GetImage", &launchScreenServiceProcessorGetImage{handler: handler}) + self.AddToProcessorMap("GetImagesByUserId", &launchScreenServiceProcessorGetImagesByUserId{handler: handler}) + self.AddToProcessorMap("ChangeImageProperty", &launchScreenServiceProcessorChangeImageProperty{handler: handler}) + self.AddToProcessorMap("ChangeImage", &launchScreenServiceProcessorChangeImage{handler: handler}) + self.AddToProcessorMap("DeleteImage", &launchScreenServiceProcessorDeleteImage{handler: handler}) + self.AddToProcessorMap("MobileGetImage", &launchScreenServiceProcessorMobileGetImage{handler: handler}) + self.AddToProcessorMap("AddImagePointTime", &launchScreenServiceProcessorAddImagePointTime{handler: handler}) + return self +} +func (p *LaunchScreenServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + name, _, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return false, err + } + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(ctx, seqId, iprot, oprot) + } + iprot.Skip(thrift.STRUCT) + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) + oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, x +} + +type launchScreenServiceProcessorCreateImage struct { + handler LaunchScreenService +} + +func (p *launchScreenServiceProcessorCreateImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceCreateImageArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("CreateImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := LaunchScreenServiceCreateImageResult{} + var retval *CreateImageResponse + if retval, err2 = p.handler.CreateImage(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CreateImage: "+err2.Error()) + oprot.WriteMessageBegin("CreateImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("CreateImage", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type launchScreenServiceProcessorGetImage struct { + handler LaunchScreenService +} + +func (p *launchScreenServiceProcessorGetImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceGetImageArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := LaunchScreenServiceGetImageResult{} + var retval *GetImagesByUserIdResponse + if retval, err2 = p.handler.GetImage(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetImage: "+err2.Error()) + oprot.WriteMessageBegin("GetImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetImage", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type launchScreenServiceProcessorGetImagesByUserId struct { + handler LaunchScreenService +} + +func (p *launchScreenServiceProcessorGetImagesByUserId) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceGetImagesByUserIdArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetImagesByUserId", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := LaunchScreenServiceGetImagesByUserIdResult{} + var retval *GetImagesByUserIdResponse + if retval, err2 = p.handler.GetImagesByUserId(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetImagesByUserId: "+err2.Error()) + oprot.WriteMessageBegin("GetImagesByUserId", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetImagesByUserId", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type launchScreenServiceProcessorChangeImageProperty struct { + handler LaunchScreenService +} + +func (p *launchScreenServiceProcessorChangeImageProperty) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceChangeImagePropertyArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("ChangeImageProperty", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := LaunchScreenServiceChangeImagePropertyResult{} + var retval *ChangeImagePropertyResponse + if retval, err2 = p.handler.ChangeImageProperty(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ChangeImageProperty: "+err2.Error()) + oprot.WriteMessageBegin("ChangeImageProperty", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("ChangeImageProperty", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type launchScreenServiceProcessorChangeImage struct { + handler LaunchScreenService +} + +func (p *launchScreenServiceProcessorChangeImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceChangeImageArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("ChangeImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := LaunchScreenServiceChangeImageResult{} + var retval *ChangeImageResponse + if retval, err2 = p.handler.ChangeImage(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ChangeImage: "+err2.Error()) + oprot.WriteMessageBegin("ChangeImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("ChangeImage", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type launchScreenServiceProcessorDeleteImage struct { + handler LaunchScreenService +} + +func (p *launchScreenServiceProcessorDeleteImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceDeleteImageArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("DeleteImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := LaunchScreenServiceDeleteImageResult{} + var retval *DeleteImageResponse + if retval, err2 = p.handler.DeleteImage(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing DeleteImage: "+err2.Error()) + oprot.WriteMessageBegin("DeleteImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("DeleteImage", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type launchScreenServiceProcessorMobileGetImage struct { + handler LaunchScreenService +} + +func (p *launchScreenServiceProcessorMobileGetImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceMobileGetImageArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("MobileGetImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := LaunchScreenServiceMobileGetImageResult{} + var retval *MobileGetImageResponse + if retval, err2 = p.handler.MobileGetImage(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing MobileGetImage: "+err2.Error()) + oprot.WriteMessageBegin("MobileGetImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("MobileGetImage", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type launchScreenServiceProcessorAddImagePointTime struct { + handler LaunchScreenService +} + +func (p *launchScreenServiceProcessorAddImagePointTime) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceAddImagePointTimeArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("AddImagePointTime", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := LaunchScreenServiceAddImagePointTimeResult{} + var retval *AddImagePointTimeResponse + if retval, err2 = p.handler.AddImagePointTime(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing AddImagePointTime: "+err2.Error()) + oprot.WriteMessageBegin("AddImagePointTime", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("AddImagePointTime", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type LaunchScreenServiceCreateImageArgs struct { + Req *CreateImageRequest `thrift:"req,1"` +} + +func NewLaunchScreenServiceCreateImageArgs() *LaunchScreenServiceCreateImageArgs { + return &LaunchScreenServiceCreateImageArgs{} +} + +func (p *LaunchScreenServiceCreateImageArgs) InitDefault() { +} + +var LaunchScreenServiceCreateImageArgs_Req_DEFAULT *CreateImageRequest + +func (p *LaunchScreenServiceCreateImageArgs) GetReq() (v *CreateImageRequest) { + if !p.IsSetReq() { + return LaunchScreenServiceCreateImageArgs_Req_DEFAULT + } + return p.Req +} + +var fieldIDToName_LaunchScreenServiceCreateImageArgs = map[int16]string{ + 1: "req", +} + +func (p *LaunchScreenServiceCreateImageArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *LaunchScreenServiceCreateImageArgs) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LaunchScreenServiceCreateImageArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceCreateImageArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewCreateImageRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *LaunchScreenServiceCreateImageArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("CreateImage_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *LaunchScreenServiceCreateImageArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *LaunchScreenServiceCreateImageArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceCreateImageArgs(%+v)", *p) + +} + +type LaunchScreenServiceCreateImageResult struct { + Success *CreateImageResponse `thrift:"success,0,optional"` +} + +func NewLaunchScreenServiceCreateImageResult() *LaunchScreenServiceCreateImageResult { + return &LaunchScreenServiceCreateImageResult{} +} + +func (p *LaunchScreenServiceCreateImageResult) InitDefault() { +} + +var LaunchScreenServiceCreateImageResult_Success_DEFAULT *CreateImageResponse + +func (p *LaunchScreenServiceCreateImageResult) GetSuccess() (v *CreateImageResponse) { + if !p.IsSetSuccess() { + return LaunchScreenServiceCreateImageResult_Success_DEFAULT + } + return p.Success +} + +var fieldIDToName_LaunchScreenServiceCreateImageResult = map[int16]string{ + 0: "success", +} + +func (p *LaunchScreenServiceCreateImageResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *LaunchScreenServiceCreateImageResult) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LaunchScreenServiceCreateImageResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceCreateImageResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewCreateImageResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *LaunchScreenServiceCreateImageResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("CreateImage_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *LaunchScreenServiceCreateImageResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *LaunchScreenServiceCreateImageResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceCreateImageResult(%+v)", *p) + +} + +type LaunchScreenServiceGetImageArgs struct { + Req *GetImageRequest `thrift:"req,1"` +} + +func NewLaunchScreenServiceGetImageArgs() *LaunchScreenServiceGetImageArgs { + return &LaunchScreenServiceGetImageArgs{} +} + +func (p *LaunchScreenServiceGetImageArgs) InitDefault() { +} + +var LaunchScreenServiceGetImageArgs_Req_DEFAULT *GetImageRequest + +func (p *LaunchScreenServiceGetImageArgs) GetReq() (v *GetImageRequest) { + if !p.IsSetReq() { + return LaunchScreenServiceGetImageArgs_Req_DEFAULT + } + return p.Req +} + +var fieldIDToName_LaunchScreenServiceGetImageArgs = map[int16]string{ + 1: "req", +} + +func (p *LaunchScreenServiceGetImageArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *LaunchScreenServiceGetImageArgs) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LaunchScreenServiceGetImageArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceGetImageArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetImageRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *LaunchScreenServiceGetImageArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetImage_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *LaunchScreenServiceGetImageArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *LaunchScreenServiceGetImageArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceGetImageArgs(%+v)", *p) + +} + +type LaunchScreenServiceGetImageResult struct { + Success *GetImagesByUserIdResponse `thrift:"success,0,optional"` +} + +func NewLaunchScreenServiceGetImageResult() *LaunchScreenServiceGetImageResult { + return &LaunchScreenServiceGetImageResult{} +} + +func (p *LaunchScreenServiceGetImageResult) InitDefault() { +} + +var LaunchScreenServiceGetImageResult_Success_DEFAULT *GetImagesByUserIdResponse + +func (p *LaunchScreenServiceGetImageResult) GetSuccess() (v *GetImagesByUserIdResponse) { + if !p.IsSetSuccess() { + return LaunchScreenServiceGetImageResult_Success_DEFAULT + } + return p.Success +} + +var fieldIDToName_LaunchScreenServiceGetImageResult = map[int16]string{ + 0: "success", +} + +func (p *LaunchScreenServiceGetImageResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *LaunchScreenServiceGetImageResult) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + 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_LaunchScreenServiceGetImageResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceGetImageResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetImagesByUserIdResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *LaunchScreenServiceGetImageResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetImage_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 *LaunchScreenServiceGetImageResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *LaunchScreenServiceGetImageResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceGetImageResult(%+v)", *p) + +} + +type LaunchScreenServiceGetImagesByUserIdArgs struct { + Req *GetImagesByUserIdRequest `thrift:"req,1"` +} + +func NewLaunchScreenServiceGetImagesByUserIdArgs() *LaunchScreenServiceGetImagesByUserIdArgs { + return &LaunchScreenServiceGetImagesByUserIdArgs{} +} + +func (p *LaunchScreenServiceGetImagesByUserIdArgs) InitDefault() { +} + +var LaunchScreenServiceGetImagesByUserIdArgs_Req_DEFAULT *GetImagesByUserIdRequest + +func (p *LaunchScreenServiceGetImagesByUserIdArgs) GetReq() (v *GetImagesByUserIdRequest) { + if !p.IsSetReq() { + return LaunchScreenServiceGetImagesByUserIdArgs_Req_DEFAULT + } + return p.Req +} + +var fieldIDToName_LaunchScreenServiceGetImagesByUserIdArgs = map[int16]string{ + 1: "req", +} + +func (p *LaunchScreenServiceGetImagesByUserIdArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *LaunchScreenServiceGetImagesByUserIdArgs) 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_LaunchScreenServiceGetImagesByUserIdArgs[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 *LaunchScreenServiceGetImagesByUserIdArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetImagesByUserIdRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *LaunchScreenServiceGetImagesByUserIdArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetImagesByUserId_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 *LaunchScreenServiceGetImagesByUserIdArgs) 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 *LaunchScreenServiceGetImagesByUserIdArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceGetImagesByUserIdArgs(%+v)", *p) + +} + +type LaunchScreenServiceGetImagesByUserIdResult struct { + Success *GetImagesByUserIdResponse `thrift:"success,0,optional"` +} + +func NewLaunchScreenServiceGetImagesByUserIdResult() *LaunchScreenServiceGetImagesByUserIdResult { + return &LaunchScreenServiceGetImagesByUserIdResult{} +} + +func (p *LaunchScreenServiceGetImagesByUserIdResult) InitDefault() { +} + +var LaunchScreenServiceGetImagesByUserIdResult_Success_DEFAULT *GetImagesByUserIdResponse + +func (p *LaunchScreenServiceGetImagesByUserIdResult) GetSuccess() (v *GetImagesByUserIdResponse) { + if !p.IsSetSuccess() { + return LaunchScreenServiceGetImagesByUserIdResult_Success_DEFAULT + } + return p.Success +} + +var fieldIDToName_LaunchScreenServiceGetImagesByUserIdResult = map[int16]string{ + 0: "success", +} + +func (p *LaunchScreenServiceGetImagesByUserIdResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *LaunchScreenServiceGetImagesByUserIdResult) 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_LaunchScreenServiceGetImagesByUserIdResult[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 *LaunchScreenServiceGetImagesByUserIdResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetImagesByUserIdResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *LaunchScreenServiceGetImagesByUserIdResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetImagesByUserId_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 *LaunchScreenServiceGetImagesByUserIdResult) 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 *LaunchScreenServiceGetImagesByUserIdResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceGetImagesByUserIdResult(%+v)", *p) + +} + +type LaunchScreenServiceChangeImagePropertyArgs struct { + Req *ChangeImagePropertyRequest `thrift:"req,1"` +} + +func NewLaunchScreenServiceChangeImagePropertyArgs() *LaunchScreenServiceChangeImagePropertyArgs { + return &LaunchScreenServiceChangeImagePropertyArgs{} +} + +func (p *LaunchScreenServiceChangeImagePropertyArgs) InitDefault() { +} + +var LaunchScreenServiceChangeImagePropertyArgs_Req_DEFAULT *ChangeImagePropertyRequest + +func (p *LaunchScreenServiceChangeImagePropertyArgs) GetReq() (v *ChangeImagePropertyRequest) { + if !p.IsSetReq() { + return LaunchScreenServiceChangeImagePropertyArgs_Req_DEFAULT + } + return p.Req +} + +var fieldIDToName_LaunchScreenServiceChangeImagePropertyArgs = map[int16]string{ + 1: "req", +} + +func (p *LaunchScreenServiceChangeImagePropertyArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *LaunchScreenServiceChangeImagePropertyArgs) 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_LaunchScreenServiceChangeImagePropertyArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceChangeImagePropertyArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewChangeImagePropertyRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *LaunchScreenServiceChangeImagePropertyArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ChangeImageProperty_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 *LaunchScreenServiceChangeImagePropertyArgs) 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 *LaunchScreenServiceChangeImagePropertyArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceChangeImagePropertyArgs(%+v)", *p) + +} + +type LaunchScreenServiceChangeImagePropertyResult struct { + Success *ChangeImagePropertyResponse `thrift:"success,0,optional"` +} + +func NewLaunchScreenServiceChangeImagePropertyResult() *LaunchScreenServiceChangeImagePropertyResult { + return &LaunchScreenServiceChangeImagePropertyResult{} +} + +func (p *LaunchScreenServiceChangeImagePropertyResult) InitDefault() { +} + +var LaunchScreenServiceChangeImagePropertyResult_Success_DEFAULT *ChangeImagePropertyResponse + +func (p *LaunchScreenServiceChangeImagePropertyResult) GetSuccess() (v *ChangeImagePropertyResponse) { + if !p.IsSetSuccess() { + return LaunchScreenServiceChangeImagePropertyResult_Success_DEFAULT + } + return p.Success +} + +var fieldIDToName_LaunchScreenServiceChangeImagePropertyResult = map[int16]string{ + 0: "success", +} + +func (p *LaunchScreenServiceChangeImagePropertyResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *LaunchScreenServiceChangeImagePropertyResult) 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_LaunchScreenServiceChangeImagePropertyResult[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 *LaunchScreenServiceChangeImagePropertyResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewChangeImagePropertyResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *LaunchScreenServiceChangeImagePropertyResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ChangeImageProperty_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 *LaunchScreenServiceChangeImagePropertyResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + 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 *LaunchScreenServiceChangeImagePropertyResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceChangeImagePropertyResult(%+v)", *p) + +} + +type LaunchScreenServiceChangeImageArgs struct { + Req *ChangeImageRequest `thrift:"req,1"` +} + +func NewLaunchScreenServiceChangeImageArgs() *LaunchScreenServiceChangeImageArgs { + return &LaunchScreenServiceChangeImageArgs{} +} + +func (p *LaunchScreenServiceChangeImageArgs) InitDefault() { +} + +var LaunchScreenServiceChangeImageArgs_Req_DEFAULT *ChangeImageRequest + +func (p *LaunchScreenServiceChangeImageArgs) GetReq() (v *ChangeImageRequest) { + if !p.IsSetReq() { + return LaunchScreenServiceChangeImageArgs_Req_DEFAULT + } + return p.Req +} + +var fieldIDToName_LaunchScreenServiceChangeImageArgs = map[int16]string{ + 1: "req", +} + +func (p *LaunchScreenServiceChangeImageArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *LaunchScreenServiceChangeImageArgs) 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_LaunchScreenServiceChangeImageArgs[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 *LaunchScreenServiceChangeImageArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewChangeImageRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *LaunchScreenServiceChangeImageArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ChangeImage_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *LaunchScreenServiceChangeImageArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *LaunchScreenServiceChangeImageArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceChangeImageArgs(%+v)", *p) + +} + +type LaunchScreenServiceChangeImageResult struct { + Success *ChangeImageResponse `thrift:"success,0,optional"` +} + +func NewLaunchScreenServiceChangeImageResult() *LaunchScreenServiceChangeImageResult { + return &LaunchScreenServiceChangeImageResult{} +} + +func (p *LaunchScreenServiceChangeImageResult) InitDefault() { +} + +var LaunchScreenServiceChangeImageResult_Success_DEFAULT *ChangeImageResponse + +func (p *LaunchScreenServiceChangeImageResult) GetSuccess() (v *ChangeImageResponse) { + if !p.IsSetSuccess() { + return LaunchScreenServiceChangeImageResult_Success_DEFAULT + } + return p.Success +} + +var fieldIDToName_LaunchScreenServiceChangeImageResult = map[int16]string{ + 0: "success", +} + +func (p *LaunchScreenServiceChangeImageResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *LaunchScreenServiceChangeImageResult) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LaunchScreenServiceChangeImageResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceChangeImageResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewChangeImageResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *LaunchScreenServiceChangeImageResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ChangeImage_result"); err != nil { + 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 *LaunchScreenServiceChangeImageResult) 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 *LaunchScreenServiceChangeImageResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceChangeImageResult(%+v)", *p) + +} + +type LaunchScreenServiceDeleteImageArgs struct { + Req *DeleteImageRequest `thrift:"req,1"` +} + +func NewLaunchScreenServiceDeleteImageArgs() *LaunchScreenServiceDeleteImageArgs { + return &LaunchScreenServiceDeleteImageArgs{} +} + +func (p *LaunchScreenServiceDeleteImageArgs) InitDefault() { +} + +var LaunchScreenServiceDeleteImageArgs_Req_DEFAULT *DeleteImageRequest + +func (p *LaunchScreenServiceDeleteImageArgs) GetReq() (v *DeleteImageRequest) { + if !p.IsSetReq() { + return LaunchScreenServiceDeleteImageArgs_Req_DEFAULT + } + return p.Req +} + +var fieldIDToName_LaunchScreenServiceDeleteImageArgs = map[int16]string{ + 1: "req", +} + +func (p *LaunchScreenServiceDeleteImageArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *LaunchScreenServiceDeleteImageArgs) 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_LaunchScreenServiceDeleteImageArgs[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 *LaunchScreenServiceDeleteImageArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewDeleteImageRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *LaunchScreenServiceDeleteImageArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("DeleteImage_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 *LaunchScreenServiceDeleteImageArgs) 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 *LaunchScreenServiceDeleteImageArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceDeleteImageArgs(%+v)", *p) + +} + +type LaunchScreenServiceDeleteImageResult struct { + Success *DeleteImageResponse `thrift:"success,0,optional"` +} + +func NewLaunchScreenServiceDeleteImageResult() *LaunchScreenServiceDeleteImageResult { + return &LaunchScreenServiceDeleteImageResult{} +} + +func (p *LaunchScreenServiceDeleteImageResult) InitDefault() { +} + +var LaunchScreenServiceDeleteImageResult_Success_DEFAULT *DeleteImageResponse + +func (p *LaunchScreenServiceDeleteImageResult) GetSuccess() (v *DeleteImageResponse) { + if !p.IsSetSuccess() { + return LaunchScreenServiceDeleteImageResult_Success_DEFAULT + } + return p.Success +} + +var fieldIDToName_LaunchScreenServiceDeleteImageResult = map[int16]string{ + 0: "success", +} + +func (p *LaunchScreenServiceDeleteImageResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *LaunchScreenServiceDeleteImageResult) 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_LaunchScreenServiceDeleteImageResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceDeleteImageResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewDeleteImageResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *LaunchScreenServiceDeleteImageResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("DeleteImage_result"); err != nil { + goto WriteStructBeginError + } + 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 *LaunchScreenServiceDeleteImageResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *LaunchScreenServiceDeleteImageResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceDeleteImageResult(%+v)", *p) + +} + +type LaunchScreenServiceMobileGetImageArgs struct { + Req *MobileGetImageRequest `thrift:"req,1"` +} + +func NewLaunchScreenServiceMobileGetImageArgs() *LaunchScreenServiceMobileGetImageArgs { + return &LaunchScreenServiceMobileGetImageArgs{} +} + +func (p *LaunchScreenServiceMobileGetImageArgs) InitDefault() { +} + +var LaunchScreenServiceMobileGetImageArgs_Req_DEFAULT *MobileGetImageRequest + +func (p *LaunchScreenServiceMobileGetImageArgs) GetReq() (v *MobileGetImageRequest) { + if !p.IsSetReq() { + return LaunchScreenServiceMobileGetImageArgs_Req_DEFAULT + } + return p.Req +} + +var fieldIDToName_LaunchScreenServiceMobileGetImageArgs = map[int16]string{ + 1: "req", +} + +func (p *LaunchScreenServiceMobileGetImageArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *LaunchScreenServiceMobileGetImageArgs) 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_LaunchScreenServiceMobileGetImageArgs[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 *LaunchScreenServiceMobileGetImageArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewMobileGetImageRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *LaunchScreenServiceMobileGetImageArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("MobileGetImage_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 *LaunchScreenServiceMobileGetImageArgs) 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 *LaunchScreenServiceMobileGetImageArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceMobileGetImageArgs(%+v)", *p) + +} + +type LaunchScreenServiceMobileGetImageResult struct { + Success *MobileGetImageResponse `thrift:"success,0,optional"` +} + +func NewLaunchScreenServiceMobileGetImageResult() *LaunchScreenServiceMobileGetImageResult { + return &LaunchScreenServiceMobileGetImageResult{} +} + +func (p *LaunchScreenServiceMobileGetImageResult) InitDefault() { +} + +var LaunchScreenServiceMobileGetImageResult_Success_DEFAULT *MobileGetImageResponse + +func (p *LaunchScreenServiceMobileGetImageResult) GetSuccess() (v *MobileGetImageResponse) { + if !p.IsSetSuccess() { + return LaunchScreenServiceMobileGetImageResult_Success_DEFAULT + } + return p.Success +} + +var fieldIDToName_LaunchScreenServiceMobileGetImageResult = map[int16]string{ + 0: "success", +} + +func (p *LaunchScreenServiceMobileGetImageResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *LaunchScreenServiceMobileGetImageResult) 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_LaunchScreenServiceMobileGetImageResult[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 *LaunchScreenServiceMobileGetImageResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewMobileGetImageResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *LaunchScreenServiceMobileGetImageResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("MobileGetImage_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 *LaunchScreenServiceMobileGetImageResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *LaunchScreenServiceMobileGetImageResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceMobileGetImageResult(%+v)", *p) + +} + +type LaunchScreenServiceAddImagePointTimeArgs struct { + Req *AddImagePointTimeRequest `thrift:"req,1"` +} + +func NewLaunchScreenServiceAddImagePointTimeArgs() *LaunchScreenServiceAddImagePointTimeArgs { + return &LaunchScreenServiceAddImagePointTimeArgs{} +} + +func (p *LaunchScreenServiceAddImagePointTimeArgs) InitDefault() { +} + +var LaunchScreenServiceAddImagePointTimeArgs_Req_DEFAULT *AddImagePointTimeRequest + +func (p *LaunchScreenServiceAddImagePointTimeArgs) GetReq() (v *AddImagePointTimeRequest) { + if !p.IsSetReq() { + return LaunchScreenServiceAddImagePointTimeArgs_Req_DEFAULT + } + return p.Req +} + +var fieldIDToName_LaunchScreenServiceAddImagePointTimeArgs = map[int16]string{ + 1: "req", +} + +func (p *LaunchScreenServiceAddImagePointTimeArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *LaunchScreenServiceAddImagePointTimeArgs) 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_LaunchScreenServiceAddImagePointTimeArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceAddImagePointTimeArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewAddImagePointTimeRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *LaunchScreenServiceAddImagePointTimeArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("AddImagePointTime_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + 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 *LaunchScreenServiceAddImagePointTimeArgs) 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 *LaunchScreenServiceAddImagePointTimeArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceAddImagePointTimeArgs(%+v)", *p) + +} + +type LaunchScreenServiceAddImagePointTimeResult struct { + Success *AddImagePointTimeResponse `thrift:"success,0,optional"` +} + +func NewLaunchScreenServiceAddImagePointTimeResult() *LaunchScreenServiceAddImagePointTimeResult { + return &LaunchScreenServiceAddImagePointTimeResult{} +} + +func (p *LaunchScreenServiceAddImagePointTimeResult) InitDefault() { +} + +var LaunchScreenServiceAddImagePointTimeResult_Success_DEFAULT *AddImagePointTimeResponse + +func (p *LaunchScreenServiceAddImagePointTimeResult) GetSuccess() (v *AddImagePointTimeResponse) { + if !p.IsSetSuccess() { + return LaunchScreenServiceAddImagePointTimeResult_Success_DEFAULT + } + return p.Success +} + +var fieldIDToName_LaunchScreenServiceAddImagePointTimeResult = map[int16]string{ + 0: "success", +} + +func (p *LaunchScreenServiceAddImagePointTimeResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *LaunchScreenServiceAddImagePointTimeResult) 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_LaunchScreenServiceAddImagePointTimeResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceAddImagePointTimeResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewAddImagePointTimeResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *LaunchScreenServiceAddImagePointTimeResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("AddImagePointTime_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *LaunchScreenServiceAddImagePointTimeResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *LaunchScreenServiceAddImagePointTimeResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceAddImagePointTimeResult(%+v)", *p) + +} diff --git a/cmd/api/biz/pack/base.go b/cmd/api/biz/pack/base.go new file mode 100644 index 0000000..e005148 --- /dev/null +++ b/cmd/api/biz/pack/base.go @@ -0,0 +1,75 @@ +package pack + +import ( + "github.com/cloudwego/hertz/pkg/app" + "github.com/cloudwego/hertz/pkg/protocol/consts" + "github.com/west2-online/fzuhelper-server/cmd/api/biz/model/api" + "github.com/west2-online/fzuhelper-server/pkg/errno" +) + +type Base struct { + Code int64 `json:"code"` + Msg string `json:"message"` +} + +type BaseResp struct { + Base Base +} + +type RespWithData struct { + Code int64 `json:"code"` + Msg string `json:"message"` + Data any `json:"data"` +} + +type DataList struct { + Items any `json:"items"` + Total int64 `json:"total"` +} + +func RespError(c *app.RequestContext, err error) { + Errno := errno.ConvertErr(err) + c.JSON(consts.StatusOK, BaseResp{ + Base: Base{ + Code: Errno.ErrorCode, + Msg: Errno.ErrorMsg, + }, + }) +} + +func RespSuccess(c *app.RequestContext) { + Errno := errno.Success + c.JSON(consts.StatusOK, BaseResp{ + Base: Base{ + Code: Errno.ErrorCode, + Msg: Errno.ErrorMsg, + }, + }) +} + +func RespData(c *app.RequestContext, data any) { + c.JSON(consts.StatusOK, RespWithData{ + Code: errno.SuccessCode, + Msg: "Success", + Data: data, + }) +} + +func RespList(c *app.RequestContext, items any) { + Errno := errno.Success + resp := RespWithData{ + Code: Errno.ErrorCode, + Msg: Errno.ErrorMsg, + Data: &DataList{ + Items: items, + }, + } + c.JSON(consts.StatusOK, resp) +} + +func BuildSuccessResp() *api.BaseResp { + return &api.BaseResp{ + Code: errno.SuccessCode, + Msg: errno.SuccessMsg, + } +} diff --git a/cmd/api/biz/pack/convert.go b/cmd/api/biz/pack/convert.go new file mode 100644 index 0000000..8b78661 --- /dev/null +++ b/cmd/api/biz/pack/convert.go @@ -0,0 +1,25 @@ +package pack + +import ( + "github.com/west2-online/fzuhelper-server/cmd/api/biz/model/api" + "github.com/west2-online/fzuhelper-server/kitex_gen/model" +) + +func ModelImageToAPI(image *model.Picture) *api.Picture { + return &api.Picture{ + ID: image.Id, + UserID: image.UserId, + URL: image.Url, + PicType: image.PicType, + Duration: image.Duration, + Href: image.Href, + ShowTimes: image.ShowTimes, + SType: image.SType, + Frequency: image.Frequency, + Text: image.Text, + StartAt: image.StartAt, + EndAt: image.EndAt, + StartTime: image.StartTime, + EndTime: image.EndTime, + } +} diff --git a/cmd/api/biz/pack/tracer/jaeger.go b/cmd/api/biz/pack/tracer/jaeger.go new file mode 100644 index 0000000..7fb6668 --- /dev/null +++ b/cmd/api/biz/pack/tracer/jaeger.go @@ -0,0 +1,35 @@ +package tracer + +import ( + "fmt" + "github.com/opentracing/opentracing-go" + "github.com/uber/jaeger-client-go" + jaegercfg "github.com/uber/jaeger-client-go/config" + "github.com/west2-online/fzuhelper-server/config" + "github.com/west2-online/fzuhelper-server/pkg/logger" +) + +func InitJaegerTracer(serviceName string) { + cfg := jaegercfg.Configuration{ + ServiceName: serviceName, + Sampler: &jaegercfg.SamplerConfig{ + Type: jaeger.SamplerTypeConst, + Param: 1, + }, + Reporter: &jaegercfg.ReporterConfig{ + LogSpans: false, + // 按实际情况替换你的 ip + CollectorEndpoint: config.Jaeger.Addr, + }, + } + + tracer, _, err := cfg.NewTracer( + jaegercfg.Logger(jaeger.StdLogger), + jaegercfg.ZipkinSharedRPCSpan(true), + ) + if err != nil { + logger.LoggerObj.Fatal(fmt.Sprintf("ERROR: cannot init Jaeger: %v\n", err)) + } + opentracing.SetGlobalTracer(tracer) + //return tracer, closer +} diff --git a/cmd/api/biz/pack/utils.go b/cmd/api/biz/pack/utils.go new file mode 100644 index 0000000..d7585b9 --- /dev/null +++ b/cmd/api/biz/pack/utils.go @@ -0,0 +1,29 @@ +package pack + +import ( + "github.com/west2-online/fzuhelper-server/pkg/errno" + "io" + "mime/multipart" + "path/filepath" +) + +func FileToByte(file *multipart.FileHeader) ([]byte, error) { + fileContent, err := file.Open() + if err != nil { + return nil, errno.ParamError + } + return io.ReadAll(fileContent) +} + +func IsAllowImageExt(fileName string) bool { + imageExt := filepath.Ext(fileName) + allowExtImage := map[string]bool{ + ".jpg": true, + ".png": true, + ".jpeg": true, + } + if _, ok := allowExtImage[imageExt]; !ok { + return false + } + return true +} diff --git a/cmd/api/biz/router/api/api.go b/cmd/api/biz/router/api/api.go new file mode 100644 index 0000000..72cb6a5 --- /dev/null +++ b/cmd/api/biz/router/api/api.go @@ -0,0 +1,38 @@ +// Code generated by hertz generator. DO NOT EDIT. + +package api + +import ( + "github.com/cloudwego/hertz/pkg/app/server" + api "github.com/west2-online/fzuhelper-server/cmd/api/biz/handler/api" +) + +/* + This file will register all the routes of the services in the master idl. + And it will update automatically when you use the "update" command for the idl. + So don't modify the contents of the file, or your code will be deleted when it is updated. +*/ + +// Register register routes based on the IDL 'api.${HTTP Method}' annotation. +func Register(r *server.Hertz) { + + root := r.Group("/", rootMw()...) + { + _launch_screen := root.Group("/launch_screen", _launch_screenMw()...) + { + _api := _launch_screen.Group("/api", _apiMw()...) + _api.GET("/image", append(_getimageMw(), api.GetImage)...) + _image := _api.Group("/image", _imageMw()...) + _image.GET("/point", append(_addimagepointtimeMw(), api.AddImagePointTime)...) + _api.PUT("/image", append(_changeimagepropertyMw(), api.ChangeImageProperty)...) + _api.DELETE("/image", append(_deleteimageMw(), api.DeleteImage)...) + _api.GET("/images", append(_getimagesbyuseridMw(), api.GetImagesByUserId)...) + _api.POST("/login", append(_loginMw(), api.Login)...) + _api.POST("/register", append(_registerMw(), api.Register)...) + _api.GET("/screen", append(_mobilegetimageMw(), api.MobileGetImage)...) + _api.POST("/image", append(_createimageMw(), api.CreateImage)...) + _image0 := _api.Group("/image", _image0Mw()...) + _image0.PUT("/img", append(_changeimageMw(), api.ChangeImage)...) + } + } +} diff --git a/cmd/api/biz/router/api/middleware.go b/cmd/api/biz/router/api/middleware.go new file mode 100644 index 0000000..c1fdfa0 --- /dev/null +++ b/cmd/api/biz/router/api/middleware.go @@ -0,0 +1,82 @@ +// Code generated by hertz generator. + +package api + +import ( + "github.com/cloudwego/hertz/pkg/app" +) + +func rootMw() []app.HandlerFunc { + // your code... + return nil +} + +func _launch_screenMw() []app.HandlerFunc { + // your code... + return nil +} + +func _apiMw() []app.HandlerFunc { + // your code... + return nil +} + +func _imageMw() []app.HandlerFunc { + // your code... + return nil +} + +func _getimageMw() []app.HandlerFunc { + // your code... + return nil +} + +func _addimagepointtimeMw() []app.HandlerFunc { + // your code... + return nil +} + +func _changeimagepropertyMw() []app.HandlerFunc { + // your code... + return nil +} + +func _deleteimageMw() []app.HandlerFunc { + // your code... + return nil +} + +func _getimagesbyuseridMw() []app.HandlerFunc { + // your code... + return nil +} + +func _loginMw() []app.HandlerFunc { + // your code... + return nil +} + +func _registerMw() []app.HandlerFunc { + // your code... + return nil +} + +func _mobilegetimageMw() []app.HandlerFunc { + // your code... + return nil +} + +func _image0Mw() []app.HandlerFunc { + // your code... + return nil +} + +func _createimageMw() []app.HandlerFunc { + // your code... + return nil +} + +func _changeimageMw() []app.HandlerFunc { + // your code... + return nil +} diff --git a/cmd/api/biz/router/register.go b/cmd/api/biz/router/register.go new file mode 100644 index 0000000..feaa931 --- /dev/null +++ b/cmd/api/biz/router/register.go @@ -0,0 +1,14 @@ +// Code generated by hertz generator. DO NOT EDIT. + +package router + +import ( + "github.com/cloudwego/hertz/pkg/app/server" + api "github.com/west2-online/fzuhelper-server/cmd/api/biz/router/api" +) + +// GeneratedRegister registers routers generated by IDL. +func GeneratedRegister(r *server.Hertz) { + //INSERT_POINT: DO NOT DELETE THIS LINE! + api.Register(r) +} diff --git a/cmd/api/biz/rpc/init.go b/cmd/api/biz/rpc/init.go new file mode 100644 index 0000000..e9e3405 --- /dev/null +++ b/cmd/api/biz/rpc/init.go @@ -0,0 +1,16 @@ +package rpc + +import ( + "github.com/west2-online/fzuhelper-server/kitex_gen/launch_screen/launchscreenservice" + "github.com/west2-online/fzuhelper-server/kitex_gen/user/userservice" +) + +var ( + userClient userservice.Client + launchScreenClient launchscreenservice.Client +) + +func Init() { + InitUserRPC() + InitLaunchScreenRPC() +} diff --git a/cmd/api/biz/rpc/launch_screen.go b/cmd/api/biz/rpc/launch_screen.go new file mode 100644 index 0000000..ab345d5 --- /dev/null +++ b/cmd/api/biz/rpc/launch_screen.go @@ -0,0 +1,32 @@ +package rpc + +import ( + "context" + "github.com/cloudwego/kitex/client" + etcd "github.com/kitex-contrib/registry-etcd" + "github.com/west2-online/fzuhelper-server/config" + "github.com/west2-online/fzuhelper-server/kitex_gen/launch_screen" + "github.com/west2-online/fzuhelper-server/kitex_gen/launch_screen/launchscreenservice" + "github.com/west2-online/fzuhelper-server/kitex_gen/model" + "github.com/west2-online/fzuhelper-server/pkg/constants" + "github.com/west2-online/fzuhelper-server/pkg/utils" +) + +func InitLaunchScreenRPC() { + r, err := etcd.NewEtcdResolver([]string{config.Etcd.Addr}) + if err != nil { + panic(err) + } + launchScreenClient, err = launchscreenservice.NewClient(constants.LaunchScreenServiceName, client.WithResolver(r)) + if err != nil { + panic(err) + } +} + +func CreateImageRPC(ctx context.Context, req *launch_screen.CreateImageRequest) (image *model.Picture, err error) { + resp, err := launchScreenClient.CreateImage(ctx, req) + if ok, err := utils.IsSuccess(err, resp.Base); !ok { + return nil, err + } + return resp.Picture, nil +} diff --git a/cmd/api/biz/rpc/user.go b/cmd/api/biz/rpc/user.go new file mode 100644 index 0000000..6397755 --- /dev/null +++ b/cmd/api/biz/rpc/user.go @@ -0,0 +1,39 @@ +package rpc + +import ( + "context" + "github.com/cloudwego/kitex/client" + etcd "github.com/kitex-contrib/registry-etcd" + "github.com/west2-online/fzuhelper-server/config" + "github.com/west2-online/fzuhelper-server/kitex_gen/user" + "github.com/west2-online/fzuhelper-server/kitex_gen/user/userservice" + "github.com/west2-online/fzuhelper-server/pkg/constants" + "github.com/west2-online/fzuhelper-server/pkg/utils" +) + +func InitUserRPC() { + r, err := etcd.NewEtcdResolver([]string{config.Etcd.Addr}) + if err != nil { + panic(err) + } + userClient, err = userservice.NewClient(constants.UserServiceName, client.WithResolver(r)) + if err != nil { + panic(err) + } +} + +func LoginRPC(ctx context.Context, req *user.LoginRequest) (token *string, err error) { + resp, err := userClient.Login(ctx, req) + if ok, err := utils.IsSuccess(err, resp.Base); !ok { + return nil, err + } + return resp.Token, nil +} + +func RegisterRPC(ctx context.Context, req *user.RegisterRequest) (uid *int64, err error) { + resp, err := userClient.Register(ctx, req) + if ok, err := utils.IsSuccess(err, resp.Base); !ok { + return nil, err + } + return resp.UserId, nil +} diff --git a/cmd/api/build.sh b/cmd/api/build.sh new file mode 100755 index 0000000..f1ba589 --- /dev/null +++ b/cmd/api/build.sh @@ -0,0 +1,6 @@ +#!/bin/bash +RUN_NAME=hertz_service +mkdir -p output/bin +cp script/* output 2>/dev/null +chmod +x output/bootstrap.sh +go build -o output/bin/${RUN_NAME} \ No newline at end of file diff --git a/cmd/api/docs/docs.go b/cmd/api/docs/docs.go new file mode 100644 index 0000000..714ef09 --- /dev/null +++ b/cmd/api/docs/docs.go @@ -0,0 +1,232 @@ +// Package docs Code generated by swaggo/swag. DO NOT EDIT +package docs + +import "github.com/swaggo/swag" + +const docTemplate = `{ + "schemes": {{ marshal .Schemes }}, + "swagger": "2.0", + "info": { + "description": "{{escape .Description}}", + "title": "{{.Title}}", + "contact": {}, + "version": "{{.Version}}" + }, + "host": "{{.Host}}", + "basePath": "{{.BasePath}}", + "paths": { + "/launch_screen/api/image": { + "get": { + "responses": {} + }, + "put": { + "responses": {} + }, + "post": { + "description": "create launch_screen image", + "consumes": [ + "json/form" + ], + "produces": [ + "application/json" + ], + "summary": "CreateImage", + "parameters": [ + { + "type": "integer", + "description": "1为空,2为页面跳转,3为app跳转", + "name": "pic_type", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "展示时间", + "name": "duration", + "in": "query" + }, + { + "type": "string", + "description": "链接", + "name": "href", + "in": "query" + }, + { + "type": "file", + "description": "图片", + "name": "image", + "in": "formData", + "required": true + }, + { + "type": "integer", + "description": "开始time(时间戳)", + "name": "start_at", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "结束time(时间戳)", + "name": "end_at", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "类型", + "name": "s_type", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "一天展示次数", + "name": "frequency", + "in": "query" + }, + { + "type": "integer", + "description": "每日起始hour", + "name": "start_time", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "每日结束hour", + "name": "end_time", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "token", + "name": "authorization", + "in": "header" + }, + { + "type": "string", + "description": "描述", + "name": "text", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "json类型,正则匹配项", + "name": "regex", + "in": "query" + } + ], + "responses": {} + }, + "delete": { + "responses": {} + } + }, + "/launch_screen/api/image/img": { + "put": { + "responses": {} + } + }, + "/launch_screen/api/image/point": { + "get": { + "responses": {} + } + }, + "/launch_screen/api/images": { + "get": { + "responses": {} + } + }, + "/launch_screen/api/login": { + "post": { + "description": "login to get token", + "consumes": [ + "json/form" + ], + "produces": [ + "application/json" + ], + "summary": "Login", + "parameters": [ + { + "type": "string", + "description": "account", + "name": "account", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "密码", + "name": "password", + "in": "query", + "required": true + } + ], + "responses": {} + } + }, + "/launch_screen/api/register": { + "post": { + "description": "userRegister", + "consumes": [ + "json/form" + ], + "produces": [ + "application/json" + ], + "summary": "Register", + "parameters": [ + { + "type": "string", + "description": "account", + "name": "account", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "name", + "name": "name", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "密码", + "name": "password", + "in": "query", + "required": true + } + ], + "responses": {} + } + }, + "/launch_screen/api/screen": { + "get": { + "responses": {} + } + } + } +}` + +// SwaggerInfo holds exported Swagger Info so clients can modify it +var SwaggerInfo = &swag.Spec{ + Version: "", + Host: "", + BasePath: "", + Schemes: []string{}, + Title: "", + Description: "", + InfoInstanceName: "swagger", + SwaggerTemplate: docTemplate, + LeftDelim: "{{", + RightDelim: "}}", +} + +func init() { + swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) +} diff --git a/cmd/api/docs/swagger.json b/cmd/api/docs/swagger.json new file mode 100644 index 0000000..178822b --- /dev/null +++ b/cmd/api/docs/swagger.json @@ -0,0 +1,203 @@ +{ + "swagger": "2.0", + "info": { + "contact": {} + }, + "paths": { + "/launch_screen/api/image": { + "get": { + "responses": {} + }, + "put": { + "responses": {} + }, + "post": { + "description": "create launch_screen image", + "consumes": [ + "json/form" + ], + "produces": [ + "application/json" + ], + "summary": "CreateImage", + "parameters": [ + { + "type": "integer", + "description": "1为空,2为页面跳转,3为app跳转", + "name": "pic_type", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "展示时间", + "name": "duration", + "in": "query" + }, + { + "type": "string", + "description": "链接", + "name": "href", + "in": "query" + }, + { + "type": "file", + "description": "图片", + "name": "image", + "in": "formData", + "required": true + }, + { + "type": "integer", + "description": "开始time(时间戳)", + "name": "start_at", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "结束time(时间戳)", + "name": "end_at", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "类型", + "name": "s_type", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "一天展示次数", + "name": "frequency", + "in": "query" + }, + { + "type": "integer", + "description": "每日起始hour", + "name": "start_time", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "每日结束hour", + "name": "end_time", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "token", + "name": "authorization", + "in": "header" + }, + { + "type": "string", + "description": "描述", + "name": "text", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "json类型,正则匹配项", + "name": "regex", + "in": "query" + } + ], + "responses": {} + }, + "delete": { + "responses": {} + } + }, + "/launch_screen/api/image/img": { + "put": { + "responses": {} + } + }, + "/launch_screen/api/image/point": { + "get": { + "responses": {} + } + }, + "/launch_screen/api/images": { + "get": { + "responses": {} + } + }, + "/launch_screen/api/login": { + "post": { + "description": "login to get token", + "consumes": [ + "json/form" + ], + "produces": [ + "application/json" + ], + "summary": "Login", + "parameters": [ + { + "type": "string", + "description": "account", + "name": "account", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "密码", + "name": "password", + "in": "query", + "required": true + } + ], + "responses": {} + } + }, + "/launch_screen/api/register": { + "post": { + "description": "userRegister", + "consumes": [ + "json/form" + ], + "produces": [ + "application/json" + ], + "summary": "Register", + "parameters": [ + { + "type": "string", + "description": "account", + "name": "account", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "name", + "name": "name", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "密码", + "name": "password", + "in": "query", + "required": true + } + ], + "responses": {} + } + }, + "/launch_screen/api/screen": { + "get": { + "responses": {} + } + } + } +} \ No newline at end of file diff --git a/cmd/api/docs/swagger.yaml b/cmd/api/docs/swagger.yaml new file mode 100644 index 0000000..3d28412 --- /dev/null +++ b/cmd/api/docs/swagger.yaml @@ -0,0 +1,137 @@ +info: + contact: {} +paths: + /launch_screen/api/image: + delete: + responses: {} + get: + responses: {} + post: + consumes: + - json/form + description: create launch_screen image + parameters: + - description: 1为空,2为页面跳转,3为app跳转 + in: query + name: pic_type + required: true + type: integer + - description: 展示时间 + in: query + name: duration + type: integer + - description: 链接 + in: query + name: href + type: string + - description: 图片 + in: formData + name: image + required: true + type: file + - description: 开始time(时间戳) + in: query + name: start_at + required: true + type: integer + - description: 结束time(时间戳) + in: query + name: end_at + required: true + type: integer + - description: 类型 + in: query + name: s_type + required: true + type: integer + - description: 一天展示次数 + in: query + name: frequency + type: integer + - description: 每日起始hour + in: query + name: start_time + required: true + type: integer + - description: 每日结束hour + in: query + name: end_time + required: true + type: integer + - description: token + in: header + name: authorization + type: string + - description: 描述 + in: query + name: text + required: true + type: string + - description: json类型,正则匹配项 + in: query + name: regex + type: string + produces: + - application/json + responses: {} + summary: CreateImage + put: + responses: {} + /launch_screen/api/image/img: + put: + responses: {} + /launch_screen/api/image/point: + get: + responses: {} + /launch_screen/api/images: + get: + responses: {} + /launch_screen/api/login: + post: + consumes: + - json/form + description: login to get token + parameters: + - description: account + in: query + name: account + required: true + type: string + - description: 密码 + in: query + name: password + required: true + type: string + produces: + - application/json + responses: {} + summary: Login + /launch_screen/api/register: + post: + consumes: + - json/form + description: userRegister + parameters: + - description: account + in: query + name: account + required: true + type: string + - description: name + in: query + name: name + required: true + type: string + - description: 密码 + in: query + name: password + required: true + type: string + produces: + - application/json + responses: {} + summary: Register + /launch_screen/api/screen: + get: + responses: {} +swagger: "2.0" diff --git a/cmd/api/main.go b/cmd/api/main.go new file mode 100755 index 0000000..0fd2660 --- /dev/null +++ b/cmd/api/main.go @@ -0,0 +1,65 @@ +// Code generated by hertz generator. + +package main + +import ( + "flag" + "github.com/cloudwego/hertz/pkg/app/server" + "github.com/elastic/go-elasticsearch" + hertztracer "github.com/hertz-contrib/tracer/hertz" + "github.com/west2-online/fzuhelper-server/cmd/api/biz/pack/tracer" + "github.com/west2-online/fzuhelper-server/cmd/api/biz/rpc" + "github.com/west2-online/fzuhelper-server/config" + "github.com/west2-online/fzuhelper-server/pkg/constants" + "github.com/west2-online/fzuhelper-server/pkg/logger" + myutils "github.com/west2-online/fzuhelper-server/pkg/utils" +) + +var ( + path *string + listenAddr string // listen port + + EsClient *elasticsearch.Client +) + +func Init() { + path = flag.String("config", "./config", "config path") + flag.Parse() + config.Init(*path, constants.APIServiceName) + logger.LoggerInit() + tracer.InitJaegerTracer(constants.APIServiceName) + rpc.Init() +} + +func main() { + Init() + //r, err := nacos.NewDefaultNacosRegistry( + //) + + for index, addr := range config.Service.AddrList { + if ok := myutils.AddrCheck(addr); ok { + listenAddr = addr + break + } + if index == len(config.Service.AddrList)-1 { + logger.LoggerObj.Fatalf("not available addr") + } + } + + h := server.New( + server.WithHostPorts(listenAddr), + server.WithStreamBody(true), + //server.WithRegistry(r, ®istry.Info{ + // ServiceName: "fzuhelper-server.api", + // Addr: utils.NewNetAddr("tcp", listenAddr), + // Weight: 10, + // Tags: nil, + //}), for nacos + server.WithTracer(hertztracer.NewDefaultTracer()), + server.WithMaxRequestBodySize(1<<31), + ) + h.Use(hertztracer.ServerCtx()) + + register(h) + h.Spin() +} diff --git a/cmd/api/router.go b/cmd/api/router.go new file mode 100755 index 0000000..4d2ef95 --- /dev/null +++ b/cmd/api/router.go @@ -0,0 +1,15 @@ +// Code generated by hertz generator. + +package main + +import ( + "github.com/cloudwego/hertz/pkg/app/server" + handler "github.com/west2-online/fzuhelper-server/cmd/api/biz/handler" +) + +// customizeRegister registers customize routers. +func customizedRegister(r *server.Hertz) { + r.GET("/ping", handler.Ping) + + // your code ... +} diff --git a/cmd/api/router_gen.go b/cmd/api/router_gen.go new file mode 100755 index 0000000..72081a3 --- /dev/null +++ b/cmd/api/router_gen.go @@ -0,0 +1,16 @@ +// Code generated by hertz generator. DO NOT EDIT. + +package main + +import ( + "github.com/cloudwego/hertz/pkg/app/server" + router "github.com/west2-online/fzuhelper-server/cmd/api/biz/router" +) + +// register registers all routers. +func register(r *server.Hertz) { + + router.GeneratedRegister(r) + + customizedRegister(r) +} diff --git a/cmd/api/script/bootstrap.sh b/cmd/api/script/bootstrap.sh new file mode 100755 index 0000000..3f3fc1a --- /dev/null +++ b/cmd/api/script/bootstrap.sh @@ -0,0 +1,5 @@ +#!/bin/bash +CURDIR=$(cd $(dirname $0); pwd) +BinaryName=hertz_service +echo "$CURDIR/bin/${BinaryName}" +exec $CURDIR/bin/${BinaryName} \ No newline at end of file diff --git a/cmd/launch_screen/build.sh b/cmd/launch_screen/build.sh new file mode 100644 index 0000000..cf7b573 --- /dev/null +++ b/cmd/launch_screen/build.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +RUN_NAME="launch_screen" + +mkdir -p output/bin +cp script/* output/ +chmod +x output/bootstrap.sh + +if [ "$IS_SYSTEM_TEST_ENV" != "1" ]; then + go build -o output/bin/${RUN_NAME} +else + go test -c -covermode=set -o output/bin/${RUN_NAME} -coverpkg=./... +fi diff --git a/cmd/launch_screen/dal/db/init.go b/cmd/launch_screen/dal/db/init.go new file mode 100644 index 0000000..4abc768 --- /dev/null +++ b/cmd/launch_screen/dal/db/init.go @@ -0,0 +1,41 @@ +package db + +import ( + "context" + "github.com/west2-online/fzuhelper-server/pkg/constants" + logger2 "github.com/west2-online/fzuhelper-server/pkg/logger" + "github.com/west2-online/fzuhelper-server/pkg/utils" + "gorm.io/driver/mysql" + "gorm.io/gorm" + "gorm.io/gorm/logger" + "gorm.io/gorm/schema" +) + +var ( + DB *gorm.DB +) + +func InitMySQL() { + dsn, err := utils.GetMysqlDSN() + if err != nil { + + } + DB, err = gorm.Open(mysql.Open(dsn), + &gorm.Config{ + Logger: logger.Default.LogMode(logger.Info), + NamingStrategy: schema.NamingStrategy{ + SingularTable: true, + }, + }) + if err != nil { + logger2.LoggerObj.Fatal("mysql connect error") + } else { + logger2.LoggerObj.Info("mysql connect access") + } + + sqlDB, _ := DB.DB() + sqlDB.SetMaxIdleConns(constants.MaxIdleConns) + sqlDB.SetMaxOpenConns(constants.MaxConnections) + sqlDB.SetConnMaxLifetime(constants.ConnMaxLifetime) + DB = DB.Table(constants.LaunchScreenTableName).WithContext(context.Background()) +} diff --git a/cmd/launch_screen/dal/db/mysql.go b/cmd/launch_screen/dal/db/mysql.go new file mode 100644 index 0000000..f847ba2 --- /dev/null +++ b/cmd/launch_screen/dal/db/mysql.go @@ -0,0 +1,35 @@ +package db + +import ( + "context" + "gorm.io/gorm" + "time" +) + +type Picture struct { + ID int64 + Uid int64 + Url string + Href string + Text string + PicType int64 + ShowTimes int64 + PointTimes int64 + Duration int64 + StartAt time.Time // 开始时间 + EndAt time.Time // 结束时间 + StartTime int64 // 开始时段 0~24 + EndTime int64 // 结束时段 0~24 + SType int64 // 类型 + Frequency int64 // 一天展示次数 + CreatedAt time.Time + UpdatedAt time.Time + DeletedAt gorm.DeletedAt `sql:"index"` +} + +func CreateImage(ctx context.Context, pictureModel *Picture) (*Picture, error) { + if err := DB.WithContext(ctx).Create(pictureModel).Error; err != nil { + return nil, err + } + return pictureModel, nil +} diff --git a/cmd/launch_screen/dal/init.go b/cmd/launch_screen/dal/init.go new file mode 100644 index 0000000..f8e18b0 --- /dev/null +++ b/cmd/launch_screen/dal/init.go @@ -0,0 +1,7 @@ +package dal + +import "github.com/west2-online/fzuhelper-server/cmd/launch_screen/dal/db" + +func Init() { + db.InitMySQL() +} diff --git a/cmd/launch_screen/handler.go b/cmd/launch_screen/handler.go new file mode 100644 index 0000000..6c55652 --- /dev/null +++ b/cmd/launch_screen/handler.go @@ -0,0 +1,116 @@ +package main + +import ( + "context" + "github.com/cloudwego/kitex/client" + "github.com/west2-online/fzuhelper-server/cmd/launch_screen/dal/db" + "github.com/west2-online/fzuhelper-server/cmd/launch_screen/pack" + "github.com/west2-online/fzuhelper-server/cmd/launch_screen/service" + "github.com/west2-online/fzuhelper-server/kitex_gen/launch_screen" + "github.com/west2-online/fzuhelper-server/kitex_gen/launch_screen/launchscreenservice" + "github.com/west2-online/fzuhelper-server/kitex_gen/model" + "github.com/west2-online/fzuhelper-server/pkg/constants" + "github.com/west2-online/fzuhelper-server/pkg/utils" + "golang.org/x/sync/errgroup" +) + +// LaunchScreenServiceImpl implements the last service interface defined in the IDL. +type LaunchScreenServiceImpl struct { + launchScreenCli launchscreenservice.Client +} + +func NewLaunchScreenClient(addr string) (launchscreenservice.Client, error) { + return launchscreenservice.NewClient(constants.LaunchScreenServiceName, client.WithHostPorts(addr)) +} + +// CreateImage implements the LaunchScreenServiceImpl interface. +func (s *LaunchScreenServiceImpl) CreateImage(ctx context.Context, req *launch_screen.CreateImageRequest) (resp *launch_screen.CreateImageResponse, err error) { + resp = new(launch_screen.CreateImageResponse) + claim, err := utils.CheckToken(req.Token) + if err != nil { + resp.Base = utils.BuildBaseResp(err) + return resp, nil + } + uid := claim.UserId + imgUrl := pack.GenerateImgName(uid) + pic := new(db.Picture) + + var eg errgroup.Group + eg.Go(func() error { + picture := &model.Picture{ + UserId: uid, + Url: imgUrl, + Href: *req.Href, + Text: req.Text, + PicType: req.PicType, + Duration: *req.Duration, + SType: &req.SType, + Frequency: req.Frequency, + StartTime: req.StartTime, + EndTime: req.EndTime, + StartAt: req.StartAt, + EndAt: req.EndAt, + } + pic, err = service.NewLaunchScreenService(ctx).PutImage(picture) + if err != nil { + return err + } + return nil + }) + eg.Go(func() error { + err = pack.UploadImg(req.Image, imgUrl) + if err != nil { + return err + } + return nil + }) + if err = eg.Wait(); err != nil { + resp.Base = utils.BuildBaseResp(err) + return resp, nil + } + resp.Base = utils.BuildBaseResp(nil) + resp.Picture = service.BuildImageResp(pic) + return resp, nil +} + +// GetImage implements the LaunchScreenServiceImpl interface. +func (s *LaunchScreenServiceImpl) GetImage(ctx context.Context, req *launch_screen.GetImageRequest) (resp *launch_screen.GetImagesByUserIdResponse, err error) { + // TODO: Your code here... + return +} + +// GetImagesByUserId implements the LaunchScreenServiceImpl interface. +func (s *LaunchScreenServiceImpl) GetImagesByUserId(ctx context.Context, req *launch_screen.GetImagesByUserIdRequest) (resp *launch_screen.GetImagesByUserIdResponse, err error) { + // TODO: Your code here... + return +} + +// ChangeImageProperty implements the LaunchScreenServiceImpl interface. +func (s *LaunchScreenServiceImpl) ChangeImageProperty(ctx context.Context, req *launch_screen.ChangeImagePropertyRequest) (resp *launch_screen.ChangeImagePropertyResponse, err error) { + // TODO: Your code here... + return +} + +// ChangeImage implements the LaunchScreenServiceImpl interface. +func (s *LaunchScreenServiceImpl) ChangeImage(ctx context.Context, req *launch_screen.ChangeImageRequest) (resp *launch_screen.ChangeImageResponse, err error) { + // TODO: Your code here... + return +} + +// DeleteImage implements the LaunchScreenServiceImpl interface. +func (s *LaunchScreenServiceImpl) DeleteImage(ctx context.Context, req *launch_screen.DeleteImageRequest) (resp *launch_screen.DeleteImageResponse, err error) { + // TODO: Your code here... + return +} + +// MobileGetImage implements the LaunchScreenServiceImpl interface. +func (s *LaunchScreenServiceImpl) MobileGetImage(ctx context.Context, req *launch_screen.MobileGetImageRequest) (resp *launch_screen.MobileGetImageResponse, err error) { + // TODO: Your code here... + return +} + +// AddImagePointTime implements the LaunchScreenServiceImpl interface. +func (s *LaunchScreenServiceImpl) AddImagePointTime(ctx context.Context, req *launch_screen.AddImagePointTimeRequest) (resp *launch_screen.AddImagePointTimeResponse, err error) { + // TODO: Your code here... + return +} diff --git a/cmd/launch_screen/kitex_info.yaml b/cmd/launch_screen/kitex_info.yaml new file mode 100644 index 0000000..710ec49 --- /dev/null +++ b/cmd/launch_screen/kitex_info.yaml @@ -0,0 +1,3 @@ +kitexinfo: + ServiceName: 'launch_screen' + ToolVersion: 'v0.9.1' diff --git a/cmd/launch_screen/main.go b/cmd/launch_screen/main.go new file mode 100644 index 0000000..1a04ed7 --- /dev/null +++ b/cmd/launch_screen/main.go @@ -0,0 +1,119 @@ +package main + +import ( + "flag" + "fmt" + "github.com/cloudwego/kitex/pkg/klog" + "github.com/cloudwego/kitex/pkg/limit" + "github.com/cloudwego/kitex/pkg/rpcinfo" + "github.com/cloudwego/kitex/server" + "github.com/cloudwego/netpoll" + elastic "github.com/elastic/go-elasticsearch" + kitexlogrus "github.com/kitex-contrib/obs-opentelemetry/logging/logrus" + etcd "github.com/kitex-contrib/registry-etcd" + kopentracing "github.com/kitex-contrib/tracer-opentracing" + "github.com/sirupsen/logrus" + "github.com/west2-online/fzuhelper-server/cmd/api/biz/pack/tracer" + "github.com/west2-online/fzuhelper-server/cmd/launch_screen/dal" + "github.com/west2-online/fzuhelper-server/config" + launch_screen "github.com/west2-online/fzuhelper-server/kitex_gen/launch_screen/launchscreenservice" + "github.com/west2-online/fzuhelper-server/pkg/constants" + "github.com/west2-online/fzuhelper-server/pkg/eslogrus" + "github.com/west2-online/fzuhelper-server/pkg/logger" + "github.com/west2-online/fzuhelper-server/pkg/utils" + "log" +) + +var ( + path *string + listenAddr string + EsClient *elastic.Client +) + +func Init() { + path = flag.String("config", "./config", "config path") + flag.Parse() + logger.LoggerInit() + config.Init(*path, constants.LaunchScreenServiceName) + dal.Init() + tracer.InitJaegerTracer(constants.LaunchScreenServiceName) + EsInit() + klog.SetLevel(klog.LevelWarn) + klog.SetLogger(kitexlogrus.NewLogger(kitexlogrus.WithHook(EsHookLog()))) +} + +func main() { + Init() + r, err := etcd.NewEtcdRegistry([]string{config.Etcd.Addr}) + if err != nil { + panic(err) + } + + //获取addr + for index, addr := range config.Service.AddrList { + if ok := utils.AddrCheck(addr); ok { + listenAddr = addr + break + } + + if index == len(config.Service.AddrList)-1 { + klog.Fatal("not available addr") + } + } + + launchScreenServiceImpl := new(LaunchScreenServiceImpl) + launchScreenCli, err := NewLaunchScreenClient(listenAddr) + if err != nil { + log.Fatal(err) + } + serviceAddr, err := netpoll.ResolveTCPAddr("tcp", listenAddr) + if err != nil { + log.Fatal(err) + } + launchScreenServiceImpl.launchScreenCli = launchScreenCli + + svr := launch_screen.NewServer(launchScreenServiceImpl, // 指定 Registry 与服务基本信息 + server.WithServerBasicInfo( + &rpcinfo.EndpointBasicInfo{ + ServiceName: constants.LaunchScreenServiceName, + }), + server.WithSuite(kopentracing.NewDefaultServerSuite()), //jaeger + server.WithRegistry(r), + server.WithServiceAddr(serviceAddr), + server.WithLimit( + &limit.Option{ + MaxConnections: constants.MaxConnections, + MaxQPS: constants.MaxQPS, + }, + ), + ) + + err = svr.Run() + + if err != nil { + klog.Error(err.Error()) + } +} + +func EsHookLog() *eslogrus.ElasticHook { + hook, err := eslogrus.NewElasticHook(EsClient, config.Elasticsearch.Host, logrus.DebugLevel, constants.LaunchScreenServiceName) + if err != nil { + panic(err) + } + + return hook +} + +// InitEs 初始化es +func EsInit() { + esConn := fmt.Sprintf("http://%s", config.Elasticsearch.Addr) + cfg := elastic.Config{ + Addresses: []string{esConn}, + } + klog.Infof("esConn:%v", esConn) + client, err := elastic.NewClient(cfg) + if err != nil { + panic(err) + } + EsClient = client +} diff --git a/cmd/launch_screen/pack/upcloud.go b/cmd/launch_screen/pack/upcloud.go new file mode 100644 index 0000000..c7ebf5a --- /dev/null +++ b/cmd/launch_screen/pack/upcloud.go @@ -0,0 +1,36 @@ +package pack + +import ( + "fmt" + "time" +) + +func UploadImg(file []byte, name string) error { + //body := bytes.NewReader(file) + //url := config.Upcloud.DomainName + config.Upcloud.Path + name + // + //req, err := http.NewRequest("PUT", url, body) + //if err != nil { + // return err + //} + //req.SetBasicAuth(config.Upcloud.User, config.Upcloud.Pass) + //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 != 200 { + // return errno.UpcloudError + //} + return nil +} + +func GenerateImgName(uid int64) string { + currentTime := time.Now() + // 获取年月日和小时分钟 + year, month, day := currentTime.Date() + hour, minute := currentTime.Hour(), currentTime.Minute() + second := currentTime.Second() + return fmt.Sprintf("%v_%d%02d%02d_%02d%02d%02d_cover.jpg", uid, year, month, day, hour, minute, second) +} diff --git a/cmd/launch_screen/script/bootstrap.sh b/cmd/launch_screen/script/bootstrap.sh new file mode 100644 index 0000000..0c1b7f1 --- /dev/null +++ b/cmd/launch_screen/script/bootstrap.sh @@ -0,0 +1,21 @@ +#! /usr/bin/env bash +CURDIR=$(cd $(dirname $0); pwd) + +if [ "X$1" != "X" ]; then + RUNTIME_ROOT=$1 +else + RUNTIME_ROOT=${CURDIR} +fi + +export KITEX_RUNTIME_ROOT=$RUNTIME_ROOT +export KITEX_LOG_DIR="$RUNTIME_ROOT/log" + +if [ ! -d "$KITEX_LOG_DIR/app" ]; then + mkdir -p "$KITEX_LOG_DIR/app" +fi + +if [ ! -d "$KITEX_LOG_DIR/rpc" ]; then + mkdir -p "$KITEX_LOG_DIR/rpc" +fi + +exec "$CURDIR/bin/launch_screen" diff --git a/cmd/launch_screen/service/create.go b/cmd/launch_screen/service/create.go new file mode 100644 index 0000000..1c7bd5f --- /dev/null +++ b/cmd/launch_screen/service/create.go @@ -0,0 +1,29 @@ +package service + +import ( + "github.com/west2-online/fzuhelper-server/cmd/launch_screen/dal/db" + "github.com/west2-online/fzuhelper-server/kitex_gen/model" + "time" +) + +func (s *LaunchScreenService) PutImage(picture *model.Picture) (*db.Picture, error) { + Loc, _ := time.LoadLocation("Asia/Shanghai") + pictureModel := &db.Picture{ + ID: picture.Id, + Uid: picture.UserId, + Url: picture.Url, + Href: picture.Href, + Text: picture.Text, + PicType: picture.PicType, + ShowTimes: 0, + PointTimes: 0, + Duration: picture.Duration, + SType: *picture.SType, + Frequency: picture.Frequency, + StartTime: picture.StartTime, + EndTime: picture.EndTime, + StartAt: time.Unix(picture.StartAt, 0).In(Loc), + EndAt: time.Unix(picture.EndAt, 0).In(Loc), + } + return db.CreateImage(s.ctx, pictureModel) +} diff --git a/cmd/launch_screen/service/service.go b/cmd/launch_screen/service/service.go new file mode 100644 index 0000000..401a27b --- /dev/null +++ b/cmd/launch_screen/service/service.go @@ -0,0 +1,30 @@ +package service + +import ( + "context" + "github.com/west2-online/fzuhelper-server/cmd/launch_screen/dal/db" + "github.com/west2-online/fzuhelper-server/kitex_gen/model" +) + +type LaunchScreenService struct { + ctx context.Context +} + +func NewLaunchScreenService(ctx context.Context) *LaunchScreenService { + return &LaunchScreenService{ctx: ctx} +} + +func BuildImageResp(dbP *db.Picture) *model.Picture { + return &model.Picture{ + Id: dbP.ID, + Url: dbP.Url, + Href: dbP.Href, + Text: dbP.Text, + PicType: dbP.PicType, + ShowTimes: &dbP.ShowTimes, + PointTimes: &dbP.PointTimes, + Duration: dbP.Duration, + SType: &dbP.SType, + Frequency: dbP.Frequency, + } +} diff --git a/cmd/user/build.sh b/cmd/user/build.sh new file mode 100644 index 0000000..d5506b5 --- /dev/null +++ b/cmd/user/build.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +RUN_NAME="user" + +mkdir -p output/bin +cp script/* output/ +chmod +x output/bootstrap.sh + +if [ "$IS_SYSTEM_TEST_ENV" != "1" ]; then + go build -o output/bin/${RUN_NAME} +else + go test -c -covermode=set -o output/bin/${RUN_NAME} -coverpkg=./... +fi diff --git a/cmd/user/dal/db/init.go b/cmd/user/dal/db/init.go new file mode 100644 index 0000000..b0a331b --- /dev/null +++ b/cmd/user/dal/db/init.go @@ -0,0 +1,42 @@ +package db + +import ( + "context" + "github.com/west2-online/fzuhelper-server/pkg/constants" + logger2 "github.com/west2-online/fzuhelper-server/pkg/logger" + "github.com/west2-online/fzuhelper-server/pkg/utils" + "gorm.io/gorm/logger" + + "gorm.io/driver/mysql" + "gorm.io/gorm" + "gorm.io/gorm/schema" +) + +var ( + DB *gorm.DB +) + +func InitMySQL() { + dsn, err := utils.GetMysqlDSN() + if err != nil { + + } + DB, err = gorm.Open(mysql.Open(dsn), + &gorm.Config{ + Logger: logger.Default.LogMode(logger.Info), + NamingStrategy: schema.NamingStrategy{ + SingularTable: true, + }, + }) + if err != nil { + logger2.LoggerObj.Fatal("mysql connect error") + } else { + logger2.LoggerObj.Info("mysql connect access") + } + + sqlDB, _ := DB.DB() + sqlDB.SetMaxIdleConns(constants.MaxIdleConns) + sqlDB.SetMaxOpenConns(constants.MaxConnections) + sqlDB.SetConnMaxLifetime(constants.ConnMaxLifetime) + DB = DB.Table(constants.UserTableName).WithContext(context.Background()) +} diff --git a/cmd/user/dal/db/mysql.go b/cmd/user/dal/db/mysql.go new file mode 100644 index 0000000..689f9c5 --- /dev/null +++ b/cmd/user/dal/db/mysql.go @@ -0,0 +1,48 @@ +//MVC--Model + +package db + +import ( + "context" + "github.com/west2-online/fzuhelper-server/cmd/user/pack/pwd" + "github.com/west2-online/fzuhelper-server/pkg/errno" + "gorm.io/gorm" + "time" +) + +type User struct { + ID int64 + Account string + Password string + Name string + CreatedAt time.Time + UpdatedAt time.Time + DeletedAt gorm.DeletedAt `sql:"index"` +} + +func Register(ctx context.Context, userModel *User) (*User, error) { + userResp := new(User) + //WithContext(ctx)是将一个context.Context对象和数据库连接绑定,以实现在数据库操作中使用context.Context上下文传递。 + if err := DB.WithContext(ctx).Where("account = ? OR name = ?", userModel.Account, userModel.Name).First(&userResp).Error; err == nil { + return nil, errno.UserExistedError + } + + if err := DB.WithContext(ctx).Create(userModel).Error; err != nil { + return nil, err + } + return userModel, nil +} + +func Login(ctx context.Context, userModel *User) (*User, error) { + userResp := new(User) + if err := DB.WithContext(ctx).Where("account = ?", userModel.Account). + First(&userResp).Error; err != nil { + return nil, errno.UserNonExistError + } + + if !pwd.CheckPassword(userResp.Password, userModel.Password) { + return nil, errno.AuthFailedError + } + + return userResp, nil +} diff --git a/cmd/user/dal/init.go b/cmd/user/dal/init.go new file mode 100644 index 0000000..71492f9 --- /dev/null +++ b/cmd/user/dal/init.go @@ -0,0 +1,9 @@ +package dal + +import ( + "github.com/west2-online/fzuhelper-server/cmd/user/dal/db" +) + +func Init() { + db.InitMySQL() +} diff --git a/cmd/user/handler.go b/cmd/user/handler.go new file mode 100644 index 0000000..aa74a6a --- /dev/null +++ b/cmd/user/handler.go @@ -0,0 +1,53 @@ +package main + +import ( + "context" + "github.com/cloudwego/kitex/client" + "github.com/west2-online/fzuhelper-server/cmd/user/service" + "github.com/west2-online/fzuhelper-server/kitex_gen/user" + "github.com/west2-online/fzuhelper-server/kitex_gen/user/userservice" + "github.com/west2-online/fzuhelper-server/pkg/constants" + "github.com/west2-online/fzuhelper-server/pkg/utils" +) + +// UserServiceImpl implements the last service interface defined in the IDL. +type UserServiceImpl struct { + userCli userservice.Client +} + +func NewUserClient(addr string) (userservice.Client, error) { + return userservice.NewClient(constants.UserServiceName, client.WithHostPorts(addr)) +} + +// Login implements the UserServiceImpl interface. +func (s *UserServiceImpl) Login(ctx context.Context, req *user.LoginRequest) (resp *user.LoginResponse, err error) { + resp = new(user.LoginResponse) + userResp, err := service.NewUserService(ctx).Login(req) + resp.Base = utils.BuildBaseResp(err) + if err != nil { + return resp, nil + } + token, err := utils.CreateToken(userResp.ID) + resp.Base = utils.BuildBaseResp(err) + if err != nil { + return resp, nil + } + resp.Token = &token + return resp, nil +} + +// Register implements the UserServiceImpl interface. +func (s *UserServiceImpl) Register(ctx context.Context, req *user.RegisterRequest) (resp *user.RegisterResponse, err error) { + resp = new(user.RegisterResponse) + + userResp, err := service.NewUserService(ctx).Register(req) + + resp.Base = utils.BuildBaseResp(err) + if err != nil { + return resp, nil + } + + resp.UserId = &userResp.ID + + return resp, nil +} diff --git a/cmd/user/kitex_info.yaml b/cmd/user/kitex_info.yaml new file mode 100644 index 0000000..da2b64e --- /dev/null +++ b/cmd/user/kitex_info.yaml @@ -0,0 +1,3 @@ +kitexinfo: + ServiceName: 'user' + ToolVersion: 'v0.9.1' diff --git a/cmd/user/main.go b/cmd/user/main.go new file mode 100644 index 0000000..ac9c313 --- /dev/null +++ b/cmd/user/main.go @@ -0,0 +1,122 @@ +package main + +import ( + "flag" + "fmt" + "github.com/cloudwego/kitex/pkg/klog" + "github.com/cloudwego/kitex/pkg/limit" + "github.com/cloudwego/kitex/pkg/rpcinfo" + "github.com/cloudwego/kitex/server" + "github.com/cloudwego/netpoll" + "github.com/elastic/go-elasticsearch" + elastic "github.com/elastic/go-elasticsearch" + kitexlogrus "github.com/kitex-contrib/obs-opentelemetry/logging/logrus" + etcd "github.com/kitex-contrib/registry-etcd" + kopentracing "github.com/kitex-contrib/tracer-opentracing" + "github.com/sirupsen/logrus" + "github.com/west2-online/fzuhelper-server/cmd/api/biz/pack/tracer" + "github.com/west2-online/fzuhelper-server/cmd/user/dal" + "github.com/west2-online/fzuhelper-server/config" + user "github.com/west2-online/fzuhelper-server/kitex_gen/user/userservice" + "github.com/west2-online/fzuhelper-server/pkg/constants" + "github.com/west2-online/fzuhelper-server/pkg/eslogrus" + "github.com/west2-online/fzuhelper-server/pkg/logger" + "github.com/west2-online/fzuhelper-server/pkg/utils" + "log" +) + +var ( + path *string + listenAddr string + EsClient *elastic.Client +) + +func Init() { + path = flag.String("config", "./config", "config path") + flag.Parse() + logger.LoggerInit() + config.Init(*path, constants.UserServiceName) + dal.Init() + tracer.InitJaegerTracer(constants.UserServiceName) + EsInit() + klog.SetLevel(klog.LevelWarn) + klog.SetLogger(kitexlogrus.NewLogger(kitexlogrus.WithHook(EsHookLog()))) +} + +func main() { + Init() + r, err := etcd.NewEtcdRegistry([]string{config.Etcd.Addr}) + if err != nil { + panic(err) + } + + //获取addr + for index, addr := range config.Service.AddrList { + if ok := utils.AddrCheck(addr); ok { + listenAddr = addr + break + } + + if index == len(config.Service.AddrList)-1 { + klog.Fatal("not available addr") + } + } + + userHandlerImpl := new(UserServiceImpl) + userCli, err := NewUserClient(listenAddr) + if err != nil { + log.Fatal(err) + } + serviceAddr, err := netpoll.ResolveTCPAddr("tcp", listenAddr) + if err != nil { + log.Fatal(err) + } + userHandlerImpl.userCli = userCli + //然而不使用WithServiceAddr方法的话,server还是在监听8888 + //那Impl携带一个Client就没用了 + + svr := user.NewServer(userHandlerImpl, // 指定 Registry 与服务基本信息 + server.WithServerBasicInfo( + &rpcinfo.EndpointBasicInfo{ + ServiceName: constants.UserServiceName, + }), + server.WithSuite(kopentracing.NewDefaultServerSuite()), //jaeger + server.WithRegistry(r), + server.WithServiceAddr(serviceAddr), + server.WithLimit( + &limit.Option{ + MaxConnections: constants.MaxConnections, + MaxQPS: constants.MaxQPS, + }, + ), + ) + + err = svr.Run() + + if err != nil { + klog.Error(err.Error()) + } +} + +func EsHookLog() *eslogrus.ElasticHook { + hook, err := eslogrus.NewElasticHook(EsClient, config.Elasticsearch.Host, logrus.DebugLevel, constants.UserServiceName) + if err != nil { + panic(err) + } + + return hook +} + +// InitEs 初始化es +func EsInit() { + esConn := fmt.Sprintf("http://%s", config.Elasticsearch.Addr) + cfg := elasticsearch.Config{ + Addresses: []string{esConn}, + } + klog.Infof("esConn:%v", esConn) + client, err := elasticsearch.NewClient(cfg) + if err != nil { + panic(err) + } + EsClient = client +} diff --git a/cmd/user/pack/pwd/pwd.go b/cmd/user/pack/pwd/pwd.go new file mode 100644 index 0000000..c14fa3f --- /dev/null +++ b/cmd/user/pack/pwd/pwd.go @@ -0,0 +1,18 @@ +package pwd + +import ( + "golang.org/x/crypto/bcrypt" +) + +// 加密 +func SetPassword(password string) (hashBytes string) { + bytes, _ := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost) + hashBytes = string(bytes) + return hashBytes +} + +// 解密 +func CheckPassword(pwdDigest string, password string) bool { + err := bcrypt.CompareHashAndPassword([]byte(pwdDigest), []byte(password)) + return err == nil +} diff --git a/cmd/user/script/bootstrap.sh b/cmd/user/script/bootstrap.sh new file mode 100644 index 0000000..e3daf0a --- /dev/null +++ b/cmd/user/script/bootstrap.sh @@ -0,0 +1,21 @@ +#! /usr/bin/env bash +CURDIR=$(cd $(dirname $0); pwd) + +if [ "X$1" != "X" ]; then + RUNTIME_ROOT=$1 +else + RUNTIME_ROOT=${CURDIR} +fi + +export KITEX_RUNTIME_ROOT=$RUNTIME_ROOT +export KITEX_LOG_DIR="$RUNTIME_ROOT/log" + +if [ ! -d "$KITEX_LOG_DIR/app" ]; then + mkdir -p "$KITEX_LOG_DIR/app" +fi + +if [ ! -d "$KITEX_LOG_DIR/rpc" ]; then + mkdir -p "$KITEX_LOG_DIR/rpc" +fi + +exec "$CURDIR/bin/user" diff --git a/cmd/user/service/login.go b/cmd/user/service/login.go new file mode 100644 index 0000000..8f9c83f --- /dev/null +++ b/cmd/user/service/login.go @@ -0,0 +1,20 @@ +package service + +import ( + "github.com/west2-online/fzuhelper-server/cmd/user/dal/db" + "github.com/west2-online/fzuhelper-server/kitex_gen/user" +) + +func (s *UserService) Login(req *user.LoginRequest /*, stTracer opentracing.Tracer, parentSpan opentracing.Span*/) (*db.User, error) { + userModel := &db.User{ + Account: req.Account, + Password: req.Password, + } + + userResp, err := db.Login(s.ctx, userModel) + if err != nil { + return nil, err + } + + return userResp, nil +} diff --git a/cmd/user/service/register.go b/cmd/user/service/register.go new file mode 100644 index 0000000..6d982f4 --- /dev/null +++ b/cmd/user/service/register.go @@ -0,0 +1,17 @@ +package service + +import ( + "github.com/west2-online/fzuhelper-server/cmd/user/dal/db" + "github.com/west2-online/fzuhelper-server/cmd/user/pack/pwd" + "github.com/west2-online/fzuhelper-server/kitex_gen/user" +) + +func (s *UserService) Register(req *user.RegisterRequest) (*db.User, error) { + PwdDigest := pwd.SetPassword(req.Password) + userModel := &db.User{ + Account: req.Account, + Name: req.Name, + Password: PwdDigest, + } + return db.Register(s.ctx, userModel) +} diff --git a/cmd/user/service/service.go b/cmd/user/service/service.go new file mode 100644 index 0000000..d0d1182 --- /dev/null +++ b/cmd/user/service/service.go @@ -0,0 +1,23 @@ +package service + +import ( + "context" + "github.com/west2-online/fzuhelper-server/cmd/user/dal/db" + "github.com/west2-online/fzuhelper-server/kitex_gen/model" +) + +type UserService struct { + ctx context.Context +} + +func NewUserService(ctx context.Context) *UserService { + return &UserService{ctx: ctx} +} + +func BuildUserResp(dbUser *db.User) *model.User { + return &model.User{ + Id: dbUser.ID, + Name: dbUser.Name, + Account: dbUser.Account, + } +} diff --git a/config/config.go b/config/config.go index 420c4d2..bca3333 100644 --- a/config/config.go +++ b/config/config.go @@ -23,6 +23,7 @@ var ( Redis *redis OSS *oss Elasticsearch *elasticsearch + Upcloud *upcloud runtime_viper = viper.New() ) @@ -84,6 +85,7 @@ func configMapping(srv string) { Redis = &c.Redis OSS = &c.OSS Elasticsearch = &c.Elasticsearch + Upcloud = &c.Upcloud Service = GetService(srv) } diff --git a/config/config.yaml b/config/config.yaml index 3654d91..3b1bda8 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -24,6 +24,14 @@ oss: bucketname: "jiuxia-video" main-directory: fzuhelper +upcloud: + Service: "fzuhelper-assets" + User: "spf" + Pass: "7lRQ6j2HZCyI86bUtsAnvJ4UfEs3eXh7" +# DomainName: "http://fzuhelper-assets.test.upcdn.net" + DomainName: "http://v0.api.upyun.com/fzuhelper-assets" + Path: "/pictures/" + elasticsearch: addr: 127.0.0.1:9200 host: 127.0.0.1 @@ -41,6 +49,11 @@ jaeger: addr: 127.0.0.1:6831 services: + api: + name: api + load-balance: false + addr: + - 127.0.0.1:10000 template: name: template load-balance: false @@ -51,4 +64,16 @@ services: name: empty_room load-balance: false addr: - - 127.0.0.1:10002 \ No newline at end of file + - 127.0.0.1:10002 + + user: + name: user + load-balance: false + addr: + - 127.0.0.1:10003 + + launch_screen: + name: launch_screen + load-balance: false + addr: + - 127.0.0.1:10004 diff --git a/config/sql/init.sql b/config/sql/init.sql index 6e7c5d0..3446487 100644 --- a/config/sql/init.sql +++ b/config/sql/init.sql @@ -96,4 +96,43 @@ create table fzuhelper.`mark` foreign key (`stu_id`) references fzuhelper.`student` (`id`) on delete cascade -)engine=InnoDB default charset=utf8mb4; \ No newline at end of file +)engine=InnoDB default charset=utf8mb4; + +CREATE TABLE fzuhelper.`user` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID', + `account` varchar(255) NOT NULL COMMENT 'account', + `name` varchar(255) NOT NULL COMMENT 'name', + `password` varchar(255) NOT NULL COMMENT '密码', + `created_at` timestamp NOT NULL DEFAULT current_timestamp , + `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE current_timestamp, + `deleted_at` timestamp NULL DEFAULT NULL, + constraint `id` + primary key (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4; + +create table fzuhelper.`launch_screen`( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID', + `uid` bigint NOT NULL COMMENT 'UserID (new add)', + `url` varchar(512) null, + `href` varchar(255) null, + `text` varchar(255) null, + `pic_type` bigint default 1 null COMMENT '1为空,2为页面跳转,3为app跳转', + `show_times` bigint default 0 null, + `point_times` bigint default 0 null, + `duration` bigint default 3 null, + `start_at` timestamp null COMMENT '开始时间', + `end_at` timestamp null COMMENT '结束时间', + `start_time` bigint default 0 null COMMENT '开始时段 0-24', + `end_time` bigint default 24 null COMMENT '结束时段 0-24', + `s_type` bigint null COMMENT '类型', + `frequency` bigint null COMMENT '一天展示次数', + `created_at` timestamp NOT NULL DEFAULT current_timestamp , + `updated_at` timestamp NOT NULL DEFAULT current_timestamp ON UPDATE current_timestamp, + `deleted_at` timestamp NULL DEFAULT NULL, + constraint `id` + primary key (`id`), + constraint `launch_screen_user` + foreign key (`uid`) + references fzuhelper.`user` (`id`) + on delete cascade +)ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4; diff --git a/config/types.go b/config/types.go index bb4f5f6..933f907 100644 --- a/config/types.go +++ b/config/types.go @@ -57,6 +57,13 @@ type elasticsearch struct { Host string } +type upcloud struct { + Service string + User string + Pass string + DomainName string + Path string +} type config struct { Server server Snowflake snowflake @@ -67,4 +74,5 @@ type config struct { Redis redis OSS oss Elasticsearch elasticsearch + Upcloud upcloud } diff --git a/docker/etcd-monitor.sh b/docker/etcd-monitor.sh index effbe57..b417b3f 100755 --- a/docker/etcd-monitor.sh +++ b/docker/etcd-monitor.sh @@ -15,20 +15,20 @@ while true; do done # upload config -etcdctl put /config/config.yaml -- < /config/config.yaml +etcdctl put /config/config.yaml -- < ./config/config.yaml # continuous listen -previous_hash=$(sha256sum /config/config.yaml | awk '{print $1}') +previous_hash=$(sha256sum ./config/config.yaml | awk '{print $1}') while true; do - current_hash=$(sha256sum /config/config.yaml | awk '{print $1}') + current_hash=$(sha256sum ./config/config.yaml | awk '{print $1}') if [ "$current_hash" != "$previous_hash" ]; then - etcdctl put /config/config.yaml -- < /config/config.yaml + etcdctl put /config/config.yaml -- < ./config/config.yaml echo "spot update, config updated in etcd. $(date +'%Y-%m-%d %H:%M:%S')" previous_hash="$current_hash" fi sleep 60 -done \ No newline at end of file +done diff --git a/entrypoint.sh b/entrypoint.sh index cc2d3eb..95567f6 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -29,4 +29,4 @@ function read_key() { export ETCD_ADDR=$(read_key $CONFIG_PATH "etcd-addr") -sh $OUTPUT_PATH/$SERVICE/bootstrap.sh \ No newline at end of file +sh $OUTPUT_PATH/$SERVICE/bootstrap.sh diff --git a/go.mod b/go.mod index 177b128..b59ef6c 100644 --- a/go.mod +++ b/go.mod @@ -4,17 +4,21 @@ go 1.21 require ( github.com/apache/thrift v0.13.0 - github.com/cloudwego/kitex v0.7.1 + github.com/cloudwego/hertz v0.9.3 + github.com/cloudwego/kitex v0.11.3 github.com/elastic/go-elasticsearch v0.0.0 github.com/fsnotify/fsnotify v1.6.0 + github.com/hertz-contrib/tracer v0.0.0-20230215022931-b246a2eb0173 github.com/kitex-contrib/obs-opentelemetry/logging/logrus v0.0.0-20230819133448-76093321aa8e github.com/kitex-contrib/registry-etcd v0.1.1 github.com/kitex-contrib/tracer-opentracing v0.0.3 github.com/opentracing/opentracing-go v1.2.0 github.com/rabbitmq/amqp091-go v1.8.1 github.com/redis/go-redis/v9 v9.1.0 + github.com/satori/go.uuid v1.2.0 github.com/sirupsen/logrus v1.9.3 github.com/spf13/viper v1.16.0 + github.com/swaggo/swag v1.16.3 github.com/uber/jaeger-client-go v2.30.0+incompatible github.com/west2-online/jwch v0.0.4 gorm.io/driver/mysql v1.5.1 @@ -22,6 +26,29 @@ require ( gorm.io/plugin/opentracing v0.0.0-20211220013347-7d2b2af23560 ) +require ( + github.com/KyleBanks/depth v1.2.1 // indirect + github.com/PuerkitoBio/purell v1.1.1 // indirect + github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect + github.com/bytedance/go-tagexpr/v2 v2.9.2 // indirect + github.com/bytedance/sonic/loader v0.2.0 // indirect + github.com/cloudwego/base64x v0.1.4 // indirect + github.com/cloudwego/gopkg v0.1.2 // indirect + github.com/cloudwego/iasm v0.2.0 // indirect + github.com/cloudwego/runtimex v0.1.0 // indirect + github.com/go-openapi/jsonpointer v0.19.5 // indirect + github.com/go-openapi/jsonreference v0.19.6 // indirect + github.com/go-openapi/spec v0.20.4 // indirect + github.com/go-openapi/swag v0.19.15 // indirect + github.com/henrylee2cn/ameda v1.4.10 // indirect + github.com/henrylee2cn/goutil v0.0.0-20210127050712-89660552f6f8 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/mailru/easyjson v0.7.6 // indirect + github.com/nyaruka/phonenumbers v1.0.55 // indirect + golang.org/x/tools v0.7.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect +) + require ( cloud.google.com/go v0.110.0 // indirect cloud.google.com/go/compute v1.19.1 // indirect @@ -31,19 +58,16 @@ require ( github.com/antchfx/htmlquery v1.3.0 // indirect github.com/antchfx/xpath v1.2.4 // indirect github.com/armon/go-metrics v0.4.0 // indirect - github.com/bytedance/gopkg v0.0.0-20230728082804-614d0af6619b // indirect - github.com/bytedance/sonic v1.9.1 // indirect + github.com/bytedance/gopkg v0.1.1 // indirect + github.com/bytedance/sonic v1.12.2 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect - github.com/chenzhuoyu/iasm v0.9.0 // indirect - github.com/choleraehyq/pid v0.0.17 // indirect - github.com/cloudwego/configmanager v0.2.0 // indirect - github.com/cloudwego/dynamicgo v0.1.3 // indirect - github.com/cloudwego/fastpb v0.0.4 // indirect - github.com/cloudwego/frugal v0.1.7 // indirect + github.com/cloudwego/configmanager v0.2.2 // indirect + github.com/cloudwego/dynamicgo v0.4.0 // indirect + github.com/cloudwego/fastpb v0.0.5 // indirect + github.com/cloudwego/frugal v0.2.0 // indirect github.com/cloudwego/localsession v0.0.2 // indirect - github.com/cloudwego/netpoll v0.4.1 // indirect - github.com/cloudwego/thriftgo v0.3.0 // indirect + github.com/cloudwego/netpoll v0.6.4 + github.com/cloudwego/thriftgo v0.3.17 // indirect github.com/coreos/go-semver v0.3.0 // indirect github.com/coreos/go-systemd/v22 v22.3.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect @@ -57,7 +81,7 @@ require ( github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/go-cmp v0.5.9 // indirect - github.com/google/pprof v0.0.0-20220608213341-c488b8fa1db3 // indirect + github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 // indirect github.com/google/s2a-go v0.1.3 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect github.com/googleapis/gax-go/v2 v2.8.0 // indirect @@ -83,7 +107,6 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/gls v0.0.0-20220109145502-612d0167dce5 // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/oleiade/lane v1.0.1 // indirect github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect @@ -92,9 +115,9 @@ require ( github.com/spf13/cast v1.5.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/stretchr/testify v1.8.3 // indirect + github.com/stretchr/testify v1.9.0 // indirect github.com/subosito/gotenv v1.4.2 // indirect - github.com/tidwall/gjson v1.9.3 // indirect + github.com/tidwall/gjson v1.17.3 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.0 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect @@ -108,14 +131,14 @@ require ( go.opentelemetry.io/otel/trace v1.16.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.8.0 // indirect - go.uber.org/zap v1.21.0 // indirect + go.uber.org/zap v1.21.0 golang.org/x/arch v0.2.0 // indirect - golang.org/x/crypto v0.14.0 // indirect - golang.org/x/net v0.17.0 // indirect + golang.org/x/crypto v0.22.0 + golang.org/x/net v0.24.0 // indirect golang.org/x/oauth2 v0.7.0 // indirect - golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/text v0.13.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.1.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/api v0.122.0 // indirect diff --git a/go.sum b/go.sum index 5af9c03..edca1a0 100644 --- a/go.sum +++ b/go.sum @@ -47,18 +47,19 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= -git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= +github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= +github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm/4RlzPXRlREEwqTHAN3T56Bv2ITsFT3gY= -github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk= +github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -86,29 +87,31 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= -github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= -github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= -github.com/brianvoe/gofakeit/v6 v6.16.0/go.mod h1:Ow6qC71xtwm79anlwKRlWZW6zVq9D2XHE4QSSMP/rU8= github.com/bsm/ginkgo/v2 v2.9.5 h1:rtVBYPs3+TC5iLUVOis1B9tjLTup7Cj5IfzosKtvTJ0= github.com/bsm/ginkgo/v2 v2.9.5/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= github.com/bsm/gomega v1.26.0 h1:LhQm+AFcgV2M0WyKroMASzAzCAJVpAxQXv4SaI9a69Y= github.com/bsm/gomega v1.26.0/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= +github.com/bytedance/go-tagexpr/v2 v2.9.2 h1:QySJaAIQgOEDQBLS3x9BxOWrnhqu5sQ+f6HaZIxD39I= +github.com/bytedance/go-tagexpr/v2 v2.9.2/go.mod h1:5qsx05dYOiUXOUgnQ7w3Oz8BYs2qtM/bJokdLb79wRM= github.com/bytedance/gopkg v0.0.0-20210705062217-74c74ebadcae/go.mod h1:birsdqRCbwnckJbdAvcSao+AzOyibVEoWB55MjpYpB8= github.com/bytedance/gopkg v0.0.0-20210709064845-3c00f9323f09/go.mod h1:birsdqRCbwnckJbdAvcSao+AzOyibVEoWB55MjpYpB8= github.com/bytedance/gopkg v0.0.0-20210716082555-acbf5a2aa7e2/go.mod h1:birsdqRCbwnckJbdAvcSao+AzOyibVEoWB55MjpYpB8= github.com/bytedance/gopkg v0.0.0-20210910103821-e4efae9c17c3/go.mod h1:birsdqRCbwnckJbdAvcSao+AzOyibVEoWB55MjpYpB8= github.com/bytedance/gopkg v0.0.0-20220413063733-65bf48ffb3a7/go.mod h1:2ZlV9BaUH4+NXIBF0aMdKKAnHTzqH+iMU4KUjAbL23Q= -github.com/bytedance/gopkg v0.0.0-20220509134931-d1878f638986/go.mod h1:2ZlV9BaUH4+NXIBF0aMdKKAnHTzqH+iMU4KUjAbL23Q= github.com/bytedance/gopkg v0.0.0-20220531084716-665b4f21126f/go.mod h1:2ZlV9BaUH4+NXIBF0aMdKKAnHTzqH+iMU4KUjAbL23Q= -github.com/bytedance/gopkg v0.0.0-20230531144706-a12972768317/go.mod h1:FtQG3YbQG9L/91pbKSw787yBQPutC+457AvDW77fgUQ= -github.com/bytedance/gopkg v0.0.0-20230728082804-614d0af6619b h1:R6PWoQtxEMpWJPHnpci+9LgFxCS7iJCfOGBvCgZeTKI= github.com/bytedance/gopkg v0.0.0-20230728082804-614d0af6619b/go.mod h1:FtQG3YbQG9L/91pbKSw787yBQPutC+457AvDW77fgUQ= -github.com/bytedance/mockey v1.2.0 h1:847+X2fBSM4s/AIN4loO5d16PCgEj53j7Q8YVB+8P6c= -github.com/bytedance/mockey v1.2.0/go.mod h1:+Jm/fzWZAuhEDrPXVjDf/jLM2BlLXJkwk94zf2JZ3X4= +github.com/bytedance/gopkg v0.1.0/go.mod h1:FtQG3YbQG9L/91pbKSw787yBQPutC+457AvDW77fgUQ= +github.com/bytedance/gopkg v0.1.1 h1:3azzgSkiaw79u24a+w9arfH8OfnQQ4MHUt9lJFREEaE= +github.com/bytedance/gopkg v0.1.1/go.mod h1:576VvJ+eJgyCzdjS+c4+77QF3p7ubbtiKARP3TxducM= +github.com/bytedance/mockey v1.2.12 h1:aeszOmGw8CPX8CRx1DZ/Glzb1yXvhjDh6jdFBNZjsU4= +github.com/bytedance/mockey v1.2.12/go.mod h1:3ZA4MQasmqC87Tw0w7Ygdy7eHIc2xgpZ8Pona5rsYIk= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.8.8/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= -github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s= -github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/bytedance/sonic v1.11.6/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4= +github.com/bytedance/sonic v1.12.2 h1:oaMFuRTpMHYLpCntGca65YWt5ny+wAceDERTkT2L9lg= +github.com/bytedance/sonic v1.12.2/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= +github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/bytedance/sonic/loader v0.2.0 h1:zNprn+lsIP06C/IqCHs3gPQIvnvpKbbxyXQP1iU4kWM= +github.com/bytedance/sonic/loader v0.2.0/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= github.com/cenkalti/backoff/v4 v4.1.1 h1:G2HAfAmvm/GcKan2oOQpBXOd2tT2G57ZnZGWa1PxPBQ= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -119,63 +122,48 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= -github.com/chenzhuoyu/iasm v0.0.0-20220818063314-28c361dae733/go.mod h1:wOQ0nsbeOLa2awv8bUYFW/EHXbjQMlZ10fAlXDB2sz8= -github.com/chenzhuoyu/iasm v0.0.0-20230222070914-0b1b64b0e762/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog= -github.com/chenzhuoyu/iasm v0.9.0 h1:9fhXjVzq5hUy2gkhhgHl95zG2cEAhw9OSGs8toWWAwo= -github.com/chenzhuoyu/iasm v0.9.0/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog= -github.com/choleraehyq/pid v0.0.13/go.mod h1:uhzeFgxJZWQsZulelVQZwdASxQ9TIPZYL4TPkQMtL/U= -github.com/choleraehyq/pid v0.0.15/go.mod h1:uhzeFgxJZWQsZulelVQZwdASxQ9TIPZYL4TPkQMtL/U= -github.com/choleraehyq/pid v0.0.16/go.mod h1:uhzeFgxJZWQsZulelVQZwdASxQ9TIPZYL4TPkQMtL/U= -github.com/choleraehyq/pid v0.0.17 h1:BLBfHTllp2nRRbZ/cOFHKlx9oWJuMwKmp7GqB5d58Hk= -github.com/choleraehyq/pid v0.0.17/go.mod h1:uhzeFgxJZWQsZulelVQZwdASxQ9TIPZYL4TPkQMtL/U= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/logex v1.2.0/go.mod h1:9+9sk7u7pGNWYMkh0hdiL++6OeibzJccyQU4p4MedaY= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/readline v1.5.0/go.mod h1:x22KAscuvRqlLoK9CsoYsmxoXZMMFVyOl86cAH8qUic= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/chzyer/test v0.0.0-20210722231415-061457976a23/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudwego/configmanager v0.2.0 h1:niVpVg+wQ+npNqnH3dup96SMbR02Pk+tNErubYCJqKo= -github.com/cloudwego/configmanager v0.2.0/go.mod h1:FLIQTjxsZRGjnmDhTttWQTy6f6DghPTatfBVOs2gQLk= -github.com/cloudwego/dynamicgo v0.1.0/go.mod h1:Mdsz0XGsIImi15vxhZaHZpspNChEmBMIiWkUfD6JDKg= -github.com/cloudwego/dynamicgo v0.1.3 h1:xK2rFS3E7cGbo4CWhqP1HIWeQcVH4Po5YgdNFDC+CfI= -github.com/cloudwego/dynamicgo v0.1.3/go.mod h1:AdPqyFN+0+fc3iVSSWojDCnOGPkzH+T0rI65017GCUA= -github.com/cloudwego/fastpb v0.0.3/go.mod h1:/V13XFTq2TUkxj2qWReV8MwfPC4NnPcy6FsrojnsSG0= -github.com/cloudwego/fastpb v0.0.4 h1:/ROVVfoFtpfc+1pkQLzGs+azjxUbSOsAqSY4tAAx4mg= -github.com/cloudwego/fastpb v0.0.4/go.mod h1:/V13XFTq2TUkxj2qWReV8MwfPC4NnPcy6FsrojnsSG0= -github.com/cloudwego/frugal v0.1.3/go.mod h1:b981ViPYdhI56aFYsoMjl9kv6yeqYSO+iEz2jrhkCgI= -github.com/cloudwego/frugal v0.1.6/go.mod h1:9ElktKsh5qd2zDBQ5ENhPSQV7F2dZ/mXlr1eaZGDBFs= -github.com/cloudwego/frugal v0.1.7 h1:Ggyk8mk0WrhBlM4g4RJxdOcVWJl/Hxbd8NJ19J8My6c= -github.com/cloudwego/frugal v0.1.7/go.mod h1:3VECBCSiTYwm3QApqHXjZB9NDH+8hUw7txxlr+6pPb4= +github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y= +github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= +github.com/cloudwego/configmanager v0.2.2 h1:sVrJB8gWYTlPV2OS3wcgJSO9F2/9Zbkmcm1Z7jempOU= +github.com/cloudwego/configmanager v0.2.2/go.mod h1:ppiyU+5TPLonE8qMVi/pFQk2eL3Q4P7d4hbiNJn6jwI= +github.com/cloudwego/dynamicgo v0.4.0 h1:wQqNRNiSQaLkbcn3sfpEJGZsz3xf8Il4P/3DcENsrFI= +github.com/cloudwego/dynamicgo v0.4.0/go.mod h1:zgWk2oz56EyH790LJSxrTz1j01GJBO964jJQ/y7qjJc= +github.com/cloudwego/fastpb v0.0.5 h1:vYnBPsfbAtU5TVz5+f9UTlmSCixG9F9vRwaqE0mZPZU= +github.com/cloudwego/fastpb v0.0.5/go.mod h1:Bho7aAKBUtT9RPD2cNVkTdx4yQumfSv3If7wYnm1izk= +github.com/cloudwego/frugal v0.2.0 h1:0ETSzQYoYqVvdl7EKjqJ9aJnDoG6TzvNKV3PMQiQTS8= +github.com/cloudwego/frugal v0.2.0/go.mod h1:cpnV6kdRMjN3ylxRo63RNbZ9rBK6oxs70Zk6QZ4Enj4= +github.com/cloudwego/gopkg v0.1.2 h1:650t+RiZGht8qX+y0hl49JXJCuO44GhbGZuxDzr2PyI= +github.com/cloudwego/gopkg v0.1.2/go.mod h1:WoNTdXDPdvL97cBmRUWXVGkh2l2UFmpd9BUvbW2r0Aw= +github.com/cloudwego/hertz v0.5.2/go.mod h1:K1U0RlU07CDeBINfHNbafH/3j9uSgIW8otbjUys3OPY= +github.com/cloudwego/hertz v0.9.3 h1:uajvLn6LjEPjUqN/ewUZtWoRQWa2es2XTELdqDlOYMw= +github.com/cloudwego/hertz v0.9.3/go.mod h1:gGVUfJU/BOkJv/ZTzrw7FS7uy7171JeYIZvAyV3wS3o= +github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= github.com/cloudwego/kitex v0.0.4/go.mod h1:EIjPJ4Dom2ornk7xDCdKpUpOnf4Tulevimh4Tn05OGc= github.com/cloudwego/kitex v0.0.5/go.mod h1:sDiWpxbadYE5wFYj7MrSzm2Tle7TFZdcSezIErMsvp8= -github.com/cloudwego/kitex v0.3.2/go.mod h1:/XD07VpUD9VQWmmoepASgZ6iw//vgWikVA9MpzLC5i0= -github.com/cloudwego/kitex v0.4.4/go.mod h1:3FcH5h9Qw+dhRljSzuGSpWuThttA8DvK0BsL7HUYydo= -github.com/cloudwego/kitex v0.6.1/go.mod h1:zI1GBrjT0qloTikcCfQTgxg3Ws+yQMyaChEEOcGNUvA= -github.com/cloudwego/kitex v0.7.1 h1:GbCsJ+zDOCsjHaqXVLLD6QIHqDnKPqefqU3+QAOhclg= -github.com/cloudwego/kitex v0.7.1/go.mod h1:TU0FRxTH26XpbR7zm063O/OfqSszVlQvM1eGJES2A4E= +github.com/cloudwego/kitex v0.11.3 h1:Qy1GtyuNbygMpwnMw+Aj1iS7fSd0IO7CzxtpZrRJ+Jc= +github.com/cloudwego/kitex v0.11.3/go.mod h1:RHT9ERKFVppJjBfGvwJAPxCIzf4oN1yASW5S4pPZNu4= github.com/cloudwego/kitex-examples v0.0.0-20211019030300-7fd73f66ff4d/go.mod h1:YYForGqNLFhxmRJe3dZx61vJxJ4nxKURQBa3rBzXUJU= github.com/cloudwego/localsession v0.0.2 h1:N9/IDtCPj1fCL9bCTP+DbXx3f40YjVYWcwkJG0YhQkY= github.com/cloudwego/localsession v0.0.2/go.mod h1:kiJxmvAcy4PLgKtEnPS5AXed3xCiXcs7Z+KBHP72Wv8= github.com/cloudwego/netpoll v0.0.2/go.mod h1:rZOiNI0FYjuvNybXKKhAPUja03loJi/cdv2F55AE6E8= github.com/cloudwego/netpoll v0.0.3/go.mod h1:rZOiNI0FYjuvNybXKKhAPUja03loJi/cdv2F55AE6E8= github.com/cloudwego/netpoll v0.0.4/go.mod h1:rZOiNI0FYjuvNybXKKhAPUja03loJi/cdv2F55AE6E8= -github.com/cloudwego/netpoll v0.2.4/go.mod h1:1T2WVuQ+MQw6h6DpE45MohSvDTKdy2DlzCx2KsnPI4E= github.com/cloudwego/netpoll v0.3.1/go.mod h1:1T2WVuQ+MQw6h6DpE45MohSvDTKdy2DlzCx2KsnPI4E= -github.com/cloudwego/netpoll v0.4.0/go.mod h1:xVefXptcyheopwNDZjDPcfU6kIjZXZ4nY550k1yH9eQ= -github.com/cloudwego/netpoll v0.4.1 h1:/pGsY7Rs09KqEXEniB9fcsEWfi1iY+66bKUO3/NO6hc= -github.com/cloudwego/netpoll v0.4.1/go.mod h1:xVefXptcyheopwNDZjDPcfU6kIjZXZ4nY550k1yH9eQ= +github.com/cloudwego/netpoll v0.6.4 h1:z/dA4sOTUQof6zZIO4QNnLBXsDFFFEos9OOGloR6kno= +github.com/cloudwego/netpoll v0.6.4/go.mod h1:BtM+GjKTdwKoC8IOzD08/+8eEn2gYoiNLipFca6BVXQ= github.com/cloudwego/netpoll-http2 v0.0.4/go.mod h1:iFr5SzJCXIYgBg0ubL0fZiCQ6W36s9p0KjXpV04lmoY= +github.com/cloudwego/runtimex v0.1.0 h1:HG+WxWoj5/CDChDZ7D99ROwvSMkuNXAqt6hnhTTZDiI= +github.com/cloudwego/runtimex v0.1.0/go.mod h1:23vL/HGV0W8nSCHbe084AgEBdDV4rvXenEUMnUNvUd8= github.com/cloudwego/thriftgo v0.1.2/go.mod h1:LzeafuLSiHA9JTiWC8TIMIq64iadeObgRUhmVG1OC/w= -github.com/cloudwego/thriftgo v0.2.4/go.mod h1:8i9AF5uDdWHGqzUhXDlubCjx4MEfKvWXGQlMWyR0tM4= -github.com/cloudwego/thriftgo v0.2.7/go.mod h1:8i9AF5uDdWHGqzUhXDlubCjx4MEfKvWXGQlMWyR0tM4= -github.com/cloudwego/thriftgo v0.2.11/go.mod h1:dAyXHEmKXo0LfMCrblVEY3mUZsdeuA5+i0vF5f09j7E= -github.com/cloudwego/thriftgo v0.3.0 h1:BBb9hVcqmu9p4iKUP/PSIaDB21Vfutgd7k2zgK37Q9Q= -github.com/cloudwego/thriftgo v0.3.0/go.mod h1:AvH0iEjvKHu3cdxG7JvhSAaffkS4h2f4/ZxpJbm48W4= +github.com/cloudwego/thriftgo v0.3.17 h1:k0iQe2jEAN1WhPsXWvatwHzoxObUSX2Nw5NqdnywS8k= +github.com/cloudwego/thriftgo v0.3.17/go.mod h1:AdLEJJVGW/ZJYvkkYAZf5SaJH+pA3OyC801WSwqcBwI= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -206,6 +194,7 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/elastic/go-elasticsearch v0.0.0 h1:Pd5fqOuBxKxv83b0+xOAJDAkziWYwFinWnBO0y+TZaA= @@ -226,29 +215,22 @@ github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYF github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/form3tech-oss/jwt-go v3.2.3+incompatible h1:7ZaBxOI7TMoYBfyA3cQHErNNyAWIKUMIwqxEtgHOs5c= github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= -github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks= -github.com/go-fonts/liberation v0.1.1/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= -github.com/go-fonts/liberation v0.2.0/go.mod h1:K6qoJYypsmfVjWg8KOVDQhLc8UDgIK2HYqyqAO9z7GY= -github.com/go-fonts/stix v0.1.0/go.mod h1:w/c1f0ldAUlJmLBvlbkvVXLAD+tAMqobIIQpmnUIzUY= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U= -github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= @@ -256,8 +238,16 @@ github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= -github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.19.6 h1:UBIxjkht+AWIgYzCDSv2GN+E/togfwXUJFRTWhl2Jjs= +github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= +github.com/go-openapi/spec v0.20.4 h1:O8hJrt0UMnhHcluhIdUgCLRWyM2x7QkBXRvOs7m+O1M= +github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.15 h1:D2NRCBzS9/pEY3gP9Nl8aDqGUcPFrwG2p+CNFrLyrCM= +github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY= github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc= @@ -323,7 +313,6 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -340,8 +329,8 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20220608213341-c488b8fa1db3 h1:mpL/HvfIgIejhVwAfxBQkwEjlhP5o0O9RAeTAjpwzxc= -github.com/google/pprof v0.0.0-20220608213341-c488b8fa1db3/go.mod h1:gSuNB+gJaOiQKLEZ+q+PK9Mq3SOzhRcw2GsGS/FhYDk= +github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQuYXQ+6EN5stWmeY/AZqtM8xk9k= +github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.3 h1:FAgZmpLl/SXurPEZyCMPBIiiYeTbqfjlbdnCNTAkbGE= github.com/google/s2a-go v0.1.3/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= @@ -418,11 +407,17 @@ github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4 github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY= github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= +github.com/henrylee2cn/ameda v1.4.8/go.mod h1:liZulR8DgHxdK+MEwvZIylGnmcjzQ6N6f2PlWe7nEO4= +github.com/henrylee2cn/ameda v1.4.10 h1:JdvI2Ekq7tapdPsuhrc4CaFiqw6QXFvZIULWJgQyCAk= +github.com/henrylee2cn/ameda v1.4.10/go.mod h1:liZulR8DgHxdK+MEwvZIylGnmcjzQ6N6f2PlWe7nEO4= +github.com/henrylee2cn/goutil v0.0.0-20210127050712-89660552f6f8 h1:yE9ULgp02BhYIrO6sdV/FPe0xQM6fNHkVQW2IAymfM0= +github.com/henrylee2cn/goutil v0.0.0-20210127050712-89660552f6f8/go.mod h1:Nhe/DM3671a5udlv2AdV2ni/MZzgfv2qrPL5nIi3EGQ= +github.com/hertz-contrib/tracer v0.0.0-20230215022931-b246a2eb0173 h1:gB4maI+sbQhkkbOMfKQYLb8b6JCnQ1XKoQIFV4Upq4c= +github.com/hertz-contrib/tracer v0.0.0-20230215022931-b246a2eb0173/go.mod h1:S9tHCLI6q0HMblvNmE5ZGcKm0xDQnUrrcJZYtqO1zi8= github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20220319035150-800ac71e25c2/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jhump/protoreflect v1.8.2 h1:k2xE7wcUomeqwY0LDCYA16y4WWfyTcMx5mKhk0d4ua0= github.com/jhump/protoreflect v1.8.2/go.mod h1:7GcYQDdMU/O/BBrl/cX6PNHpXh6cenjd8pneu5yW7Tg= @@ -434,6 +429,8 @@ github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/ github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ= github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -447,7 +444,6 @@ github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7 github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= @@ -461,7 +457,6 @@ github.com/kitex-contrib/tracer-opentracing v0.0.2/go.mod h1:mprt5pxqywFQxlHb7ug github.com/kitex-contrib/tracer-opentracing v0.0.3 h1:8SI0OrHTQ8u6eWpemnuaecMBSEVEvWKCWxg2HnnONQU= github.com/kitex-contrib/tracer-opentracing v0.0.3/go.mod h1:mprt5pxqywFQxlHb7ugfiMdKbABTLI9YrBYs9WmlK5Q= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.1.0/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= @@ -479,6 +474,10 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -490,7 +489,6 @@ github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= @@ -525,9 +523,9 @@ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRW github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nishanths/predeclared v0.0.0-20200524104333-86fad755b4d3/go.mod h1:nt3d53pc1VYcphSCIaYAJtnPYnr3Zyn8fMq2wvPGPso= +github.com/nyaruka/phonenumbers v1.0.55 h1:bj0nTO88Y68KeUQ/n3Lo2KgK7lM1hF7L9NFuwcCl3yg= +github.com/nyaruka/phonenumbers v1.0.55/go.mod h1:sDaTZ/KPX5f8qyV9qN+hIm+4ZBARJrupC6LuhshJq1U= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/oleiade/lane v1.0.1 h1:hXofkn7GEOubzTwNpeL9MaNy8WxolCYb9cInAIeqShU= -github.com/oleiade/lane v1.0.1/go.mod h1:IyTkraa4maLfjq/GmHR+Dxb4kCMtEGeb+qmhlrQ5Mk4= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= @@ -537,9 +535,6 @@ github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144T github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= -github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= -github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= -github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -578,7 +573,6 @@ github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rabbitmq/amqp091-go v1.8.1 h1:RejT1SBUim5doqcL6s7iN6SBmsQqyTgXb1xMlH0h1hA= github.com/rabbitmq/amqp091-go v1.8.1/go.mod h1:+jPrT9iY2eLjRaMSRHUhc3z14E/l85kv/f+6luSD3pc= -github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/redis/go-redis/v9 v9.1.0 h1:137FnGdk+EQdCbye1FW+qOEcY5S+SpY9T0NiuqvtfMY= github.com/redis/go-redis/v9 v9.1.0/go.mod h1:urWj3He21Dj5k4TK1y59xH8Uj6ATueP8AH1cY3lZl4c= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= @@ -587,11 +581,11 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= -github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sagikazarmark/crypt v0.10.0 h1:96E1qrToLBU6fGzo+PRRz7KGOc9FkYFiPnR3/zf8Smg= github.com/sagikazarmark/crypt v0.10.0/go.mod h1:gwTNHQVoOS3xp9Xvz5LLR+1AauC5M6880z5NWzdhOyQ= +github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= @@ -628,8 +622,9 @@ github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1Fof github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -639,16 +634,19 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/thrift-iterator/go v0.0.0-20190402154806-9b5a67519118/go.mod h1:60PRwE/TCI1UqLvn8v2pwAf6+yzTPLP/Ji5xaesWDqk= +github.com/swaggo/swag v1.16.3 h1:PnCYjPCah8FK4I26l2F/KQ4yz3sILcVUN3cTlBFA9Pg= +github.com/swaggo/swag v1.16.3/go.mod h1:DImHIuOFXKpMFAQjcC7FG4m3Dg4+QuUgUzJmKjI/gRk= github.com/tidwall/gjson v1.8.0/go.mod h1:5/xDoumyyDNerp2U36lyolv46b3uF/9Bu6OfyQ9GImk= -github.com/tidwall/gjson v1.9.3 h1:hqzS9wAHMO+KVBBkLxYdkEeeFHuqr95GfClRLKlgK0E= github.com/tidwall/gjson v1.9.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.13.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.17.3 h1:bwWLZU7icoKRG+C+0PNwIKC6FCJO/Q3p2pZvuP0jN94= +github.com/tidwall/gjson v1.17.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= @@ -666,9 +664,6 @@ github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaO github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg= github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= -github.com/v2pro/plz v0.0.0-20221028024117-e5f9aec5b631/go.mod h1:3gacX+hQo+xvl0vtLqCMufzxuNCwt4geAVOMt2LQYfE= -github.com/v2pro/quokka v0.0.0-20171201153428-382cb39c6ee6/go.mod h1:0VP5W9AFNVWU8C1QLNeVg8TvzoEkIHWZ4vxtxEVFWUY= -github.com/v2pro/wombat v0.0.0-20180402055224-a56dbdcddef2/go.mod h1:wen8nMxrRrUmXnRwH+3wGAW+hyYTHcOrTNhMpxyp/i0= github.com/west2-online/jwch v0.0.4 h1:3yN6FEt7g88LBPmrfOj0rWEbV3fj/r3BUvR083wsv58= github.com/west2-online/jwch v0.0.4/go.mod h1:yAh5jjEFzFFXowajIFxkdgSQTngj0CZsnyqRvwZkwsQ= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= @@ -678,7 +673,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= @@ -747,9 +741,7 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= -golang.org/x/arch v0.0.0-20201008161808-52c3e6f60cff/go.mod h1:flIaEI6LNU6xOCD5PaJvn9wGP0agmIOqjrtsKGRguv4= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.0.0-20220722155209-00200b7164a7/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/arch v0.2.0 h1:W1sUEHXiJTfjaFJ5SLo0N6lZn+0eO5gWD1MFeTGqQEY= golang.org/x/arch v0.2.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -766,8 +758,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -775,7 +767,6 @@ golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= @@ -785,16 +776,6 @@ golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMk golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20210216034530-4410531fe030/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= -golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= -golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= -golang.org/x/image v0.0.0-20220302094943-723b81ca9867/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -818,8 +799,9 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= +golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -862,15 +844,15 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= +golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -894,8 +876,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -946,33 +928,30 @@ golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210304124612-50617c2ba197/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210415045647-66c3f260301c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210818153620-00dd8d7831e7/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220110181412-a018aaa089fe/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220817070843-5a390386f1f2/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= @@ -987,8 +966,9 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1015,7 +995,6 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1054,11 +1033,11 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= +golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1067,12 +1046,8 @@ golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3j golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= -gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= -gonum.org/v1/gonum v0.12.0/go.mod h1:73TDxJfAAHeA8Mk9mf8NlIppyhQNo5GLTcYeqgo2lvY= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= -gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY= -gonum.org/v1/plot v0.10.1/go.mod h1:VZW5OlhkL1mysU9vaqNHnsy86inf6Ot+jB3r+BczCEo= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1184,8 +1159,6 @@ google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12/go.mod h1:9JNX7 google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= @@ -1212,6 +1185,7 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= @@ -1229,11 +1203,11 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/idl/api.thrift b/idl/api.thrift index 094b30f..3295e83 100644 --- a/idl/api.thrift +++ b/idl/api.thrift @@ -13,15 +13,20 @@ struct User{ struct Picture{ 1:i64 id, - 2:string url, - 3:string href, - 4:string text, - 5:i64 pic_type, - 6:i64 show_times, - 7:i64 point_times, - 8:i64 duration, - 9:i64 s_type, - 10:i64 frequency, + 2:i64 user_id, + 3:string url, + 4:string href, + 5:string text, + 6:i64 pic_type, + 7:optional i64 show_times, + 8:optional i64 point_times, + 9:i64 duration, + 10:optional i64 s_type, + 11:i64 frequency, + 12:i64 start_at, + 13:i64 end_at, + 14:i64 start_time, + 15:i64 end_time, } struct RegisterRequest { @@ -42,7 +47,7 @@ struct LoginRequest { struct LoginResponse { 1: BaseResp base, - 2: optional string data, + 2: optional string token, } service UserService { @@ -51,3 +56,121 @@ service UserService { //test for backend RegisterResponse Register(1: RegisterRequest req)(api.post="/launch_screen/api/register"), } + +struct CreateImageRequest { + 1: required i64 pic_type,//1为空,2为页面跳转,3为app跳转 + 2: optional i64 duration, + 3: optional string href,//连接 + 4: binary image, + 5: required i64 start_at, + 6: required i64 end_at, + 7: required i64 s_type, + 8: required i64 frequency,//单日最大展示次数 + 9: required i64 start_time,//比如6表示6点 + 10:required i64 end_time, + 11:required string text,//描述图片 + 12:string regex,//正则匹配项 + + 13:i64 user_id,//get by token +} + +struct CreateImageResponse{ + 1:BaseResp base, + 2:optional Picture picture, +} + +struct GetImageRequest{ + 1:required i64 picture_id, + + 2:i64 user_id, +} + +struct GetImageResponse{ + 1:BaseResp base, + 2:optional Picture picture, +} + +struct GetImagesByUserIdRequest{ + 1:i64 user_id, +} + +struct GetImagesByUserIdResponse{ + 1:BaseResp base, + 2:optional list picture_list, +} + +struct ChangeImagePropertyRequest { + 1: required i64 pic_type,//1为空,2为页面跳转,3为app跳转 + 2: optional i64 duration, + 3: optional string href,//连接 + 4: required i64 start_at, + 5: required i64 end_at, + 6: required i64 s_type, + 7: required i64 frequency, + 8: required i64 start_time,//比如6表示6点 + 9:required i64 end_time, + 10:required string text,//描述图片 + 11:string regex,//正则匹配项 + + 12:i64 user_id,//get by token +} + +struct ChangeImagePropertyResponse{ + 1:BaseResp base, + 2:optional Picture picture, +} + +struct ChangeImageRequest { + 1:required i64 picture_id, + 2:required binary image, + + 3:i64 user_id, +} + +struct ChangeImageResponse{ + 1:BaseResp base, + 2:optional Picture picture, +} + +struct DeleteImageRequest{ + 1:required i64 picture_id, + + 2:i64 user_id, +} + +struct DeleteImageResponse{ + 1:BaseResp base, + 2:optional Picture picture, +} + +struct MobileGetImageRequest{ + 1:required i64 type, + 2:required i64 student_id, + 3:required string college, + 4:required string device, +} + +struct MobileGetImageResponse{ + 1:BaseResp base, + 2:optional Picture picture, +} + +struct AddImagePointTimeRequest{ + 1:required i64 picture_id, +} + +struct AddImagePointTimeResponse{ + 1:BaseResp base, + 2:optional Picture picture, +} + +service LaunchScreenService{ + CreateImageResponse CreateImage(1:CreateImageRequest req)(api.post="/launch_screen/api/image"), + GetImagesByUserIdResponse GetImage(1:GetImageRequest req)(api.get="/launch_screen/api/image"), + GetImagesByUserIdResponse GetImagesByUserId(1:GetImagesByUserIdRequest req)(api.get="/launch_screen/api/images"), + ChangeImagePropertyResponse ChangeImageProperty(1:ChangeImagePropertyRequest req)(api.put="/launch_screen/api/image"), + ChangeImageResponse ChangeImage(1:ChangeImageRequest req)(api.put="/launch_screen/api/image/img"), + DeleteImageResponse DeleteImage(1:DeleteImageRequest req)(api.delete="/launch_screen/api/image"), + MobileGetImageResponse MobileGetImage(1:MobileGetImageRequest req)(api.get="/launch_screen/api/screen"), + AddImagePointTimeResponse AddImagePointTime(1:AddImagePointTimeRequest req)(api.get="/launch_screen/api/image/point"), +} diff --git a/idl/launch_screen.thrift b/idl/launch_screen.thrift index cb14890..3cfdf08 100644 --- a/idl/launch_screen.thrift +++ b/idl/launch_screen.thrift @@ -6,16 +6,16 @@ struct CreateImageRequest { 2: optional i64 duration, 3: optional string href,//连接 4: required binary image, - 5: required string start_at, - 6: required string end_at, + 5: required i64 start_at, + 6: required i64 end_at, 7: required i64 s_type, - 8: required i64 frequency, + 8: required i64 frequency,//单日最大展示次数 9: required i64 start_time,//比如6表示6点 10:required i64 end_time, 11:required string text,//描述图片 12:string regex,//正则匹配项 - 13:i64 user_id,//get by token + 13:string token,//get by token } struct CreateImageResponse{ @@ -26,11 +26,95 @@ struct CreateImageResponse{ struct GetImageRequest{ 1:required i64 picture_id, - 2:i64 user_id, + 2:string token, } struct GetImageResponse{ + 1:model.BaseResp base, + 2:optional model.Picture picture, +} + +struct GetImagesByUserIdRequest{ + 1:string token, +} + +struct GetImagesByUserIdResponse{ + 1:model.BaseResp base, + 2:optional list picture_list, +} + +struct ChangeImagePropertyRequest { + 1: required i64 pic_type,//1为空,2为页面跳转,3为app跳转 + 2: optional i64 duration, + 3: optional string href,//连接 + 4: required i64 start_at, + 5: required i64 end_at, + 6: required i64 s_type, + 7: required i64 frequency, + 8: required i64 start_time,//比如6表示6点 + 9:required i64 end_time, + 10:required string text,//描述图片 + 11:string regex,//正则匹配项 + + 12:string token,//get by token +} + +struct ChangeImagePropertyResponse{ + 1:model.BaseResp base, + 2:optional model.Picture picture, +} + +struct ChangeImageRequest { + 1:required i64 picture_id, + 2:required binary image, + + 3:string token, +} + +struct ChangeImageResponse{ + 1:model.BaseResp base, + 2:optional model.Picture picture, +} + +struct DeleteImageRequest{ 1:required i64 picture_id, - 2:i64 user_id, + 2:string token, +} + +struct DeleteImageResponse{ + 1:model.BaseResp base, + 2:optional model.Picture picture, +} + +struct MobileGetImageRequest{ + 1:required i64 type, + 2:required i64 student_id, + 3:required string college, + 4:required string device, +} + +struct MobileGetImageResponse{ + 1:model.BaseResp base, + 2:optional model.Picture picture, +} + +struct AddImagePointTimeRequest{ + 1:required i64 picture_id, +} + +struct AddImagePointTimeResponse{ + 1:model.BaseResp base, + 2:optional model.Picture picture, +} + +service LaunchScreenService{ + CreateImageResponse CreateImage(1:CreateImageRequest req)(api.post="/launch_screen/api/image"), + GetImagesByUserIdResponse GetImage(1:GetImageRequest req)(api.get="/launch_screen/api/image"), + GetImagesByUserIdResponse GetImagesByUserId(1:GetImagesByUserIdRequest req)(api.get="/launch_screen/api/images"), + ChangeImagePropertyResponse ChangeImageProperty(1:ChangeImagePropertyRequest req)(api.put="/launch_screen/api/image"), + ChangeImageResponse ChangeImage(1:ChangeImageRequest req)(api.put="/launch_screen/api/image/img"), + DeleteImageResponse DeleteImage(1:DeleteImageRequest req)(api.delete="/launch_screen/api/image"), + MobileGetImageResponse MobileGetImage(1:MobileGetImageRequest req)(api.get="/launch_screen/api/screen"), + AddImagePointTimeResponse AddImagePointTime(1:AddImagePointTimeRequest req)(api.get="/launch_screen/api/image/point"), } diff --git a/idl/model.thrift b/idl/model.thrift index 0211693..9329c0b 100644 --- a/idl/model.thrift +++ b/idl/model.thrift @@ -13,13 +13,18 @@ struct User{ struct Picture{ 1:i64 id, - 2:string url, - 3:string href, - 4:string text, - 5:i64 pic_type, - 6:i64 show_times, - 7:i64 point_times, - 8:i64 duration, - 9:i64 s_type, - 10:i64 frequency, + 2:i64 user_id, + 3:string url, + 4:string href, + 5:string text, + 6:i64 pic_type, + 7:optional i64 show_times, + 8:optional i64 point_times, + 9:i64 duration, + 10:optional i64 s_type, + 11:i64 frequency, + 12:i64 start_at, + 13:i64 end_at, + 14:i64 start_time, + 15:i64 end_time, } diff --git a/kitex_gen/launch_screen/k-consts.go b/kitex_gen/launch_screen/k-consts.go new file mode 100644 index 0000000..4bdc594 --- /dev/null +++ b/kitex_gen/launch_screen/k-consts.go @@ -0,0 +1,4 @@ +package launch_screen + +// KitexUnusedProtection is used to prevent 'imported and not used' error. +var KitexUnusedProtection = struct{}{} diff --git a/kitex_gen/launch_screen/k-launch_screen.go b/kitex_gen/launch_screen/k-launch_screen.go new file mode 100644 index 0000000..c7a0708 --- /dev/null +++ b/kitex_gen/launch_screen/k-launch_screen.go @@ -0,0 +1,6270 @@ +// Code generated by Kitex v0.9.1. DO NOT EDIT. + +package launch_screen + +import ( + "bytes" + "fmt" + "reflect" + "strings" + + "github.com/apache/thrift/lib/go/thrift" + + "github.com/cloudwego/kitex/pkg/protocol/bthrift" + + "github.com/west2-online/fzuhelper-server/kitex_gen/model" +) + +// unused protection +var ( + _ = fmt.Formatter(nil) + _ = (*bytes.Buffer)(nil) + _ = (*strings.Builder)(nil) + _ = reflect.Type(nil) + _ = thrift.TProtocol(nil) + _ = bthrift.BinaryWriter(nil) + _ = model.KitexUnusedProtection +) + +func (p *CreateImageRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + var issetPicType bool = false + var issetImage bool = false + var issetStartAt bool = false + var issetEndAt bool = false + var issetSType bool = false + var issetFrequency bool = false + var issetStartTime bool = false + var issetEndTime bool = false + var issetText bool = false + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetPicType = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.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 = bthrift.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 + } + issetImage = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetStartAt = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 6: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField6(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetEndAt = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 7: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField7(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetSType = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 8: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField8(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetFrequency = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 9: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField9(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetStartTime = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 10: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField10(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetEndTime = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 11: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField11(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetText = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 12: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField12(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 13: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField13(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + if !issetPicType { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetImage { + fieldId = 4 + goto RequiredFieldNotSetError + } + + if !issetStartAt { + fieldId = 5 + goto RequiredFieldNotSetError + } + + if !issetEndAt { + fieldId = 6 + goto RequiredFieldNotSetError + } + + if !issetSType { + fieldId = 7 + goto RequiredFieldNotSetError + } + + if !issetFrequency { + fieldId = 8 + goto RequiredFieldNotSetError + } + + if !issetStartTime { + fieldId = 9 + goto RequiredFieldNotSetError + } + + if !issetEndTime { + fieldId = 10 + goto RequiredFieldNotSetError + } + + if !issetText { + fieldId = 11 + goto RequiredFieldNotSetError + } + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_CreateImageRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_CreateImageRequest[fieldId])) +} + +func (p *CreateImageRequest) FastReadField1(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.PicType = v + + } + return offset, nil +} + +func (p *CreateImageRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Duration = &v + + } + return offset, nil +} + +func (p *CreateImageRequest) FastReadField3(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Href = &v + + } + return offset, nil +} + +func (p *CreateImageRequest) FastReadField4(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadBinary(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Image = []byte(v) + + } + return offset, nil +} + +func (p *CreateImageRequest) FastReadField5(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.StartAt = v + + } + return offset, nil +} + +func (p *CreateImageRequest) FastReadField6(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.EndAt = v + + } + return offset, nil +} + +func (p *CreateImageRequest) FastReadField7(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.SType = v + + } + return offset, nil +} + +func (p *CreateImageRequest) FastReadField8(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Frequency = v + + } + return offset, nil +} + +func (p *CreateImageRequest) FastReadField9(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.StartTime = v + + } + return offset, nil +} + +func (p *CreateImageRequest) FastReadField10(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.EndTime = v + + } + return offset, nil +} + +func (p *CreateImageRequest) FastReadField11(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Text = v + + } + return offset, nil +} + +func (p *CreateImageRequest) FastReadField12(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Regex = v + + } + return offset, nil +} + +func (p *CreateImageRequest) FastReadField13(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Token = v + + } + return offset, nil +} + +// for compatibility +func (p *CreateImageRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *CreateImageRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "CreateImageRequest") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField5(buf[offset:], binaryWriter) + offset += p.fastWriteField6(buf[offset:], binaryWriter) + offset += p.fastWriteField7(buf[offset:], binaryWriter) + offset += p.fastWriteField8(buf[offset:], binaryWriter) + offset += p.fastWriteField9(buf[offset:], binaryWriter) + offset += p.fastWriteField10(buf[offset:], binaryWriter) + offset += p.fastWriteField3(buf[offset:], binaryWriter) + offset += p.fastWriteField4(buf[offset:], binaryWriter) + offset += p.fastWriteField11(buf[offset:], binaryWriter) + offset += p.fastWriteField12(buf[offset:], binaryWriter) + offset += p.fastWriteField13(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *CreateImageRequest) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("CreateImageRequest") + 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 += p.field8Length() + l += p.field9Length() + l += p.field10Length() + l += p.field11Length() + l += p.field12Length() + l += p.field13Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *CreateImageRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "pic_type", thrift.I64, 1) + offset += bthrift.Binary.WriteI64(buf[offset:], p.PicType) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *CreateImageRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetDuration() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "duration", thrift.I64, 2) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.Duration) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *CreateImageRequest) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetHref() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "href", thrift.STRING, 3) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Href) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *CreateImageRequest) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "image", thrift.STRING, 4) + offset += bthrift.Binary.WriteBinaryNocopy(buf[offset:], binaryWriter, []byte(p.Image)) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *CreateImageRequest) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "start_at", thrift.I64, 5) + offset += bthrift.Binary.WriteI64(buf[offset:], p.StartAt) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *CreateImageRequest) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "end_at", thrift.I64, 6) + offset += bthrift.Binary.WriteI64(buf[offset:], p.EndAt) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *CreateImageRequest) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "s_type", thrift.I64, 7) + offset += bthrift.Binary.WriteI64(buf[offset:], p.SType) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *CreateImageRequest) fastWriteField8(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "frequency", thrift.I64, 8) + offset += bthrift.Binary.WriteI64(buf[offset:], p.Frequency) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *CreateImageRequest) fastWriteField9(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "start_time", thrift.I64, 9) + offset += bthrift.Binary.WriteI64(buf[offset:], p.StartTime) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *CreateImageRequest) fastWriteField10(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "end_time", thrift.I64, 10) + offset += bthrift.Binary.WriteI64(buf[offset:], p.EndTime) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *CreateImageRequest) fastWriteField11(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "text", thrift.STRING, 11) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Text) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *CreateImageRequest) fastWriteField12(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "regex", thrift.STRING, 12) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Regex) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *CreateImageRequest) fastWriteField13(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "token", thrift.STRING, 13) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Token) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *CreateImageRequest) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("pic_type", thrift.I64, 1) + l += bthrift.Binary.I64Length(p.PicType) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *CreateImageRequest) field2Length() int { + l := 0 + if p.IsSetDuration() { + l += bthrift.Binary.FieldBeginLength("duration", thrift.I64, 2) + l += bthrift.Binary.I64Length(*p.Duration) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *CreateImageRequest) field3Length() int { + l := 0 + if p.IsSetHref() { + l += bthrift.Binary.FieldBeginLength("href", thrift.STRING, 3) + l += bthrift.Binary.StringLengthNocopy(*p.Href) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *CreateImageRequest) field4Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("image", thrift.STRING, 4) + l += bthrift.Binary.BinaryLengthNocopy([]byte(p.Image)) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *CreateImageRequest) field5Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("start_at", thrift.I64, 5) + l += bthrift.Binary.I64Length(p.StartAt) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *CreateImageRequest) field6Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("end_at", thrift.I64, 6) + l += bthrift.Binary.I64Length(p.EndAt) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *CreateImageRequest) field7Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("s_type", thrift.I64, 7) + l += bthrift.Binary.I64Length(p.SType) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *CreateImageRequest) field8Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("frequency", thrift.I64, 8) + l += bthrift.Binary.I64Length(p.Frequency) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *CreateImageRequest) field9Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("start_time", thrift.I64, 9) + l += bthrift.Binary.I64Length(p.StartTime) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *CreateImageRequest) field10Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("end_time", thrift.I64, 10) + l += bthrift.Binary.I64Length(p.EndTime) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *CreateImageRequest) field11Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("text", thrift.STRING, 11) + l += bthrift.Binary.StringLengthNocopy(p.Text) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *CreateImageRequest) field12Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("regex", thrift.STRING, 12) + l += bthrift.Binary.StringLengthNocopy(p.Regex) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *CreateImageRequest) field13Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("token", thrift.STRING, 13) + l += bthrift.Binary.StringLengthNocopy(p.Token) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *CreateImageResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_CreateImageResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *CreateImageResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := model.NewBaseResp() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = tmp + return offset, nil +} + +func (p *CreateImageResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 + + tmp := model.NewPicture() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Picture = tmp + return offset, nil +} + +// for compatibility +func (p *CreateImageResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *CreateImageResponse) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "CreateImageResponse") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *CreateImageResponse) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("CreateImageResponse") + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *CreateImageResponse) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "base", thrift.STRUCT, 1) + offset += p.Base.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *CreateImageResponse) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetPicture() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "picture", thrift.STRUCT, 2) + offset += p.Picture.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *CreateImageResponse) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("base", thrift.STRUCT, 1) + l += p.Base.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *CreateImageResponse) field2Length() int { + l := 0 + if p.IsSetPicture() { + l += bthrift.Binary.FieldBeginLength("picture", thrift.STRUCT, 2) + l += p.Picture.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *GetImageRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + var issetPictureId bool = false + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetPictureId = true + } else { + l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + if !issetPictureId { + fieldId = 1 + goto RequiredFieldNotSetError + } + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_GetImageRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetImageRequest[fieldId])) +} + +func (p *GetImageRequest) FastReadField1(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.PictureId = v + + } + return offset, nil +} + +func (p *GetImageRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Token = v + + } + return offset, nil +} + +// for compatibility +func (p *GetImageRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *GetImageRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "GetImageRequest") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *GetImageRequest) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("GetImageRequest") + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *GetImageRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "picture_id", thrift.I64, 1) + offset += bthrift.Binary.WriteI64(buf[offset:], p.PictureId) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *GetImageRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "token", thrift.STRING, 2) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Token) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *GetImageRequest) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("picture_id", thrift.I64, 1) + l += bthrift.Binary.I64Length(p.PictureId) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *GetImageRequest) field2Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("token", thrift.STRING, 2) + l += bthrift.Binary.StringLengthNocopy(p.Token) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *GetImageResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_GetImageResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *GetImageResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := model.NewBaseResp() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = tmp + return offset, nil +} + +func (p *GetImageResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 + + tmp := model.NewPicture() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Picture = tmp + return offset, nil +} + +// for compatibility +func (p *GetImageResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *GetImageResponse) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "GetImageResponse") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *GetImageResponse) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("GetImageResponse") + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *GetImageResponse) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "base", thrift.STRUCT, 1) + offset += p.Base.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *GetImageResponse) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetPicture() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "picture", thrift.STRUCT, 2) + offset += p.Picture.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *GetImageResponse) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("base", thrift.STRUCT, 1) + l += p.Base.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *GetImageResponse) field2Length() int { + l := 0 + if p.IsSetPicture() { + l += bthrift.Binary.FieldBeginLength("picture", thrift.STRUCT, 2) + l += p.Picture.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *GetImagesByUserIdRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_GetImagesByUserIdRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *GetImagesByUserIdRequest) FastReadField1(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Token = v + + } + return offset, nil +} + +// for compatibility +func (p *GetImagesByUserIdRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *GetImagesByUserIdRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "GetImagesByUserIdRequest") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *GetImagesByUserIdRequest) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("GetImagesByUserIdRequest") + if p != nil { + l += p.field1Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *GetImagesByUserIdRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "token", thrift.STRING, 1) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Token) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *GetImagesByUserIdRequest) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("token", thrift.STRING, 1) + l += bthrift.Binary.StringLengthNocopy(p.Token) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *GetImagesByUserIdResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_GetImagesByUserIdResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *GetImagesByUserIdResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := model.NewBaseResp() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = tmp + return offset, nil +} + +func (p *GetImagesByUserIdResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 + + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + p.PictureList = make([]*model.Picture, 0, size) + for i := 0; i < size; i++ { + _elem := model.NewPicture() + if l, err := _elem.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + + p.PictureList = append(p.PictureList, _elem) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + return offset, nil +} + +// for compatibility +func (p *GetImagesByUserIdResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *GetImagesByUserIdResponse) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "GetImagesByUserIdResponse") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *GetImagesByUserIdResponse) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("GetImagesByUserIdResponse") + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *GetImagesByUserIdResponse) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "base", thrift.STRUCT, 1) + offset += p.Base.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *GetImagesByUserIdResponse) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetPictureList() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "picture_list", thrift.LIST, 2) + listBeginOffset := offset + offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) + var length int + for _, v := range p.PictureList { + length++ + offset += v.FastWriteNocopy(buf[offset:], binaryWriter) + } + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) + offset += bthrift.Binary.WriteListEnd(buf[offset:]) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *GetImagesByUserIdResponse) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("base", thrift.STRUCT, 1) + l += p.Base.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *GetImagesByUserIdResponse) field2Length() int { + l := 0 + if p.IsSetPictureList() { + l += bthrift.Binary.FieldBeginLength("picture_list", thrift.LIST, 2) + l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.PictureList)) + for _, v := range p.PictureList { + l += v.BLength() + } + l += bthrift.Binary.ListEndLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *ChangeImagePropertyRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + var issetPicType bool = false + var issetStartAt bool = false + var issetEndAt bool = false + var issetSType bool = false + var issetFrequency bool = false + var issetStartTime bool = false + var issetEndTime bool = false + var issetText bool = false + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetPicType = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetStartAt = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetEndAt = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 6: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField6(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetSType = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 7: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField7(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetFrequency = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 8: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField8(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetStartTime = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 9: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField9(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetEndTime = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 10: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField10(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetText = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 11: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField11(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 12: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField12(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + if !issetPicType { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetStartAt { + fieldId = 4 + goto RequiredFieldNotSetError + } + + if !issetEndAt { + fieldId = 5 + goto RequiredFieldNotSetError + } + + if !issetSType { + fieldId = 6 + goto RequiredFieldNotSetError + } + + if !issetFrequency { + fieldId = 7 + goto RequiredFieldNotSetError + } + + if !issetStartTime { + fieldId = 8 + goto RequiredFieldNotSetError + } + + if !issetEndTime { + fieldId = 9 + goto RequiredFieldNotSetError + } + + if !issetText { + fieldId = 10 + goto RequiredFieldNotSetError + } + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_ChangeImagePropertyRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_ChangeImagePropertyRequest[fieldId])) +} + +func (p *ChangeImagePropertyRequest) FastReadField1(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.PicType = v + + } + return offset, nil +} + +func (p *ChangeImagePropertyRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Duration = &v + + } + return offset, nil +} + +func (p *ChangeImagePropertyRequest) FastReadField3(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Href = &v + + } + return offset, nil +} + +func (p *ChangeImagePropertyRequest) FastReadField4(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.StartAt = v + + } + return offset, nil +} + +func (p *ChangeImagePropertyRequest) FastReadField5(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.EndAt = v + + } + return offset, nil +} + +func (p *ChangeImagePropertyRequest) FastReadField6(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.SType = v + + } + return offset, nil +} + +func (p *ChangeImagePropertyRequest) FastReadField7(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Frequency = v + + } + return offset, nil +} + +func (p *ChangeImagePropertyRequest) FastReadField8(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.StartTime = v + + } + return offset, nil +} + +func (p *ChangeImagePropertyRequest) FastReadField9(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.EndTime = v + + } + return offset, nil +} + +func (p *ChangeImagePropertyRequest) FastReadField10(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Text = v + + } + return offset, nil +} + +func (p *ChangeImagePropertyRequest) FastReadField11(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Regex = v + + } + return offset, nil +} + +func (p *ChangeImagePropertyRequest) FastReadField12(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Token = v + + } + return offset, nil +} + +// for compatibility +func (p *ChangeImagePropertyRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *ChangeImagePropertyRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "ChangeImagePropertyRequest") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField4(buf[offset:], binaryWriter) + offset += p.fastWriteField5(buf[offset:], binaryWriter) + offset += p.fastWriteField6(buf[offset:], binaryWriter) + offset += p.fastWriteField7(buf[offset:], binaryWriter) + offset += p.fastWriteField8(buf[offset:], binaryWriter) + offset += p.fastWriteField9(buf[offset:], binaryWriter) + offset += p.fastWriteField3(buf[offset:], binaryWriter) + offset += p.fastWriteField10(buf[offset:], binaryWriter) + offset += p.fastWriteField11(buf[offset:], binaryWriter) + offset += p.fastWriteField12(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *ChangeImagePropertyRequest) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("ChangeImagePropertyRequest") + 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 += p.field8Length() + l += p.field9Length() + l += p.field10Length() + l += p.field11Length() + l += p.field12Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *ChangeImagePropertyRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "pic_type", thrift.I64, 1) + offset += bthrift.Binary.WriteI64(buf[offset:], p.PicType) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ChangeImagePropertyRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetDuration() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "duration", thrift.I64, 2) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.Duration) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *ChangeImagePropertyRequest) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetHref() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "href", thrift.STRING, 3) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Href) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *ChangeImagePropertyRequest) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "start_at", thrift.I64, 4) + offset += bthrift.Binary.WriteI64(buf[offset:], p.StartAt) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ChangeImagePropertyRequest) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "end_at", thrift.I64, 5) + offset += bthrift.Binary.WriteI64(buf[offset:], p.EndAt) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ChangeImagePropertyRequest) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "s_type", thrift.I64, 6) + offset += bthrift.Binary.WriteI64(buf[offset:], p.SType) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ChangeImagePropertyRequest) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "frequency", thrift.I64, 7) + offset += bthrift.Binary.WriteI64(buf[offset:], p.Frequency) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ChangeImagePropertyRequest) fastWriteField8(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "start_time", thrift.I64, 8) + offset += bthrift.Binary.WriteI64(buf[offset:], p.StartTime) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ChangeImagePropertyRequest) fastWriteField9(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "end_time", thrift.I64, 9) + offset += bthrift.Binary.WriteI64(buf[offset:], p.EndTime) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ChangeImagePropertyRequest) fastWriteField10(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "text", thrift.STRING, 10) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Text) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ChangeImagePropertyRequest) fastWriteField11(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "regex", thrift.STRING, 11) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Regex) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ChangeImagePropertyRequest) fastWriteField12(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "token", thrift.STRING, 12) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Token) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ChangeImagePropertyRequest) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("pic_type", thrift.I64, 1) + l += bthrift.Binary.I64Length(p.PicType) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ChangeImagePropertyRequest) field2Length() int { + l := 0 + if p.IsSetDuration() { + l += bthrift.Binary.FieldBeginLength("duration", thrift.I64, 2) + l += bthrift.Binary.I64Length(*p.Duration) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *ChangeImagePropertyRequest) field3Length() int { + l := 0 + if p.IsSetHref() { + l += bthrift.Binary.FieldBeginLength("href", thrift.STRING, 3) + l += bthrift.Binary.StringLengthNocopy(*p.Href) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *ChangeImagePropertyRequest) field4Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("start_at", thrift.I64, 4) + l += bthrift.Binary.I64Length(p.StartAt) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ChangeImagePropertyRequest) field5Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("end_at", thrift.I64, 5) + l += bthrift.Binary.I64Length(p.EndAt) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ChangeImagePropertyRequest) field6Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("s_type", thrift.I64, 6) + l += bthrift.Binary.I64Length(p.SType) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ChangeImagePropertyRequest) field7Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("frequency", thrift.I64, 7) + l += bthrift.Binary.I64Length(p.Frequency) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ChangeImagePropertyRequest) field8Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("start_time", thrift.I64, 8) + l += bthrift.Binary.I64Length(p.StartTime) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ChangeImagePropertyRequest) field9Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("end_time", thrift.I64, 9) + l += bthrift.Binary.I64Length(p.EndTime) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ChangeImagePropertyRequest) field10Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("text", thrift.STRING, 10) + l += bthrift.Binary.StringLengthNocopy(p.Text) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ChangeImagePropertyRequest) field11Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("regex", thrift.STRING, 11) + l += bthrift.Binary.StringLengthNocopy(p.Regex) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ChangeImagePropertyRequest) field12Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("token", thrift.STRING, 12) + l += bthrift.Binary.StringLengthNocopy(p.Token) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ChangeImagePropertyResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_ChangeImagePropertyResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *ChangeImagePropertyResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := model.NewBaseResp() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = tmp + return offset, nil +} + +func (p *ChangeImagePropertyResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 + + tmp := model.NewPicture() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Picture = tmp + return offset, nil +} + +// for compatibility +func (p *ChangeImagePropertyResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *ChangeImagePropertyResponse) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "ChangeImagePropertyResponse") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *ChangeImagePropertyResponse) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("ChangeImagePropertyResponse") + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *ChangeImagePropertyResponse) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "base", thrift.STRUCT, 1) + offset += p.Base.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ChangeImagePropertyResponse) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetPicture() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "picture", thrift.STRUCT, 2) + offset += p.Picture.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *ChangeImagePropertyResponse) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("base", thrift.STRUCT, 1) + l += p.Base.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ChangeImagePropertyResponse) field2Length() int { + l := 0 + if p.IsSetPicture() { + l += bthrift.Binary.FieldBeginLength("picture", thrift.STRUCT, 2) + l += p.Picture.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *ChangeImageRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + var issetPictureId bool = false + var issetImage bool = false + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetPictureId = true + } else { + l, err = bthrift.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 + } + issetImage = true + } else { + l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + if !issetPictureId { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetImage { + fieldId = 2 + goto RequiredFieldNotSetError + } + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_ChangeImageRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_ChangeImageRequest[fieldId])) +} + +func (p *ChangeImageRequest) FastReadField1(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.PictureId = v + + } + return offset, nil +} + +func (p *ChangeImageRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadBinary(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Image = []byte(v) + + } + return offset, nil +} + +func (p *ChangeImageRequest) FastReadField3(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Token = v + + } + return offset, nil +} + +// for compatibility +func (p *ChangeImageRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *ChangeImageRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "ChangeImageRequest") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField3(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *ChangeImageRequest) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("ChangeImageRequest") + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *ChangeImageRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "picture_id", thrift.I64, 1) + offset += bthrift.Binary.WriteI64(buf[offset:], p.PictureId) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ChangeImageRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "image", thrift.STRING, 2) + offset += bthrift.Binary.WriteBinaryNocopy(buf[offset:], binaryWriter, []byte(p.Image)) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ChangeImageRequest) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "token", thrift.STRING, 3) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Token) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ChangeImageRequest) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("picture_id", thrift.I64, 1) + l += bthrift.Binary.I64Length(p.PictureId) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ChangeImageRequest) field2Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("image", thrift.STRING, 2) + l += bthrift.Binary.BinaryLengthNocopy([]byte(p.Image)) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ChangeImageRequest) field3Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("token", thrift.STRING, 3) + l += bthrift.Binary.StringLengthNocopy(p.Token) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ChangeImageResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_ChangeImageResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *ChangeImageResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := model.NewBaseResp() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = tmp + return offset, nil +} + +func (p *ChangeImageResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 + + tmp := model.NewPicture() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Picture = tmp + return offset, nil +} + +// for compatibility +func (p *ChangeImageResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *ChangeImageResponse) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "ChangeImageResponse") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *ChangeImageResponse) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("ChangeImageResponse") + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *ChangeImageResponse) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "base", thrift.STRUCT, 1) + offset += p.Base.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *ChangeImageResponse) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetPicture() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "picture", thrift.STRUCT, 2) + offset += p.Picture.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *ChangeImageResponse) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("base", thrift.STRUCT, 1) + l += p.Base.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *ChangeImageResponse) field2Length() int { + l := 0 + if p.IsSetPicture() { + l += bthrift.Binary.FieldBeginLength("picture", thrift.STRUCT, 2) + l += p.Picture.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *DeleteImageRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + var issetPictureId bool = false + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetPictureId = true + } else { + l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + if !issetPictureId { + fieldId = 1 + goto RequiredFieldNotSetError + } + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_DeleteImageRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_DeleteImageRequest[fieldId])) +} + +func (p *DeleteImageRequest) FastReadField1(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.PictureId = v + + } + return offset, nil +} + +func (p *DeleteImageRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Token = v + + } + return offset, nil +} + +// for compatibility +func (p *DeleteImageRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *DeleteImageRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "DeleteImageRequest") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *DeleteImageRequest) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("DeleteImageRequest") + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *DeleteImageRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "picture_id", thrift.I64, 1) + offset += bthrift.Binary.WriteI64(buf[offset:], p.PictureId) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *DeleteImageRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "token", thrift.STRING, 2) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Token) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *DeleteImageRequest) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("picture_id", thrift.I64, 1) + l += bthrift.Binary.I64Length(p.PictureId) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *DeleteImageRequest) field2Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("token", thrift.STRING, 2) + l += bthrift.Binary.StringLengthNocopy(p.Token) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *DeleteImageResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_DeleteImageResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *DeleteImageResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := model.NewBaseResp() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = tmp + return offset, nil +} + +func (p *DeleteImageResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 + + tmp := model.NewPicture() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Picture = tmp + return offset, nil +} + +// for compatibility +func (p *DeleteImageResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *DeleteImageResponse) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "DeleteImageResponse") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *DeleteImageResponse) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("DeleteImageResponse") + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *DeleteImageResponse) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "base", thrift.STRUCT, 1) + offset += p.Base.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *DeleteImageResponse) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetPicture() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "picture", thrift.STRUCT, 2) + offset += p.Picture.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *DeleteImageResponse) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("base", thrift.STRUCT, 1) + l += p.Base.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *DeleteImageResponse) field2Length() int { + l := 0 + if p.IsSetPicture() { + l += bthrift.Binary.FieldBeginLength("picture", thrift.STRUCT, 2) + l += p.Picture.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *MobileGetImageRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + var issetType bool = false + var issetStudentId bool = false + var issetCollege bool = false + var issetDevice bool = false + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetType = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetStudentId = true + } else { + l, err = bthrift.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 + } + issetCollege = true + } else { + l, err = bthrift.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 + } + issetDevice = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + if !issetType { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetStudentId { + fieldId = 2 + goto RequiredFieldNotSetError + } + + if !issetCollege { + fieldId = 3 + goto RequiredFieldNotSetError + } + + if !issetDevice { + fieldId = 4 + goto RequiredFieldNotSetError + } + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_MobileGetImageRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_MobileGetImageRequest[fieldId])) +} + +func (p *MobileGetImageRequest) FastReadField1(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Type = v + + } + return offset, nil +} + +func (p *MobileGetImageRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.StudentId = v + + } + return offset, nil +} + +func (p *MobileGetImageRequest) FastReadField3(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.College = v + + } + return offset, nil +} + +func (p *MobileGetImageRequest) FastReadField4(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Device = v + + } + return offset, nil +} + +// for compatibility +func (p *MobileGetImageRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *MobileGetImageRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "MobileGetImageRequest") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField3(buf[offset:], binaryWriter) + offset += p.fastWriteField4(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *MobileGetImageRequest) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("MobileGetImageRequest") + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field4Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *MobileGetImageRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "type", thrift.I64, 1) + offset += bthrift.Binary.WriteI64(buf[offset:], p.Type) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *MobileGetImageRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "student_id", thrift.I64, 2) + offset += bthrift.Binary.WriteI64(buf[offset:], p.StudentId) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *MobileGetImageRequest) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "college", thrift.STRING, 3) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.College) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *MobileGetImageRequest) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "device", thrift.STRING, 4) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Device) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *MobileGetImageRequest) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("type", thrift.I64, 1) + l += bthrift.Binary.I64Length(p.Type) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *MobileGetImageRequest) field2Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("student_id", thrift.I64, 2) + l += bthrift.Binary.I64Length(p.StudentId) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *MobileGetImageRequest) field3Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("college", thrift.STRING, 3) + l += bthrift.Binary.StringLengthNocopy(p.College) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *MobileGetImageRequest) field4Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("device", thrift.STRING, 4) + l += bthrift.Binary.StringLengthNocopy(p.Device) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *MobileGetImageResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_MobileGetImageResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *MobileGetImageResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := model.NewBaseResp() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = tmp + return offset, nil +} + +func (p *MobileGetImageResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 + + tmp := model.NewPicture() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Picture = tmp + return offset, nil +} + +// for compatibility +func (p *MobileGetImageResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *MobileGetImageResponse) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "MobileGetImageResponse") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *MobileGetImageResponse) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("MobileGetImageResponse") + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *MobileGetImageResponse) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "base", thrift.STRUCT, 1) + offset += p.Base.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *MobileGetImageResponse) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetPicture() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "picture", thrift.STRUCT, 2) + offset += p.Picture.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *MobileGetImageResponse) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("base", thrift.STRUCT, 1) + l += p.Base.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *MobileGetImageResponse) field2Length() int { + l := 0 + if p.IsSetPicture() { + l += bthrift.Binary.FieldBeginLength("picture", thrift.STRUCT, 2) + l += p.Picture.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *AddImagePointTimeRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + var issetPictureId bool = false + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetPictureId = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + if !issetPictureId { + fieldId = 1 + goto RequiredFieldNotSetError + } + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_AddImagePointTimeRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_AddImagePointTimeRequest[fieldId])) +} + +func (p *AddImagePointTimeRequest) FastReadField1(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.PictureId = v + + } + return offset, nil +} + +// for compatibility +func (p *AddImagePointTimeRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *AddImagePointTimeRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "AddImagePointTimeRequest") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *AddImagePointTimeRequest) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("AddImagePointTimeRequest") + if p != nil { + l += p.field1Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *AddImagePointTimeRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "picture_id", thrift.I64, 1) + offset += bthrift.Binary.WriteI64(buf[offset:], p.PictureId) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *AddImagePointTimeRequest) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("picture_id", thrift.I64, 1) + l += bthrift.Binary.I64Length(p.PictureId) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *AddImagePointTimeResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_AddImagePointTimeResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *AddImagePointTimeResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := model.NewBaseResp() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = tmp + return offset, nil +} + +func (p *AddImagePointTimeResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 + + tmp := model.NewPicture() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Picture = tmp + return offset, nil +} + +// for compatibility +func (p *AddImagePointTimeResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *AddImagePointTimeResponse) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "AddImagePointTimeResponse") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *AddImagePointTimeResponse) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("AddImagePointTimeResponse") + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *AddImagePointTimeResponse) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "base", thrift.STRUCT, 1) + offset += p.Base.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *AddImagePointTimeResponse) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetPicture() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "picture", thrift.STRUCT, 2) + offset += p.Picture.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *AddImagePointTimeResponse) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("base", thrift.STRUCT, 1) + l += p.Base.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *AddImagePointTimeResponse) field2Length() int { + l := 0 + if p.IsSetPicture() { + l += bthrift.Binary.FieldBeginLength("picture", thrift.STRUCT, 2) + l += p.Picture.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *LaunchScreenServiceCreateImageArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_LaunchScreenServiceCreateImageArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceCreateImageArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := NewCreateImageRequest() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = tmp + return offset, nil +} + +// for compatibility +func (p *LaunchScreenServiceCreateImageArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *LaunchScreenServiceCreateImageArgs) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "CreateImage_args") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *LaunchScreenServiceCreateImageArgs) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("CreateImage_args") + if p != nil { + l += p.field1Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *LaunchScreenServiceCreateImageArgs) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "req", thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *LaunchScreenServiceCreateImageArgs) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("req", thrift.STRUCT, 1) + l += p.Req.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *LaunchScreenServiceCreateImageResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_LaunchScreenServiceCreateImageResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceCreateImageResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + + tmp := NewCreateImageResponse() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = tmp + return offset, nil +} + +// for compatibility +func (p *LaunchScreenServiceCreateImageResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *LaunchScreenServiceCreateImageResult) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "CreateImage_result") + if p != nil { + offset += p.fastWriteField0(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *LaunchScreenServiceCreateImageResult) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("CreateImage_result") + if p != nil { + l += p.field0Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *LaunchScreenServiceCreateImageResult) fastWriteField0(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "success", thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *LaunchScreenServiceCreateImageResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += bthrift.Binary.FieldBeginLength("success", thrift.STRUCT, 0) + l += p.Success.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *LaunchScreenServiceGetImageArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_LaunchScreenServiceGetImageArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceGetImageArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := NewGetImageRequest() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = tmp + return offset, nil +} + +// for compatibility +func (p *LaunchScreenServiceGetImageArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *LaunchScreenServiceGetImageArgs) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "GetImage_args") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *LaunchScreenServiceGetImageArgs) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("GetImage_args") + if p != nil { + l += p.field1Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *LaunchScreenServiceGetImageArgs) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "req", thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *LaunchScreenServiceGetImageArgs) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("req", thrift.STRUCT, 1) + l += p.Req.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *LaunchScreenServiceGetImageResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_LaunchScreenServiceGetImageResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceGetImageResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + + tmp := NewGetImagesByUserIdResponse() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = tmp + return offset, nil +} + +// for compatibility +func (p *LaunchScreenServiceGetImageResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *LaunchScreenServiceGetImageResult) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "GetImage_result") + if p != nil { + offset += p.fastWriteField0(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *LaunchScreenServiceGetImageResult) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("GetImage_result") + if p != nil { + l += p.field0Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *LaunchScreenServiceGetImageResult) fastWriteField0(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "success", thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *LaunchScreenServiceGetImageResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += bthrift.Binary.FieldBeginLength("success", thrift.STRUCT, 0) + l += p.Success.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *LaunchScreenServiceGetImagesByUserIdArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_LaunchScreenServiceGetImagesByUserIdArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceGetImagesByUserIdArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := NewGetImagesByUserIdRequest() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = tmp + return offset, nil +} + +// for compatibility +func (p *LaunchScreenServiceGetImagesByUserIdArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *LaunchScreenServiceGetImagesByUserIdArgs) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "GetImagesByUserId_args") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *LaunchScreenServiceGetImagesByUserIdArgs) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("GetImagesByUserId_args") + if p != nil { + l += p.field1Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *LaunchScreenServiceGetImagesByUserIdArgs) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "req", thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *LaunchScreenServiceGetImagesByUserIdArgs) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("req", thrift.STRUCT, 1) + l += p.Req.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *LaunchScreenServiceGetImagesByUserIdResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_LaunchScreenServiceGetImagesByUserIdResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceGetImagesByUserIdResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + + tmp := NewGetImagesByUserIdResponse() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = tmp + return offset, nil +} + +// for compatibility +func (p *LaunchScreenServiceGetImagesByUserIdResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *LaunchScreenServiceGetImagesByUserIdResult) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "GetImagesByUserId_result") + if p != nil { + offset += p.fastWriteField0(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *LaunchScreenServiceGetImagesByUserIdResult) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("GetImagesByUserId_result") + if p != nil { + l += p.field0Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *LaunchScreenServiceGetImagesByUserIdResult) fastWriteField0(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "success", thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *LaunchScreenServiceGetImagesByUserIdResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += bthrift.Binary.FieldBeginLength("success", thrift.STRUCT, 0) + l += p.Success.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *LaunchScreenServiceChangeImagePropertyArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_LaunchScreenServiceChangeImagePropertyArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceChangeImagePropertyArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := NewChangeImagePropertyRequest() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = tmp + return offset, nil +} + +// for compatibility +func (p *LaunchScreenServiceChangeImagePropertyArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *LaunchScreenServiceChangeImagePropertyArgs) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "ChangeImageProperty_args") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *LaunchScreenServiceChangeImagePropertyArgs) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("ChangeImageProperty_args") + if p != nil { + l += p.field1Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *LaunchScreenServiceChangeImagePropertyArgs) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "req", thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *LaunchScreenServiceChangeImagePropertyArgs) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("req", thrift.STRUCT, 1) + l += p.Req.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *LaunchScreenServiceChangeImagePropertyResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_LaunchScreenServiceChangeImagePropertyResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceChangeImagePropertyResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + + tmp := NewChangeImagePropertyResponse() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = tmp + return offset, nil +} + +// for compatibility +func (p *LaunchScreenServiceChangeImagePropertyResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *LaunchScreenServiceChangeImagePropertyResult) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "ChangeImageProperty_result") + if p != nil { + offset += p.fastWriteField0(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *LaunchScreenServiceChangeImagePropertyResult) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("ChangeImageProperty_result") + if p != nil { + l += p.field0Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *LaunchScreenServiceChangeImagePropertyResult) fastWriteField0(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "success", thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *LaunchScreenServiceChangeImagePropertyResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += bthrift.Binary.FieldBeginLength("success", thrift.STRUCT, 0) + l += p.Success.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *LaunchScreenServiceChangeImageArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_LaunchScreenServiceChangeImageArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceChangeImageArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := NewChangeImageRequest() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = tmp + return offset, nil +} + +// for compatibility +func (p *LaunchScreenServiceChangeImageArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *LaunchScreenServiceChangeImageArgs) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "ChangeImage_args") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *LaunchScreenServiceChangeImageArgs) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("ChangeImage_args") + if p != nil { + l += p.field1Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *LaunchScreenServiceChangeImageArgs) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "req", thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *LaunchScreenServiceChangeImageArgs) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("req", thrift.STRUCT, 1) + l += p.Req.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *LaunchScreenServiceChangeImageResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_LaunchScreenServiceChangeImageResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceChangeImageResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + + tmp := NewChangeImageResponse() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = tmp + return offset, nil +} + +// for compatibility +func (p *LaunchScreenServiceChangeImageResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *LaunchScreenServiceChangeImageResult) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "ChangeImage_result") + if p != nil { + offset += p.fastWriteField0(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *LaunchScreenServiceChangeImageResult) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("ChangeImage_result") + if p != nil { + l += p.field0Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *LaunchScreenServiceChangeImageResult) fastWriteField0(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "success", thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *LaunchScreenServiceChangeImageResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += bthrift.Binary.FieldBeginLength("success", thrift.STRUCT, 0) + l += p.Success.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *LaunchScreenServiceDeleteImageArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_LaunchScreenServiceDeleteImageArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceDeleteImageArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := NewDeleteImageRequest() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = tmp + return offset, nil +} + +// for compatibility +func (p *LaunchScreenServiceDeleteImageArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *LaunchScreenServiceDeleteImageArgs) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "DeleteImage_args") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *LaunchScreenServiceDeleteImageArgs) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("DeleteImage_args") + if p != nil { + l += p.field1Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *LaunchScreenServiceDeleteImageArgs) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "req", thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *LaunchScreenServiceDeleteImageArgs) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("req", thrift.STRUCT, 1) + l += p.Req.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *LaunchScreenServiceDeleteImageResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_LaunchScreenServiceDeleteImageResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceDeleteImageResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + + tmp := NewDeleteImageResponse() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = tmp + return offset, nil +} + +// for compatibility +func (p *LaunchScreenServiceDeleteImageResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *LaunchScreenServiceDeleteImageResult) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "DeleteImage_result") + if p != nil { + offset += p.fastWriteField0(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *LaunchScreenServiceDeleteImageResult) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("DeleteImage_result") + if p != nil { + l += p.field0Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *LaunchScreenServiceDeleteImageResult) fastWriteField0(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "success", thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *LaunchScreenServiceDeleteImageResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += bthrift.Binary.FieldBeginLength("success", thrift.STRUCT, 0) + l += p.Success.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *LaunchScreenServiceMobileGetImageArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_LaunchScreenServiceMobileGetImageArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceMobileGetImageArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := NewMobileGetImageRequest() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = tmp + return offset, nil +} + +// for compatibility +func (p *LaunchScreenServiceMobileGetImageArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *LaunchScreenServiceMobileGetImageArgs) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "MobileGetImage_args") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *LaunchScreenServiceMobileGetImageArgs) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("MobileGetImage_args") + if p != nil { + l += p.field1Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *LaunchScreenServiceMobileGetImageArgs) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "req", thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *LaunchScreenServiceMobileGetImageArgs) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("req", thrift.STRUCT, 1) + l += p.Req.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *LaunchScreenServiceMobileGetImageResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_LaunchScreenServiceMobileGetImageResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceMobileGetImageResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + + tmp := NewMobileGetImageResponse() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = tmp + return offset, nil +} + +// for compatibility +func (p *LaunchScreenServiceMobileGetImageResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *LaunchScreenServiceMobileGetImageResult) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "MobileGetImage_result") + if p != nil { + offset += p.fastWriteField0(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *LaunchScreenServiceMobileGetImageResult) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("MobileGetImage_result") + if p != nil { + l += p.field0Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *LaunchScreenServiceMobileGetImageResult) fastWriteField0(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "success", thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *LaunchScreenServiceMobileGetImageResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += bthrift.Binary.FieldBeginLength("success", thrift.STRUCT, 0) + l += p.Success.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *LaunchScreenServiceAddImagePointTimeArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_LaunchScreenServiceAddImagePointTimeArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceAddImagePointTimeArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := NewAddImagePointTimeRequest() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = tmp + return offset, nil +} + +// for compatibility +func (p *LaunchScreenServiceAddImagePointTimeArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *LaunchScreenServiceAddImagePointTimeArgs) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "AddImagePointTime_args") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *LaunchScreenServiceAddImagePointTimeArgs) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("AddImagePointTime_args") + if p != nil { + l += p.field1Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *LaunchScreenServiceAddImagePointTimeArgs) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "req", thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *LaunchScreenServiceAddImagePointTimeArgs) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("req", thrift.STRUCT, 1) + l += p.Req.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *LaunchScreenServiceAddImagePointTimeResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_LaunchScreenServiceAddImagePointTimeResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceAddImagePointTimeResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + + tmp := NewAddImagePointTimeResponse() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = tmp + return offset, nil +} + +// for compatibility +func (p *LaunchScreenServiceAddImagePointTimeResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *LaunchScreenServiceAddImagePointTimeResult) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "AddImagePointTime_result") + if p != nil { + offset += p.fastWriteField0(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *LaunchScreenServiceAddImagePointTimeResult) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("AddImagePointTime_result") + if p != nil { + l += p.field0Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *LaunchScreenServiceAddImagePointTimeResult) fastWriteField0(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "success", thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *LaunchScreenServiceAddImagePointTimeResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += bthrift.Binary.FieldBeginLength("success", thrift.STRUCT, 0) + l += p.Success.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *LaunchScreenServiceCreateImageArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *LaunchScreenServiceCreateImageResult) GetResult() interface{} { + return p.Success +} + +func (p *LaunchScreenServiceGetImageArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *LaunchScreenServiceGetImageResult) GetResult() interface{} { + return p.Success +} + +func (p *LaunchScreenServiceGetImagesByUserIdArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *LaunchScreenServiceGetImagesByUserIdResult) GetResult() interface{} { + return p.Success +} + +func (p *LaunchScreenServiceChangeImagePropertyArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *LaunchScreenServiceChangeImagePropertyResult) GetResult() interface{} { + return p.Success +} + +func (p *LaunchScreenServiceChangeImageArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *LaunchScreenServiceChangeImageResult) GetResult() interface{} { + return p.Success +} + +func (p *LaunchScreenServiceDeleteImageArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *LaunchScreenServiceDeleteImageResult) GetResult() interface{} { + return p.Success +} + +func (p *LaunchScreenServiceMobileGetImageArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *LaunchScreenServiceMobileGetImageResult) GetResult() interface{} { + return p.Success +} + +func (p *LaunchScreenServiceAddImagePointTimeArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *LaunchScreenServiceAddImagePointTimeResult) GetResult() interface{} { + return p.Success +} diff --git a/kitex_gen/launch_screen/launch_screen.go b/kitex_gen/launch_screen/launch_screen.go new file mode 100644 index 0000000..747f499 --- /dev/null +++ b/kitex_gen/launch_screen/launch_screen.go @@ -0,0 +1,8525 @@ +// Code generated by thriftgo (0.3.13). DO NOT EDIT. + +package launch_screen + +import ( + "bytes" + "context" + "fmt" + "github.com/apache/thrift/lib/go/thrift" + "github.com/west2-online/fzuhelper-server/kitex_gen/model" + "strings" +) + +type CreateImageRequest struct { + PicType int64 `thrift:"pic_type,1,required" frugal:"1,required,i64" json:"pic_type"` + Duration *int64 `thrift:"duration,2,optional" frugal:"2,optional,i64" json:"duration,omitempty"` + Href *string `thrift:"href,3,optional" frugal:"3,optional,string" json:"href,omitempty"` + Image []byte `thrift:"image,4,required" frugal:"4,required,binary" json:"image"` + StartAt int64 `thrift:"start_at,5,required" frugal:"5,required,i64" json:"start_at"` + EndAt int64 `thrift:"end_at,6,required" frugal:"6,required,i64" json:"end_at"` + SType int64 `thrift:"s_type,7,required" frugal:"7,required,i64" json:"s_type"` + Frequency int64 `thrift:"frequency,8,required" frugal:"8,required,i64" json:"frequency"` + StartTime int64 `thrift:"start_time,9,required" frugal:"9,required,i64" json:"start_time"` + EndTime int64 `thrift:"end_time,10,required" frugal:"10,required,i64" json:"end_time"` + Text string `thrift:"text,11,required" frugal:"11,required,string" json:"text"` + Regex string `thrift:"regex,12" frugal:"12,default,string" json:"regex"` + Token string `thrift:"token,13" frugal:"13,default,string" json:"token"` +} + +func NewCreateImageRequest() *CreateImageRequest { + return &CreateImageRequest{} +} + +func (p *CreateImageRequest) InitDefault() { +} + +func (p *CreateImageRequest) GetPicType() (v int64) { + return p.PicType +} + +var CreateImageRequest_Duration_DEFAULT int64 + +func (p *CreateImageRequest) GetDuration() (v int64) { + if !p.IsSetDuration() { + return CreateImageRequest_Duration_DEFAULT + } + return *p.Duration +} + +var CreateImageRequest_Href_DEFAULT string + +func (p *CreateImageRequest) GetHref() (v string) { + if !p.IsSetHref() { + return CreateImageRequest_Href_DEFAULT + } + return *p.Href +} + +func (p *CreateImageRequest) GetImage() (v []byte) { + return p.Image +} + +func (p *CreateImageRequest) GetStartAt() (v int64) { + return p.StartAt +} + +func (p *CreateImageRequest) GetEndAt() (v int64) { + return p.EndAt +} + +func (p *CreateImageRequest) GetSType() (v int64) { + return p.SType +} + +func (p *CreateImageRequest) GetFrequency() (v int64) { + return p.Frequency +} + +func (p *CreateImageRequest) GetStartTime() (v int64) { + return p.StartTime +} + +func (p *CreateImageRequest) GetEndTime() (v int64) { + return p.EndTime +} + +func (p *CreateImageRequest) GetText() (v string) { + return p.Text +} + +func (p *CreateImageRequest) GetRegex() (v string) { + return p.Regex +} + +func (p *CreateImageRequest) GetToken() (v string) { + return p.Token +} +func (p *CreateImageRequest) SetPicType(val int64) { + p.PicType = val +} +func (p *CreateImageRequest) SetDuration(val *int64) { + p.Duration = val +} +func (p *CreateImageRequest) SetHref(val *string) { + p.Href = val +} +func (p *CreateImageRequest) SetImage(val []byte) { + p.Image = val +} +func (p *CreateImageRequest) SetStartAt(val int64) { + p.StartAt = val +} +func (p *CreateImageRequest) SetEndAt(val int64) { + p.EndAt = val +} +func (p *CreateImageRequest) SetSType(val int64) { + p.SType = val +} +func (p *CreateImageRequest) SetFrequency(val int64) { + p.Frequency = val +} +func (p *CreateImageRequest) SetStartTime(val int64) { + p.StartTime = val +} +func (p *CreateImageRequest) SetEndTime(val int64) { + p.EndTime = val +} +func (p *CreateImageRequest) SetText(val string) { + p.Text = val +} +func (p *CreateImageRequest) SetRegex(val string) { + p.Regex = val +} +func (p *CreateImageRequest) SetToken(val string) { + p.Token = val +} + +var fieldIDToName_CreateImageRequest = map[int16]string{ + 1: "pic_type", + 2: "duration", + 3: "href", + 4: "image", + 5: "start_at", + 6: "end_at", + 7: "s_type", + 8: "frequency", + 9: "start_time", + 10: "end_time", + 11: "text", + 12: "regex", + 13: "token", +} + +func (p *CreateImageRequest) IsSetDuration() bool { + return p.Duration != nil +} + +func (p *CreateImageRequest) IsSetHref() bool { + return p.Href != nil +} + +func (p *CreateImageRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetPicType bool = false + var issetImage bool = false + var issetStartAt bool = false + var issetEndAt bool = false + var issetSType bool = false + var issetFrequency bool = false + var issetStartTime bool = false + var issetEndTime bool = false + var issetText bool = false + + 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.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetPicType = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.I64 { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRING { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + issetImage = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.I64 { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + issetStartAt = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.I64 { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + issetEndAt = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.I64 { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + issetSType = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 8: + if fieldTypeId == thrift.I64 { + if err = p.ReadField8(iprot); err != nil { + goto ReadFieldError + } + issetFrequency = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 9: + if fieldTypeId == thrift.I64 { + if err = p.ReadField9(iprot); err != nil { + goto ReadFieldError + } + issetStartTime = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 10: + if fieldTypeId == thrift.I64 { + if err = p.ReadField10(iprot); err != nil { + goto ReadFieldError + } + issetEndTime = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 11: + if fieldTypeId == thrift.STRING { + if err = p.ReadField11(iprot); err != nil { + goto ReadFieldError + } + issetText = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 12: + if fieldTypeId == thrift.STRING { + if err = p.ReadField12(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 13: + if fieldTypeId == thrift.STRING { + if err = p.ReadField13(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + if !issetPicType { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetImage { + fieldId = 4 + goto RequiredFieldNotSetError + } + + if !issetStartAt { + fieldId = 5 + goto RequiredFieldNotSetError + } + + if !issetEndAt { + fieldId = 6 + goto RequiredFieldNotSetError + } + + if !issetSType { + fieldId = 7 + goto RequiredFieldNotSetError + } + + if !issetFrequency { + fieldId = 8 + goto RequiredFieldNotSetError + } + + if !issetStartTime { + fieldId = 9 + goto RequiredFieldNotSetError + } + + if !issetEndTime { + fieldId = 10 + goto RequiredFieldNotSetError + } + + if !issetText { + fieldId = 11 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CreateImageRequest[fieldId]), err) +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_CreateImageRequest[fieldId])) +} + +func (p *CreateImageRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.PicType = _field + return nil +} +func (p *CreateImageRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.Duration = _field + return nil +} +func (p *CreateImageRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Href = _field + return nil +} +func (p *CreateImageRequest) ReadField4(iprot thrift.TProtocol) error { + + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { + return err + } else { + _field = []byte(v) + } + p.Image = _field + return nil +} +func (p *CreateImageRequest) ReadField5(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.StartAt = _field + return nil +} +func (p *CreateImageRequest) ReadField6(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.EndAt = _field + return nil +} +func (p *CreateImageRequest) ReadField7(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.SType = _field + return nil +} +func (p *CreateImageRequest) ReadField8(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Frequency = _field + return nil +} +func (p *CreateImageRequest) ReadField9(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.StartTime = _field + return nil +} +func (p *CreateImageRequest) ReadField10(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.EndTime = _field + return nil +} +func (p *CreateImageRequest) ReadField11(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Text = _field + return nil +} +func (p *CreateImageRequest) ReadField12(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Regex = _field + return nil +} +func (p *CreateImageRequest) ReadField13(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Token = _field + return nil +} + +func (p *CreateImageRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("CreateImageRequest"); 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 = p.writeField8(oprot); err != nil { + fieldId = 8 + goto WriteFieldError + } + if err = p.writeField9(oprot); err != nil { + fieldId = 9 + goto WriteFieldError + } + if err = p.writeField10(oprot); err != nil { + fieldId = 10 + goto WriteFieldError + } + if err = p.writeField11(oprot); err != nil { + fieldId = 11 + goto WriteFieldError + } + if err = p.writeField12(oprot); err != nil { + fieldId = 12 + goto WriteFieldError + } + if err = p.writeField13(oprot); err != nil { + fieldId = 13 + 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 *CreateImageRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("pic_type", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.PicType); 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 *CreateImageRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetDuration() { + if err = oprot.WriteFieldBegin("duration", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.Duration); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetHref() { + if err = oprot.WriteFieldBegin("href", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Href); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("image", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBinary([]byte(p.Image)); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("start_at", thrift.I64, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.StartAt); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("end_at", thrift.I64, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.EndAt); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField7(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("s_type", thrift.I64, 7); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.SType); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField8(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("frequency", thrift.I64, 8); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.Frequency); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField9(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("start_time", thrift.I64, 9); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.StartTime); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField10(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("end_time", thrift.I64, 10); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.EndTime); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField11(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("text", thrift.STRING, 11); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Text); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField12(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("regex", thrift.STRING, 12); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Regex); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) +} + +func (p *CreateImageRequest) writeField13(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("token", thrift.STRING, 13); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Token); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 13 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 13 end error: ", p), err) +} + +func (p *CreateImageRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateImageRequest(%+v)", *p) + +} + +func (p *CreateImageRequest) DeepEqual(ano *CreateImageRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.PicType) { + return false + } + if !p.Field2DeepEqual(ano.Duration) { + return false + } + if !p.Field3DeepEqual(ano.Href) { + return false + } + if !p.Field4DeepEqual(ano.Image) { + return false + } + if !p.Field5DeepEqual(ano.StartAt) { + return false + } + if !p.Field6DeepEqual(ano.EndAt) { + return false + } + if !p.Field7DeepEqual(ano.SType) { + return false + } + if !p.Field8DeepEqual(ano.Frequency) { + return false + } + if !p.Field9DeepEqual(ano.StartTime) { + return false + } + if !p.Field10DeepEqual(ano.EndTime) { + return false + } + if !p.Field11DeepEqual(ano.Text) { + return false + } + if !p.Field12DeepEqual(ano.Regex) { + return false + } + if !p.Field13DeepEqual(ano.Token) { + return false + } + return true +} + +func (p *CreateImageRequest) Field1DeepEqual(src int64) bool { + + if p.PicType != src { + return false + } + return true +} +func (p *CreateImageRequest) Field2DeepEqual(src *int64) bool { + + if p.Duration == src { + return true + } else if p.Duration == nil || src == nil { + return false + } + if *p.Duration != *src { + return false + } + return true +} +func (p *CreateImageRequest) Field3DeepEqual(src *string) bool { + + if p.Href == src { + return true + } else if p.Href == nil || src == nil { + return false + } + if strings.Compare(*p.Href, *src) != 0 { + return false + } + return true +} +func (p *CreateImageRequest) Field4DeepEqual(src []byte) bool { + + if bytes.Compare(p.Image, src) != 0 { + return false + } + return true +} +func (p *CreateImageRequest) Field5DeepEqual(src int64) bool { + + if p.StartAt != src { + return false + } + return true +} +func (p *CreateImageRequest) Field6DeepEqual(src int64) bool { + + if p.EndAt != src { + return false + } + return true +} +func (p *CreateImageRequest) Field7DeepEqual(src int64) bool { + + if p.SType != src { + return false + } + return true +} +func (p *CreateImageRequest) Field8DeepEqual(src int64) bool { + + if p.Frequency != src { + return false + } + return true +} +func (p *CreateImageRequest) Field9DeepEqual(src int64) bool { + + if p.StartTime != src { + return false + } + return true +} +func (p *CreateImageRequest) Field10DeepEqual(src int64) bool { + + if p.EndTime != src { + return false + } + return true +} +func (p *CreateImageRequest) Field11DeepEqual(src string) bool { + + if strings.Compare(p.Text, src) != 0 { + return false + } + return true +} +func (p *CreateImageRequest) Field12DeepEqual(src string) bool { + + if strings.Compare(p.Regex, src) != 0 { + return false + } + return true +} +func (p *CreateImageRequest) Field13DeepEqual(src string) bool { + + if strings.Compare(p.Token, src) != 0 { + return false + } + return true +} + +type CreateImageResponse struct { + Base *model.BaseResp `thrift:"base,1" frugal:"1,default,model.BaseResp" json:"base"` + Picture *model.Picture `thrift:"picture,2,optional" frugal:"2,optional,model.Picture" json:"picture,omitempty"` +} + +func NewCreateImageResponse() *CreateImageResponse { + return &CreateImageResponse{} +} + +func (p *CreateImageResponse) InitDefault() { +} + +var CreateImageResponse_Base_DEFAULT *model.BaseResp + +func (p *CreateImageResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return CreateImageResponse_Base_DEFAULT + } + return p.Base +} + +var CreateImageResponse_Picture_DEFAULT *model.Picture + +func (p *CreateImageResponse) GetPicture() (v *model.Picture) { + if !p.IsSetPicture() { + return CreateImageResponse_Picture_DEFAULT + } + return p.Picture +} +func (p *CreateImageResponse) SetBase(val *model.BaseResp) { + p.Base = val +} +func (p *CreateImageResponse) SetPicture(val *model.Picture) { + p.Picture = val +} + +var fieldIDToName_CreateImageResponse = map[int16]string{ + 1: "base", + 2: "picture", +} + +func (p *CreateImageResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *CreateImageResponse) IsSetPicture() bool { + return p.Picture != nil +} + +func (p *CreateImageResponse) 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.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CreateImageResponse[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 *CreateImageResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *CreateImageResponse) ReadField2(iprot thrift.TProtocol) error { + _field := model.NewPicture() + if err := _field.Read(iprot); err != nil { + return err + } + p.Picture = _field + return nil +} + +func (p *CreateImageResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("CreateImageResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + 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 *CreateImageResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + 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 *CreateImageResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPicture() { + if err = oprot.WriteFieldBegin("picture", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Picture.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + 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 *CreateImageResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateImageResponse(%+v)", *p) + +} + +func (p *CreateImageResponse) DeepEqual(ano *CreateImageResponse) 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.Picture) { + return false + } + return true +} + +func (p *CreateImageResponse) Field1DeepEqual(src *model.BaseResp) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} +func (p *CreateImageResponse) Field2DeepEqual(src *model.Picture) bool { + + if !p.Picture.DeepEqual(src) { + return false + } + return true +} + +type GetImageRequest struct { + PictureId int64 `thrift:"picture_id,1,required" frugal:"1,required,i64" json:"picture_id"` + Token string `thrift:"token,2" frugal:"2,default,string" json:"token"` +} + +func NewGetImageRequest() *GetImageRequest { + return &GetImageRequest{} +} + +func (p *GetImageRequest) InitDefault() { +} + +func (p *GetImageRequest) GetPictureId() (v int64) { + return p.PictureId +} + +func (p *GetImageRequest) GetToken() (v string) { + return p.Token +} +func (p *GetImageRequest) SetPictureId(val int64) { + p.PictureId = val +} +func (p *GetImageRequest) SetToken(val string) { + p.Token = val +} + +var fieldIDToName_GetImageRequest = map[int16]string{ + 1: "picture_id", + 2: "token", +} + +func (p *GetImageRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetPictureId bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetPictureId = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + if !issetPictureId { + 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_GetImageRequest[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_GetImageRequest[fieldId])) +} + +func (p *GetImageRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.PictureId = _field + return nil +} +func (p *GetImageRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Token = _field + return nil +} + +func (p *GetImageRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetImageRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = 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 *GetImageRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("picture_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.PictureId); err != nil { + return err + } + 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 *GetImageRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("token", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Token); 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 *GetImageRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetImageRequest(%+v)", *p) + +} + +func (p *GetImageRequest) DeepEqual(ano *GetImageRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.PictureId) { + return false + } + if !p.Field2DeepEqual(ano.Token) { + return false + } + return true +} + +func (p *GetImageRequest) Field1DeepEqual(src int64) bool { + + if p.PictureId != src { + return false + } + return true +} +func (p *GetImageRequest) Field2DeepEqual(src string) bool { + + if strings.Compare(p.Token, src) != 0 { + return false + } + return true +} + +type GetImageResponse struct { + Base *model.BaseResp `thrift:"base,1" frugal:"1,default,model.BaseResp" json:"base"` + Picture *model.Picture `thrift:"picture,2,optional" frugal:"2,optional,model.Picture" json:"picture,omitempty"` +} + +func NewGetImageResponse() *GetImageResponse { + return &GetImageResponse{} +} + +func (p *GetImageResponse) InitDefault() { +} + +var GetImageResponse_Base_DEFAULT *model.BaseResp + +func (p *GetImageResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return GetImageResponse_Base_DEFAULT + } + return p.Base +} + +var GetImageResponse_Picture_DEFAULT *model.Picture + +func (p *GetImageResponse) GetPicture() (v *model.Picture) { + if !p.IsSetPicture() { + return GetImageResponse_Picture_DEFAULT + } + return p.Picture +} +func (p *GetImageResponse) SetBase(val *model.BaseResp) { + p.Base = val +} +func (p *GetImageResponse) SetPicture(val *model.Picture) { + p.Picture = val +} + +var fieldIDToName_GetImageResponse = map[int16]string{ + 1: "base", + 2: "picture", +} + +func (p *GetImageResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *GetImageResponse) IsSetPicture() bool { + return p.Picture != nil +} + +func (p *GetImageResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetImageResponse[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *GetImageResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *GetImageResponse) ReadField2(iprot thrift.TProtocol) error { + _field := model.NewPicture() + if err := _field.Read(iprot); err != nil { + return err + } + p.Picture = _field + return nil +} + +func (p *GetImageResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetImageResponse"); 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 *GetImageResponse) 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 *GetImageResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPicture() { + if err = oprot.WriteFieldBegin("picture", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Picture.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *GetImageResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetImageResponse(%+v)", *p) + +} + +func (p *GetImageResponse) DeepEqual(ano *GetImageResponse) 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.Picture) { + return false + } + return true +} + +func (p *GetImageResponse) Field1DeepEqual(src *model.BaseResp) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} +func (p *GetImageResponse) Field2DeepEqual(src *model.Picture) bool { + + if !p.Picture.DeepEqual(src) { + return false + } + return true +} + +type GetImagesByUserIdRequest struct { + Token string `thrift:"token,1" frugal:"1,default,string" json:"token"` +} + +func NewGetImagesByUserIdRequest() *GetImagesByUserIdRequest { + return &GetImagesByUserIdRequest{} +} + +func (p *GetImagesByUserIdRequest) InitDefault() { +} + +func (p *GetImagesByUserIdRequest) GetToken() (v string) { + return p.Token +} +func (p *GetImagesByUserIdRequest) SetToken(val string) { + p.Token = val +} + +var fieldIDToName_GetImagesByUserIdRequest = map[int16]string{ + 1: "token", +} + +func (p *GetImagesByUserIdRequest) 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_GetImagesByUserIdRequest[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 *GetImagesByUserIdRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Token = _field + return nil +} + +func (p *GetImagesByUserIdRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetImagesByUserIdRequest"); 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 *GetImagesByUserIdRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("token", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Token); 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 *GetImagesByUserIdRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetImagesByUserIdRequest(%+v)", *p) + +} + +func (p *GetImagesByUserIdRequest) DeepEqual(ano *GetImagesByUserIdRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Token) { + return false + } + return true +} + +func (p *GetImagesByUserIdRequest) Field1DeepEqual(src string) bool { + + if strings.Compare(p.Token, src) != 0 { + return false + } + return true +} + +type GetImagesByUserIdResponse struct { + Base *model.BaseResp `thrift:"base,1" frugal:"1,default,model.BaseResp" json:"base"` + PictureList []*model.Picture `thrift:"picture_list,2,optional" frugal:"2,optional,list" json:"picture_list,omitempty"` +} + +func NewGetImagesByUserIdResponse() *GetImagesByUserIdResponse { + return &GetImagesByUserIdResponse{} +} + +func (p *GetImagesByUserIdResponse) InitDefault() { +} + +var GetImagesByUserIdResponse_Base_DEFAULT *model.BaseResp + +func (p *GetImagesByUserIdResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return GetImagesByUserIdResponse_Base_DEFAULT + } + return p.Base +} + +var GetImagesByUserIdResponse_PictureList_DEFAULT []*model.Picture + +func (p *GetImagesByUserIdResponse) GetPictureList() (v []*model.Picture) { + if !p.IsSetPictureList() { + return GetImagesByUserIdResponse_PictureList_DEFAULT + } + return p.PictureList +} +func (p *GetImagesByUserIdResponse) SetBase(val *model.BaseResp) { + p.Base = val +} +func (p *GetImagesByUserIdResponse) SetPictureList(val []*model.Picture) { + p.PictureList = val +} + +var fieldIDToName_GetImagesByUserIdResponse = map[int16]string{ + 1: "base", + 2: "picture_list", +} + +func (p *GetImagesByUserIdResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *GetImagesByUserIdResponse) IsSetPictureList() bool { + return p.PictureList != nil +} + +func (p *GetImagesByUserIdResponse) 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.LIST { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_GetImagesByUserIdResponse[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 *GetImagesByUserIdResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *GetImagesByUserIdResponse) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*model.Picture, 0, size) + values := make([]model.Picture, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.PictureList = _field + return nil +} + +func (p *GetImagesByUserIdResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetImagesByUserIdResponse"); 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 *GetImagesByUserIdResponse) 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 *GetImagesByUserIdResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPictureList() { + if err = oprot.WriteFieldBegin("picture_list", thrift.LIST, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.PictureList)); err != nil { + return err + } + for _, v := range p.PictureList { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *GetImagesByUserIdResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetImagesByUserIdResponse(%+v)", *p) + +} + +func (p *GetImagesByUserIdResponse) DeepEqual(ano *GetImagesByUserIdResponse) 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.PictureList) { + return false + } + return true +} + +func (p *GetImagesByUserIdResponse) Field1DeepEqual(src *model.BaseResp) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} +func (p *GetImagesByUserIdResponse) Field2DeepEqual(src []*model.Picture) bool { + + if len(p.PictureList) != len(src) { + return false + } + for i, v := range p.PictureList { + _src := src[i] + if !v.DeepEqual(_src) { + return false + } + } + return true +} + +type ChangeImagePropertyRequest struct { + PicType int64 `thrift:"pic_type,1,required" frugal:"1,required,i64" json:"pic_type"` + Duration *int64 `thrift:"duration,2,optional" frugal:"2,optional,i64" json:"duration,omitempty"` + Href *string `thrift:"href,3,optional" frugal:"3,optional,string" json:"href,omitempty"` + StartAt int64 `thrift:"start_at,4,required" frugal:"4,required,i64" json:"start_at"` + EndAt int64 `thrift:"end_at,5,required" frugal:"5,required,i64" json:"end_at"` + SType int64 `thrift:"s_type,6,required" frugal:"6,required,i64" json:"s_type"` + Frequency int64 `thrift:"frequency,7,required" frugal:"7,required,i64" json:"frequency"` + StartTime int64 `thrift:"start_time,8,required" frugal:"8,required,i64" json:"start_time"` + EndTime int64 `thrift:"end_time,9,required" frugal:"9,required,i64" json:"end_time"` + Text string `thrift:"text,10,required" frugal:"10,required,string" json:"text"` + Regex string `thrift:"regex,11" frugal:"11,default,string" json:"regex"` + Token string `thrift:"token,12" frugal:"12,default,string" json:"token"` +} + +func NewChangeImagePropertyRequest() *ChangeImagePropertyRequest { + return &ChangeImagePropertyRequest{} +} + +func (p *ChangeImagePropertyRequest) InitDefault() { +} + +func (p *ChangeImagePropertyRequest) GetPicType() (v int64) { + return p.PicType +} + +var ChangeImagePropertyRequest_Duration_DEFAULT int64 + +func (p *ChangeImagePropertyRequest) GetDuration() (v int64) { + if !p.IsSetDuration() { + return ChangeImagePropertyRequest_Duration_DEFAULT + } + return *p.Duration +} + +var ChangeImagePropertyRequest_Href_DEFAULT string + +func (p *ChangeImagePropertyRequest) GetHref() (v string) { + if !p.IsSetHref() { + return ChangeImagePropertyRequest_Href_DEFAULT + } + return *p.Href +} + +func (p *ChangeImagePropertyRequest) GetStartAt() (v int64) { + return p.StartAt +} + +func (p *ChangeImagePropertyRequest) GetEndAt() (v int64) { + return p.EndAt +} + +func (p *ChangeImagePropertyRequest) GetSType() (v int64) { + return p.SType +} + +func (p *ChangeImagePropertyRequest) GetFrequency() (v int64) { + return p.Frequency +} + +func (p *ChangeImagePropertyRequest) GetStartTime() (v int64) { + return p.StartTime +} + +func (p *ChangeImagePropertyRequest) GetEndTime() (v int64) { + return p.EndTime +} + +func (p *ChangeImagePropertyRequest) GetText() (v string) { + return p.Text +} + +func (p *ChangeImagePropertyRequest) GetRegex() (v string) { + return p.Regex +} + +func (p *ChangeImagePropertyRequest) GetToken() (v string) { + return p.Token +} +func (p *ChangeImagePropertyRequest) SetPicType(val int64) { + p.PicType = val +} +func (p *ChangeImagePropertyRequest) SetDuration(val *int64) { + p.Duration = val +} +func (p *ChangeImagePropertyRequest) SetHref(val *string) { + p.Href = val +} +func (p *ChangeImagePropertyRequest) SetStartAt(val int64) { + p.StartAt = val +} +func (p *ChangeImagePropertyRequest) SetEndAt(val int64) { + p.EndAt = val +} +func (p *ChangeImagePropertyRequest) SetSType(val int64) { + p.SType = val +} +func (p *ChangeImagePropertyRequest) SetFrequency(val int64) { + p.Frequency = val +} +func (p *ChangeImagePropertyRequest) SetStartTime(val int64) { + p.StartTime = val +} +func (p *ChangeImagePropertyRequest) SetEndTime(val int64) { + p.EndTime = val +} +func (p *ChangeImagePropertyRequest) SetText(val string) { + p.Text = val +} +func (p *ChangeImagePropertyRequest) SetRegex(val string) { + p.Regex = val +} +func (p *ChangeImagePropertyRequest) SetToken(val string) { + p.Token = val +} + +var fieldIDToName_ChangeImagePropertyRequest = map[int16]string{ + 1: "pic_type", + 2: "duration", + 3: "href", + 4: "start_at", + 5: "end_at", + 6: "s_type", + 7: "frequency", + 8: "start_time", + 9: "end_time", + 10: "text", + 11: "regex", + 12: "token", +} + +func (p *ChangeImagePropertyRequest) IsSetDuration() bool { + return p.Duration != nil +} + +func (p *ChangeImagePropertyRequest) IsSetHref() bool { + return p.Href != nil +} + +func (p *ChangeImagePropertyRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetPicType bool = false + var issetStartAt bool = false + var issetEndAt bool = false + var issetSType bool = false + var issetFrequency bool = false + var issetStartTime bool = false + var issetEndTime bool = false + var issetText bool = false + + 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.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetPicType = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.I64 { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.I64 { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + issetStartAt = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.I64 { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + issetEndAt = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.I64 { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + issetSType = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.I64 { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + issetFrequency = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 8: + if fieldTypeId == thrift.I64 { + if err = p.ReadField8(iprot); err != nil { + goto ReadFieldError + } + issetStartTime = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 9: + if fieldTypeId == thrift.I64 { + if err = p.ReadField9(iprot); err != nil { + goto ReadFieldError + } + issetEndTime = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 10: + if fieldTypeId == thrift.STRING { + if err = p.ReadField10(iprot); err != nil { + goto ReadFieldError + } + issetText = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 11: + if fieldTypeId == thrift.STRING { + if err = p.ReadField11(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 12: + if fieldTypeId == thrift.STRING { + if err = p.ReadField12(iprot); err != nil { + goto ReadFieldError + } + } 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 !issetPicType { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetStartAt { + fieldId = 4 + goto RequiredFieldNotSetError + } + + if !issetEndAt { + fieldId = 5 + goto RequiredFieldNotSetError + } + + if !issetSType { + fieldId = 6 + goto RequiredFieldNotSetError + } + + if !issetFrequency { + fieldId = 7 + goto RequiredFieldNotSetError + } + + if !issetStartTime { + fieldId = 8 + goto RequiredFieldNotSetError + } + + if !issetEndTime { + fieldId = 9 + goto RequiredFieldNotSetError + } + + if !issetText { + fieldId = 10 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(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_ChangeImagePropertyRequest[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_ChangeImagePropertyRequest[fieldId])) +} + +func (p *ChangeImagePropertyRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.PicType = _field + return nil +} +func (p *ChangeImagePropertyRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.Duration = _field + return nil +} +func (p *ChangeImagePropertyRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Href = _field + return nil +} +func (p *ChangeImagePropertyRequest) ReadField4(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.StartAt = _field + return nil +} +func (p *ChangeImagePropertyRequest) ReadField5(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.EndAt = _field + return nil +} +func (p *ChangeImagePropertyRequest) ReadField6(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.SType = _field + return nil +} +func (p *ChangeImagePropertyRequest) ReadField7(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Frequency = _field + return nil +} +func (p *ChangeImagePropertyRequest) ReadField8(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.StartTime = _field + return nil +} +func (p *ChangeImagePropertyRequest) ReadField9(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.EndTime = _field + return nil +} +func (p *ChangeImagePropertyRequest) ReadField10(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Text = _field + return nil +} +func (p *ChangeImagePropertyRequest) ReadField11(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Regex = _field + return nil +} +func (p *ChangeImagePropertyRequest) ReadField12(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Token = _field + return nil +} + +func (p *ChangeImagePropertyRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ChangeImagePropertyRequest"); 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 = p.writeField8(oprot); err != nil { + fieldId = 8 + goto WriteFieldError + } + if err = p.writeField9(oprot); err != nil { + fieldId = 9 + goto WriteFieldError + } + if err = p.writeField10(oprot); err != nil { + fieldId = 10 + goto WriteFieldError + } + if err = p.writeField11(oprot); err != nil { + fieldId = 11 + goto WriteFieldError + } + if err = p.writeField12(oprot); err != nil { + fieldId = 12 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + 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 *ChangeImagePropertyRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("pic_type", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.PicType); 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 *ChangeImagePropertyRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetDuration() { + if err = oprot.WriteFieldBegin("duration", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.Duration); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetHref() { + if err = oprot.WriteFieldBegin("href", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Href); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("start_at", thrift.I64, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.StartAt); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("end_at", thrift.I64, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.EndAt); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("s_type", thrift.I64, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.SType); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) writeField7(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("frequency", thrift.I64, 7); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.Frequency); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) writeField8(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("start_time", thrift.I64, 8); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.StartTime); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) writeField9(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("end_time", thrift.I64, 9); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.EndTime); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) writeField10(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("text", thrift.STRING, 10); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Text); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) writeField11(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("regex", thrift.STRING, 11); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Regex); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) writeField12(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("token", thrift.STRING, 12); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Token); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) +} + +func (p *ChangeImagePropertyRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ChangeImagePropertyRequest(%+v)", *p) + +} + +func (p *ChangeImagePropertyRequest) DeepEqual(ano *ChangeImagePropertyRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.PicType) { + return false + } + if !p.Field2DeepEqual(ano.Duration) { + return false + } + if !p.Field3DeepEqual(ano.Href) { + return false + } + if !p.Field4DeepEqual(ano.StartAt) { + return false + } + if !p.Field5DeepEqual(ano.EndAt) { + return false + } + if !p.Field6DeepEqual(ano.SType) { + return false + } + if !p.Field7DeepEqual(ano.Frequency) { + return false + } + if !p.Field8DeepEqual(ano.StartTime) { + return false + } + if !p.Field9DeepEqual(ano.EndTime) { + return false + } + if !p.Field10DeepEqual(ano.Text) { + return false + } + if !p.Field11DeepEqual(ano.Regex) { + return false + } + if !p.Field12DeepEqual(ano.Token) { + return false + } + return true +} + +func (p *ChangeImagePropertyRequest) Field1DeepEqual(src int64) bool { + + if p.PicType != src { + return false + } + return true +} +func (p *ChangeImagePropertyRequest) Field2DeepEqual(src *int64) bool { + + if p.Duration == src { + return true + } else if p.Duration == nil || src == nil { + return false + } + if *p.Duration != *src { + return false + } + return true +} +func (p *ChangeImagePropertyRequest) Field3DeepEqual(src *string) bool { + + if p.Href == src { + return true + } else if p.Href == nil || src == nil { + return false + } + if strings.Compare(*p.Href, *src) != 0 { + return false + } + return true +} +func (p *ChangeImagePropertyRequest) Field4DeepEqual(src int64) bool { + + if p.StartAt != src { + return false + } + return true +} +func (p *ChangeImagePropertyRequest) Field5DeepEqual(src int64) bool { + + if p.EndAt != src { + return false + } + return true +} +func (p *ChangeImagePropertyRequest) Field6DeepEqual(src int64) bool { + + if p.SType != src { + return false + } + return true +} +func (p *ChangeImagePropertyRequest) Field7DeepEqual(src int64) bool { + + if p.Frequency != src { + return false + } + return true +} +func (p *ChangeImagePropertyRequest) Field8DeepEqual(src int64) bool { + + if p.StartTime != src { + return false + } + return true +} +func (p *ChangeImagePropertyRequest) Field9DeepEqual(src int64) bool { + + if p.EndTime != src { + return false + } + return true +} +func (p *ChangeImagePropertyRequest) Field10DeepEqual(src string) bool { + + if strings.Compare(p.Text, src) != 0 { + return false + } + return true +} +func (p *ChangeImagePropertyRequest) Field11DeepEqual(src string) bool { + + if strings.Compare(p.Regex, src) != 0 { + return false + } + return true +} +func (p *ChangeImagePropertyRequest) Field12DeepEqual(src string) bool { + + if strings.Compare(p.Token, src) != 0 { + return false + } + return true +} + +type ChangeImagePropertyResponse struct { + Base *model.BaseResp `thrift:"base,1" frugal:"1,default,model.BaseResp" json:"base"` + Picture *model.Picture `thrift:"picture,2,optional" frugal:"2,optional,model.Picture" json:"picture,omitempty"` +} + +func NewChangeImagePropertyResponse() *ChangeImagePropertyResponse { + return &ChangeImagePropertyResponse{} +} + +func (p *ChangeImagePropertyResponse) InitDefault() { +} + +var ChangeImagePropertyResponse_Base_DEFAULT *model.BaseResp + +func (p *ChangeImagePropertyResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return ChangeImagePropertyResponse_Base_DEFAULT + } + return p.Base +} + +var ChangeImagePropertyResponse_Picture_DEFAULT *model.Picture + +func (p *ChangeImagePropertyResponse) GetPicture() (v *model.Picture) { + if !p.IsSetPicture() { + return ChangeImagePropertyResponse_Picture_DEFAULT + } + return p.Picture +} +func (p *ChangeImagePropertyResponse) SetBase(val *model.BaseResp) { + p.Base = val +} +func (p *ChangeImagePropertyResponse) SetPicture(val *model.Picture) { + p.Picture = val +} + +var fieldIDToName_ChangeImagePropertyResponse = map[int16]string{ + 1: "base", + 2: "picture", +} + +func (p *ChangeImagePropertyResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *ChangeImagePropertyResponse) IsSetPicture() bool { + return p.Picture != nil +} + +func (p *ChangeImagePropertyResponse) 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.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ChangeImagePropertyResponse[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 *ChangeImagePropertyResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *ChangeImagePropertyResponse) ReadField2(iprot thrift.TProtocol) error { + _field := model.NewPicture() + if err := _field.Read(iprot); err != nil { + return err + } + p.Picture = _field + return nil +} + +func (p *ChangeImagePropertyResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ChangeImagePropertyResponse"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + 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 *ChangeImagePropertyResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("base", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Base.Write(oprot); err != nil { + 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 *ChangeImagePropertyResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPicture() { + if err = oprot.WriteFieldBegin("picture", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Picture.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + 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 *ChangeImagePropertyResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ChangeImagePropertyResponse(%+v)", *p) + +} + +func (p *ChangeImagePropertyResponse) DeepEqual(ano *ChangeImagePropertyResponse) 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.Picture) { + return false + } + return true +} + +func (p *ChangeImagePropertyResponse) Field1DeepEqual(src *model.BaseResp) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} +func (p *ChangeImagePropertyResponse) Field2DeepEqual(src *model.Picture) bool { + + if !p.Picture.DeepEqual(src) { + return false + } + return true +} + +type ChangeImageRequest struct { + PictureId int64 `thrift:"picture_id,1,required" frugal:"1,required,i64" json:"picture_id"` + Image []byte `thrift:"image,2,required" frugal:"2,required,binary" json:"image"` + Token string `thrift:"token,3" frugal:"3,default,string" json:"token"` +} + +func NewChangeImageRequest() *ChangeImageRequest { + return &ChangeImageRequest{} +} + +func (p *ChangeImageRequest) InitDefault() { +} + +func (p *ChangeImageRequest) GetPictureId() (v int64) { + return p.PictureId +} + +func (p *ChangeImageRequest) GetImage() (v []byte) { + return p.Image +} + +func (p *ChangeImageRequest) GetToken() (v string) { + return p.Token +} +func (p *ChangeImageRequest) SetPictureId(val int64) { + p.PictureId = val +} +func (p *ChangeImageRequest) SetImage(val []byte) { + p.Image = val +} +func (p *ChangeImageRequest) SetToken(val string) { + p.Token = val +} + +var fieldIDToName_ChangeImageRequest = map[int16]string{ + 1: "picture_id", + 2: "image", + 3: "token", +} + +func (p *ChangeImageRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetPictureId bool = false + var issetImage 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.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetPictureId = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + issetImage = 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 + } + 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 !issetPictureId { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetImage { + 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_ChangeImageRequest[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_ChangeImageRequest[fieldId])) +} + +func (p *ChangeImageRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.PictureId = _field + return nil +} +func (p *ChangeImageRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field []byte + if v, err := iprot.ReadBinary(); err != nil { + return err + } else { + _field = []byte(v) + } + p.Image = _field + return nil +} +func (p *ChangeImageRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Token = _field + return nil +} + +func (p *ChangeImageRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ChangeImageRequest"); 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 *ChangeImageRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("picture_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.PictureId); err != nil { + return err + } + 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 *ChangeImageRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("image", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBinary([]byte(p.Image)); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *ChangeImageRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("token", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Token); 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 *ChangeImageRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ChangeImageRequest(%+v)", *p) + +} + +func (p *ChangeImageRequest) DeepEqual(ano *ChangeImageRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.PictureId) { + return false + } + if !p.Field2DeepEqual(ano.Image) { + return false + } + if !p.Field3DeepEqual(ano.Token) { + return false + } + return true +} + +func (p *ChangeImageRequest) Field1DeepEqual(src int64) bool { + + if p.PictureId != src { + return false + } + return true +} +func (p *ChangeImageRequest) Field2DeepEqual(src []byte) bool { + + if bytes.Compare(p.Image, src) != 0 { + return false + } + return true +} +func (p *ChangeImageRequest) Field3DeepEqual(src string) bool { + + if strings.Compare(p.Token, src) != 0 { + return false + } + return true +} + +type ChangeImageResponse struct { + Base *model.BaseResp `thrift:"base,1" frugal:"1,default,model.BaseResp" json:"base"` + Picture *model.Picture `thrift:"picture,2,optional" frugal:"2,optional,model.Picture" json:"picture,omitempty"` +} + +func NewChangeImageResponse() *ChangeImageResponse { + return &ChangeImageResponse{} +} + +func (p *ChangeImageResponse) InitDefault() { +} + +var ChangeImageResponse_Base_DEFAULT *model.BaseResp + +func (p *ChangeImageResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return ChangeImageResponse_Base_DEFAULT + } + return p.Base +} + +var ChangeImageResponse_Picture_DEFAULT *model.Picture + +func (p *ChangeImageResponse) GetPicture() (v *model.Picture) { + if !p.IsSetPicture() { + return ChangeImageResponse_Picture_DEFAULT + } + return p.Picture +} +func (p *ChangeImageResponse) SetBase(val *model.BaseResp) { + p.Base = val +} +func (p *ChangeImageResponse) SetPicture(val *model.Picture) { + p.Picture = val +} + +var fieldIDToName_ChangeImageResponse = map[int16]string{ + 1: "base", + 2: "picture", +} + +func (p *ChangeImageResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *ChangeImageResponse) IsSetPicture() bool { + return p.Picture != nil +} + +func (p *ChangeImageResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + 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.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_ChangeImageResponse[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 *ChangeImageResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *ChangeImageResponse) ReadField2(iprot thrift.TProtocol) error { + _field := model.NewPicture() + if err := _field.Read(iprot); err != nil { + return err + } + p.Picture = _field + return nil +} + +func (p *ChangeImageResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ChangeImageResponse"); 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 *ChangeImageResponse) 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 *ChangeImageResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPicture() { + if err = oprot.WriteFieldBegin("picture", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Picture.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return 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 *ChangeImageResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ChangeImageResponse(%+v)", *p) + +} + +func (p *ChangeImageResponse) DeepEqual(ano *ChangeImageResponse) 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.Picture) { + return false + } + return true +} + +func (p *ChangeImageResponse) Field1DeepEqual(src *model.BaseResp) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} +func (p *ChangeImageResponse) Field2DeepEqual(src *model.Picture) bool { + + if !p.Picture.DeepEqual(src) { + return false + } + return true +} + +type DeleteImageRequest struct { + PictureId int64 `thrift:"picture_id,1,required" frugal:"1,required,i64" json:"picture_id"` + Token string `thrift:"token,2" frugal:"2,default,string" json:"token"` +} + +func NewDeleteImageRequest() *DeleteImageRequest { + return &DeleteImageRequest{} +} + +func (p *DeleteImageRequest) InitDefault() { +} + +func (p *DeleteImageRequest) GetPictureId() (v int64) { + return p.PictureId +} + +func (p *DeleteImageRequest) GetToken() (v string) { + return p.Token +} +func (p *DeleteImageRequest) SetPictureId(val int64) { + p.PictureId = val +} +func (p *DeleteImageRequest) SetToken(val string) { + p.Token = val +} + +var fieldIDToName_DeleteImageRequest = map[int16]string{ + 1: "picture_id", + 2: "token", +} + +func (p *DeleteImageRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetPictureId bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetPictureId = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + if !issetPictureId { + 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_DeleteImageRequest[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_DeleteImageRequest[fieldId])) +} + +func (p *DeleteImageRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.PictureId = _field + return nil +} +func (p *DeleteImageRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Token = _field + return nil +} + +func (p *DeleteImageRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("DeleteImageRequest"); 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 *DeleteImageRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("picture_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.PictureId); 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 *DeleteImageRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("token", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Token); 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 *DeleteImageRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DeleteImageRequest(%+v)", *p) + +} + +func (p *DeleteImageRequest) DeepEqual(ano *DeleteImageRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.PictureId) { + return false + } + if !p.Field2DeepEqual(ano.Token) { + return false + } + return true +} + +func (p *DeleteImageRequest) Field1DeepEqual(src int64) bool { + + if p.PictureId != src { + return false + } + return true +} +func (p *DeleteImageRequest) Field2DeepEqual(src string) bool { + + if strings.Compare(p.Token, src) != 0 { + return false + } + return true +} + +type DeleteImageResponse struct { + Base *model.BaseResp `thrift:"base,1" frugal:"1,default,model.BaseResp" json:"base"` + Picture *model.Picture `thrift:"picture,2,optional" frugal:"2,optional,model.Picture" json:"picture,omitempty"` +} + +func NewDeleteImageResponse() *DeleteImageResponse { + return &DeleteImageResponse{} +} + +func (p *DeleteImageResponse) InitDefault() { +} + +var DeleteImageResponse_Base_DEFAULT *model.BaseResp + +func (p *DeleteImageResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return DeleteImageResponse_Base_DEFAULT + } + return p.Base +} + +var DeleteImageResponse_Picture_DEFAULT *model.Picture + +func (p *DeleteImageResponse) GetPicture() (v *model.Picture) { + if !p.IsSetPicture() { + return DeleteImageResponse_Picture_DEFAULT + } + return p.Picture +} +func (p *DeleteImageResponse) SetBase(val *model.BaseResp) { + p.Base = val +} +func (p *DeleteImageResponse) SetPicture(val *model.Picture) { + p.Picture = val +} + +var fieldIDToName_DeleteImageResponse = map[int16]string{ + 1: "base", + 2: "picture", +} + +func (p *DeleteImageResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *DeleteImageResponse) IsSetPicture() bool { + return p.Picture != nil +} + +func (p *DeleteImageResponse) 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.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_DeleteImageResponse[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 *DeleteImageResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *DeleteImageResponse) ReadField2(iprot thrift.TProtocol) error { + _field := model.NewPicture() + if err := _field.Read(iprot); err != nil { + return err + } + p.Picture = _field + return nil +} + +func (p *DeleteImageResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("DeleteImageResponse"); 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 *DeleteImageResponse) 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 *DeleteImageResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPicture() { + if err = oprot.WriteFieldBegin("picture", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Picture.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return 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 *DeleteImageResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DeleteImageResponse(%+v)", *p) + +} + +func (p *DeleteImageResponse) DeepEqual(ano *DeleteImageResponse) 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.Picture) { + return false + } + return true +} + +func (p *DeleteImageResponse) Field1DeepEqual(src *model.BaseResp) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} +func (p *DeleteImageResponse) Field2DeepEqual(src *model.Picture) bool { + + if !p.Picture.DeepEqual(src) { + return false + } + return true +} + +type MobileGetImageRequest struct { + Type int64 `thrift:"type,1,required" frugal:"1,required,i64" json:"type"` + StudentId int64 `thrift:"student_id,2,required" frugal:"2,required,i64" json:"student_id"` + College string `thrift:"college,3,required" frugal:"3,required,string" json:"college"` + Device string `thrift:"device,4,required" frugal:"4,required,string" json:"device"` +} + +func NewMobileGetImageRequest() *MobileGetImageRequest { + return &MobileGetImageRequest{} +} + +func (p *MobileGetImageRequest) InitDefault() { +} + +func (p *MobileGetImageRequest) GetType() (v int64) { + return p.Type +} + +func (p *MobileGetImageRequest) GetStudentId() (v int64) { + return p.StudentId +} + +func (p *MobileGetImageRequest) GetCollege() (v string) { + return p.College +} + +func (p *MobileGetImageRequest) GetDevice() (v string) { + return p.Device +} +func (p *MobileGetImageRequest) SetType(val int64) { + p.Type = val +} +func (p *MobileGetImageRequest) SetStudentId(val int64) { + p.StudentId = val +} +func (p *MobileGetImageRequest) SetCollege(val string) { + p.College = val +} +func (p *MobileGetImageRequest) SetDevice(val string) { + p.Device = val +} + +var fieldIDToName_MobileGetImageRequest = map[int16]string{ + 1: "type", + 2: "student_id", + 3: "college", + 4: "device", +} + +func (p *MobileGetImageRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetType bool = false + var issetStudentId bool = false + var issetCollege bool = false + var issetDevice 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.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetType = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.I64 { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + issetStudentId = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + issetCollege = 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 + } + issetDevice = 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 !issetType { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetStudentId { + fieldId = 2 + goto RequiredFieldNotSetError + } + + if !issetCollege { + fieldId = 3 + goto RequiredFieldNotSetError + } + + if !issetDevice { + fieldId = 4 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MobileGetImageRequest[fieldId]), err) +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_MobileGetImageRequest[fieldId])) +} + +func (p *MobileGetImageRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Type = _field + return nil +} +func (p *MobileGetImageRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.StudentId = _field + return nil +} +func (p *MobileGetImageRequest) ReadField3(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.College = _field + return nil +} +func (p *MobileGetImageRequest) ReadField4(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Device = _field + return nil +} + +func (p *MobileGetImageRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("MobileGetImageRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *MobileGetImageRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("type", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(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 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *MobileGetImageRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("student_id", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.StudentId); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *MobileGetImageRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("college", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.College); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *MobileGetImageRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("device", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Device); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *MobileGetImageRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MobileGetImageRequest(%+v)", *p) + +} + +func (p *MobileGetImageRequest) DeepEqual(ano *MobileGetImageRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Type) { + return false + } + if !p.Field2DeepEqual(ano.StudentId) { + return false + } + if !p.Field3DeepEqual(ano.College) { + return false + } + if !p.Field4DeepEqual(ano.Device) { + return false + } + return true +} + +func (p *MobileGetImageRequest) Field1DeepEqual(src int64) bool { + + if p.Type != src { + return false + } + return true +} +func (p *MobileGetImageRequest) Field2DeepEqual(src int64) bool { + + if p.StudentId != src { + return false + } + return true +} +func (p *MobileGetImageRequest) Field3DeepEqual(src string) bool { + + if strings.Compare(p.College, src) != 0 { + return false + } + return true +} +func (p *MobileGetImageRequest) Field4DeepEqual(src string) bool { + + if strings.Compare(p.Device, src) != 0 { + return false + } + return true +} + +type MobileGetImageResponse struct { + Base *model.BaseResp `thrift:"base,1" frugal:"1,default,model.BaseResp" json:"base"` + Picture *model.Picture `thrift:"picture,2,optional" frugal:"2,optional,model.Picture" json:"picture,omitempty"` +} + +func NewMobileGetImageResponse() *MobileGetImageResponse { + return &MobileGetImageResponse{} +} + +func (p *MobileGetImageResponse) InitDefault() { +} + +var MobileGetImageResponse_Base_DEFAULT *model.BaseResp + +func (p *MobileGetImageResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return MobileGetImageResponse_Base_DEFAULT + } + return p.Base +} + +var MobileGetImageResponse_Picture_DEFAULT *model.Picture + +func (p *MobileGetImageResponse) GetPicture() (v *model.Picture) { + if !p.IsSetPicture() { + return MobileGetImageResponse_Picture_DEFAULT + } + return p.Picture +} +func (p *MobileGetImageResponse) SetBase(val *model.BaseResp) { + p.Base = val +} +func (p *MobileGetImageResponse) SetPicture(val *model.Picture) { + p.Picture = val +} + +var fieldIDToName_MobileGetImageResponse = map[int16]string{ + 1: "base", + 2: "picture", +} + +func (p *MobileGetImageResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *MobileGetImageResponse) IsSetPicture() bool { + return p.Picture != nil +} + +func (p *MobileGetImageResponse) 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.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_MobileGetImageResponse[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 *MobileGetImageResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *MobileGetImageResponse) ReadField2(iprot thrift.TProtocol) error { + _field := model.NewPicture() + if err := _field.Read(iprot); err != nil { + return err + } + p.Picture = _field + return nil +} + +func (p *MobileGetImageResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("MobileGetImageResponse"); 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 *MobileGetImageResponse) 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 *MobileGetImageResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPicture() { + if err = oprot.WriteFieldBegin("picture", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Picture.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *MobileGetImageResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MobileGetImageResponse(%+v)", *p) + +} + +func (p *MobileGetImageResponse) DeepEqual(ano *MobileGetImageResponse) 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.Picture) { + return false + } + return true +} + +func (p *MobileGetImageResponse) Field1DeepEqual(src *model.BaseResp) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} +func (p *MobileGetImageResponse) Field2DeepEqual(src *model.Picture) bool { + + if !p.Picture.DeepEqual(src) { + return false + } + return true +} + +type AddImagePointTimeRequest struct { + PictureId int64 `thrift:"picture_id,1,required" frugal:"1,required,i64" json:"picture_id"` +} + +func NewAddImagePointTimeRequest() *AddImagePointTimeRequest { + return &AddImagePointTimeRequest{} +} + +func (p *AddImagePointTimeRequest) InitDefault() { +} + +func (p *AddImagePointTimeRequest) GetPictureId() (v int64) { + return p.PictureId +} +func (p *AddImagePointTimeRequest) SetPictureId(val int64) { + p.PictureId = val +} + +var fieldIDToName_AddImagePointTimeRequest = map[int16]string{ + 1: "picture_id", +} + +func (p *AddImagePointTimeRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetPictureId bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetPictureId = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + if !issetPictureId { + 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_AddImagePointTimeRequest[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_AddImagePointTimeRequest[fieldId])) +} + +func (p *AddImagePointTimeRequest) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.PictureId = _field + return nil +} + +func (p *AddImagePointTimeRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("AddImagePointTimeRequest"); 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 *AddImagePointTimeRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("picture_id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.PictureId); err != nil { + return err + } + 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 *AddImagePointTimeRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AddImagePointTimeRequest(%+v)", *p) + +} + +func (p *AddImagePointTimeRequest) DeepEqual(ano *AddImagePointTimeRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.PictureId) { + return false + } + return true +} + +func (p *AddImagePointTimeRequest) Field1DeepEqual(src int64) bool { + + if p.PictureId != src { + return false + } + return true +} + +type AddImagePointTimeResponse struct { + Base *model.BaseResp `thrift:"base,1" frugal:"1,default,model.BaseResp" json:"base"` + Picture *model.Picture `thrift:"picture,2,optional" frugal:"2,optional,model.Picture" json:"picture,omitempty"` +} + +func NewAddImagePointTimeResponse() *AddImagePointTimeResponse { + return &AddImagePointTimeResponse{} +} + +func (p *AddImagePointTimeResponse) InitDefault() { +} + +var AddImagePointTimeResponse_Base_DEFAULT *model.BaseResp + +func (p *AddImagePointTimeResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return AddImagePointTimeResponse_Base_DEFAULT + } + return p.Base +} + +var AddImagePointTimeResponse_Picture_DEFAULT *model.Picture + +func (p *AddImagePointTimeResponse) GetPicture() (v *model.Picture) { + if !p.IsSetPicture() { + return AddImagePointTimeResponse_Picture_DEFAULT + } + return p.Picture +} +func (p *AddImagePointTimeResponse) SetBase(val *model.BaseResp) { + p.Base = val +} +func (p *AddImagePointTimeResponse) SetPicture(val *model.Picture) { + p.Picture = val +} + +var fieldIDToName_AddImagePointTimeResponse = map[int16]string{ + 1: "base", + 2: "picture", +} + +func (p *AddImagePointTimeResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *AddImagePointTimeResponse) IsSetPicture() bool { + return p.Picture != nil +} + +func (p *AddImagePointTimeResponse) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + 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.STRUCT { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_AddImagePointTimeResponse[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 *AddImagePointTimeResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *AddImagePointTimeResponse) ReadField2(iprot thrift.TProtocol) error { + _field := model.NewPicture() + if err := _field.Read(iprot); err != nil { + return err + } + p.Picture = _field + return nil +} + +func (p *AddImagePointTimeResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("AddImagePointTimeResponse"); 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 *AddImagePointTimeResponse) 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 *AddImagePointTimeResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPicture() { + if err = oprot.WriteFieldBegin("picture", thrift.STRUCT, 2); err != nil { + goto WriteFieldBeginError + } + if err := p.Picture.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return 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 *AddImagePointTimeResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AddImagePointTimeResponse(%+v)", *p) + +} + +func (p *AddImagePointTimeResponse) DeepEqual(ano *AddImagePointTimeResponse) 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.Picture) { + return false + } + return true +} + +func (p *AddImagePointTimeResponse) Field1DeepEqual(src *model.BaseResp) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} +func (p *AddImagePointTimeResponse) Field2DeepEqual(src *model.Picture) bool { + + if !p.Picture.DeepEqual(src) { + return false + } + return true +} + +type LaunchScreenService interface { + CreateImage(ctx context.Context, req *CreateImageRequest) (r *CreateImageResponse, err error) + + GetImage(ctx context.Context, req *GetImageRequest) (r *GetImagesByUserIdResponse, err error) + + GetImagesByUserId(ctx context.Context, req *GetImagesByUserIdRequest) (r *GetImagesByUserIdResponse, err error) + + ChangeImageProperty(ctx context.Context, req *ChangeImagePropertyRequest) (r *ChangeImagePropertyResponse, err error) + + ChangeImage(ctx context.Context, req *ChangeImageRequest) (r *ChangeImageResponse, err error) + + DeleteImage(ctx context.Context, req *DeleteImageRequest) (r *DeleteImageResponse, err error) + + MobileGetImage(ctx context.Context, req *MobileGetImageRequest) (r *MobileGetImageResponse, err error) + + AddImagePointTime(ctx context.Context, req *AddImagePointTimeRequest) (r *AddImagePointTimeResponse, err error) +} + +type LaunchScreenServiceClient struct { + c thrift.TClient +} + +func NewLaunchScreenServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *LaunchScreenServiceClient { + return &LaunchScreenServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewLaunchScreenServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *LaunchScreenServiceClient { + return &LaunchScreenServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewLaunchScreenServiceClient(c thrift.TClient) *LaunchScreenServiceClient { + return &LaunchScreenServiceClient{ + c: c, + } +} + +func (p *LaunchScreenServiceClient) Client_() thrift.TClient { + return p.c +} + +func (p *LaunchScreenServiceClient) CreateImage(ctx context.Context, req *CreateImageRequest) (r *CreateImageResponse, err error) { + var _args LaunchScreenServiceCreateImageArgs + _args.Req = req + var _result LaunchScreenServiceCreateImageResult + if err = p.Client_().Call(ctx, "CreateImage", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *LaunchScreenServiceClient) GetImage(ctx context.Context, req *GetImageRequest) (r *GetImagesByUserIdResponse, err error) { + var _args LaunchScreenServiceGetImageArgs + _args.Req = req + var _result LaunchScreenServiceGetImageResult + if err = p.Client_().Call(ctx, "GetImage", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *LaunchScreenServiceClient) GetImagesByUserId(ctx context.Context, req *GetImagesByUserIdRequest) (r *GetImagesByUserIdResponse, err error) { + var _args LaunchScreenServiceGetImagesByUserIdArgs + _args.Req = req + var _result LaunchScreenServiceGetImagesByUserIdResult + if err = p.Client_().Call(ctx, "GetImagesByUserId", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *LaunchScreenServiceClient) ChangeImageProperty(ctx context.Context, req *ChangeImagePropertyRequest) (r *ChangeImagePropertyResponse, err error) { + var _args LaunchScreenServiceChangeImagePropertyArgs + _args.Req = req + var _result LaunchScreenServiceChangeImagePropertyResult + if err = p.Client_().Call(ctx, "ChangeImageProperty", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *LaunchScreenServiceClient) ChangeImage(ctx context.Context, req *ChangeImageRequest) (r *ChangeImageResponse, err error) { + var _args LaunchScreenServiceChangeImageArgs + _args.Req = req + var _result LaunchScreenServiceChangeImageResult + if err = p.Client_().Call(ctx, "ChangeImage", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *LaunchScreenServiceClient) DeleteImage(ctx context.Context, req *DeleteImageRequest) (r *DeleteImageResponse, err error) { + var _args LaunchScreenServiceDeleteImageArgs + _args.Req = req + var _result LaunchScreenServiceDeleteImageResult + if err = p.Client_().Call(ctx, "DeleteImage", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *LaunchScreenServiceClient) MobileGetImage(ctx context.Context, req *MobileGetImageRequest) (r *MobileGetImageResponse, err error) { + var _args LaunchScreenServiceMobileGetImageArgs + _args.Req = req + var _result LaunchScreenServiceMobileGetImageResult + if err = p.Client_().Call(ctx, "MobileGetImage", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *LaunchScreenServiceClient) AddImagePointTime(ctx context.Context, req *AddImagePointTimeRequest) (r *AddImagePointTimeResponse, err error) { + var _args LaunchScreenServiceAddImagePointTimeArgs + _args.Req = req + var _result LaunchScreenServiceAddImagePointTimeResult + if err = p.Client_().Call(ctx, "AddImagePointTime", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +type LaunchScreenServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler LaunchScreenService +} + +func (p *LaunchScreenServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *LaunchScreenServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *LaunchScreenServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewLaunchScreenServiceProcessor(handler LaunchScreenService) *LaunchScreenServiceProcessor { + self := &LaunchScreenServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self.AddToProcessorMap("CreateImage", &launchScreenServiceProcessorCreateImage{handler: handler}) + self.AddToProcessorMap("GetImage", &launchScreenServiceProcessorGetImage{handler: handler}) + self.AddToProcessorMap("GetImagesByUserId", &launchScreenServiceProcessorGetImagesByUserId{handler: handler}) + self.AddToProcessorMap("ChangeImageProperty", &launchScreenServiceProcessorChangeImageProperty{handler: handler}) + self.AddToProcessorMap("ChangeImage", &launchScreenServiceProcessorChangeImage{handler: handler}) + self.AddToProcessorMap("DeleteImage", &launchScreenServiceProcessorDeleteImage{handler: handler}) + self.AddToProcessorMap("MobileGetImage", &launchScreenServiceProcessorMobileGetImage{handler: handler}) + self.AddToProcessorMap("AddImagePointTime", &launchScreenServiceProcessorAddImagePointTime{handler: handler}) + return self +} +func (p *LaunchScreenServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + name, _, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return false, err + } + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(ctx, seqId, iprot, oprot) + } + iprot.Skip(thrift.STRUCT) + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) + oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, x +} + +type launchScreenServiceProcessorCreateImage struct { + handler LaunchScreenService +} + +func (p *launchScreenServiceProcessorCreateImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceCreateImageArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("CreateImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := LaunchScreenServiceCreateImageResult{} + var retval *CreateImageResponse + if retval, err2 = p.handler.CreateImage(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CreateImage: "+err2.Error()) + oprot.WriteMessageBegin("CreateImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("CreateImage", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type launchScreenServiceProcessorGetImage struct { + handler LaunchScreenService +} + +func (p *launchScreenServiceProcessorGetImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceGetImageArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := LaunchScreenServiceGetImageResult{} + var retval *GetImagesByUserIdResponse + if retval, err2 = p.handler.GetImage(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetImage: "+err2.Error()) + oprot.WriteMessageBegin("GetImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetImage", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type launchScreenServiceProcessorGetImagesByUserId struct { + handler LaunchScreenService +} + +func (p *launchScreenServiceProcessorGetImagesByUserId) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceGetImagesByUserIdArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("GetImagesByUserId", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := LaunchScreenServiceGetImagesByUserIdResult{} + var retval *GetImagesByUserIdResponse + if retval, err2 = p.handler.GetImagesByUserId(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetImagesByUserId: "+err2.Error()) + oprot.WriteMessageBegin("GetImagesByUserId", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("GetImagesByUserId", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type launchScreenServiceProcessorChangeImageProperty struct { + handler LaunchScreenService +} + +func (p *launchScreenServiceProcessorChangeImageProperty) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceChangeImagePropertyArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("ChangeImageProperty", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := LaunchScreenServiceChangeImagePropertyResult{} + var retval *ChangeImagePropertyResponse + if retval, err2 = p.handler.ChangeImageProperty(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ChangeImageProperty: "+err2.Error()) + oprot.WriteMessageBegin("ChangeImageProperty", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("ChangeImageProperty", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type launchScreenServiceProcessorChangeImage struct { + handler LaunchScreenService +} + +func (p *launchScreenServiceProcessorChangeImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceChangeImageArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("ChangeImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := LaunchScreenServiceChangeImageResult{} + var retval *ChangeImageResponse + if retval, err2 = p.handler.ChangeImage(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ChangeImage: "+err2.Error()) + oprot.WriteMessageBegin("ChangeImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("ChangeImage", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type launchScreenServiceProcessorDeleteImage struct { + handler LaunchScreenService +} + +func (p *launchScreenServiceProcessorDeleteImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceDeleteImageArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("DeleteImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := LaunchScreenServiceDeleteImageResult{} + var retval *DeleteImageResponse + if retval, err2 = p.handler.DeleteImage(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing DeleteImage: "+err2.Error()) + oprot.WriteMessageBegin("DeleteImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("DeleteImage", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type launchScreenServiceProcessorMobileGetImage struct { + handler LaunchScreenService +} + +func (p *launchScreenServiceProcessorMobileGetImage) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceMobileGetImageArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("MobileGetImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := LaunchScreenServiceMobileGetImageResult{} + var retval *MobileGetImageResponse + if retval, err2 = p.handler.MobileGetImage(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing MobileGetImage: "+err2.Error()) + oprot.WriteMessageBegin("MobileGetImage", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("MobileGetImage", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type launchScreenServiceProcessorAddImagePointTime struct { + handler LaunchScreenService +} + +func (p *launchScreenServiceProcessorAddImagePointTime) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := LaunchScreenServiceAddImagePointTimeArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("AddImagePointTime", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := LaunchScreenServiceAddImagePointTimeResult{} + var retval *AddImagePointTimeResponse + if retval, err2 = p.handler.AddImagePointTime(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing AddImagePointTime: "+err2.Error()) + oprot.WriteMessageBegin("AddImagePointTime", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("AddImagePointTime", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type LaunchScreenServiceCreateImageArgs struct { + Req *CreateImageRequest `thrift:"req,1" frugal:"1,default,CreateImageRequest" json:"req"` +} + +func NewLaunchScreenServiceCreateImageArgs() *LaunchScreenServiceCreateImageArgs { + return &LaunchScreenServiceCreateImageArgs{} +} + +func (p *LaunchScreenServiceCreateImageArgs) InitDefault() { +} + +var LaunchScreenServiceCreateImageArgs_Req_DEFAULT *CreateImageRequest + +func (p *LaunchScreenServiceCreateImageArgs) GetReq() (v *CreateImageRequest) { + if !p.IsSetReq() { + return LaunchScreenServiceCreateImageArgs_Req_DEFAULT + } + return p.Req +} +func (p *LaunchScreenServiceCreateImageArgs) SetReq(val *CreateImageRequest) { + p.Req = val +} + +var fieldIDToName_LaunchScreenServiceCreateImageArgs = map[int16]string{ + 1: "req", +} + +func (p *LaunchScreenServiceCreateImageArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *LaunchScreenServiceCreateImageArgs) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LaunchScreenServiceCreateImageArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceCreateImageArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewCreateImageRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *LaunchScreenServiceCreateImageArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("CreateImage_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *LaunchScreenServiceCreateImageArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *LaunchScreenServiceCreateImageArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceCreateImageArgs(%+v)", *p) + +} + +func (p *LaunchScreenServiceCreateImageArgs) DeepEqual(ano *LaunchScreenServiceCreateImageArgs) 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 *LaunchScreenServiceCreateImageArgs) Field1DeepEqual(src *CreateImageRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type LaunchScreenServiceCreateImageResult struct { + Success *CreateImageResponse `thrift:"success,0,optional" frugal:"0,optional,CreateImageResponse" json:"success,omitempty"` +} + +func NewLaunchScreenServiceCreateImageResult() *LaunchScreenServiceCreateImageResult { + return &LaunchScreenServiceCreateImageResult{} +} + +func (p *LaunchScreenServiceCreateImageResult) InitDefault() { +} + +var LaunchScreenServiceCreateImageResult_Success_DEFAULT *CreateImageResponse + +func (p *LaunchScreenServiceCreateImageResult) GetSuccess() (v *CreateImageResponse) { + if !p.IsSetSuccess() { + return LaunchScreenServiceCreateImageResult_Success_DEFAULT + } + return p.Success +} +func (p *LaunchScreenServiceCreateImageResult) SetSuccess(x interface{}) { + p.Success = x.(*CreateImageResponse) +} + +var fieldIDToName_LaunchScreenServiceCreateImageResult = map[int16]string{ + 0: "success", +} + +func (p *LaunchScreenServiceCreateImageResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *LaunchScreenServiceCreateImageResult) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LaunchScreenServiceCreateImageResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceCreateImageResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewCreateImageResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *LaunchScreenServiceCreateImageResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("CreateImage_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *LaunchScreenServiceCreateImageResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *LaunchScreenServiceCreateImageResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceCreateImageResult(%+v)", *p) + +} + +func (p *LaunchScreenServiceCreateImageResult) DeepEqual(ano *LaunchScreenServiceCreateImageResult) 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 *LaunchScreenServiceCreateImageResult) Field0DeepEqual(src *CreateImageResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type LaunchScreenServiceGetImageArgs struct { + Req *GetImageRequest `thrift:"req,1" frugal:"1,default,GetImageRequest" json:"req"` +} + +func NewLaunchScreenServiceGetImageArgs() *LaunchScreenServiceGetImageArgs { + return &LaunchScreenServiceGetImageArgs{} +} + +func (p *LaunchScreenServiceGetImageArgs) InitDefault() { +} + +var LaunchScreenServiceGetImageArgs_Req_DEFAULT *GetImageRequest + +func (p *LaunchScreenServiceGetImageArgs) GetReq() (v *GetImageRequest) { + if !p.IsSetReq() { + return LaunchScreenServiceGetImageArgs_Req_DEFAULT + } + return p.Req +} +func (p *LaunchScreenServiceGetImageArgs) SetReq(val *GetImageRequest) { + p.Req = val +} + +var fieldIDToName_LaunchScreenServiceGetImageArgs = map[int16]string{ + 1: "req", +} + +func (p *LaunchScreenServiceGetImageArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *LaunchScreenServiceGetImageArgs) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LaunchScreenServiceGetImageArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceGetImageArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetImageRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *LaunchScreenServiceGetImageArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetImage_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *LaunchScreenServiceGetImageArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *LaunchScreenServiceGetImageArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceGetImageArgs(%+v)", *p) + +} + +func (p *LaunchScreenServiceGetImageArgs) DeepEqual(ano *LaunchScreenServiceGetImageArgs) 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 *LaunchScreenServiceGetImageArgs) Field1DeepEqual(src *GetImageRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type LaunchScreenServiceGetImageResult struct { + Success *GetImagesByUserIdResponse `thrift:"success,0,optional" frugal:"0,optional,GetImagesByUserIdResponse" json:"success,omitempty"` +} + +func NewLaunchScreenServiceGetImageResult() *LaunchScreenServiceGetImageResult { + return &LaunchScreenServiceGetImageResult{} +} + +func (p *LaunchScreenServiceGetImageResult) InitDefault() { +} + +var LaunchScreenServiceGetImageResult_Success_DEFAULT *GetImagesByUserIdResponse + +func (p *LaunchScreenServiceGetImageResult) GetSuccess() (v *GetImagesByUserIdResponse) { + if !p.IsSetSuccess() { + return LaunchScreenServiceGetImageResult_Success_DEFAULT + } + return p.Success +} +func (p *LaunchScreenServiceGetImageResult) SetSuccess(x interface{}) { + p.Success = x.(*GetImagesByUserIdResponse) +} + +var fieldIDToName_LaunchScreenServiceGetImageResult = map[int16]string{ + 0: "success", +} + +func (p *LaunchScreenServiceGetImageResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *LaunchScreenServiceGetImageResult) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + 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_LaunchScreenServiceGetImageResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceGetImageResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetImagesByUserIdResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *LaunchScreenServiceGetImageResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetImage_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 *LaunchScreenServiceGetImageResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *LaunchScreenServiceGetImageResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceGetImageResult(%+v)", *p) + +} + +func (p *LaunchScreenServiceGetImageResult) DeepEqual(ano *LaunchScreenServiceGetImageResult) 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 *LaunchScreenServiceGetImageResult) Field0DeepEqual(src *GetImagesByUserIdResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type LaunchScreenServiceGetImagesByUserIdArgs struct { + Req *GetImagesByUserIdRequest `thrift:"req,1" frugal:"1,default,GetImagesByUserIdRequest" json:"req"` +} + +func NewLaunchScreenServiceGetImagesByUserIdArgs() *LaunchScreenServiceGetImagesByUserIdArgs { + return &LaunchScreenServiceGetImagesByUserIdArgs{} +} + +func (p *LaunchScreenServiceGetImagesByUserIdArgs) InitDefault() { +} + +var LaunchScreenServiceGetImagesByUserIdArgs_Req_DEFAULT *GetImagesByUserIdRequest + +func (p *LaunchScreenServiceGetImagesByUserIdArgs) GetReq() (v *GetImagesByUserIdRequest) { + if !p.IsSetReq() { + return LaunchScreenServiceGetImagesByUserIdArgs_Req_DEFAULT + } + return p.Req +} +func (p *LaunchScreenServiceGetImagesByUserIdArgs) SetReq(val *GetImagesByUserIdRequest) { + p.Req = val +} + +var fieldIDToName_LaunchScreenServiceGetImagesByUserIdArgs = map[int16]string{ + 1: "req", +} + +func (p *LaunchScreenServiceGetImagesByUserIdArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *LaunchScreenServiceGetImagesByUserIdArgs) 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_LaunchScreenServiceGetImagesByUserIdArgs[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 *LaunchScreenServiceGetImagesByUserIdArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewGetImagesByUserIdRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *LaunchScreenServiceGetImagesByUserIdArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetImagesByUserId_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 *LaunchScreenServiceGetImagesByUserIdArgs) 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 *LaunchScreenServiceGetImagesByUserIdArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceGetImagesByUserIdArgs(%+v)", *p) + +} + +func (p *LaunchScreenServiceGetImagesByUserIdArgs) DeepEqual(ano *LaunchScreenServiceGetImagesByUserIdArgs) 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 *LaunchScreenServiceGetImagesByUserIdArgs) Field1DeepEqual(src *GetImagesByUserIdRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type LaunchScreenServiceGetImagesByUserIdResult struct { + Success *GetImagesByUserIdResponse `thrift:"success,0,optional" frugal:"0,optional,GetImagesByUserIdResponse" json:"success,omitempty"` +} + +func NewLaunchScreenServiceGetImagesByUserIdResult() *LaunchScreenServiceGetImagesByUserIdResult { + return &LaunchScreenServiceGetImagesByUserIdResult{} +} + +func (p *LaunchScreenServiceGetImagesByUserIdResult) InitDefault() { +} + +var LaunchScreenServiceGetImagesByUserIdResult_Success_DEFAULT *GetImagesByUserIdResponse + +func (p *LaunchScreenServiceGetImagesByUserIdResult) GetSuccess() (v *GetImagesByUserIdResponse) { + if !p.IsSetSuccess() { + return LaunchScreenServiceGetImagesByUserIdResult_Success_DEFAULT + } + return p.Success +} +func (p *LaunchScreenServiceGetImagesByUserIdResult) SetSuccess(x interface{}) { + p.Success = x.(*GetImagesByUserIdResponse) +} + +var fieldIDToName_LaunchScreenServiceGetImagesByUserIdResult = map[int16]string{ + 0: "success", +} + +func (p *LaunchScreenServiceGetImagesByUserIdResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *LaunchScreenServiceGetImagesByUserIdResult) 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_LaunchScreenServiceGetImagesByUserIdResult[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 *LaunchScreenServiceGetImagesByUserIdResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewGetImagesByUserIdResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *LaunchScreenServiceGetImagesByUserIdResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("GetImagesByUserId_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 *LaunchScreenServiceGetImagesByUserIdResult) 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 *LaunchScreenServiceGetImagesByUserIdResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceGetImagesByUserIdResult(%+v)", *p) + +} + +func (p *LaunchScreenServiceGetImagesByUserIdResult) DeepEqual(ano *LaunchScreenServiceGetImagesByUserIdResult) 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 *LaunchScreenServiceGetImagesByUserIdResult) Field0DeepEqual(src *GetImagesByUserIdResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type LaunchScreenServiceChangeImagePropertyArgs struct { + Req *ChangeImagePropertyRequest `thrift:"req,1" frugal:"1,default,ChangeImagePropertyRequest" json:"req"` +} + +func NewLaunchScreenServiceChangeImagePropertyArgs() *LaunchScreenServiceChangeImagePropertyArgs { + return &LaunchScreenServiceChangeImagePropertyArgs{} +} + +func (p *LaunchScreenServiceChangeImagePropertyArgs) InitDefault() { +} + +var LaunchScreenServiceChangeImagePropertyArgs_Req_DEFAULT *ChangeImagePropertyRequest + +func (p *LaunchScreenServiceChangeImagePropertyArgs) GetReq() (v *ChangeImagePropertyRequest) { + if !p.IsSetReq() { + return LaunchScreenServiceChangeImagePropertyArgs_Req_DEFAULT + } + return p.Req +} +func (p *LaunchScreenServiceChangeImagePropertyArgs) SetReq(val *ChangeImagePropertyRequest) { + p.Req = val +} + +var fieldIDToName_LaunchScreenServiceChangeImagePropertyArgs = map[int16]string{ + 1: "req", +} + +func (p *LaunchScreenServiceChangeImagePropertyArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *LaunchScreenServiceChangeImagePropertyArgs) 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_LaunchScreenServiceChangeImagePropertyArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceChangeImagePropertyArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewChangeImagePropertyRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *LaunchScreenServiceChangeImagePropertyArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ChangeImageProperty_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 *LaunchScreenServiceChangeImagePropertyArgs) 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 *LaunchScreenServiceChangeImagePropertyArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceChangeImagePropertyArgs(%+v)", *p) + +} + +func (p *LaunchScreenServiceChangeImagePropertyArgs) DeepEqual(ano *LaunchScreenServiceChangeImagePropertyArgs) 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 *LaunchScreenServiceChangeImagePropertyArgs) Field1DeepEqual(src *ChangeImagePropertyRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type LaunchScreenServiceChangeImagePropertyResult struct { + Success *ChangeImagePropertyResponse `thrift:"success,0,optional" frugal:"0,optional,ChangeImagePropertyResponse" json:"success,omitempty"` +} + +func NewLaunchScreenServiceChangeImagePropertyResult() *LaunchScreenServiceChangeImagePropertyResult { + return &LaunchScreenServiceChangeImagePropertyResult{} +} + +func (p *LaunchScreenServiceChangeImagePropertyResult) InitDefault() { +} + +var LaunchScreenServiceChangeImagePropertyResult_Success_DEFAULT *ChangeImagePropertyResponse + +func (p *LaunchScreenServiceChangeImagePropertyResult) GetSuccess() (v *ChangeImagePropertyResponse) { + if !p.IsSetSuccess() { + return LaunchScreenServiceChangeImagePropertyResult_Success_DEFAULT + } + return p.Success +} +func (p *LaunchScreenServiceChangeImagePropertyResult) SetSuccess(x interface{}) { + p.Success = x.(*ChangeImagePropertyResponse) +} + +var fieldIDToName_LaunchScreenServiceChangeImagePropertyResult = map[int16]string{ + 0: "success", +} + +func (p *LaunchScreenServiceChangeImagePropertyResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *LaunchScreenServiceChangeImagePropertyResult) 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_LaunchScreenServiceChangeImagePropertyResult[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 *LaunchScreenServiceChangeImagePropertyResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewChangeImagePropertyResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *LaunchScreenServiceChangeImagePropertyResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ChangeImageProperty_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 *LaunchScreenServiceChangeImagePropertyResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + 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 *LaunchScreenServiceChangeImagePropertyResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceChangeImagePropertyResult(%+v)", *p) + +} + +func (p *LaunchScreenServiceChangeImagePropertyResult) DeepEqual(ano *LaunchScreenServiceChangeImagePropertyResult) 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 *LaunchScreenServiceChangeImagePropertyResult) Field0DeepEqual(src *ChangeImagePropertyResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type LaunchScreenServiceChangeImageArgs struct { + Req *ChangeImageRequest `thrift:"req,1" frugal:"1,default,ChangeImageRequest" json:"req"` +} + +func NewLaunchScreenServiceChangeImageArgs() *LaunchScreenServiceChangeImageArgs { + return &LaunchScreenServiceChangeImageArgs{} +} + +func (p *LaunchScreenServiceChangeImageArgs) InitDefault() { +} + +var LaunchScreenServiceChangeImageArgs_Req_DEFAULT *ChangeImageRequest + +func (p *LaunchScreenServiceChangeImageArgs) GetReq() (v *ChangeImageRequest) { + if !p.IsSetReq() { + return LaunchScreenServiceChangeImageArgs_Req_DEFAULT + } + return p.Req +} +func (p *LaunchScreenServiceChangeImageArgs) SetReq(val *ChangeImageRequest) { + p.Req = val +} + +var fieldIDToName_LaunchScreenServiceChangeImageArgs = map[int16]string{ + 1: "req", +} + +func (p *LaunchScreenServiceChangeImageArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *LaunchScreenServiceChangeImageArgs) 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_LaunchScreenServiceChangeImageArgs[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 *LaunchScreenServiceChangeImageArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewChangeImageRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *LaunchScreenServiceChangeImageArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ChangeImage_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *LaunchScreenServiceChangeImageArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Req.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *LaunchScreenServiceChangeImageArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceChangeImageArgs(%+v)", *p) + +} + +func (p *LaunchScreenServiceChangeImageArgs) DeepEqual(ano *LaunchScreenServiceChangeImageArgs) 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 *LaunchScreenServiceChangeImageArgs) Field1DeepEqual(src *ChangeImageRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type LaunchScreenServiceChangeImageResult struct { + Success *ChangeImageResponse `thrift:"success,0,optional" frugal:"0,optional,ChangeImageResponse" json:"success,omitempty"` +} + +func NewLaunchScreenServiceChangeImageResult() *LaunchScreenServiceChangeImageResult { + return &LaunchScreenServiceChangeImageResult{} +} + +func (p *LaunchScreenServiceChangeImageResult) InitDefault() { +} + +var LaunchScreenServiceChangeImageResult_Success_DEFAULT *ChangeImageResponse + +func (p *LaunchScreenServiceChangeImageResult) GetSuccess() (v *ChangeImageResponse) { + if !p.IsSetSuccess() { + return LaunchScreenServiceChangeImageResult_Success_DEFAULT + } + return p.Success +} +func (p *LaunchScreenServiceChangeImageResult) SetSuccess(x interface{}) { + p.Success = x.(*ChangeImageResponse) +} + +var fieldIDToName_LaunchScreenServiceChangeImageResult = map[int16]string{ + 0: "success", +} + +func (p *LaunchScreenServiceChangeImageResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *LaunchScreenServiceChangeImageResult) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_LaunchScreenServiceChangeImageResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceChangeImageResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewChangeImageResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *LaunchScreenServiceChangeImageResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("ChangeImage_result"); err != nil { + 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 *LaunchScreenServiceChangeImageResult) 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 *LaunchScreenServiceChangeImageResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceChangeImageResult(%+v)", *p) + +} + +func (p *LaunchScreenServiceChangeImageResult) DeepEqual(ano *LaunchScreenServiceChangeImageResult) 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 *LaunchScreenServiceChangeImageResult) Field0DeepEqual(src *ChangeImageResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type LaunchScreenServiceDeleteImageArgs struct { + Req *DeleteImageRequest `thrift:"req,1" frugal:"1,default,DeleteImageRequest" json:"req"` +} + +func NewLaunchScreenServiceDeleteImageArgs() *LaunchScreenServiceDeleteImageArgs { + return &LaunchScreenServiceDeleteImageArgs{} +} + +func (p *LaunchScreenServiceDeleteImageArgs) InitDefault() { +} + +var LaunchScreenServiceDeleteImageArgs_Req_DEFAULT *DeleteImageRequest + +func (p *LaunchScreenServiceDeleteImageArgs) GetReq() (v *DeleteImageRequest) { + if !p.IsSetReq() { + return LaunchScreenServiceDeleteImageArgs_Req_DEFAULT + } + return p.Req +} +func (p *LaunchScreenServiceDeleteImageArgs) SetReq(val *DeleteImageRequest) { + p.Req = val +} + +var fieldIDToName_LaunchScreenServiceDeleteImageArgs = map[int16]string{ + 1: "req", +} + +func (p *LaunchScreenServiceDeleteImageArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *LaunchScreenServiceDeleteImageArgs) 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_LaunchScreenServiceDeleteImageArgs[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 *LaunchScreenServiceDeleteImageArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewDeleteImageRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *LaunchScreenServiceDeleteImageArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("DeleteImage_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 *LaunchScreenServiceDeleteImageArgs) 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 *LaunchScreenServiceDeleteImageArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceDeleteImageArgs(%+v)", *p) + +} + +func (p *LaunchScreenServiceDeleteImageArgs) DeepEqual(ano *LaunchScreenServiceDeleteImageArgs) 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 *LaunchScreenServiceDeleteImageArgs) Field1DeepEqual(src *DeleteImageRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type LaunchScreenServiceDeleteImageResult struct { + Success *DeleteImageResponse `thrift:"success,0,optional" frugal:"0,optional,DeleteImageResponse" json:"success,omitempty"` +} + +func NewLaunchScreenServiceDeleteImageResult() *LaunchScreenServiceDeleteImageResult { + return &LaunchScreenServiceDeleteImageResult{} +} + +func (p *LaunchScreenServiceDeleteImageResult) InitDefault() { +} + +var LaunchScreenServiceDeleteImageResult_Success_DEFAULT *DeleteImageResponse + +func (p *LaunchScreenServiceDeleteImageResult) GetSuccess() (v *DeleteImageResponse) { + if !p.IsSetSuccess() { + return LaunchScreenServiceDeleteImageResult_Success_DEFAULT + } + return p.Success +} +func (p *LaunchScreenServiceDeleteImageResult) SetSuccess(x interface{}) { + p.Success = x.(*DeleteImageResponse) +} + +var fieldIDToName_LaunchScreenServiceDeleteImageResult = map[int16]string{ + 0: "success", +} + +func (p *LaunchScreenServiceDeleteImageResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *LaunchScreenServiceDeleteImageResult) 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_LaunchScreenServiceDeleteImageResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceDeleteImageResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewDeleteImageResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *LaunchScreenServiceDeleteImageResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("DeleteImage_result"); err != nil { + goto WriteStructBeginError + } + 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 *LaunchScreenServiceDeleteImageResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *LaunchScreenServiceDeleteImageResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceDeleteImageResult(%+v)", *p) + +} + +func (p *LaunchScreenServiceDeleteImageResult) DeepEqual(ano *LaunchScreenServiceDeleteImageResult) 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 *LaunchScreenServiceDeleteImageResult) Field0DeepEqual(src *DeleteImageResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type LaunchScreenServiceMobileGetImageArgs struct { + Req *MobileGetImageRequest `thrift:"req,1" frugal:"1,default,MobileGetImageRequest" json:"req"` +} + +func NewLaunchScreenServiceMobileGetImageArgs() *LaunchScreenServiceMobileGetImageArgs { + return &LaunchScreenServiceMobileGetImageArgs{} +} + +func (p *LaunchScreenServiceMobileGetImageArgs) InitDefault() { +} + +var LaunchScreenServiceMobileGetImageArgs_Req_DEFAULT *MobileGetImageRequest + +func (p *LaunchScreenServiceMobileGetImageArgs) GetReq() (v *MobileGetImageRequest) { + if !p.IsSetReq() { + return LaunchScreenServiceMobileGetImageArgs_Req_DEFAULT + } + return p.Req +} +func (p *LaunchScreenServiceMobileGetImageArgs) SetReq(val *MobileGetImageRequest) { + p.Req = val +} + +var fieldIDToName_LaunchScreenServiceMobileGetImageArgs = map[int16]string{ + 1: "req", +} + +func (p *LaunchScreenServiceMobileGetImageArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *LaunchScreenServiceMobileGetImageArgs) 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_LaunchScreenServiceMobileGetImageArgs[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 *LaunchScreenServiceMobileGetImageArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewMobileGetImageRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *LaunchScreenServiceMobileGetImageArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("MobileGetImage_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 *LaunchScreenServiceMobileGetImageArgs) 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 *LaunchScreenServiceMobileGetImageArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceMobileGetImageArgs(%+v)", *p) + +} + +func (p *LaunchScreenServiceMobileGetImageArgs) DeepEqual(ano *LaunchScreenServiceMobileGetImageArgs) 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 *LaunchScreenServiceMobileGetImageArgs) Field1DeepEqual(src *MobileGetImageRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type LaunchScreenServiceMobileGetImageResult struct { + Success *MobileGetImageResponse `thrift:"success,0,optional" frugal:"0,optional,MobileGetImageResponse" json:"success,omitempty"` +} + +func NewLaunchScreenServiceMobileGetImageResult() *LaunchScreenServiceMobileGetImageResult { + return &LaunchScreenServiceMobileGetImageResult{} +} + +func (p *LaunchScreenServiceMobileGetImageResult) InitDefault() { +} + +var LaunchScreenServiceMobileGetImageResult_Success_DEFAULT *MobileGetImageResponse + +func (p *LaunchScreenServiceMobileGetImageResult) GetSuccess() (v *MobileGetImageResponse) { + if !p.IsSetSuccess() { + return LaunchScreenServiceMobileGetImageResult_Success_DEFAULT + } + return p.Success +} +func (p *LaunchScreenServiceMobileGetImageResult) SetSuccess(x interface{}) { + p.Success = x.(*MobileGetImageResponse) +} + +var fieldIDToName_LaunchScreenServiceMobileGetImageResult = map[int16]string{ + 0: "success", +} + +func (p *LaunchScreenServiceMobileGetImageResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *LaunchScreenServiceMobileGetImageResult) 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_LaunchScreenServiceMobileGetImageResult[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 *LaunchScreenServiceMobileGetImageResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewMobileGetImageResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *LaunchScreenServiceMobileGetImageResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("MobileGetImage_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 *LaunchScreenServiceMobileGetImageResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *LaunchScreenServiceMobileGetImageResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceMobileGetImageResult(%+v)", *p) + +} + +func (p *LaunchScreenServiceMobileGetImageResult) DeepEqual(ano *LaunchScreenServiceMobileGetImageResult) 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 *LaunchScreenServiceMobileGetImageResult) Field0DeepEqual(src *MobileGetImageResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type LaunchScreenServiceAddImagePointTimeArgs struct { + Req *AddImagePointTimeRequest `thrift:"req,1" frugal:"1,default,AddImagePointTimeRequest" json:"req"` +} + +func NewLaunchScreenServiceAddImagePointTimeArgs() *LaunchScreenServiceAddImagePointTimeArgs { + return &LaunchScreenServiceAddImagePointTimeArgs{} +} + +func (p *LaunchScreenServiceAddImagePointTimeArgs) InitDefault() { +} + +var LaunchScreenServiceAddImagePointTimeArgs_Req_DEFAULT *AddImagePointTimeRequest + +func (p *LaunchScreenServiceAddImagePointTimeArgs) GetReq() (v *AddImagePointTimeRequest) { + if !p.IsSetReq() { + return LaunchScreenServiceAddImagePointTimeArgs_Req_DEFAULT + } + return p.Req +} +func (p *LaunchScreenServiceAddImagePointTimeArgs) SetReq(val *AddImagePointTimeRequest) { + p.Req = val +} + +var fieldIDToName_LaunchScreenServiceAddImagePointTimeArgs = map[int16]string{ + 1: "req", +} + +func (p *LaunchScreenServiceAddImagePointTimeArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *LaunchScreenServiceAddImagePointTimeArgs) 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_LaunchScreenServiceAddImagePointTimeArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceAddImagePointTimeArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewAddImagePointTimeRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *LaunchScreenServiceAddImagePointTimeArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("AddImagePointTime_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + 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 *LaunchScreenServiceAddImagePointTimeArgs) 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 *LaunchScreenServiceAddImagePointTimeArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceAddImagePointTimeArgs(%+v)", *p) + +} + +func (p *LaunchScreenServiceAddImagePointTimeArgs) DeepEqual(ano *LaunchScreenServiceAddImagePointTimeArgs) 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 *LaunchScreenServiceAddImagePointTimeArgs) Field1DeepEqual(src *AddImagePointTimeRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type LaunchScreenServiceAddImagePointTimeResult struct { + Success *AddImagePointTimeResponse `thrift:"success,0,optional" frugal:"0,optional,AddImagePointTimeResponse" json:"success,omitempty"` +} + +func NewLaunchScreenServiceAddImagePointTimeResult() *LaunchScreenServiceAddImagePointTimeResult { + return &LaunchScreenServiceAddImagePointTimeResult{} +} + +func (p *LaunchScreenServiceAddImagePointTimeResult) InitDefault() { +} + +var LaunchScreenServiceAddImagePointTimeResult_Success_DEFAULT *AddImagePointTimeResponse + +func (p *LaunchScreenServiceAddImagePointTimeResult) GetSuccess() (v *AddImagePointTimeResponse) { + if !p.IsSetSuccess() { + return LaunchScreenServiceAddImagePointTimeResult_Success_DEFAULT + } + return p.Success +} +func (p *LaunchScreenServiceAddImagePointTimeResult) SetSuccess(x interface{}) { + p.Success = x.(*AddImagePointTimeResponse) +} + +var fieldIDToName_LaunchScreenServiceAddImagePointTimeResult = map[int16]string{ + 0: "success", +} + +func (p *LaunchScreenServiceAddImagePointTimeResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *LaunchScreenServiceAddImagePointTimeResult) 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_LaunchScreenServiceAddImagePointTimeResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LaunchScreenServiceAddImagePointTimeResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewAddImagePointTimeResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *LaunchScreenServiceAddImagePointTimeResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("AddImagePointTime_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *LaunchScreenServiceAddImagePointTimeResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *LaunchScreenServiceAddImagePointTimeResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LaunchScreenServiceAddImagePointTimeResult(%+v)", *p) + +} + +func (p *LaunchScreenServiceAddImagePointTimeResult) DeepEqual(ano *LaunchScreenServiceAddImagePointTimeResult) 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 *LaunchScreenServiceAddImagePointTimeResult) Field0DeepEqual(src *AddImagePointTimeResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} diff --git a/kitex_gen/launch_screen/launchscreenservice/client.go b/kitex_gen/launch_screen/launchscreenservice/client.go new file mode 100644 index 0000000..a7d433a --- /dev/null +++ b/kitex_gen/launch_screen/launchscreenservice/client.go @@ -0,0 +1,91 @@ +// Code generated by Kitex v0.9.1. DO NOT EDIT. + +package launchscreenservice + +import ( + "context" + client "github.com/cloudwego/kitex/client" + callopt "github.com/cloudwego/kitex/client/callopt" + launch_screen "github.com/west2-online/fzuhelper-server/kitex_gen/launch_screen" +) + +// Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework. +type Client interface { + CreateImage(ctx context.Context, req *launch_screen.CreateImageRequest, callOptions ...callopt.Option) (r *launch_screen.CreateImageResponse, err error) + GetImage(ctx context.Context, req *launch_screen.GetImageRequest, callOptions ...callopt.Option) (r *launch_screen.GetImagesByUserIdResponse, err error) + GetImagesByUserId(ctx context.Context, req *launch_screen.GetImagesByUserIdRequest, callOptions ...callopt.Option) (r *launch_screen.GetImagesByUserIdResponse, err error) + ChangeImageProperty(ctx context.Context, req *launch_screen.ChangeImagePropertyRequest, callOptions ...callopt.Option) (r *launch_screen.ChangeImagePropertyResponse, err error) + ChangeImage(ctx context.Context, req *launch_screen.ChangeImageRequest, callOptions ...callopt.Option) (r *launch_screen.ChangeImageResponse, err error) + DeleteImage(ctx context.Context, req *launch_screen.DeleteImageRequest, callOptions ...callopt.Option) (r *launch_screen.DeleteImageResponse, err error) + MobileGetImage(ctx context.Context, req *launch_screen.MobileGetImageRequest, callOptions ...callopt.Option) (r *launch_screen.MobileGetImageResponse, err error) + AddImagePointTime(ctx context.Context, req *launch_screen.AddImagePointTimeRequest, callOptions ...callopt.Option) (r *launch_screen.AddImagePointTimeResponse, 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 &kLaunchScreenServiceClient{ + 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 kLaunchScreenServiceClient struct { + *kClient +} + +func (p *kLaunchScreenServiceClient) CreateImage(ctx context.Context, req *launch_screen.CreateImageRequest, callOptions ...callopt.Option) (r *launch_screen.CreateImageResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.CreateImage(ctx, req) +} + +func (p *kLaunchScreenServiceClient) GetImage(ctx context.Context, req *launch_screen.GetImageRequest, callOptions ...callopt.Option) (r *launch_screen.GetImagesByUserIdResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.GetImage(ctx, req) +} + +func (p *kLaunchScreenServiceClient) GetImagesByUserId(ctx context.Context, req *launch_screen.GetImagesByUserIdRequest, callOptions ...callopt.Option) (r *launch_screen.GetImagesByUserIdResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.GetImagesByUserId(ctx, req) +} + +func (p *kLaunchScreenServiceClient) ChangeImageProperty(ctx context.Context, req *launch_screen.ChangeImagePropertyRequest, callOptions ...callopt.Option) (r *launch_screen.ChangeImagePropertyResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.ChangeImageProperty(ctx, req) +} + +func (p *kLaunchScreenServiceClient) ChangeImage(ctx context.Context, req *launch_screen.ChangeImageRequest, callOptions ...callopt.Option) (r *launch_screen.ChangeImageResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.ChangeImage(ctx, req) +} + +func (p *kLaunchScreenServiceClient) DeleteImage(ctx context.Context, req *launch_screen.DeleteImageRequest, callOptions ...callopt.Option) (r *launch_screen.DeleteImageResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.DeleteImage(ctx, req) +} + +func (p *kLaunchScreenServiceClient) MobileGetImage(ctx context.Context, req *launch_screen.MobileGetImageRequest, callOptions ...callopt.Option) (r *launch_screen.MobileGetImageResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.MobileGetImage(ctx, req) +} + +func (p *kLaunchScreenServiceClient) AddImagePointTime(ctx context.Context, req *launch_screen.AddImagePointTimeRequest, callOptions ...callopt.Option) (r *launch_screen.AddImagePointTimeResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.AddImagePointTime(ctx, req) +} diff --git a/kitex_gen/launch_screen/launchscreenservice/invoker.go b/kitex_gen/launch_screen/launchscreenservice/invoker.go new file mode 100644 index 0000000..cd732df --- /dev/null +++ b/kitex_gen/launch_screen/launchscreenservice/invoker.go @@ -0,0 +1,24 @@ +// Code generated by Kitex v0.9.1. DO NOT EDIT. + +package launchscreenservice + +import ( + server "github.com/cloudwego/kitex/server" + launch_screen "github.com/west2-online/fzuhelper-server/kitex_gen/launch_screen" +) + +// NewInvoker creates a server.Invoker with the given handler and options. +func NewInvoker(handler launch_screen.LaunchScreenService, opts ...server.Option) server.Invoker { + var options []server.Option + + options = append(options, opts...) + + s := server.NewInvoker(options...) + if err := s.RegisterService(serviceInfo(), handler); err != nil { + panic(err) + } + if err := s.Init(); err != nil { + panic(err) + } + return s +} diff --git a/kitex_gen/launch_screen/launchscreenservice/launchscreenservice.go b/kitex_gen/launch_screen/launchscreenservice/launchscreenservice.go new file mode 100644 index 0000000..5913cf6 --- /dev/null +++ b/kitex_gen/launch_screen/launchscreenservice/launchscreenservice.go @@ -0,0 +1,370 @@ +// Code generated by Kitex v0.9.1. DO NOT EDIT. + +package launchscreenservice + +import ( + "context" + "errors" + client "github.com/cloudwego/kitex/client" + kitex "github.com/cloudwego/kitex/pkg/serviceinfo" + launch_screen "github.com/west2-online/fzuhelper-server/kitex_gen/launch_screen" +) + +var errInvalidMessageType = errors.New("invalid message type for service method handler") + +var serviceMethods = map[string]kitex.MethodInfo{ + "CreateImage": kitex.NewMethodInfo( + createImageHandler, + newLaunchScreenServiceCreateImageArgs, + newLaunchScreenServiceCreateImageResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "GetImage": kitex.NewMethodInfo( + getImageHandler, + newLaunchScreenServiceGetImageArgs, + newLaunchScreenServiceGetImageResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "GetImagesByUserId": kitex.NewMethodInfo( + getImagesByUserIdHandler, + newLaunchScreenServiceGetImagesByUserIdArgs, + newLaunchScreenServiceGetImagesByUserIdResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "ChangeImageProperty": kitex.NewMethodInfo( + changeImagePropertyHandler, + newLaunchScreenServiceChangeImagePropertyArgs, + newLaunchScreenServiceChangeImagePropertyResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "ChangeImage": kitex.NewMethodInfo( + changeImageHandler, + newLaunchScreenServiceChangeImageArgs, + newLaunchScreenServiceChangeImageResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "DeleteImage": kitex.NewMethodInfo( + deleteImageHandler, + newLaunchScreenServiceDeleteImageArgs, + newLaunchScreenServiceDeleteImageResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "MobileGetImage": kitex.NewMethodInfo( + mobileGetImageHandler, + newLaunchScreenServiceMobileGetImageArgs, + newLaunchScreenServiceMobileGetImageResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "AddImagePointTime": kitex.NewMethodInfo( + addImagePointTimeHandler, + newLaunchScreenServiceAddImagePointTimeArgs, + newLaunchScreenServiceAddImagePointTimeResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), +} + +var ( + launchScreenServiceServiceInfo = NewServiceInfo() + launchScreenServiceServiceInfoForClient = NewServiceInfoForClient() + launchScreenServiceServiceInfoForStreamClient = NewServiceInfoForStreamClient() +) + +// for server +func serviceInfo() *kitex.ServiceInfo { + return launchScreenServiceServiceInfo +} + +// for client +func serviceInfoForStreamClient() *kitex.ServiceInfo { + return launchScreenServiceServiceInfoForStreamClient +} + +// for stream client +func serviceInfoForClient() *kitex.ServiceInfo { + return launchScreenServiceServiceInfoForClient +} + +// 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 := "LaunchScreenService" + handlerType := (*launch_screen.LaunchScreenService)(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": "launch_screen", + } + if hasStreaming { + extra["streaming"] = hasStreaming + } + svcInfo := &kitex.ServiceInfo{ + ServiceName: serviceName, + HandlerType: handlerType, + Methods: methods, + PayloadCodec: kitex.Thrift, + KiteXGenVersion: "v0.9.1", + Extra: extra, + } + return svcInfo +} + +func createImageHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*launch_screen.LaunchScreenServiceCreateImageArgs) + realResult := result.(*launch_screen.LaunchScreenServiceCreateImageResult) + success, err := handler.(launch_screen.LaunchScreenService).CreateImage(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newLaunchScreenServiceCreateImageArgs() interface{} { + return launch_screen.NewLaunchScreenServiceCreateImageArgs() +} + +func newLaunchScreenServiceCreateImageResult() interface{} { + return launch_screen.NewLaunchScreenServiceCreateImageResult() +} + +func getImageHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*launch_screen.LaunchScreenServiceGetImageArgs) + realResult := result.(*launch_screen.LaunchScreenServiceGetImageResult) + success, err := handler.(launch_screen.LaunchScreenService).GetImage(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newLaunchScreenServiceGetImageArgs() interface{} { + return launch_screen.NewLaunchScreenServiceGetImageArgs() +} + +func newLaunchScreenServiceGetImageResult() interface{} { + return launch_screen.NewLaunchScreenServiceGetImageResult() +} + +func getImagesByUserIdHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*launch_screen.LaunchScreenServiceGetImagesByUserIdArgs) + realResult := result.(*launch_screen.LaunchScreenServiceGetImagesByUserIdResult) + success, err := handler.(launch_screen.LaunchScreenService).GetImagesByUserId(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newLaunchScreenServiceGetImagesByUserIdArgs() interface{} { + return launch_screen.NewLaunchScreenServiceGetImagesByUserIdArgs() +} + +func newLaunchScreenServiceGetImagesByUserIdResult() interface{} { + return launch_screen.NewLaunchScreenServiceGetImagesByUserIdResult() +} + +func changeImagePropertyHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*launch_screen.LaunchScreenServiceChangeImagePropertyArgs) + realResult := result.(*launch_screen.LaunchScreenServiceChangeImagePropertyResult) + success, err := handler.(launch_screen.LaunchScreenService).ChangeImageProperty(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newLaunchScreenServiceChangeImagePropertyArgs() interface{} { + return launch_screen.NewLaunchScreenServiceChangeImagePropertyArgs() +} + +func newLaunchScreenServiceChangeImagePropertyResult() interface{} { + return launch_screen.NewLaunchScreenServiceChangeImagePropertyResult() +} + +func changeImageHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*launch_screen.LaunchScreenServiceChangeImageArgs) + realResult := result.(*launch_screen.LaunchScreenServiceChangeImageResult) + success, err := handler.(launch_screen.LaunchScreenService).ChangeImage(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newLaunchScreenServiceChangeImageArgs() interface{} { + return launch_screen.NewLaunchScreenServiceChangeImageArgs() +} + +func newLaunchScreenServiceChangeImageResult() interface{} { + return launch_screen.NewLaunchScreenServiceChangeImageResult() +} + +func deleteImageHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*launch_screen.LaunchScreenServiceDeleteImageArgs) + realResult := result.(*launch_screen.LaunchScreenServiceDeleteImageResult) + success, err := handler.(launch_screen.LaunchScreenService).DeleteImage(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newLaunchScreenServiceDeleteImageArgs() interface{} { + return launch_screen.NewLaunchScreenServiceDeleteImageArgs() +} + +func newLaunchScreenServiceDeleteImageResult() interface{} { + return launch_screen.NewLaunchScreenServiceDeleteImageResult() +} + +func mobileGetImageHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*launch_screen.LaunchScreenServiceMobileGetImageArgs) + realResult := result.(*launch_screen.LaunchScreenServiceMobileGetImageResult) + success, err := handler.(launch_screen.LaunchScreenService).MobileGetImage(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newLaunchScreenServiceMobileGetImageArgs() interface{} { + return launch_screen.NewLaunchScreenServiceMobileGetImageArgs() +} + +func newLaunchScreenServiceMobileGetImageResult() interface{} { + return launch_screen.NewLaunchScreenServiceMobileGetImageResult() +} + +func addImagePointTimeHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*launch_screen.LaunchScreenServiceAddImagePointTimeArgs) + realResult := result.(*launch_screen.LaunchScreenServiceAddImagePointTimeResult) + success, err := handler.(launch_screen.LaunchScreenService).AddImagePointTime(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newLaunchScreenServiceAddImagePointTimeArgs() interface{} { + return launch_screen.NewLaunchScreenServiceAddImagePointTimeArgs() +} + +func newLaunchScreenServiceAddImagePointTimeResult() interface{} { + return launch_screen.NewLaunchScreenServiceAddImagePointTimeResult() +} + +type kClient struct { + c client.Client +} + +func newServiceClient(c client.Client) *kClient { + return &kClient{ + c: c, + } +} + +func (p *kClient) CreateImage(ctx context.Context, req *launch_screen.CreateImageRequest) (r *launch_screen.CreateImageResponse, err error) { + var _args launch_screen.LaunchScreenServiceCreateImageArgs + _args.Req = req + var _result launch_screen.LaunchScreenServiceCreateImageResult + if err = p.c.Call(ctx, "CreateImage", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) GetImage(ctx context.Context, req *launch_screen.GetImageRequest) (r *launch_screen.GetImagesByUserIdResponse, err error) { + var _args launch_screen.LaunchScreenServiceGetImageArgs + _args.Req = req + var _result launch_screen.LaunchScreenServiceGetImageResult + if err = p.c.Call(ctx, "GetImage", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) GetImagesByUserId(ctx context.Context, req *launch_screen.GetImagesByUserIdRequest) (r *launch_screen.GetImagesByUserIdResponse, err error) { + var _args launch_screen.LaunchScreenServiceGetImagesByUserIdArgs + _args.Req = req + var _result launch_screen.LaunchScreenServiceGetImagesByUserIdResult + if err = p.c.Call(ctx, "GetImagesByUserId", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) ChangeImageProperty(ctx context.Context, req *launch_screen.ChangeImagePropertyRequest) (r *launch_screen.ChangeImagePropertyResponse, err error) { + var _args launch_screen.LaunchScreenServiceChangeImagePropertyArgs + _args.Req = req + var _result launch_screen.LaunchScreenServiceChangeImagePropertyResult + if err = p.c.Call(ctx, "ChangeImageProperty", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) ChangeImage(ctx context.Context, req *launch_screen.ChangeImageRequest) (r *launch_screen.ChangeImageResponse, err error) { + var _args launch_screen.LaunchScreenServiceChangeImageArgs + _args.Req = req + var _result launch_screen.LaunchScreenServiceChangeImageResult + if err = p.c.Call(ctx, "ChangeImage", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) DeleteImage(ctx context.Context, req *launch_screen.DeleteImageRequest) (r *launch_screen.DeleteImageResponse, err error) { + var _args launch_screen.LaunchScreenServiceDeleteImageArgs + _args.Req = req + var _result launch_screen.LaunchScreenServiceDeleteImageResult + if err = p.c.Call(ctx, "DeleteImage", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) MobileGetImage(ctx context.Context, req *launch_screen.MobileGetImageRequest) (r *launch_screen.MobileGetImageResponse, err error) { + var _args launch_screen.LaunchScreenServiceMobileGetImageArgs + _args.Req = req + var _result launch_screen.LaunchScreenServiceMobileGetImageResult + if err = p.c.Call(ctx, "MobileGetImage", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) AddImagePointTime(ctx context.Context, req *launch_screen.AddImagePointTimeRequest) (r *launch_screen.AddImagePointTimeResponse, err error) { + var _args launch_screen.LaunchScreenServiceAddImagePointTimeArgs + _args.Req = req + var _result launch_screen.LaunchScreenServiceAddImagePointTimeResult + if err = p.c.Call(ctx, "AddImagePointTime", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} diff --git a/kitex_gen/launch_screen/launchscreenservice/server.go b/kitex_gen/launch_screen/launchscreenservice/server.go new file mode 100644 index 0000000..d68a145 --- /dev/null +++ b/kitex_gen/launch_screen/launchscreenservice/server.go @@ -0,0 +1,25 @@ +// Code generated by Kitex v0.9.1. DO NOT EDIT. +package launchscreenservice + +import ( + server "github.com/cloudwego/kitex/server" + launch_screen "github.com/west2-online/fzuhelper-server/kitex_gen/launch_screen" +) + +// NewServer creates a server.Server with the given handler and options. +func NewServer(handler launch_screen.LaunchScreenService, 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 launch_screen.LaunchScreenService, opts ...server.RegisterOption) error { + return svr.RegisterService(serviceInfo(), handler, opts...) +} diff --git a/kitex_gen/model/k-consts.go b/kitex_gen/model/k-consts.go new file mode 100644 index 0000000..f98304c --- /dev/null +++ b/kitex_gen/model/k-consts.go @@ -0,0 +1,4 @@ +package model + +// 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 new file mode 100644 index 0000000..905482c --- /dev/null +++ b/kitex_gen/model/k-model.go @@ -0,0 +1,1239 @@ +// Code generated by Kitex v0.9.1. DO NOT EDIT. + +package model + +import ( + "bytes" + "fmt" + "reflect" + "strings" + + "github.com/apache/thrift/lib/go/thrift" + + "github.com/cloudwego/kitex/pkg/protocol/bthrift" +) + +// unused protection +var ( + _ = fmt.Formatter(nil) + _ = (*bytes.Buffer)(nil) + _ = (*strings.Builder)(nil) + _ = reflect.Type(nil) + _ = thrift.TProtocol(nil) + _ = bthrift.BinaryWriter(nil) +) + +func (p *BaseResp) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_BaseResp[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *BaseResp) FastReadField1(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Code = v + + } + return offset, nil +} + +func (p *BaseResp) FastReadField2(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Msg = v + + } + return offset, nil +} + +// for compatibility +func (p *BaseResp) FastWrite(buf []byte) int { + return 0 +} + +func (p *BaseResp) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "BaseResp") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *BaseResp) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("BaseResp") + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *BaseResp) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "code", thrift.I64, 1) + offset += bthrift.Binary.WriteI64(buf[offset:], p.Code) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *BaseResp) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "msg", thrift.STRING, 2) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Msg) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *BaseResp) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("code", thrift.I64, 1) + l += bthrift.Binary.I64Length(p.Code) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *BaseResp) field2Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("msg", thrift.STRING, 2) + l += bthrift.Binary.StringLengthNocopy(p.Msg) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *User) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.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 = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_User[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *User) FastReadField1(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Id = v + + } + return offset, nil +} + +func (p *User) FastReadField2(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Account = v + + } + return offset, nil +} + +func (p *User) FastReadField3(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Name = v + + } + return offset, nil +} + +// for compatibility +func (p *User) FastWrite(buf []byte) int { + return 0 +} + +func (p *User) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "User") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField3(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *User) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("User") + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *User) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "id", thrift.I64, 1) + offset += bthrift.Binary.WriteI64(buf[offset:], p.Id) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *User) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "account", thrift.STRING, 2) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Account) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *User) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "name", thrift.STRING, 3) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Name) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *User) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("id", thrift.I64, 1) + l += bthrift.Binary.I64Length(p.Id) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *User) field2Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("account", thrift.STRING, 2) + l += bthrift.Binary.StringLengthNocopy(p.Account) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *User) field3Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("name", thrift.STRING, 3) + l += bthrift.Binary.StringLengthNocopy(p.Name) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *Picture) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.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 = bthrift.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 = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 6: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField6(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 7: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField7(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 8: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField8(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 9: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField9(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 10: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField10(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 11: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField11(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 12: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField12(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 13: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField13(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 14: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField14(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 15: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField15(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_Picture[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *Picture) FastReadField1(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Id = v + + } + return offset, nil +} + +func (p *Picture) FastReadField2(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.UserId = v + + } + return offset, nil +} + +func (p *Picture) FastReadField3(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Url = v + + } + return offset, nil +} + +func (p *Picture) FastReadField4(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Href = v + + } + return offset, nil +} + +func (p *Picture) FastReadField5(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Text = v + + } + return offset, nil +} + +func (p *Picture) FastReadField6(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.PicType = v + + } + return offset, nil +} + +func (p *Picture) FastReadField7(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.ShowTimes = &v + + } + return offset, nil +} + +func (p *Picture) FastReadField8(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.PointTimes = &v + + } + return offset, nil +} + +func (p *Picture) FastReadField9(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Duration = v + + } + return offset, nil +} + +func (p *Picture) FastReadField10(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.SType = &v + + } + return offset, nil +} + +func (p *Picture) FastReadField11(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Frequency = v + + } + return offset, nil +} + +func (p *Picture) FastReadField12(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.StartAt = v + + } + return offset, nil +} + +func (p *Picture) FastReadField13(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.EndAt = v + + } + return offset, nil +} + +func (p *Picture) FastReadField14(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.StartTime = v + + } + return offset, nil +} + +func (p *Picture) FastReadField15(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.EndTime = v + + } + return offset, nil +} + +// for compatibility +func (p *Picture) FastWrite(buf []byte) int { + return 0 +} + +func (p *Picture) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "Picture") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField6(buf[offset:], binaryWriter) + offset += p.fastWriteField7(buf[offset:], binaryWriter) + offset += p.fastWriteField8(buf[offset:], binaryWriter) + offset += p.fastWriteField9(buf[offset:], binaryWriter) + offset += p.fastWriteField10(buf[offset:], binaryWriter) + offset += p.fastWriteField11(buf[offset:], binaryWriter) + offset += p.fastWriteField12(buf[offset:], binaryWriter) + offset += p.fastWriteField13(buf[offset:], binaryWriter) + offset += p.fastWriteField14(buf[offset:], binaryWriter) + offset += p.fastWriteField15(buf[offset:], binaryWriter) + offset += p.fastWriteField3(buf[offset:], binaryWriter) + offset += p.fastWriteField4(buf[offset:], binaryWriter) + offset += p.fastWriteField5(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *Picture) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("Picture") + 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 += p.field8Length() + l += p.field9Length() + l += p.field10Length() + l += p.field11Length() + l += p.field12Length() + l += p.field13Length() + l += p.field14Length() + l += p.field15Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *Picture) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "id", thrift.I64, 1) + offset += bthrift.Binary.WriteI64(buf[offset:], p.Id) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *Picture) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "user_id", thrift.I64, 2) + offset += bthrift.Binary.WriteI64(buf[offset:], p.UserId) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *Picture) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "url", thrift.STRING, 3) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Url) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *Picture) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "href", thrift.STRING, 4) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Href) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *Picture) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "text", thrift.STRING, 5) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Text) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *Picture) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "pic_type", thrift.I64, 6) + offset += bthrift.Binary.WriteI64(buf[offset:], p.PicType) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *Picture) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetShowTimes() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "show_times", thrift.I64, 7) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.ShowTimes) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *Picture) fastWriteField8(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetPointTimes() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "point_times", thrift.I64, 8) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.PointTimes) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *Picture) fastWriteField9(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "duration", thrift.I64, 9) + offset += bthrift.Binary.WriteI64(buf[offset:], p.Duration) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *Picture) fastWriteField10(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetSType() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "s_type", thrift.I64, 10) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.SType) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *Picture) fastWriteField11(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "frequency", thrift.I64, 11) + offset += bthrift.Binary.WriteI64(buf[offset:], p.Frequency) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *Picture) fastWriteField12(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "start_at", thrift.I64, 12) + offset += bthrift.Binary.WriteI64(buf[offset:], p.StartAt) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *Picture) fastWriteField13(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "end_at", thrift.I64, 13) + offset += bthrift.Binary.WriteI64(buf[offset:], p.EndAt) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *Picture) fastWriteField14(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "start_time", thrift.I64, 14) + offset += bthrift.Binary.WriteI64(buf[offset:], p.StartTime) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *Picture) fastWriteField15(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "end_time", thrift.I64, 15) + offset += bthrift.Binary.WriteI64(buf[offset:], p.EndTime) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *Picture) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("id", thrift.I64, 1) + l += bthrift.Binary.I64Length(p.Id) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *Picture) field2Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("user_id", thrift.I64, 2) + l += bthrift.Binary.I64Length(p.UserId) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *Picture) field3Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("url", thrift.STRING, 3) + l += bthrift.Binary.StringLengthNocopy(p.Url) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *Picture) field4Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("href", thrift.STRING, 4) + l += bthrift.Binary.StringLengthNocopy(p.Href) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *Picture) field5Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("text", thrift.STRING, 5) + l += bthrift.Binary.StringLengthNocopy(p.Text) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *Picture) field6Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("pic_type", thrift.I64, 6) + l += bthrift.Binary.I64Length(p.PicType) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *Picture) field7Length() int { + l := 0 + if p.IsSetShowTimes() { + l += bthrift.Binary.FieldBeginLength("show_times", thrift.I64, 7) + l += bthrift.Binary.I64Length(*p.ShowTimes) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *Picture) field8Length() int { + l := 0 + if p.IsSetPointTimes() { + l += bthrift.Binary.FieldBeginLength("point_times", thrift.I64, 8) + l += bthrift.Binary.I64Length(*p.PointTimes) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *Picture) field9Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("duration", thrift.I64, 9) + l += bthrift.Binary.I64Length(p.Duration) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *Picture) field10Length() int { + l := 0 + if p.IsSetSType() { + l += bthrift.Binary.FieldBeginLength("s_type", thrift.I64, 10) + l += bthrift.Binary.I64Length(*p.SType) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *Picture) field11Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("frequency", thrift.I64, 11) + l += bthrift.Binary.I64Length(p.Frequency) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *Picture) field12Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("start_at", thrift.I64, 12) + l += bthrift.Binary.I64Length(p.StartAt) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *Picture) field13Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("end_at", thrift.I64, 13) + l += bthrift.Binary.I64Length(p.EndAt) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *Picture) field14Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("start_time", thrift.I64, 14) + l += bthrift.Binary.I64Length(p.StartTime) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *Picture) field15Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("end_time", thrift.I64, 15) + l += bthrift.Binary.I64Length(p.EndTime) + + l += bthrift.Binary.FieldEndLength() + return l +} diff --git a/kitex_gen/model/model.go b/kitex_gen/model/model.go new file mode 100644 index 0000000..22e3149 --- /dev/null +++ b/kitex_gen/model/model.go @@ -0,0 +1,1549 @@ +// Code generated by thriftgo (0.3.13). DO NOT EDIT. + +package model + +import ( + "fmt" + "github.com/apache/thrift/lib/go/thrift" + "strings" +) + +type BaseResp struct { + Code int64 `thrift:"code,1" frugal:"1,default,i64" json:"code"` + Msg string `thrift:"msg,2" frugal:"2,default,string" json:"msg"` +} + +func NewBaseResp() *BaseResp { + return &BaseResp{} +} + +func (p *BaseResp) InitDefault() { +} + +func (p *BaseResp) GetCode() (v int64) { + return p.Code +} + +func (p *BaseResp) GetMsg() (v string) { + return p.Msg +} +func (p *BaseResp) SetCode(val int64) { + p.Code = val +} +func (p *BaseResp) SetMsg(val string) { + p.Msg = val +} + +var fieldIDToName_BaseResp = map[int16]string{ + 1: "code", + 2: "msg", +} + +func (p *BaseResp) 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.I64 { + 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_BaseResp[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 *BaseResp) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Code = _field + return nil +} +func (p *BaseResp) ReadField2(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Msg = _field + return nil +} + +func (p *BaseResp) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("BaseResp"); 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 *BaseResp) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("code", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(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 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *BaseResp) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("msg", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Msg); 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 *BaseResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BaseResp(%+v)", *p) + +} + +func (p *BaseResp) DeepEqual(ano *BaseResp) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Code) { + return false + } + if !p.Field2DeepEqual(ano.Msg) { + return false + } + return true +} + +func (p *BaseResp) Field1DeepEqual(src int64) bool { + + if p.Code != src { + return false + } + return true +} +func (p *BaseResp) Field2DeepEqual(src string) bool { + + if strings.Compare(p.Msg, src) != 0 { + return false + } + return true +} + +type User struct { + Id int64 `thrift:"id,1" frugal:"1,default,i64" json:"id"` + Account string `thrift:"account,2" frugal:"2,default,string" json:"account"` + Name string `thrift:"name,3" frugal:"3,default,string" json:"name"` +} + +func NewUser() *User { + return &User{} +} + +func (p *User) InitDefault() { +} + +func (p *User) GetId() (v int64) { + return p.Id +} + +func (p *User) GetAccount() (v string) { + return p.Account +} + +func (p *User) GetName() (v string) { + return p.Name +} +func (p *User) SetId(val int64) { + p.Id = val +} +func (p *User) SetAccount(val string) { + p.Account = val +} +func (p *User) SetName(val string) { + p.Name = val +} + +var fieldIDToName_User = map[int16]string{ + 1: "id", + 2: "account", + 3: "name", +} + +func (p *User) 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.I64 { + 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_User[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 *User) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Id = _field + return nil +} +func (p *User) 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 *User) ReadField3(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 *User) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("User"); 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 *User) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.Id); 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 *User) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("account", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Account); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *User) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 3); 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 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *User) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("User(%+v)", *p) + +} + +func (p *User) DeepEqual(ano *User) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Id) { + return false + } + if !p.Field2DeepEqual(ano.Account) { + return false + } + if !p.Field3DeepEqual(ano.Name) { + return false + } + return true +} + +func (p *User) Field1DeepEqual(src int64) bool { + + if p.Id != src { + return false + } + return true +} +func (p *User) Field2DeepEqual(src string) bool { + + if strings.Compare(p.Account, src) != 0 { + return false + } + return true +} +func (p *User) Field3DeepEqual(src string) bool { + + if strings.Compare(p.Name, src) != 0 { + return false + } + return true +} + +type Picture struct { + Id int64 `thrift:"id,1" frugal:"1,default,i64" json:"id"` + UserId int64 `thrift:"user_id,2" frugal:"2,default,i64" json:"user_id"` + Url string `thrift:"url,3" frugal:"3,default,string" json:"url"` + Href string `thrift:"href,4" frugal:"4,default,string" json:"href"` + Text string `thrift:"text,5" frugal:"5,default,string" json:"text"` + PicType int64 `thrift:"pic_type,6" frugal:"6,default,i64" json:"pic_type"` + ShowTimes *int64 `thrift:"show_times,7,optional" frugal:"7,optional,i64" json:"show_times,omitempty"` + PointTimes *int64 `thrift:"point_times,8,optional" frugal:"8,optional,i64" json:"point_times,omitempty"` + Duration int64 `thrift:"duration,9" frugal:"9,default,i64" json:"duration"` + SType *int64 `thrift:"s_type,10,optional" frugal:"10,optional,i64" json:"s_type,omitempty"` + Frequency int64 `thrift:"frequency,11" frugal:"11,default,i64" json:"frequency"` + StartAt int64 `thrift:"start_at,12" frugal:"12,default,i64" json:"start_at"` + EndAt int64 `thrift:"end_at,13" frugal:"13,default,i64" json:"end_at"` + StartTime int64 `thrift:"start_time,14" frugal:"14,default,i64" json:"start_time"` + EndTime int64 `thrift:"end_time,15" frugal:"15,default,i64" json:"end_time"` +} + +func NewPicture() *Picture { + return &Picture{} +} + +func (p *Picture) InitDefault() { +} + +func (p *Picture) GetId() (v int64) { + return p.Id +} + +func (p *Picture) GetUserId() (v int64) { + return p.UserId +} + +func (p *Picture) GetUrl() (v string) { + return p.Url +} + +func (p *Picture) GetHref() (v string) { + return p.Href +} + +func (p *Picture) GetText() (v string) { + return p.Text +} + +func (p *Picture) GetPicType() (v int64) { + return p.PicType +} + +var Picture_ShowTimes_DEFAULT int64 + +func (p *Picture) GetShowTimes() (v int64) { + if !p.IsSetShowTimes() { + return Picture_ShowTimes_DEFAULT + } + return *p.ShowTimes +} + +var Picture_PointTimes_DEFAULT int64 + +func (p *Picture) GetPointTimes() (v int64) { + if !p.IsSetPointTimes() { + return Picture_PointTimes_DEFAULT + } + return *p.PointTimes +} + +func (p *Picture) GetDuration() (v int64) { + return p.Duration +} + +var Picture_SType_DEFAULT int64 + +func (p *Picture) GetSType() (v int64) { + if !p.IsSetSType() { + return Picture_SType_DEFAULT + } + return *p.SType +} + +func (p *Picture) GetFrequency() (v int64) { + return p.Frequency +} + +func (p *Picture) GetStartAt() (v int64) { + return p.StartAt +} + +func (p *Picture) GetEndAt() (v int64) { + return p.EndAt +} + +func (p *Picture) GetStartTime() (v int64) { + return p.StartTime +} + +func (p *Picture) GetEndTime() (v int64) { + return p.EndTime +} +func (p *Picture) SetId(val int64) { + p.Id = val +} +func (p *Picture) SetUserId(val int64) { + p.UserId = val +} +func (p *Picture) SetUrl(val string) { + p.Url = val +} +func (p *Picture) SetHref(val string) { + p.Href = val +} +func (p *Picture) SetText(val string) { + p.Text = val +} +func (p *Picture) SetPicType(val int64) { + p.PicType = val +} +func (p *Picture) SetShowTimes(val *int64) { + p.ShowTimes = val +} +func (p *Picture) SetPointTimes(val *int64) { + p.PointTimes = val +} +func (p *Picture) SetDuration(val int64) { + p.Duration = val +} +func (p *Picture) SetSType(val *int64) { + p.SType = val +} +func (p *Picture) SetFrequency(val int64) { + p.Frequency = val +} +func (p *Picture) SetStartAt(val int64) { + p.StartAt = val +} +func (p *Picture) SetEndAt(val int64) { + p.EndAt = val +} +func (p *Picture) SetStartTime(val int64) { + p.StartTime = val +} +func (p *Picture) SetEndTime(val int64) { + p.EndTime = val +} + +var fieldIDToName_Picture = map[int16]string{ + 1: "id", + 2: "user_id", + 3: "url", + 4: "href", + 5: "text", + 6: "pic_type", + 7: "show_times", + 8: "point_times", + 9: "duration", + 10: "s_type", + 11: "frequency", + 12: "start_at", + 13: "end_at", + 14: "start_time", + 15: "end_time", +} + +func (p *Picture) IsSetShowTimes() bool { + return p.ShowTimes != nil +} + +func (p *Picture) IsSetPointTimes() bool { + return p.PointTimes != nil +} + +func (p *Picture) IsSetSType() bool { + return p.SType != nil +} + +func (p *Picture) 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.I64 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.I64 { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRING { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.STRING { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.I64 { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.I64 { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 8: + if fieldTypeId == thrift.I64 { + if err = p.ReadField8(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 9: + if fieldTypeId == thrift.I64 { + if err = p.ReadField9(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 10: + if fieldTypeId == thrift.I64 { + if err = p.ReadField10(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 11: + if fieldTypeId == thrift.I64 { + if err = p.ReadField11(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 12: + if fieldTypeId == thrift.I64 { + if err = p.ReadField12(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 13: + if fieldTypeId == thrift.I64 { + if err = p.ReadField13(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 14: + if fieldTypeId == thrift.I64 { + if err = p.ReadField14(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 15: + if fieldTypeId == thrift.I64 { + if err = p.ReadField15(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_Picture[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 *Picture) ReadField1(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Id = _field + return nil +} +func (p *Picture) ReadField2(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.UserId = _field + return nil +} +func (p *Picture) 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 *Picture) ReadField4(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Href = _field + return nil +} +func (p *Picture) ReadField5(iprot thrift.TProtocol) error { + + var _field string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = v + } + p.Text = _field + return nil +} +func (p *Picture) ReadField6(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.PicType = _field + return nil +} +func (p *Picture) ReadField7(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.ShowTimes = _field + return nil +} +func (p *Picture) ReadField8(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.PointTimes = _field + return nil +} +func (p *Picture) ReadField9(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Duration = _field + return nil +} +func (p *Picture) ReadField10(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.SType = _field + return nil +} +func (p *Picture) ReadField11(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.Frequency = _field + return nil +} +func (p *Picture) ReadField12(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.StartAt = _field + return nil +} +func (p *Picture) ReadField13(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.EndAt = _field + return nil +} +func (p *Picture) ReadField14(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.StartTime = _field + return nil +} +func (p *Picture) ReadField15(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.EndTime = _field + return nil +} + +func (p *Picture) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Picture"); 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 = p.writeField8(oprot); err != nil { + fieldId = 8 + goto WriteFieldError + } + if err = p.writeField9(oprot); err != nil { + fieldId = 9 + goto WriteFieldError + } + if err = p.writeField10(oprot); err != nil { + fieldId = 10 + goto WriteFieldError + } + if err = p.writeField11(oprot); err != nil { + fieldId = 11 + goto WriteFieldError + } + if err = p.writeField12(oprot); err != nil { + fieldId = 12 + goto WriteFieldError + } + if err = p.writeField13(oprot); err != nil { + fieldId = 13 + goto WriteFieldError + } + if err = p.writeField14(oprot); err != nil { + fieldId = 14 + goto WriteFieldError + } + if err = p.writeField15(oprot); err != nil { + fieldId = 15 + 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 *Picture) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("id", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.Id); 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 *Picture) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("user_id", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.UserId); 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 *Picture) 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 *Picture) writeField4(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("href", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Href); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *Picture) writeField5(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("text", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Text); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *Picture) writeField6(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("pic_type", thrift.I64, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.PicType); 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 *Picture) writeField7(oprot thrift.TProtocol) (err error) { + if p.IsSetShowTimes() { + if err = oprot.WriteFieldBegin("show_times", thrift.I64, 7); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.ShowTimes); 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 *Picture) writeField8(oprot thrift.TProtocol) (err error) { + if p.IsSetPointTimes() { + if err = oprot.WriteFieldBegin("point_times", thrift.I64, 8); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.PointTimes); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) +} + +func (p *Picture) writeField9(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("duration", thrift.I64, 9); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.Duration); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) +} + +func (p *Picture) writeField10(oprot thrift.TProtocol) (err error) { + if p.IsSetSType() { + if err = oprot.WriteFieldBegin("s_type", thrift.I64, 10); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.SType); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) +} + +func (p *Picture) writeField11(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("frequency", thrift.I64, 11); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.Frequency); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) +} + +func (p *Picture) writeField12(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("start_at", thrift.I64, 12); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.StartAt); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) +} + +func (p *Picture) writeField13(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("end_at", thrift.I64, 13); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.EndAt); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 13 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 13 end error: ", p), err) +} + +func (p *Picture) writeField14(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("start_time", thrift.I64, 14); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.StartTime); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 14 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 14 end error: ", p), err) +} + +func (p *Picture) writeField15(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("end_time", thrift.I64, 15); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.EndTime); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 15 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 15 end error: ", p), err) +} + +func (p *Picture) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Picture(%+v)", *p) + +} + +func (p *Picture) DeepEqual(ano *Picture) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Id) { + return false + } + if !p.Field2DeepEqual(ano.UserId) { + return false + } + if !p.Field3DeepEqual(ano.Url) { + return false + } + if !p.Field4DeepEqual(ano.Href) { + return false + } + if !p.Field5DeepEqual(ano.Text) { + return false + } + if !p.Field6DeepEqual(ano.PicType) { + return false + } + if !p.Field7DeepEqual(ano.ShowTimes) { + return false + } + if !p.Field8DeepEqual(ano.PointTimes) { + return false + } + if !p.Field9DeepEqual(ano.Duration) { + return false + } + if !p.Field10DeepEqual(ano.SType) { + return false + } + if !p.Field11DeepEqual(ano.Frequency) { + return false + } + if !p.Field12DeepEqual(ano.StartAt) { + return false + } + if !p.Field13DeepEqual(ano.EndAt) { + return false + } + if !p.Field14DeepEqual(ano.StartTime) { + return false + } + if !p.Field15DeepEqual(ano.EndTime) { + return false + } + return true +} + +func (p *Picture) Field1DeepEqual(src int64) bool { + + if p.Id != src { + return false + } + return true +} +func (p *Picture) Field2DeepEqual(src int64) bool { + + if p.UserId != src { + return false + } + return true +} +func (p *Picture) Field3DeepEqual(src string) bool { + + if strings.Compare(p.Url, src) != 0 { + return false + } + return true +} +func (p *Picture) Field4DeepEqual(src string) bool { + + if strings.Compare(p.Href, src) != 0 { + return false + } + return true +} +func (p *Picture) Field5DeepEqual(src string) bool { + + if strings.Compare(p.Text, src) != 0 { + return false + } + return true +} +func (p *Picture) Field6DeepEqual(src int64) bool { + + if p.PicType != src { + return false + } + return true +} +func (p *Picture) Field7DeepEqual(src *int64) bool { + + if p.ShowTimes == src { + return true + } else if p.ShowTimes == nil || src == nil { + return false + } + if *p.ShowTimes != *src { + return false + } + return true +} +func (p *Picture) Field8DeepEqual(src *int64) bool { + + if p.PointTimes == src { + return true + } else if p.PointTimes == nil || src == nil { + return false + } + if *p.PointTimes != *src { + return false + } + return true +} +func (p *Picture) Field9DeepEqual(src int64) bool { + + if p.Duration != src { + return false + } + return true +} +func (p *Picture) Field10DeepEqual(src *int64) bool { + + if p.SType == src { + return true + } else if p.SType == nil || src == nil { + return false + } + if *p.SType != *src { + return false + } + return true +} +func (p *Picture) Field11DeepEqual(src int64) bool { + + if p.Frequency != src { + return false + } + return true +} +func (p *Picture) Field12DeepEqual(src int64) bool { + + if p.StartAt != src { + return false + } + return true +} +func (p *Picture) Field13DeepEqual(src int64) bool { + + if p.EndAt != src { + return false + } + return true +} +func (p *Picture) Field14DeepEqual(src int64) bool { + + if p.StartTime != src { + return false + } + return true +} +func (p *Picture) Field15DeepEqual(src int64) bool { + + if p.EndTime != src { + return false + } + return true +} diff --git a/kitex_gen/user/k-consts.go b/kitex_gen/user/k-consts.go new file mode 100644 index 0000000..b774a40 --- /dev/null +++ b/kitex_gen/user/k-consts.go @@ -0,0 +1,4 @@ +package user + +// KitexUnusedProtection is used to prevent 'imported and not used' error. +var KitexUnusedProtection = struct{}{} diff --git a/kitex_gen/user/k-user.go b/kitex_gen/user/k-user.go new file mode 100644 index 0000000..6ea61a2 --- /dev/null +++ b/kitex_gen/user/k-user.go @@ -0,0 +1,1341 @@ +// Code generated by Kitex v0.9.1. DO NOT EDIT. + +package user + +import ( + "bytes" + "fmt" + "reflect" + "strings" + + "github.com/apache/thrift/lib/go/thrift" + + "github.com/cloudwego/kitex/pkg/protocol/bthrift" + + "github.com/west2-online/fzuhelper-server/kitex_gen/model" +) + +// unused protection +var ( + _ = fmt.Formatter(nil) + _ = (*bytes.Buffer)(nil) + _ = (*strings.Builder)(nil) + _ = reflect.Type(nil) + _ = thrift.TProtocol(nil) + _ = bthrift.BinaryWriter(nil) + _ = model.KitexUnusedProtection +) + +func (p *RegisterRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + var issetAccount bool = false + var issetName bool = false + var issetPassword bool = false + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 + } + issetAccount = true + } else { + l, err = bthrift.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 + } + issetName = true + } else { + l, err = bthrift.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 + } + issetPassword = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + if !issetAccount { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetName { + fieldId = 2 + goto RequiredFieldNotSetError + } + + if !issetPassword { + fieldId = 3 + goto RequiredFieldNotSetError + } + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_RegisterRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_RegisterRequest[fieldId])) +} + +func (p *RegisterRequest) FastReadField1(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Account = v + + } + return offset, nil +} + +func (p *RegisterRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Name = v + + } + return offset, nil +} + +func (p *RegisterRequest) FastReadField3(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Password = v + + } + return offset, nil +} + +// for compatibility +func (p *RegisterRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *RegisterRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "RegisterRequest") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField3(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *RegisterRequest) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("RegisterRequest") + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *RegisterRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "account", thrift.STRING, 1) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Account) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *RegisterRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "name", thrift.STRING, 2) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Name) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *RegisterRequest) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "password", thrift.STRING, 3) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Password) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *RegisterRequest) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("account", thrift.STRING, 1) + l += bthrift.Binary.StringLengthNocopy(p.Account) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *RegisterRequest) field2Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("name", thrift.STRING, 2) + l += bthrift.Binary.StringLengthNocopy(p.Name) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *RegisterRequest) field3Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("password", thrift.STRING, 3) + l += bthrift.Binary.StringLengthNocopy(p.Password) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *RegisterResponse) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_RegisterResponse[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *RegisterResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := model.NewBaseResp() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = tmp + return offset, nil +} + +func (p *RegisterResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.UserId = &v + + } + return offset, nil +} + +// for compatibility +func (p *RegisterResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *RegisterResponse) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "RegisterResponse") + if p != nil { + offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField1(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *RegisterResponse) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("RegisterResponse") + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *RegisterResponse) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "base", thrift.STRUCT, 1) + offset += p.Base.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *RegisterResponse) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetUserId() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "user_id", thrift.I64, 2) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.UserId) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *RegisterResponse) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("base", thrift.STRUCT, 1) + l += p.Base.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *RegisterResponse) field2Length() int { + l := 0 + if p.IsSetUserId() { + l += bthrift.Binary.FieldBeginLength("user_id", thrift.I64, 2) + l += bthrift.Binary.I64Length(*p.UserId) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *LoginRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LoginRequest) FastReadField1(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Account = v + + } + return offset, nil +} + +func (p *LoginRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Password = v + + } + return offset, nil +} + +// for compatibility +func (p *LoginRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *LoginRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "LoginRequest") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *LoginRequest) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("LoginRequest") + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *LoginRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "account", thrift.STRING, 1) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Account) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *LoginRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "password", thrift.STRING, 2) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Password) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *LoginRequest) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("account", thrift.STRING, 1) + l += bthrift.Binary.StringLengthNocopy(p.Account) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *LoginRequest) field2Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("password", thrift.STRING, 2) + l += bthrift.Binary.StringLengthNocopy(p.Password) + + l += bthrift.Binary.FieldEndLength() + 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 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *LoginResponse) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := model.NewBaseResp() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Base = tmp + return offset, nil +} + +func (p *LoginResponse) FastReadField2(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Token = &v + + } + return offset, nil +} + +// for compatibility +func (p *LoginResponse) FastWrite(buf []byte) int { + return 0 +} + +func (p *LoginResponse) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "LoginResponse") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *LoginResponse) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("LoginResponse") + if p != nil { + l += p.field1Length() + l += p.field2Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *LoginResponse) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "base", thrift.STRUCT, 1) + offset += p.Base.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *LoginResponse) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetToken() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "token", thrift.STRING, 2) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Token) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *LoginResponse) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("base", thrift.STRUCT, 1) + l += p.Base.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *LoginResponse) field2Length() int { + l := 0 + if p.IsSetToken() { + l += bthrift.Binary.FieldBeginLength("token", thrift.STRING, 2) + l += bthrift.Binary.StringLengthNocopy(*p.Token) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *UserServiceLoginArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_UserServiceLoginArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *UserServiceLoginArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := NewLoginRequest() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = tmp + return offset, nil +} + +// for compatibility +func (p *UserServiceLoginArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *UserServiceLoginArgs) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "Login_args") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *UserServiceLoginArgs) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("Login_args") + if p != nil { + l += p.field1Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *UserServiceLoginArgs) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "req", thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *UserServiceLoginArgs) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("req", thrift.STRUCT, 1) + l += p.Req.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *UserServiceLoginResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_UserServiceLoginResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *UserServiceLoginResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + + tmp := NewLoginResponse() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = tmp + return offset, nil +} + +// for compatibility +func (p *UserServiceLoginResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *UserServiceLoginResult) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "Login_result") + if p != nil { + offset += p.fastWriteField0(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *UserServiceLoginResult) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("Login_result") + if p != nil { + l += p.field0Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *UserServiceLoginResult) fastWriteField0(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "success", thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *UserServiceLoginResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += bthrift.Binary.FieldBeginLength("success", thrift.STRUCT, 0) + l += p.Success.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *UserServiceRegisterArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_UserServiceRegisterArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *UserServiceRegisterArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := NewRegisterRequest() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Req = tmp + return offset, nil +} + +// for compatibility +func (p *UserServiceRegisterArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *UserServiceRegisterArgs) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "Register_args") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *UserServiceRegisterArgs) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("Register_args") + if p != nil { + l += p.field1Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *UserServiceRegisterArgs) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "req", thrift.STRUCT, 1) + offset += p.Req.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *UserServiceRegisterArgs) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("req", thrift.STRUCT, 1) + l += p.Req.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *UserServiceRegisterResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.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 = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +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_UserServiceRegisterResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *UserServiceRegisterResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + + tmp := NewRegisterResponse() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = tmp + return offset, nil +} + +// for compatibility +func (p *UserServiceRegisterResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *UserServiceRegisterResult) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "Register_result") + if p != nil { + offset += p.fastWriteField0(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *UserServiceRegisterResult) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("Register_result") + if p != nil { + l += p.field0Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *UserServiceRegisterResult) fastWriteField0(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "success", thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *UserServiceRegisterResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += bthrift.Binary.FieldBeginLength("success", thrift.STRUCT, 0) + l += p.Success.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *UserServiceLoginArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *UserServiceLoginResult) GetResult() interface{} { + return p.Success +} + +func (p *UserServiceRegisterArgs) GetFirstArgument() interface{} { + return p.Req +} + +func (p *UserServiceRegisterResult) GetResult() interface{} { + return p.Success +} diff --git a/kitex_gen/user/user.go b/kitex_gen/user/user.go new file mode 100644 index 0000000..93117da --- /dev/null +++ b/kitex_gen/user/user.go @@ -0,0 +1,1893 @@ +// Code generated by thriftgo (0.3.13). DO NOT EDIT. + +package user + +import ( + "context" + "fmt" + "github.com/apache/thrift/lib/go/thrift" + "github.com/west2-online/fzuhelper-server/kitex_gen/model" + "strings" +) + +type RegisterRequest struct { + Account string `thrift:"account,1,required" frugal:"1,required,string" json:"account"` + Name string `thrift:"name,2,required" frugal:"2,required,string" json:"name"` + Password string `thrift:"password,3,required" frugal:"3,required,string" json:"password"` +} + +func NewRegisterRequest() *RegisterRequest { + return &RegisterRequest{} +} + +func (p *RegisterRequest) InitDefault() { +} + +func (p *RegisterRequest) GetAccount() (v string) { + return p.Account +} + +func (p *RegisterRequest) GetName() (v string) { + return p.Name +} + +func (p *RegisterRequest) GetPassword() (v string) { + return p.Password +} +func (p *RegisterRequest) SetAccount(val string) { + p.Account = val +} +func (p *RegisterRequest) SetName(val string) { + p.Name = val +} +func (p *RegisterRequest) SetPassword(val string) { + p.Password = val +} + +var fieldIDToName_RegisterRequest = map[int16]string{ + 1: "account", + 2: "name", + 3: "password", +} + +func (p *RegisterRequest) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetAccount bool = false + var issetName 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 + } + issetAccount = 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 + } + issetName = 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 + } + 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 !issetAccount { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetName { + fieldId = 2 + goto RequiredFieldNotSetError + } + + if !issetPassword { + 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_RegisterRequest[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_RegisterRequest[fieldId])) +} + +func (p *RegisterRequest) 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 *RegisterRequest) ReadField2(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 *RegisterRequest) ReadField3(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 *RegisterRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("RegisterRequest"); 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 *RegisterRequest) writeField1(oprot thrift.TProtocol) (err error) { + 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 *RegisterRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("name", thrift.STRING, 2); 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 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *RegisterRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("password", thrift.STRING, 3); 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 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *RegisterRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RegisterRequest(%+v)", *p) + +} + +func (p *RegisterRequest) DeepEqual(ano *RegisterRequest) 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.Name) { + return false + } + if !p.Field3DeepEqual(ano.Password) { + return false + } + return true +} + +func (p *RegisterRequest) Field1DeepEqual(src string) bool { + + if strings.Compare(p.Account, src) != 0 { + return false + } + return true +} +func (p *RegisterRequest) Field2DeepEqual(src string) bool { + + if strings.Compare(p.Name, src) != 0 { + return false + } + return true +} +func (p *RegisterRequest) Field3DeepEqual(src string) bool { + + if strings.Compare(p.Password, src) != 0 { + return false + } + return true +} + +type RegisterResponse struct { + Base *model.BaseResp `thrift:"base,1" frugal:"1,default,model.BaseResp" json:"base"` + UserId *int64 `thrift:"user_id,2,optional" frugal:"2,optional,i64" json:"user_id,omitempty"` +} + +func NewRegisterResponse() *RegisterResponse { + return &RegisterResponse{} +} + +func (p *RegisterResponse) InitDefault() { +} + +var RegisterResponse_Base_DEFAULT *model.BaseResp + +func (p *RegisterResponse) GetBase() (v *model.BaseResp) { + if !p.IsSetBase() { + return RegisterResponse_Base_DEFAULT + } + return p.Base +} + +var RegisterResponse_UserId_DEFAULT int64 + +func (p *RegisterResponse) GetUserId() (v int64) { + if !p.IsSetUserId() { + return RegisterResponse_UserId_DEFAULT + } + return *p.UserId +} +func (p *RegisterResponse) SetBase(val *model.BaseResp) { + p.Base = val +} +func (p *RegisterResponse) SetUserId(val *int64) { + p.UserId = val +} + +var fieldIDToName_RegisterResponse = map[int16]string{ + 1: "base", + 2: "user_id", +} + +func (p *RegisterResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *RegisterResponse) IsSetUserId() bool { + return p.UserId != nil +} + +func (p *RegisterResponse) 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.I64 { + 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_RegisterResponse[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 *RegisterResponse) ReadField1(iprot thrift.TProtocol) error { + _field := model.NewBaseResp() + if err := _field.Read(iprot); err != nil { + return err + } + p.Base = _field + return nil +} +func (p *RegisterResponse) ReadField2(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.UserId = _field + return nil +} + +func (p *RegisterResponse) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("RegisterResponse"); 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 *RegisterResponse) 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 *RegisterResponse) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetUserId() { + if err = oprot.WriteFieldBegin("user_id", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.UserId); 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 *RegisterResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RegisterResponse(%+v)", *p) + +} + +func (p *RegisterResponse) DeepEqual(ano *RegisterResponse) 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.UserId) { + return false + } + return true +} + +func (p *RegisterResponse) Field1DeepEqual(src *model.BaseResp) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} +func (p *RegisterResponse) Field2DeepEqual(src *int64) bool { + + if p.UserId == src { + return true + } else if p.UserId == nil || src == nil { + return false + } + if *p.UserId != *src { + return false + } + return true +} + +type LoginRequest struct { + Account string `thrift:"account,1" frugal:"1,default,string" json:"account"` + Password string `thrift:"password,2" frugal:"2,default,string" json:"password"` +} + +func NewLoginRequest() *LoginRequest { + return &LoginRequest{} +} + +func (p *LoginRequest) InitDefault() { +} + +func (p *LoginRequest) GetAccount() (v string) { + return p.Account +} + +func (p *LoginRequest) GetPassword() (v string) { + return p.Password +} +func (p *LoginRequest) SetAccount(val string) { + p.Account = val +} +func (p *LoginRequest) SetPassword(val string) { + p.Password = val +} + +var fieldIDToName_LoginRequest = map[int16]string{ + 1: "account", + 2: "password", +} + +func (p *LoginRequest) 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 + } + 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_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) +} + +func (p *LoginRequest) 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 *LoginRequest) ReadField2(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 = 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 *LoginRequest) writeField1(oprot thrift.TProtocol) (err error) { + 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 *LoginRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("password", thrift.STRING, 2); 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 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 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.Account) { + return false + } + if !p.Field2DeepEqual(ano.Password) { + return false + } + return true +} + +func (p *LoginRequest) Field1DeepEqual(src string) bool { + + if strings.Compare(p.Account, src) != 0 { + return false + } + return true +} +func (p *LoginRequest) Field2DeepEqual(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"` + Token *string `thrift:"token,2,optional" frugal:"2,optional,string" json:"token,omitempty"` +} + +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 +} + +var LoginResponse_Token_DEFAULT string + +func (p *LoginResponse) GetToken() (v string) { + if !p.IsSetToken() { + return LoginResponse_Token_DEFAULT + } + return *p.Token +} +func (p *LoginResponse) SetBase(val *model.BaseResp) { + p.Base = val +} +func (p *LoginResponse) SetToken(val *string) { + p.Token = val +} + +var fieldIDToName_LoginResponse = map[int16]string{ + 1: "base", + 2: "token", +} + +func (p *LoginResponse) IsSetBase() bool { + return p.Base != nil +} + +func (p *LoginResponse) IsSetToken() bool { + return p.Token != 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 + } + 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_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) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Token = _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 = 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 *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) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetToken() { + if err = oprot.WriteFieldBegin("token", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Token); 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 *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 + } + if !p.Field2DeepEqual(ano.Token) { + return false + } + return true +} + +func (p *LoginResponse) Field1DeepEqual(src *model.BaseResp) bool { + + if !p.Base.DeepEqual(src) { + return false + } + return true +} +func (p *LoginResponse) Field2DeepEqual(src *string) bool { + + if p.Token == src { + return true + } else if p.Token == nil || src == nil { + return false + } + if strings.Compare(*p.Token, *src) != 0 { + return false + } + return true +} + +type UserService interface { + Login(ctx context.Context, req *LoginRequest) (r *LoginResponse, err error) + + Register(ctx context.Context, req *RegisterRequest) (r *RegisterResponse, err error) +} + +type UserServiceClient struct { + c thrift.TClient +} + +func NewUserServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *UserServiceClient { + return &UserServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewUserServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *UserServiceClient { + return &UserServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewUserServiceClient(c thrift.TClient) *UserServiceClient { + return &UserServiceClient{ + c: c, + } +} + +func (p *UserServiceClient) Client_() thrift.TClient { + return p.c +} + +func (p *UserServiceClient) Login(ctx context.Context, req *LoginRequest) (r *LoginResponse, err error) { + var _args UserServiceLoginArgs + _args.Req = req + var _result UserServiceLoginResult + if err = p.Client_().Call(ctx, "Login", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} +func (p *UserServiceClient) Register(ctx context.Context, req *RegisterRequest) (r *RegisterResponse, err error) { + var _args UserServiceRegisterArgs + _args.Req = req + var _result UserServiceRegisterResult + if err = p.Client_().Call(ctx, "Register", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +type UserServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler UserService +} + +func (p *UserServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *UserServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *UserServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewUserServiceProcessor(handler UserService) *UserServiceProcessor { + self := &UserServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self.AddToProcessorMap("Login", &userServiceProcessorLogin{handler: handler}) + self.AddToProcessorMap("Register", &userServiceProcessorRegister{handler: handler}) + return self +} +func (p *UserServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + name, _, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return false, err + } + 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 userServiceProcessorLogin struct { + handler UserService +} + +func (p *userServiceProcessorLogin) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := UserServiceLoginArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("Login", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := UserServiceLoginResult{} + var retval *LoginResponse + if retval, err2 = p.handler.Login(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing Login: "+err2.Error()) + oprot.WriteMessageBegin("Login", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("Login", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type userServiceProcessorRegister struct { + handler UserService +} + +func (p *userServiceProcessorRegister) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := UserServiceRegisterArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("Register", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := UserServiceRegisterResult{} + var retval *RegisterResponse + if retval, err2 = p.handler.Register(ctx, args.Req); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing Register: "+err2.Error()) + oprot.WriteMessageBegin("Register", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("Register", 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 UserServiceLoginArgs struct { + Req *LoginRequest `thrift:"req,1" frugal:"1,default,LoginRequest" json:"req"` +} + +func NewUserServiceLoginArgs() *UserServiceLoginArgs { + return &UserServiceLoginArgs{} +} + +func (p *UserServiceLoginArgs) InitDefault() { +} + +var UserServiceLoginArgs_Req_DEFAULT *LoginRequest + +func (p *UserServiceLoginArgs) GetReq() (v *LoginRequest) { + if !p.IsSetReq() { + return UserServiceLoginArgs_Req_DEFAULT + } + return p.Req +} +func (p *UserServiceLoginArgs) SetReq(val *LoginRequest) { + p.Req = val +} + +var fieldIDToName_UserServiceLoginArgs = map[int16]string{ + 1: "req", +} + +func (p *UserServiceLoginArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *UserServiceLoginArgs) 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_UserServiceLoginArgs[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 *UserServiceLoginArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewLoginRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *UserServiceLoginArgs) 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 *UserServiceLoginArgs) 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 *UserServiceLoginArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UserServiceLoginArgs(%+v)", *p) + +} + +func (p *UserServiceLoginArgs) DeepEqual(ano *UserServiceLoginArgs) 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 *UserServiceLoginArgs) Field1DeepEqual(src *LoginRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type UserServiceLoginResult struct { + Success *LoginResponse `thrift:"success,0,optional" frugal:"0,optional,LoginResponse" json:"success,omitempty"` +} + +func NewUserServiceLoginResult() *UserServiceLoginResult { + return &UserServiceLoginResult{} +} + +func (p *UserServiceLoginResult) InitDefault() { +} + +var UserServiceLoginResult_Success_DEFAULT *LoginResponse + +func (p *UserServiceLoginResult) GetSuccess() (v *LoginResponse) { + if !p.IsSetSuccess() { + return UserServiceLoginResult_Success_DEFAULT + } + return p.Success +} +func (p *UserServiceLoginResult) SetSuccess(x interface{}) { + p.Success = x.(*LoginResponse) +} + +var fieldIDToName_UserServiceLoginResult = map[int16]string{ + 0: "success", +} + +func (p *UserServiceLoginResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *UserServiceLoginResult) 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_UserServiceLoginResult[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 *UserServiceLoginResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewLoginResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *UserServiceLoginResult) 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 *UserServiceLoginResult) 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 *UserServiceLoginResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UserServiceLoginResult(%+v)", *p) + +} + +func (p *UserServiceLoginResult) DeepEqual(ano *UserServiceLoginResult) 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 *UserServiceLoginResult) Field0DeepEqual(src *LoginResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type UserServiceRegisterArgs struct { + Req *RegisterRequest `thrift:"req,1" frugal:"1,default,RegisterRequest" json:"req"` +} + +func NewUserServiceRegisterArgs() *UserServiceRegisterArgs { + return &UserServiceRegisterArgs{} +} + +func (p *UserServiceRegisterArgs) InitDefault() { +} + +var UserServiceRegisterArgs_Req_DEFAULT *RegisterRequest + +func (p *UserServiceRegisterArgs) GetReq() (v *RegisterRequest) { + if !p.IsSetReq() { + return UserServiceRegisterArgs_Req_DEFAULT + } + return p.Req +} +func (p *UserServiceRegisterArgs) SetReq(val *RegisterRequest) { + p.Req = val +} + +var fieldIDToName_UserServiceRegisterArgs = map[int16]string{ + 1: "req", +} + +func (p *UserServiceRegisterArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *UserServiceRegisterArgs) 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_UserServiceRegisterArgs[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 *UserServiceRegisterArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewRegisterRequest() + if err := _field.Read(iprot); err != nil { + return err + } + p.Req = _field + return nil +} + +func (p *UserServiceRegisterArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Register_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 *UserServiceRegisterArgs) 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 *UserServiceRegisterArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UserServiceRegisterArgs(%+v)", *p) + +} + +func (p *UserServiceRegisterArgs) DeepEqual(ano *UserServiceRegisterArgs) 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 *UserServiceRegisterArgs) Field1DeepEqual(src *RegisterRequest) bool { + + if !p.Req.DeepEqual(src) { + return false + } + return true +} + +type UserServiceRegisterResult struct { + Success *RegisterResponse `thrift:"success,0,optional" frugal:"0,optional,RegisterResponse" json:"success,omitempty"` +} + +func NewUserServiceRegisterResult() *UserServiceRegisterResult { + return &UserServiceRegisterResult{} +} + +func (p *UserServiceRegisterResult) InitDefault() { +} + +var UserServiceRegisterResult_Success_DEFAULT *RegisterResponse + +func (p *UserServiceRegisterResult) GetSuccess() (v *RegisterResponse) { + if !p.IsSetSuccess() { + return UserServiceRegisterResult_Success_DEFAULT + } + return p.Success +} +func (p *UserServiceRegisterResult) SetSuccess(x interface{}) { + p.Success = x.(*RegisterResponse) +} + +var fieldIDToName_UserServiceRegisterResult = map[int16]string{ + 0: "success", +} + +func (p *UserServiceRegisterResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *UserServiceRegisterResult) 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_UserServiceRegisterResult[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 *UserServiceRegisterResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewRegisterResponse() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *UserServiceRegisterResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("Register_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 *UserServiceRegisterResult) 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 *UserServiceRegisterResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UserServiceRegisterResult(%+v)", *p) + +} + +func (p *UserServiceRegisterResult) DeepEqual(ano *UserServiceRegisterResult) 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 *UserServiceRegisterResult) Field0DeepEqual(src *RegisterResponse) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} diff --git a/kitex_gen/user/userservice/client.go b/kitex_gen/user/userservice/client.go new file mode 100644 index 0000000..968891e --- /dev/null +++ b/kitex_gen/user/userservice/client.go @@ -0,0 +1,55 @@ +// Code generated by Kitex v0.9.1. DO NOT EDIT. + +package userservice + +import ( + "context" + client "github.com/cloudwego/kitex/client" + callopt "github.com/cloudwego/kitex/client/callopt" + user "github.com/west2-online/fzuhelper-server/kitex_gen/user" +) + +// Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework. +type Client interface { + Login(ctx context.Context, req *user.LoginRequest, callOptions ...callopt.Option) (r *user.LoginResponse, err error) + Register(ctx context.Context, req *user.RegisterRequest, callOptions ...callopt.Option) (r *user.RegisterResponse, 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 &kUserServiceClient{ + 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 kUserServiceClient struct { + *kClient +} + +func (p *kUserServiceClient) Login(ctx context.Context, req *user.LoginRequest, callOptions ...callopt.Option) (r *user.LoginResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.Login(ctx, req) +} + +func (p *kUserServiceClient) Register(ctx context.Context, req *user.RegisterRequest, callOptions ...callopt.Option) (r *user.RegisterResponse, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.Register(ctx, req) +} diff --git a/kitex_gen/user/userservice/invoker.go b/kitex_gen/user/userservice/invoker.go new file mode 100644 index 0000000..dfac5e2 --- /dev/null +++ b/kitex_gen/user/userservice/invoker.go @@ -0,0 +1,24 @@ +// Code generated by Kitex v0.9.1. DO NOT EDIT. + +package userservice + +import ( + server "github.com/cloudwego/kitex/server" + user "github.com/west2-online/fzuhelper-server/kitex_gen/user" +) + +// NewInvoker creates a server.Invoker with the given handler and options. +func NewInvoker(handler user.UserService, opts ...server.Option) server.Invoker { + var options []server.Option + + options = append(options, opts...) + + s := server.NewInvoker(options...) + if err := s.RegisterService(serviceInfo(), handler); err != nil { + panic(err) + } + if err := s.Init(); err != nil { + panic(err) + } + return s +} diff --git a/kitex_gen/user/userservice/server.go b/kitex_gen/user/userservice/server.go new file mode 100644 index 0000000..3cb06d5 --- /dev/null +++ b/kitex_gen/user/userservice/server.go @@ -0,0 +1,25 @@ +// Code generated by Kitex v0.9.1. DO NOT EDIT. +package userservice + +import ( + server "github.com/cloudwego/kitex/server" + user "github.com/west2-online/fzuhelper-server/kitex_gen/user" +) + +// NewServer creates a server.Server with the given handler and options. +func NewServer(handler user.UserService, 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 user.UserService, opts ...server.RegisterOption) error { + return svr.RegisterService(serviceInfo(), handler, opts...) +} diff --git a/kitex_gen/user/userservice/userservice.go b/kitex_gen/user/userservice/userservice.go new file mode 100644 index 0000000..dc733e3 --- /dev/null +++ b/kitex_gen/user/userservice/userservice.go @@ -0,0 +1,160 @@ +// Code generated by Kitex v0.9.1. DO NOT EDIT. + +package userservice + +import ( + "context" + "errors" + client "github.com/cloudwego/kitex/client" + kitex "github.com/cloudwego/kitex/pkg/serviceinfo" + user "github.com/west2-online/fzuhelper-server/kitex_gen/user" +) + +var errInvalidMessageType = errors.New("invalid message type for service method handler") + +var serviceMethods = map[string]kitex.MethodInfo{ + "Login": kitex.NewMethodInfo( + loginHandler, + newUserServiceLoginArgs, + newUserServiceLoginResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), + "Register": kitex.NewMethodInfo( + registerHandler, + newUserServiceRegisterArgs, + newUserServiceRegisterResult, + false, + kitex.WithStreamingMode(kitex.StreamingNone), + ), +} + +var ( + userServiceServiceInfo = NewServiceInfo() + userServiceServiceInfoForClient = NewServiceInfoForClient() + userServiceServiceInfoForStreamClient = NewServiceInfoForStreamClient() +) + +// for server +func serviceInfo() *kitex.ServiceInfo { + return userServiceServiceInfo +} + +// for client +func serviceInfoForStreamClient() *kitex.ServiceInfo { + return userServiceServiceInfoForStreamClient +} + +// for stream client +func serviceInfoForClient() *kitex.ServiceInfo { + return userServiceServiceInfoForClient +} + +// 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 := "UserService" + handlerType := (*user.UserService)(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": "user", + } + if hasStreaming { + extra["streaming"] = hasStreaming + } + svcInfo := &kitex.ServiceInfo{ + ServiceName: serviceName, + HandlerType: handlerType, + Methods: methods, + PayloadCodec: kitex.Thrift, + KiteXGenVersion: "v0.9.1", + Extra: extra, + } + return svcInfo +} + +func loginHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*user.UserServiceLoginArgs) + realResult := result.(*user.UserServiceLoginResult) + success, err := handler.(user.UserService).Login(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newUserServiceLoginArgs() interface{} { + return user.NewUserServiceLoginArgs() +} + +func newUserServiceLoginResult() interface{} { + return user.NewUserServiceLoginResult() +} + +func registerHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*user.UserServiceRegisterArgs) + realResult := result.(*user.UserServiceRegisterResult) + success, err := handler.(user.UserService).Register(ctx, realArg.Req) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newUserServiceRegisterArgs() interface{} { + return user.NewUserServiceRegisterArgs() +} + +func newUserServiceRegisterResult() interface{} { + return user.NewUserServiceRegisterResult() +} + +type kClient struct { + c client.Client +} + +func newServiceClient(c client.Client) *kClient { + return &kClient{ + c: c, + } +} + +func (p *kClient) Login(ctx context.Context, req *user.LoginRequest) (r *user.LoginResponse, err error) { + var _args user.UserServiceLoginArgs + _args.Req = req + var _result user.UserServiceLoginResult + if err = p.c.Call(ctx, "Login", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + +func (p *kClient) Register(ctx context.Context, req *user.RegisterRequest) (r *user.RegisterResponse, err error) { + var _args user.UserServiceRegisterArgs + _args.Req = req + var _result user.UserServiceRegisterResult + if err = p.c.Call(ctx, "Register", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} diff --git a/pkg/constants/constants.go b/pkg/constants/constants.go index 01eb205..93d93b1 100644 --- a/pkg/constants/constants.go +++ b/pkg/constants/constants.go @@ -13,12 +13,16 @@ const ( ConnectTimeout = 50 * time.Millisecond // service name - TemplateServiceName = "template" - EmptyRoomService = "empty_room" - LaunchScreenService = "launch_screen" + TemplateServiceName = "template" + EmptyRoomService = "empty_room" + LaunchScreenServiceName = "launch_screen" + APIServiceName = "api" + UserServiceName = "user" // db table name TemplateServiceTableName = "template" + UserTableName = "user" + LaunchScreenTableName = "launch_screen" // redis RedisDBEmptyRoom = 1 diff --git a/pkg/errno/default.go b/pkg/errno/default.go index ac9df72..6045ffa 100644 --- a/pkg/errno/default.go +++ b/pkg/errno/default.go @@ -12,4 +12,9 @@ var ( AuthFailedError = NewErrNo(AuthErrorCode, "authorization failed") BizError = NewErrNo(BizErrorCode, "business error") InternalServiceError = NewErrNo(InternalServiceErrorCode, "internal service error") + + UserExistedError = NewErrNo(InternalDatabaseErrorCode, "user existed") + UserNonExistError = NewErrNo(InternalDatabaseErrorCode, "user didn't exist") + SuffixError = NewErrNo(ParamErrorCode, "invalid file") + UpcloudError = NewErrNo(BizFileUploadErrorCode, "upload to upcloud error") ) diff --git a/pkg/logger/logger.go b/pkg/logger/logger.go new file mode 100644 index 0000000..c77cac2 --- /dev/null +++ b/pkg/logger/logger.go @@ -0,0 +1,43 @@ +// utils/logger.go +package logger + +import ( + "go.uber.org/zap" + "go.uber.org/zap/zapcore" +) + +// 全局 Logger 变量 +var LoggerObj *zap.SugaredLogger + +func LoggerInit() { + // 配置 zap 的日志等级和输出格式 + config := zap.Config{ + Level: zap.NewAtomicLevelAt(zap.InfoLevel), // 设置日志等级 + Development: false, // 非开发模式 + Encoding: "console", // 输出格式(json 或 console) + OutputPaths: []string{"stdout"}, // 输出目标 + ErrorOutputPaths: []string{"stderr"}, // 错误输出目标 + EncoderConfig: zapcore.EncoderConfig{ + TimeKey: "time", + LevelKey: "level", + NameKey: "logger", + CallerKey: "caller", + MessageKey: "msg", + StacktraceKey: "stacktrace", + LineEnding: zapcore.DefaultLineEnding, + EncodeLevel: zapcore.CapitalLevelEncoder, // 日志等级大写 + EncodeTime: zapcore.ISO8601TimeEncoder, // 时间格式 + EncodeDuration: zapcore.StringDurationEncoder, + EncodeCaller: zapcore.ShortCallerEncoder, + }, + } + var err error + logger, err := config.Build() // 创建基础 Logger + if err != nil { + panic(err) + } + defer logger.Sync() // 确保日志缓冲区被刷新 + + // 创建 SugaredLogger + LoggerObj = logger.Sugar() +} diff --git a/pkg/utils/base_resp.go b/pkg/utils/base_resp.go new file mode 100644 index 0000000..56afbaa --- /dev/null +++ b/pkg/utils/base_resp.go @@ -0,0 +1,28 @@ +package utils + +import ( + "errors" + "github.com/west2-online/fzuhelper-server/kitex_gen/model" + "github.com/west2-online/jwch/errno" +) + +func BuildBaseResp(err error) *model.BaseResp { + if err == nil { + return ErrToResp(errno.Success) + } + + e := errno.ErrNo{} + if errors.As(err, &e) { + return ErrToResp(e) + } + + _e := errno.ServiceError.WithMessage(err.Error()) //未知错误 + return ErrToResp(_e) +} + +func ErrToResp(err errno.ErrNo) *model.BaseResp { + return &model.BaseResp{ + Code: err.ErrorCode, + Msg: err.ErrorMsg, + } +} diff --git a/pkg/utils/jwt.go b/pkg/utils/jwt.go index 1b11de6..c69c9ab 100644 --- a/pkg/utils/jwt.go +++ b/pkg/utils/jwt.go @@ -1,6 +1,7 @@ package utils import ( + "fmt" "time" "github.com/golang-jwt/jwt" @@ -37,6 +38,7 @@ func CheckToken(token string) (*Claims, error) { } if resp, ok := response.Claims.(*Claims); ok && response.Valid { + fmt.Println(resp.UserId) return resp, nil } diff --git a/pkg/utils/rpc.go b/pkg/utils/rpc.go new file mode 100644 index 0000000..33cea06 --- /dev/null +++ b/pkg/utils/rpc.go @@ -0,0 +1,21 @@ +package utils + +import ( + "github.com/west2-online/fzuhelper-server/kitex_gen/model" + "github.com/west2-online/fzuhelper-server/pkg/errno" + "github.com/west2-online/fzuhelper-server/pkg/logger" +) + +//处理通用rpc请求 + +func IsSuccess(err error, baseResp *model.BaseResp) (bool, error) { + if err != nil { + logger.LoggerObj.Errorf("api.rpc.classroom GetEmptyRoomRPC received rpc error %v", err) + return false, err + } + if baseResp.Code != errno.SuccessCode { + logger.LoggerObj.Errorf("api.rpc.classroom GetEmptyRoomRPC received failed") + return false, errno.NewErrNo(baseResp.Code, baseResp.Msg) + } + return true, nil +}