From ec7738c4f6025a91cee5cabb9b00695220112e45 Mon Sep 17 00:00:00 2001 From: weizhihong Date: Fri, 20 Oct 2023 18:08:06 +0800 Subject: [PATCH 01/16] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9API=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E4=BF=A1=E6=81=AF=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/auth.go | 43 ++++++--------- api/category.go | 45 +++++----------- api/drafting.go | 65 ++++++----------------- api/project.go | 45 +++++----------- api/projectLink.go | 9 ++-- api/simulation.go | 28 +++++----- api/trainManage.go | 115 ++++++++++++----------------------------- init.go | 13 ----- service/auth.go | 8 +-- service/category.go | 16 +++--- service/drafting.go | 26 ++++++---- service/project.go | 16 +++--- service/trainManage.go | 48 ++++++++++------- 13 files changed, 179 insertions(+), 298 deletions(-) diff --git a/api/auth.go b/api/auth.go index bb21f81..a95d742 100644 --- a/api/auth.go +++ b/api/auth.go @@ -10,6 +10,7 @@ import ( "joylink.club/bj-rtsts-server/dto" "joylink.club/bj-rtsts-server/middleware" "joylink.club/bj-rtsts-server/service" + "joylink.club/bj-rtsts-server/sys_error" ) func InitAuthRouter(api *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) { @@ -49,13 +50,9 @@ func InitAuthRouter(api *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) func pageQueryRole(c *gin.Context) { req := dto.PageQueryDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("查询失败,请求参数异常", err)) } - page, err := service.PageAuthRoleQuery(&req) - if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) - } - c.JSON(http.StatusOK, page) + c.JSON(http.StatusOK, service.PageAuthRoleQuery(&req)) } // 查询角色列表 @@ -74,8 +71,7 @@ func pageQueryRole(c *gin.Context) { // @Failure 500 {object} dto.ErrorDto // @Router /api/v1/auth/role/list [get] func listQueryRole(c *gin.Context) { - page := service.ListAuthRoleQuery() - c.JSON(http.StatusOK, page) + c.JSON(http.StatusOK, service.ListAuthRoleQuery()) } // 创建角色 @@ -97,7 +93,7 @@ func listQueryRole(c *gin.Context) { func createRole(c *gin.Context) { req := dto.AuthRoleReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("创建失败,请求参数异常", err)) } slog.Debug("保存数据", req) c.JSON(http.StatusOK, service.CreateAuthRole(&req)) @@ -122,7 +118,7 @@ func createRole(c *gin.Context) { func queryRoleInfo(c *gin.Context) { id, exist := c.Params.Get("id") if !exist { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: "必要参数id不存在"}) + panic(sys_error.New("查询失败,缺少id")) } slog.Debug("传入参数id为" + id) int64Id, _ := strconv.ParseInt(id, 10, 64) @@ -149,12 +145,12 @@ func queryRoleInfo(c *gin.Context) { func updateRoleInfo(c *gin.Context) { id, exist := c.Params.Get("id") if !exist { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: "必要参数id不存在"}) + panic(sys_error.New("更新失败,缺少id")) } slog.Debug("传入参数id为" + id) req := dto.AuthRoleReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("更新角色信息出错,参数格式错误", err)) } int64Id, _ := strconv.ParseInt(id, 10, 64) rid := int32(int64Id) @@ -184,9 +180,8 @@ func updateRoleInfo(c *gin.Context) { func deleteRoleInfo(c *gin.Context) { id, exist := c.Params.Get("id") if !exist { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: "必要参数id不存在"}) + panic(sys_error.New("删除失败,缺少id")) } - slog.Debug("传入参数id为" + id) int64Id, _ := strconv.ParseInt(id, 10, 64) rid := int32(int64Id) result := service.DeleteAuthRole(rid) @@ -215,13 +210,9 @@ func deleteRoleInfo(c *gin.Context) { func pageQueryApiPath(c *gin.Context) { req := dto.AuthApiPathPageReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("查询失败,参数格式错误", err)) } - page, err := service.PageAuthApiPathQuery(&req) - if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) - } - c.JSON(http.StatusOK, page) + c.JSON(http.StatusOK, service.PageAuthApiPathQuery(&req)) } // 查询接口路径列表 @@ -262,7 +253,7 @@ func listQueryApiPath(c *gin.Context) { func createApiPath(c *gin.Context) { req := dto.AuthApiPathReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("创建失败,参数格式错误", err)) } slog.Debug("保存数据", req) c.JSON(http.StatusOK, service.CreateAuthApiPath(&req)) @@ -287,7 +278,7 @@ func createApiPath(c *gin.Context) { func queryApiPathInfo(c *gin.Context) { id, exist := c.Params.Get("id") if !exist { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: "必要参数id不存在"}) + panic(sys_error.New("查询失败,缺少id")) } slog.Debug("传入参数id为" + id) int64Id, _ := strconv.ParseInt(id, 10, 64) @@ -314,11 +305,11 @@ func queryApiPathInfo(c *gin.Context) { func updateApiPathInfo(c *gin.Context) { id, exist := c.Params.Get("id") if !exist { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: "必要参数id不存在"}) + panic(sys_error.New("更新失败,缺少id")) } req := dto.AuthApiPathReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("更新失败,参数格式错误", err)) } int64Id, _ := strconv.ParseInt(id, 10, 64) c.JSON(http.StatusOK, service.UpdateAuthApiPath(int32(int64Id), &req)) @@ -343,7 +334,7 @@ func updateApiPathInfo(c *gin.Context) { func deleteApiPathInfo(c *gin.Context) { id, exist := c.Params.Get("id") if !exist { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: "必要参数id不存在"}) + panic(sys_error.New("删除失败,缺少id")) } slog.Debug("传入参数id为" + id) int64Id, _ := strconv.ParseInt(id, 10, 64) @@ -369,7 +360,7 @@ func deleteApiPathInfo(c *gin.Context) { func assignRoleToUser(c *gin.Context) { req := dto.AuthRoleUserReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("关联失败,参数格式错误", err)) } result := service.UserLinkRole(&req) if result { diff --git a/api/category.go b/api/category.go index c335081..539633a 100644 --- a/api/category.go +++ b/api/category.go @@ -10,6 +10,7 @@ import ( "joylink.club/bj-rtsts-server/dto" "joylink.club/bj-rtsts-server/middleware" "joylink.club/bj-rtsts-server/service" + "joylink.club/bj-rtsts-server/sys_error" ) func InitCategoryRouter(api *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) { @@ -39,18 +40,12 @@ func InitCategoryRouter(api *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddlewa // @Failure 500 {object} dto.ErrorDto // @Router /api/v1/category/paging [get] func pageQueryCategory(c *gin.Context) { - user, _ := c.Get(middleware.IdentityKey) - slog.Debug("分页查询厂家", user) req := dto.PageCategoryReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("查询失败,参数格式错误", err)) } slog.Debug("分页查厂家参数", req) - page, err := service.PageCategoryQuery(&req) - if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) - } - c.JSON(http.StatusOK, page) + c.JSON(http.StatusOK, service.PageCategoryQuery(&req)) } // 查询厂家信息列表 @@ -72,14 +67,10 @@ func pageQueryCategory(c *gin.Context) { func listQueryCategory(c *gin.Context) { req := dto.CategoryReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("查询失败,参数格式错误", err)) } slog.Debug("查厂家参数", req) - page, err := service.ListCategoryQuery(&req) - if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) - } - c.JSON(http.StatusOK, page) + c.JSON(http.StatusOK, service.ListCategoryQuery(&req)) } // 创建厂家信息 @@ -101,14 +92,10 @@ func listQueryCategory(c *gin.Context) { func createCategory(c *gin.Context) { req := dto.CategoryDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: "传入参数错误"}) + panic(sys_error.New("保存失败,参数格式错误", err)) } slog.Debug("保存数据", req) - data, err := service.CreateCategory(&req) - if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) - } - c.JSON(http.StatusOK, data) + c.JSON(http.StatusOK, service.CreateCategory(&req)) } // 查询厂家信息 @@ -130,9 +117,8 @@ func createCategory(c *gin.Context) { func queryCategoryInfo(c *gin.Context) { id, exist := c.Params.Get("id") if !exist { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: "必要参数id不存在"}) + panic(sys_error.New("查询失败,缺少id")) } - slog.Debug("传入参数id为" + id) int64Id, _ := strconv.ParseInt(id, 10, 64) c.JSON(http.StatusOK, service.QueryCategory(int32(int64Id))) } @@ -157,19 +143,15 @@ func queryCategoryInfo(c *gin.Context) { func updateCategoryInfo(c *gin.Context) { id, exist := c.Params.Get("id") if !exist { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: "必要参数id不存在"}) + panic(sys_error.New("更新失败,缺少id")) } slog.Debug("传入参数id为" + id) req := dto.CategoryDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("更新失败,参数格式错误", err)) } int64Id, _ := strconv.ParseInt(id, 10, 64) - result := service.UpdateCategory(int32(int64Id), &req) - if !result { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: "保存参数出错"}) - } - c.JSON(http.StatusOK, result) + c.JSON(http.StatusOK, service.UpdateCategory(int32(int64Id), &req)) } // 删除厂家信息 @@ -189,14 +171,11 @@ func updateCategoryInfo(c *gin.Context) { // @Failure 500 {object} dto.ErrorDto // @Router /api/v1/category/{id} [delete] func deleteCategory(c *gin.Context) { - user, _ := c.Get(middleware.IdentityKey) - slog.Debug("id删除草稿的图形数据", user) idStr := c.Param("id") id, err := strconv.Atoi(idStr) if err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("删除失败,主键格式错误", err)) } - slog.Debug("id查询草稿的图形数据", id) service.DeleteCategoryById(id) c.JSON(http.StatusOK, true) } diff --git a/api/drafting.go b/api/drafting.go index 242cdb3..d3b7454 100644 --- a/api/drafting.go +++ b/api/drafting.go @@ -1,7 +1,6 @@ package api import ( - "log/slog" "net/http" "strconv" @@ -14,6 +13,7 @@ import ( "joylink.club/bj-rtsts-server/dto" "joylink.club/bj-rtsts-server/middleware" "joylink.club/bj-rtsts-server/service" + "joylink.club/bj-rtsts-server/sys_error" ) func InitDraftingRouter(api *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) { @@ -45,18 +45,11 @@ func InitDraftingRouter(api *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddlewa // @Failure 500 {object} dto.ErrorDto // @Router /api/v1/drafting/paging [get] func pageQueryDrafting(c *gin.Context) { - user, _ := c.Get(middleware.IdentityKey) - slog.Debug("分页查询草稿", user) req := dto.PageDraftingReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("查询失败,参数格式错误", err)) } - slog.Debug("分页查草稿参数", req) - page, err := service.PageDraftingQuery(&req) - if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) - } - c.JSON(http.StatusOK, page) + c.JSON(http.StatusOK, service.PageDraftingQuery(&req)) } // 列表查询草稿 @@ -76,18 +69,11 @@ func pageQueryDrafting(c *gin.Context) { // @Failure 500 {object} dto.ErrorDto // @Router /api/v1/drafting/list [get] func listQueryDrafting(c *gin.Context) { - user, _ := c.Get(middleware.IdentityKey) - slog.Debug("列表查询草稿", user) req := dto.ListDraftingReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("查询失败,参数格式错误", err)) } - slog.Debug("列表查草稿参数", req) - list, err := service.ListDraftingQuery(&req) - if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) - } - c.JSON(http.StatusOK, list) + c.JSON(http.StatusOK, service.ListDraftingQuery(&req)) } // 创建草稿 @@ -111,14 +97,9 @@ func createDrafting(c *gin.Context) { createId := user.(*model.User).ID req := dto.DraftingDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("创建失败,参数格式错误", err)) } - slog.Debug("保存数据", req) - data, err := service.CreateDrafting(createId, &req) - if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) - } - c.JSON(http.StatusOK, data) + c.JSON(http.StatusOK, service.CreateDrafting(createId, &req)) } // 草稿另存为 @@ -141,21 +122,16 @@ func createDrafting(c *gin.Context) { func saveAsDrafting(c *gin.Context) { id, exist := c.Params.Get("id") if !exist { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: "必要参数id不存在"}) + panic(sys_error.New("另存为失败,缺少主键")) } - slog.Debug("传入参数id为" + id) user, _ := c.Get(middleware.IdentityKey) createrId := user.(*model.User).ID req := dto.DraftingDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("另存为失败,参数格式错误", err)) } int64Id, _ := strconv.ParseInt(id, 10, 64) - newData, err := service.SaveAsDrafting(createrId, int32(int64Id), &req) - if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) - } - c.JSON(http.StatusOK, newData) + c.JSON(http.StatusOK, service.SaveAsDrafting(createrId, int32(int64Id), &req)) } // 查询草稿详情 @@ -177,9 +153,8 @@ func saveAsDrafting(c *gin.Context) { func queryDraftingInfo(c *gin.Context) { id, exist := c.Params.Get("id") if !exist { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: "必要参数id不存在"}) + panic(sys_error.New("查询失败,缺少主键")) } - slog.Debug("传入参数id为" + id) int64Id, _ := strconv.ParseInt(id, 10, 64) c.JSON(http.StatusOK, service.QueryDrafting(int32(int64Id))) } @@ -204,19 +179,14 @@ func queryDraftingInfo(c *gin.Context) { func updateDraftingInfo(c *gin.Context) { id, exist := c.Params.Get("id") if !exist { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: "必要参数id不存在"}) + panic(sys_error.New("更新失败,缺少主键")) } - slog.Debug("传入参数id为" + id) req := dto.DraftingDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("更新失败,参数格式错误", err)) } int64Id, _ := strconv.ParseInt(id, 10, 64) - result := service.UpdateDrafting(int32(int64Id), &req) - if !result { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: "保存出错"}) - } - c.JSON(http.StatusOK, result) + c.JSON(http.StatusOK, service.UpdateDrafting(int32(int64Id), &req)) } // 删除草稿数据 @@ -236,14 +206,11 @@ func updateDraftingInfo(c *gin.Context) { // @Failure 500 {object} dto.ErrorDto // @Router /api/v1/drafting/{id} [delete] func deleteDrafting(c *gin.Context) { - user, _ := c.Get(middleware.IdentityKey) - slog.Debug("id删除草稿的图形数据", user) idStr := c.Param("id") id, err := strconv.Atoi(idStr) if err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("删除失败,主键格式错误", err)) } - slog.Debug("id查询草稿的图形数据", id) service.DeleteDraftingById(id) c.JSON(http.StatusOK, true) } @@ -267,7 +234,7 @@ func deleteDrafting(c *gin.Context) { func generateCalculateLinkData(c *gin.Context) { req := dto.DraftingMapDataDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("link生成失败,参数格式错误", err)) } gd := &graphicData.RtssGraphicStorage{} proto.Unmarshal(req.Proto, gd) diff --git a/api/project.go b/api/project.go index 8a7d756..f298711 100644 --- a/api/project.go +++ b/api/project.go @@ -1,7 +1,6 @@ package api import ( - "log/slog" "net/http" "strconv" @@ -10,6 +9,7 @@ import ( "joylink.club/bj-rtsts-server/dto" "joylink.club/bj-rtsts-server/middleware" "joylink.club/bj-rtsts-server/service" + "joylink.club/bj-rtsts-server/sys_error" ) func InitProjectRouter(api *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) { @@ -41,14 +41,9 @@ func InitProjectRouter(api *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddlewar func pageQueryProject(c *gin.Context) { req := dto.PageProjectReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("查询失败,参数格式错误", err)) } - slog.Debug("分页查项目参数", req) - page, err := service.PageProjectQuery(&req) - if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) - } - c.JSON(http.StatusOK, page) + c.JSON(http.StatusOK, service.PageProjectQuery(&req)) } // 查询项目信息列表 @@ -70,14 +65,9 @@ func pageQueryProject(c *gin.Context) { func listQueryProject(c *gin.Context) { req := dto.ProjectReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("查询失败,参数格式错误", err)) } - slog.Debug("查项目参数", req) - page, err := service.ListProjectQuery(&req) - if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) - } - c.JSON(http.StatusOK, page) + c.JSON(http.StatusOK, service.ListProjectQuery(&req)) } // 创建项目信息 @@ -99,14 +89,9 @@ func listQueryProject(c *gin.Context) { func createProject(c *gin.Context) { req := dto.ProjectDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("创建失败,参数格式错误", err)) } - slog.Debug("保存数据", req) - data, err := service.CreateProject(&req) - if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) - } - c.JSON(http.StatusOK, data) + c.JSON(http.StatusOK, service.CreateProject(&req)) } // 查询项目信息 @@ -128,9 +113,8 @@ func createProject(c *gin.Context) { func queryProjectInfo(c *gin.Context) { id, exist := c.Params.Get("id") if !exist { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: "必要参数id不存在"}) + panic(sys_error.New("查询失败,缺少主键")) } - slog.Debug("传入参数id为" + id) int64Id, _ := strconv.ParseInt(id, 10, 64) c.JSON(http.StatusOK, service.QueryProject(int32(int64Id))) } @@ -155,18 +139,14 @@ func queryProjectInfo(c *gin.Context) { func updateProjectInfo(c *gin.Context) { id, exist := c.Params.Get("id") if !exist { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: "必要参数id不存在"}) + panic(sys_error.New("更新失败,缺少主键")) } req := dto.ProjectDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("更新失败,参数格式错误", err)) } int64Id, _ := strconv.ParseInt(id, 10, 64) - result := service.UpdateProject(int32(int64Id), &req) - if !result { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: "保存出错"}) - } - c.JSON(http.StatusOK, result) + c.JSON(http.StatusOK, service.UpdateProject(int32(int64Id), &req)) } // 删除项目信息 @@ -189,9 +169,8 @@ func deleteProject(c *gin.Context) { idStr := c.Param("id") id, err := strconv.Atoi(idStr) if err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("删除失败,缺少主键")) } - slog.Debug("id查询草稿的图形数据", id) service.DeleteProjectById(id) c.JSON(http.StatusOK, true) } diff --git a/api/projectLink.go b/api/projectLink.go index f0ee22b..4f6b8d8 100644 --- a/api/projectLink.go +++ b/api/projectLink.go @@ -10,6 +10,7 @@ import ( "joylink.club/bj-rtsts-server/dto" "joylink.club/bj-rtsts-server/middleware" "joylink.club/bj-rtsts-server/service" + "joylink.club/bj-rtsts-server/sys_error" ) func InitProjectLinkRouter(api *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) { @@ -39,7 +40,7 @@ func InitProjectLinkRouter(api *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddl func queryProjectLinkInfo(c *gin.Context) { id, exist := c.Params.Get("id") if !exist { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: "必要参数id不存在"}) + panic(sys_error.New("查询失败,缺少id")) } slog.Debug("传入参数id为" + id) int64Id, _ := strconv.ParseInt(id, 10, 64) @@ -65,7 +66,7 @@ func queryProjectLinkInfo(c *gin.Context) { func queryTrainSizeByMapId(c *gin.Context) { id, exist := c.Params.Get("id") if !exist { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: "必要参数id不存在"}) + panic(sys_error.New("查询失败,缺少id")) } slog.Debug("传入参数id为" + id) int64Id, _ := strconv.ParseInt(id, 10, 64) @@ -91,7 +92,7 @@ func queryTrainSizeByMapId(c *gin.Context) { func queryTrainSizeByPId(c *gin.Context) { id, exist := c.Params.Get("id") if !exist { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: "必要参数id不存在"}) + panic(sys_error.New("查询失败,缺少id")) } slog.Debug("传入参数id为" + id) int64Id, _ := strconv.ParseInt(id, 10, 64) @@ -118,7 +119,7 @@ func queryTrainSizeByPId(c *gin.Context) { func saveProjectLinkInfo(c *gin.Context) { req := dto.ProjectLinkReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("保持失败,参数格式化错误", err)) } service.UpdateProjectLink(&req) c.JSON(http.StatusOK, true) diff --git a/api/simulation.go b/api/simulation.go index 52be561..7a69938 100644 --- a/api/simulation.go +++ b/api/simulation.go @@ -79,12 +79,10 @@ func initPublishMapInfo() { func createByProjectId(c *gin.Context) { req := dto.SimulationCreateReqDto{} if err := c.ShouldBind(&req); nil != err { - // panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) panic(sys_error.New("测试启动失败,请求参数异常", err)) } mapInfos := service.QueryProjectPublishedGi(req.ProjectId) if len(mapInfos) == 0 { - // panic(dto.ErrorDto{Code: dto.DataNotExist, Message: "项目未关联地图"}) panic(sys_error.New("测试启动失败,项目未关联发布图")) } mapIds := make([]int32, len(mapInfos)) @@ -159,12 +157,11 @@ func findAllSimulations(c *gin.Context) { func checkSimMapData(c *gin.Context) { rt := &dto.CheckMapDataReqDto{} if err := c.ShouldBind(&rt); nil != err { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("请求参数异常", err)) } err := proto.Unmarshal(rt.Data, &graphicData.RtssGraphicStorage{}) if err != nil { - c.JSON(http.StatusInternalServerError, "参数错误") - return + panic(sys_error.New("非平面布置图数据")) } c.JSON(http.StatusOK, &dto.CheckMapDataRspDto{Success: true}) } @@ -187,13 +184,12 @@ func checkSimMapData(c *gin.Context) { func addTrain(c *gin.Context) { req := dto.AddTrainReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("添加列车失败,请求参数异常", err)) } simulation := checkDeviceDataAndReturn(req.SimulationId) id := getAddTrainPrimaryKey(simulation) if id == -1 { - c.JSON(http.StatusBadRequest, "已存在在线列车") - return + panic(sys_error.New("添加列车失败,已有列车在运行")) } rsp := &state.TrainState{ Id: strconv.Itoa(id), @@ -226,7 +222,7 @@ func addTrain(c *gin.Context) { func removeTrain(c *gin.Context) { rt := &dto.RemoveTrainDto{} if err := c.ShouldBind(&rt); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("移除列车失败,请求参数异常", err)) } slog.Debug("ATS测试仿真-移除列车,请求:", rt) simulation := checkDeviceDataAndReturn(rt.SimulationId) @@ -254,7 +250,7 @@ func removeTrain(c *gin.Context) { func switchOperation(c *gin.Context) { req := &request_proto.TurnoutOperationReq{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("道岔操作失败,请求参数异常", err)) } simulation := checkDeviceDataAndReturn(req.SimulationId) slog.Info("传入状态参数", "request", req) @@ -308,7 +304,7 @@ func signalOperation(c *gin.Context) { func esbBtnOperation(c *gin.Context) { req := &dto.EsbButtonOperationReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("紧急关闭按钮操作失败,请求参数异常", err)) } simulation := checkDeviceDataAndReturn(req.SimulationId) slog.Info("传入状态参数", req) @@ -335,7 +331,7 @@ func esbBtnOperation(c *gin.Context) { func ibpBtnOperation(c *gin.Context) { req := &dto.IBPButtonOperationReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("IBP按钮操作失败,请求参数异常", err)) } simulation := checkDeviceDataAndReturn(req.SimulationId) slog.Info("传入状态参数", req) @@ -362,7 +358,7 @@ func ibpBtnOperation(c *gin.Context) { func ibpKeyOperation(c *gin.Context) { req := &dto.KeyOperationReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("IBP开关操作失败,请求参数异常", err)) } simulation := checkDeviceDataAndReturn(req.SimulationId) slog.Info("传入状态参数", req) @@ -434,7 +430,7 @@ func getDataChannelName(c *gin.Context) { func getMapKilometerRange(c *gin.Context) { id, exist := c.Params.Get("id") if !exist { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: "必要参数id不存在"}) + panic(sys_error.New("缺少仿真编号")) } simulation := checkDeviceDataAndReturn(id) c.JSON(http.StatusOK, simulation.Repo.GetCoordinateInfo()) @@ -459,7 +455,7 @@ func getMapKilometerRange(c *gin.Context) { func relayOperation(c *gin.Context) { req := &dto.RelayOperationReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("继电器操作失败,请求参数异常", err)) } simulation := checkDeviceDataAndReturn(req.SimulationId) slog.Info("传入状态参数", req) @@ -471,7 +467,7 @@ func relayOperation(c *gin.Context) { func checkDeviceDataAndReturn(simId string) *memory.VerifySimulation { deviceMemory := simulation.FindSimulation(simId) if deviceMemory == nil { - panic(&dto.ErrorDto{Code: dto.DataNotExist, Message: fmt.Sprintf("仿真[%s]不存在", simId)}) + panic(sys_error.New(fmt.Sprintf("仿真[%s]不存在", simId))) } return deviceMemory } diff --git a/api/trainManage.go b/api/trainManage.go index c93f84a..af90196 100644 --- a/api/trainManage.go +++ b/api/trainManage.go @@ -10,6 +10,7 @@ import ( "joylink.club/bj-rtsts-server/dto" "joylink.club/bj-rtsts-server/middleware" "joylink.club/bj-rtsts-server/service" + "joylink.club/bj-rtsts-server/sys_error" ) func InitTrainManageRouter(api *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) { @@ -53,13 +54,9 @@ func InitTrainManageRouter(api *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddl func pageQueryTrainModel(c *gin.Context) { req := dto.PageTrainManageReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("查询失败,参数格式错误", err)) } - page, err := service.PageTrainModelQuery(&req) - if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) - } - c.JSON(http.StatusOK, page) + c.JSON(http.StatusOK, service.PageTrainModelQuery(&req)) } // 创建列车型号 @@ -81,13 +78,9 @@ func pageQueryTrainModel(c *gin.Context) { func createTrainModel(c *gin.Context) { req := dto.TrainModelDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("保存失败,参数格式错误", err)) } - data, err := service.CreateTrainModel(&req) - if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) - } - c.JSON(http.StatusOK, data) + c.JSON(http.StatusOK, service.CreateTrainModel(&req)) } // 查询列车型号详情 @@ -109,7 +102,7 @@ func createTrainModel(c *gin.Context) { func queryTrainModel(c *gin.Context) { id, exist := c.Params.Get("id") if !exist { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: "必要参数id不存在"}) + panic(sys_error.New("查询失败,缺少主键")) } int64Id, _ := strconv.ParseInt(id, 10, 64) c.JSON(http.StatusOK, service.QueryTrainModel(int32(int64Id))) @@ -135,18 +128,14 @@ func queryTrainModel(c *gin.Context) { func updateTrainModel(c *gin.Context) { id, exist := c.Params.Get("id") if !exist { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: "必要参数id不存在"}) + panic(sys_error.New("更新失败,缺少主键")) } req := dto.TrainModelDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("更新失败,参数格式错误", err)) } int64Id, _ := strconv.ParseInt(id, 10, 64) - result := service.UpdateTrainModel(int32(int64Id), &req) - if !result { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: "保存参数出错"}) - } - c.JSON(http.StatusOK, result) + c.JSON(http.StatusOK, service.UpdateTrainModel(int32(int64Id), &req)) } // 删除列车型号数据 @@ -169,7 +158,7 @@ func deleteTrainModel(c *gin.Context) { idStr := c.Param("id") id, err := strconv.Atoi(idStr) if err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("删除失败,缺少主键")) } service.DeleteTrainModelById(id) c.JSON(http.StatusOK, true) @@ -194,13 +183,9 @@ func deleteTrainModel(c *gin.Context) { func queryTrainModelList(c *gin.Context) { req := dto.TrainManageReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("查询失败,参数格式错误", err)) } - models, err := service.ListTrainModelQuery(&req) - if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) - } - c.JSON(http.StatusOK, models) + c.JSON(http.StatusOK, service.ListTrainModelQuery(&req)) } // 分页查询列车尺寸列表 @@ -222,13 +207,9 @@ func queryTrainModelList(c *gin.Context) { func pageQueryTrainSize(c *gin.Context) { req := dto.PageTrainManageReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("查询失败,参数格式错误", err)) } - page, err := service.PageTrainSizeQuery(&req) - if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) - } - c.JSON(http.StatusOK, page) + c.JSON(http.StatusOK, service.PageTrainSizeQuery(&req)) } // 查询列车尺寸列表 @@ -250,13 +231,9 @@ func pageQueryTrainSize(c *gin.Context) { func queryTrainSizeList(c *gin.Context) { req := dto.TrainManageReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("查询失败,参数格式错误", err)) } - sizeList, err := service.ListTrainSizeQuery(&req) - if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) - } - c.JSON(http.StatusOK, sizeList) + c.JSON(http.StatusOK, service.ListTrainSizeQuery(&req)) } // 创建列车尺寸 @@ -278,13 +255,9 @@ func queryTrainSizeList(c *gin.Context) { func createTrainSize(c *gin.Context) { req := dto.TrainSizeDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("创建失败,参数格式错误", err)) } - data, err := service.CreateTrainSize(&req) - if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) - } - c.JSON(http.StatusOK, data) + c.JSON(http.StatusOK, service.CreateTrainSize(&req)) } // 查询列车尺寸详情 @@ -306,7 +279,7 @@ func createTrainSize(c *gin.Context) { func queryTrainSize(c *gin.Context) { id, exist := c.Params.Get("id") if !exist { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: "必要参数id不存在"}) + panic(sys_error.New("查询失败,缺少查询主键")) } int64Id, _ := strconv.ParseInt(id, 10, 64) c.JSON(http.StatusOK, service.QueryTrainSize(int32(int64Id))) @@ -332,18 +305,14 @@ func queryTrainSize(c *gin.Context) { func updateTrainSize(c *gin.Context) { id, exist := c.Params.Get("id") if !exist { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: "必要参数id不存在"}) + panic(sys_error.New("更新失败,缺少查询主键")) } req := dto.TrainSizeDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("更新失败,参数格式错误", err)) } int64Id, _ := strconv.ParseInt(id, 10, 64) - result := service.UpdateTrainSize(int32(int64Id), &req) - if !result { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: "保存出错"}) - } - c.JSON(http.StatusOK, result) + c.JSON(http.StatusOK, service.UpdateTrainSize(int32(int64Id), &req)) } // 删除列车尺寸数据 @@ -366,7 +335,7 @@ func deleteTrainSize(c *gin.Context) { idStr := c.Param("id") id, err := strconv.Atoi(idStr) if err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("删除失败,主键格式错误", err)) } service.DeleteTrainSizeById(id) c.JSON(http.StatusOK, true) @@ -391,13 +360,9 @@ func deleteTrainSize(c *gin.Context) { func pageQueryTrainWheelDiameter(c *gin.Context) { req := dto.PageTrainManageReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("查询失败,参数格式错误", err)) } - page, err := service.PageTrainWheelDiameterQuery(&req) - if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) - } - c.JSON(http.StatusOK, page) + c.JSON(http.StatusOK, service.PageTrainWheelDiameterQuery(&req)) } // 查询列车轮径列表 @@ -419,13 +384,9 @@ func pageQueryTrainWheelDiameter(c *gin.Context) { func queryTrainWheelDiameterList(c *gin.Context) { req := dto.TrainManageReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("查询失败,参数格式错误", err)) } - wheels, err := service.ListTrainWheelDiameterQuery(&req) - if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) - } - c.JSON(http.StatusOK, wheels) + c.JSON(http.StatusOK, service.ListTrainWheelDiameterQuery(&req)) } // 创建列车轮径 @@ -447,13 +408,9 @@ func queryTrainWheelDiameterList(c *gin.Context) { func createTrainWheelDiameter(c *gin.Context) { req := dto.TrainWheelDiameterDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("创建失败,参数格式错误", err)) } - data, err := service.CreateTrainWheelDiameter(&req) - if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) - } - c.JSON(http.StatusOK, data) + c.JSON(http.StatusOK, service.CreateTrainWheelDiameter(&req)) } // 查询列车轮径详情 @@ -475,7 +432,7 @@ func createTrainWheelDiameter(c *gin.Context) { func queryTrainWheelDiameter(c *gin.Context) { id, exist := c.Params.Get("id") if !exist { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: "必要参数id不存在"}) + panic(sys_error.New("查询失败,缺少查询主键")) } int64Id, _ := strconv.ParseInt(id, 10, 64) c.JSON(http.StatusOK, service.QueryTrainWheelDiameter(int32(int64Id))) @@ -501,18 +458,14 @@ func queryTrainWheelDiameter(c *gin.Context) { func updateTrainWheelDiameter(c *gin.Context) { id, exist := c.Params.Get("id") if !exist { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: "必要参数id不存在"}) + panic(sys_error.New("更新失败,缺少查询主键")) } req := dto.TrainWheelDiameterDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("查询失败,参数格式错误", err)) } int64Id, _ := strconv.ParseInt(id, 10, 64) - result := service.UpdateTrainWheelDiameter(int32(int64Id), &req) - if !result { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: "保存出错"}) - } - c.JSON(http.StatusOK, result) + c.JSON(http.StatusOK, service.UpdateTrainWheelDiameter(int32(int64Id), &req)) } // 删除列车轮径数据 @@ -535,7 +488,7 @@ func deleteTrainWheelDiameter(c *gin.Context) { idStr := c.Param("id") id, err := strconv.Atoi(idStr) if err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: "必要参数id不存在"}) + panic(sys_error.New("删除失败,缺少主键")) } service.DeleteTrainWheelDiameterById(id) c.JSON(http.StatusOK, true) diff --git a/init.go b/init.go index 1e45d9b..c988431 100644 --- a/init.go +++ b/init.go @@ -60,19 +60,6 @@ func InitServer() *gin.Engine { Tip: be.UserMsg, Message: be.Error(), }) - // switch e := e.(type) { - // case error: - // c.JSON(http.StatusInternalServerError, &dto.ErrorDto{ - // Code: dto.LogicError, - // Tip: dto.ErrorTipMap[dto.LogicError], - // Message: e.Error(), - // }) - // case dto.ErrorDto: - // e.Tip = dto.ErrorTipMap[e.Code] - // c.JSON(http.StatusInternalServerError, e) - // default: - // c.JSON(http.StatusInternalServerError, e) - // } c.Writer.WriteHeaderNow() c.Abort() })) diff --git a/service/auth.go b/service/auth.go index 364c74a..eab2257 100644 --- a/service/auth.go +++ b/service/auth.go @@ -10,13 +10,13 @@ import ( ) // 查询权限角色信息列表 -func PageAuthRoleQuery(query *dto.PageQueryDto) (*dto.PageDto, error) { +func PageAuthRoleQuery(query *dto.PageQueryDto) *dto.PageDto { d := dbquery.AuthRole records, total, err := d.Debug().Select(d.ID, d.Name).Order(d.CreateTime).FindByPage(query.Offset(), query.Size) if err != nil { panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) } - return &dto.PageDto{Total: int(total), PageQueryDto: *query, Records: dto.ConvertFromAuthRole(records)}, nil + return &dto.PageDto{Total: int(total), PageQueryDto: *query, Records: dto.ConvertFromAuthRole(records)} } // 获取角色列表 @@ -142,7 +142,7 @@ func DeleteAuthRole(rid int32) bool { } // 查询接口路径信息列表 -func PageAuthApiPathQuery(query *dto.AuthApiPathPageReqDto) (*dto.PageDto, error) { +func PageAuthApiPathQuery(query *dto.AuthApiPathPageReqDto) *dto.PageDto { d := dbquery.AuthAPIPath dq := d.Where() if query.Name != "" { @@ -152,7 +152,7 @@ func PageAuthApiPathQuery(query *dto.AuthApiPathPageReqDto) (*dto.PageDto, error if err != nil { panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) } - return &dto.PageDto{Total: int(total), PageQueryDto: query.PageQueryDto, Records: records}, nil + return &dto.PageDto{Total: int(total), PageQueryDto: query.PageQueryDto, Records: records} } // 查询接口路径信息列表 diff --git a/service/category.go b/service/category.go index 3b15001..bb36c33 100644 --- a/service/category.go +++ b/service/category.go @@ -10,7 +10,7 @@ import ( ) // 查询草稿列表 -func PageCategoryQuery(query *dto.PageCategoryReqDto) (*dto.PageDto, error) { +func PageCategoryQuery(query *dto.PageCategoryReqDto) *dto.PageDto { d := dbquery.Category dq := d.Where() if query.Name != "" { @@ -20,11 +20,11 @@ func PageCategoryQuery(query *dto.PageCategoryReqDto) (*dto.PageDto, error) { if err != nil { panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) } - return &dto.PageDto{Total: int(total), PageQueryDto: query.PageQueryDto, Records: records}, nil + return &dto.PageDto{Total: int(total), PageQueryDto: query.PageQueryDto, Records: records} } // 查询草稿列表 -func ListCategoryQuery(query *dto.CategoryReqDto) ([]*model.Category, error) { +func ListCategoryQuery(query *dto.CategoryReqDto) []*model.Category { d := dbquery.Category dq := d.Where() if query.Name != "" { @@ -34,11 +34,11 @@ func ListCategoryQuery(query *dto.CategoryReqDto) ([]*model.Category, error) { if err != nil { panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) } - return records, nil + return records } // 创建草稿 -func CreateCategory(cd *dto.CategoryDto) (*model.Category, error) { +func CreateCategory(cd *dto.CategoryDto) *model.Category { if err := checkCategoryInfo(cd.Name, cd.Code, 0); err != nil { panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) } @@ -53,7 +53,11 @@ func CreateCategory(cd *dto.CategoryDto) (*model.Category, error) { if err != nil { panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) } - return dbquery.Category.Where(dbquery.Category.Name.Eq(cd.Name)).Order(dbquery.Category.CreatedAt).Debug().First() + data, err := dbquery.Category.Where(dbquery.Category.Name.Eq(cd.Name)).Order(dbquery.Category.CreatedAt).Debug().First() + if err != nil { + panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) + } + return data } func QueryCategory(id int32) *model.Category { diff --git a/service/drafting.go b/service/drafting.go index 19584a7..f811272 100644 --- a/service/drafting.go +++ b/service/drafting.go @@ -10,7 +10,7 @@ import ( ) // 查询草稿列表 -func PageDraftingQuery(query *dto.PageDraftingReqDto) (*dto.PageDto, error) { +func PageDraftingQuery(query *dto.PageDraftingReqDto) *dto.PageDto { d := dbquery.Drafting dq := d.Where() if query.Name != "" { @@ -20,10 +20,10 @@ func PageDraftingQuery(query *dto.PageDraftingReqDto) (*dto.PageDto, error) { if err != nil { panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) } - return &dto.PageDto{Total: int(total), PageQueryDto: query.PageQueryDto, Records: records}, nil + return &dto.PageDto{Total: int(total), PageQueryDto: query.PageQueryDto, Records: records} } -func ListDraftingQuery(query *dto.ListDraftingReqDto) ([]*model.Drafting, error) { +func ListDraftingQuery(query *dto.ListDraftingReqDto) []*model.Drafting { d := dbquery.Drafting dq := d.Where() if query.Type != 0 { @@ -33,11 +33,11 @@ func ListDraftingQuery(query *dto.ListDraftingReqDto) ([]*model.Drafting, error) if err != nil { panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) } - return records, nil + return records } // 创建草稿 -func CreateDrafting(createId int32, dd *dto.DraftingDto) (*model.Drafting, error) { +func CreateDrafting(createId int32, dd *dto.DraftingDto) *model.Drafting { if err := checkDraftingInfo(dd.Name); err != nil { panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) } @@ -54,16 +54,20 @@ func CreateDrafting(createId int32, dd *dto.DraftingDto) (*model.Drafting, error if err != nil { panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) } - return dbquery.Drafting.Where( + data, err := dbquery.Drafting.Where( dbquery.Drafting.Name.Eq(dd.Name), dbquery.Drafting.CreatorID.Eq(createId), ).Order(dbquery.Drafting.CreatedAt).Debug().First() + if err != nil { + panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) + } + return data } // 另存为 -func SaveAsDrafting(createId int32, oldId int32, dd *dto.DraftingDto) (*model.Drafting, error) { +func SaveAsDrafting(createId int32, oldId int32, dd *dto.DraftingDto) *model.Drafting { if err := checkDraftingInfo(dd.Name); err != nil { - return nil, err + return nil } oldD, err := dbquery.Drafting.Where(dbquery.Drafting.ID.Eq(oldId)).Debug().First() if oldD == nil || err != nil { @@ -81,10 +85,14 @@ func SaveAsDrafting(createId int32, oldId int32, dd *dto.DraftingDto) (*model.Dr if err = dbquery.Drafting.Save(&newD); err != nil { panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) } - return dbquery.Drafting.Where( + data, err := dbquery.Drafting.Where( dbquery.Drafting.Name.Eq(dd.Name), dbquery.Drafting.CreatorID.Eq(createId), ).Order(dbquery.Drafting.CreatedAt).Debug().First() + if err != nil { + panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) + } + return data } func QueryDrafting(id int32) *model.Drafting { diff --git a/service/project.go b/service/project.go index 2677ba1..5a74541 100644 --- a/service/project.go +++ b/service/project.go @@ -10,7 +10,7 @@ import ( ) // 查询项目列表 -func PageProjectQuery(query *dto.PageProjectReqDto) (*dto.PageDto, error) { +func PageProjectQuery(query *dto.PageProjectReqDto) *dto.PageDto { d := dbquery.Project dq := d.Where() if query.Name != "" { @@ -23,11 +23,11 @@ func PageProjectQuery(query *dto.PageProjectReqDto) (*dto.PageDto, error) { if err != nil { panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) } - return &dto.PageDto{Total: int(total), PageQueryDto: query.PageQueryDto, Records: records}, nil + return &dto.PageDto{Total: int(total), PageQueryDto: query.PageQueryDto, Records: records} } // 查询项目列表 -func ListProjectQuery(query *dto.ProjectReqDto) ([]*model.Project, error) { +func ListProjectQuery(query *dto.ProjectReqDto) []*model.Project { d := dbquery.Project dq := d.Where() if query.Name != "" { @@ -40,11 +40,11 @@ func ListProjectQuery(query *dto.ProjectReqDto) ([]*model.Project, error) { if err != nil { panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) } - return records, nil + return records } // 创建草稿 -func CreateProject(pd *dto.ProjectDto) (*model.Project, error) { +func CreateProject(pd *dto.ProjectDto) *model.Project { if err := checkProjectInfo(pd.Code, 0); err != nil { panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) } @@ -59,7 +59,11 @@ func CreateProject(pd *dto.ProjectDto) (*model.Project, error) { if err != nil { panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) } - return p.Where(p.Name.Eq(pd.Name)).Order(p.CreatedAt).Debug().First() + data, err := p.Where(p.Name.Eq(pd.Name)).Order(p.CreatedAt).Debug().First() + if err != nil { + panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) + } + return data } func QueryProject(id int32) *model.Project { diff --git a/service/trainManage.go b/service/trainManage.go index bba3f3b..4ca27de 100644 --- a/service/trainManage.go +++ b/service/trainManage.go @@ -10,7 +10,7 @@ import ( ) // 查询列车型号信息列表 -func PageTrainModelQuery(query *dto.PageTrainManageReqDto) (*dto.PageDto, error) { +func PageTrainModelQuery(query *dto.PageTrainManageReqDto) *dto.PageDto { d := dbquery.TrainModel dq := d.Where() if query.Name != "" { @@ -20,11 +20,11 @@ func PageTrainModelQuery(query *dto.PageTrainManageReqDto) (*dto.PageDto, error) if err != nil { panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) } - return &dto.PageDto{Total: int(total), PageQueryDto: query.PageQueryDto, Records: records}, nil + return &dto.PageDto{Total: int(total), PageQueryDto: query.PageQueryDto, Records: records} } // 查询列车型号信息列表 -func ListTrainModelQuery(query *dto.TrainManageReqDto) ([]*model.TrainModel, error) { +func ListTrainModelQuery(query *dto.TrainManageReqDto) []*model.TrainModel { d := dbquery.TrainModel dq := d.Where() if query.Name != "" { @@ -34,11 +34,11 @@ func ListTrainModelQuery(query *dto.TrainManageReqDto) ([]*model.TrainModel, err if err != nil { panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) } - return records, nil + return records } // 创建列车型号信息 -func CreateTrainModel(td *dto.TrainModelDto) (*model.TrainModel, error) { +func CreateTrainModel(td *dto.TrainModelDto) *model.TrainModel { if err := checkTrainModel(td.Name, 0); err != nil { panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) } @@ -52,7 +52,11 @@ func CreateTrainModel(td *dto.TrainModelDto) (*model.TrainModel, error) { if err != nil { panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) } - return dt.Where(dt.Name.Eq(td.Name)).Order(dt.CreatedAt).Debug().First() + data, err2 := dt.Where(dt.Name.Eq(td.Name)).Order(dt.CreatedAt).Debug().First() + if err2 != nil { + panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err2.Error()}) + } + return data } // 查询列车型号信息 @@ -90,7 +94,7 @@ func DeleteTrainModelById(id int) { } // 查询列车尺寸信息列表 -func PageTrainSizeQuery(query *dto.PageTrainManageReqDto) (*dto.PageDto, error) { +func PageTrainSizeQuery(query *dto.PageTrainManageReqDto) *dto.PageDto { d := dbquery.TrainSize dq := d.Where() if query.Name != "" { @@ -100,11 +104,11 @@ func PageTrainSizeQuery(query *dto.PageTrainManageReqDto) (*dto.PageDto, error) if err != nil { panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) } - return &dto.PageDto{Total: int(total), PageQueryDto: query.PageQueryDto, Records: records}, nil + return &dto.PageDto{Total: int(total), PageQueryDto: query.PageQueryDto, Records: records} } // 查询列车尺寸信息列表 -func ListTrainSizeQuery(query *dto.TrainManageReqDto) ([]*model.TrainSize, error) { +func ListTrainSizeQuery(query *dto.TrainManageReqDto) []*model.TrainSize { d := dbquery.TrainSize dq := d.Where() if query.Name != "" { @@ -114,11 +118,11 @@ func ListTrainSizeQuery(query *dto.TrainManageReqDto) ([]*model.TrainSize, error if err != nil { panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) } - return records, nil + return records } // 创建列车尺寸信息 -func CreateTrainSize(td *dto.TrainSizeDto) (*model.TrainSize, error) { +func CreateTrainSize(td *dto.TrainSizeDto) *model.TrainSize { d := model.TrainSize{ Name: td.Name, CarriageLength: td.CarriageLength, @@ -130,7 +134,11 @@ func CreateTrainSize(td *dto.TrainSizeDto) (*model.TrainSize, error) { if err != nil { panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) } - return dt.Where(dt.Name.Eq(td.Name)).Order(dt.Name).Debug().First() + data, err := dt.Where(dt.Name.Eq(td.Name)).Order(dt.Name).Debug().First() + if err != nil { + panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) + } + return data } // 查询列车尺寸信息 @@ -185,7 +193,7 @@ func QueryProjectTrainSize(id int32) []*model.TrainSize { } // 查询列车轮径信息列表 -func PageTrainWheelDiameterQuery(query *dto.PageTrainManageReqDto) (*dto.PageDto, error) { +func PageTrainWheelDiameterQuery(query *dto.PageTrainManageReqDto) *dto.PageDto { d := dbquery.TrainWheelDiameter dq := d.Where() if query.Name != "" { @@ -195,11 +203,11 @@ func PageTrainWheelDiameterQuery(query *dto.PageTrainManageReqDto) (*dto.PageDto if err != nil { panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) } - return &dto.PageDto{Total: int(total), PageQueryDto: query.PageQueryDto, Records: records}, nil + return &dto.PageDto{Total: int(total), PageQueryDto: query.PageQueryDto, Records: records} } // 查询列车轮径信息列表 -func ListTrainWheelDiameterQuery(query *dto.TrainManageReqDto) ([]*model.TrainWheelDiameter, error) { +func ListTrainWheelDiameterQuery(query *dto.TrainManageReqDto) []*model.TrainWheelDiameter { d := dbquery.TrainWheelDiameter dq := d.Where() if query.Name != "" { @@ -209,11 +217,11 @@ func ListTrainWheelDiameterQuery(query *dto.TrainManageReqDto) ([]*model.TrainWh if err != nil { panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) } - return records, nil + return records } // 创建列车轮径信息 -func CreateTrainWheelDiameter(twd *dto.TrainWheelDiameterDto) (*model.TrainWheelDiameter, error) { +func CreateTrainWheelDiameter(twd *dto.TrainWheelDiameterDto) *model.TrainWheelDiameter { d := model.TrainWheelDiameter{ Name: twd.Name, Diameter: twd.Diameter, @@ -227,7 +235,11 @@ func CreateTrainWheelDiameter(twd *dto.TrainWheelDiameterDto) (*model.TrainWheel if err != nil { panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) } - return dt.Where(dt.Name.Eq(twd.Name)).Order(dt.Name).Debug().First() + data, err := dt.Where(dt.Name.Eq(twd.Name)).Order(dt.Name).Debug().First() + if err != nil { + panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) + } + return data } // 查询列车轮径信息 From e84db3a9bf25d0eeb75312ff7719962575fb0c6c Mon Sep 17 00:00:00 2001 From: weizhihong Date: Mon, 23 Oct 2023 09:45:04 +0800 Subject: [PATCH 02/16] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9api=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E6=89=93=E5=8D=B0=EF=BC=8C=E5=88=A0=E9=99=A4=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E6=96=87=E4=BB=B6=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/publishedGi.go | 44 +++++++++++------------------------------- rtss_simulation | 2 +- service/publishedGi.go | 16 +++++++++++---- service/simulation.go | 18 ----------------- 4 files changed, 24 insertions(+), 56 deletions(-) delete mode 100644 service/simulation.go diff --git a/api/publishedGi.go b/api/publishedGi.go index b4a3423..37257b5 100644 --- a/api/publishedGi.go +++ b/api/publishedGi.go @@ -8,10 +8,10 @@ import ( jwt "github.com/appleboy/gin-jwt/v2" "github.com/gin-gonic/gin" "joylink.club/bj-rtsts-server/db/model" - "joylink.club/bj-rtsts-server/dto" "joylink.club/bj-rtsts-server/dto/publishedGi" "joylink.club/bj-rtsts-server/middleware" "joylink.club/bj-rtsts-server/service" + "joylink.club/bj-rtsts-server/sys_error" ) func InitPublishedGiRouter(api *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) { @@ -41,13 +41,10 @@ func InitPublishedGiRouter(api *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddl // @Failure 500 {object} dto.ErrorDto // @Router /api/v1/publishedGi/paging [get] func pageQueryPublishedGi(c *gin.Context) { - user, _ := c.Get(middleware.IdentityKey) - slog.Debug("分页查询发布的图形数据", user) req := publishedGi.PublishedGiReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("查询失败,查询参数格式错误", err)) } - slog.Debug("分页查询发布的图形数据", req) page := service.PageQueryPublishedGi(&req) c.JSON(http.StatusOK, page) } @@ -68,13 +65,10 @@ func pageQueryPublishedGi(c *gin.Context) { // @Failure 500 {object} dto.ErrorDto // @Router /api/v1/publishedGi/list [get] func listQueryPublishedGi(c *gin.Context) { - user, _ := c.Get(middleware.IdentityKey) - slog.Debug("列表查询发布的图形数据", user) req := publishedGi.PublishedGiListReqDto{} if err := c.ShouldBindQuery(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("查询失败,查询参数格式错误", err)) } - slog.Debug("列表查询发布的图形数据", req) list := service.ListQueryPublishedGi(&req) c.JSON(http.StatusOK, list) } @@ -95,18 +89,12 @@ func listQueryPublishedGi(c *gin.Context) { // @Failure 500 {object} dto.ErrorDto // @Router /api/v1/publishedGi/{id} [get] func getPublishedGiById(c *gin.Context) { - user, _ := c.Get(middleware.IdentityKey) - slog.Debug("id查询发布的图形数据", user) idStr := c.Param("id") id, err := strconv.Atoi(idStr) if err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) - } - slog.Debug("id查询发布的图形数据", id) - entity, err := service.GetPublishedGiById(id) - if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) + panic(sys_error.New("查询失败,传入参数格式错误", err)) } + entity := service.GetPublishedGiById(id) c.JSON(http.StatusOK, entity) } @@ -130,10 +118,8 @@ func publishFromDraft(c *gin.Context) { slog.Debug("发布图形数据", user) req := publishedGi.PublishReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("发布失败,参数格式错误", err)) } - //todo - slog.Debug("发布图形数据请求参数", req) service.PublishFormDraft(&req, user.(*model.User)) } @@ -153,14 +139,11 @@ func publishFromDraft(c *gin.Context) { // @Failure 500 {object} dto.ErrorDto // @Router /api/v1/publishedGi/{id} [delete] func deletePublishedGiById(c *gin.Context) { - user, _ := c.Get(middleware.IdentityKey) - slog.Debug("id删除发布的图形数据", user) idStr := c.Param("id") id, err := strconv.Atoi(idStr) if err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("删除失败,传入参数格式错误", err)) } - slog.Debug("id查询发布的图形数据", id) service.DeletePublishedGiById(id) } @@ -186,11 +169,11 @@ func saveAsDraftingFromPublish(c *gin.Context) { slog.Debug("用户拉取发布图形数据", "userId", user, "发布图数据id", idStr) id, err := strconv.Atoi(idStr) if err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("另存为草稿失败,传入参数格式错误", err)) } req := publishedGi.PublishReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("另存为草稿失败,传入参数格式错误", err)) } service.SaveAsDraftingFromPublish(int32(id), user.(*model.User), req.Name) } @@ -211,16 +194,11 @@ func saveAsDraftingFromPublish(c *gin.Context) { // @Failure 500 {object} dto.ErrorDto // @Router /api/v1/publishedGi/name [get] func getPublishedGiByName(c *gin.Context) { - user, _ := c.Get(middleware.IdentityKey) - slog.Debug("name查询发布的图形数据", user) param := &publishedGi.PublishedGiSingleQueryDto{} if err := c.ShouldBind(param); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("查询失败,查询参数格式错误", err)) } slog.Debug("name查询发布的图形数据", param.Name) - entity, err := service.GetPublishedGiByName(param) - if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) - } + entity := service.GetPublishedGiByName(param) c.JSON(http.StatusOK, entity) } diff --git a/rtss_simulation b/rtss_simulation index 89dd583..365f5a5 160000 --- a/rtss_simulation +++ b/rtss_simulation @@ -1 +1 @@ -Subproject commit 89dd583d1990729e1925e31b7bb5da3c6aeb3a94 +Subproject commit 365f5a50d94b1ad1462d58d1e555d4fb1fd2bc7e diff --git a/service/publishedGi.go b/service/publishedGi.go index 389a63a..070f835 100644 --- a/service/publishedGi.go +++ b/service/publishedGi.go @@ -53,8 +53,12 @@ func ListAllPublishedGi() ([]*model.PublishedGi, error) { return dbquery.PublishedGi.Debug().Where(dbquery.PublishedGi.Status.Eq(1)).Find() } -func GetPublishedGiById(id int) (*model.PublishedGi, error) { - return dbquery.PublishedGi.Where(dbquery.PublishedGi.ID.Eq(int32(id))).Debug().First() +func GetPublishedGiById(id int) *model.PublishedGi { + data, err := dbquery.PublishedGi.Where(dbquery.PublishedGi.ID.Eq(int32(id))).Debug().First() + if err != nil { + panic(err) + } + return data } func PublishFormDraft(req *publishedGi.PublishReqDto, user *model.User) { @@ -151,12 +155,16 @@ func QueryProjectPublishedGi(id int32) []*model.PublishedGi { return publishedGis } -func GetPublishedGiByName(param *publishedGi.PublishedGiSingleQueryDto) (*model.PublishedGi, error) { +func GetPublishedGiByName(param *publishedGi.PublishedGiSingleQueryDto) *model.PublishedGi { where := dbquery.PublishedGi. Where(dbquery.PublishedGi.Name.Eq(param.Name)). Where(dbquery.PublishedGi.Status.Eq(1)) if !param.Detail { where = where.Omit(dbquery.PublishedGi.Proto) } - return where.Debug().First() + data, err := where.Debug().First() + if err != nil { + panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) + } + return data } diff --git a/service/simulation.go b/service/simulation.go deleted file mode 100644 index 9c4ed95..0000000 --- a/service/simulation.go +++ /dev/null @@ -1,18 +0,0 @@ -package service - -import ( - "google.golang.org/protobuf/proto" - "joylink.club/bj-rtsts-server/ats/verify/protos/graphicData" - "joylink.club/bj-rtsts-server/dto" -) - -// 查询地图数据 -func QueryRtssGraphicStorage(mapId int32) *graphicData.RtssGraphicStorage { - publishdata, err := GetPublishedGiById(int(mapId)) - if err != nil { - panic(dto.ErrorDto{Code: dto.QueryDBError, Message: err.Error()}) - } - graphicStorage := &graphicData.RtssGraphicStorage{} - proto.Unmarshal(publishdata.Proto, graphicStorage) - return graphicStorage -} From 57dc7850d4ad699eb5a0269c25df93abe979c3a7 Mon Sep 17 00:00:00 2001 From: weizhihong Date: Mon, 23 Oct 2023 13:41:58 +0800 Subject: [PATCH 03/16] =?UTF-8?q?=E3=80=90=E6=9D=83=E9=99=90=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=93=8D=E4=BD=9C=E7=9A=84=E9=83=A8=E5=88=86=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E8=AF=B4=E6=98=8E=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/auth.go | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/service/auth.go b/service/auth.go index eab2257..ed5298e 100644 --- a/service/auth.go +++ b/service/auth.go @@ -7,6 +7,7 @@ import ( "joylink.club/bj-rtsts-server/db/dbquery" "joylink.club/bj-rtsts-server/db/model" "joylink.club/bj-rtsts-server/dto" + "joylink.club/bj-rtsts-server/sys_error" ) // 查询权限角色信息列表 @@ -14,7 +15,7 @@ func PageAuthRoleQuery(query *dto.PageQueryDto) *dto.PageDto { d := dbquery.AuthRole records, total, err := d.Debug().Select(d.ID, d.Name).Order(d.CreateTime).FindByPage(query.Offset(), query.Size) if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) + panic(sys_error.New("查询权限数据库出错,请联系维护人员", err)) } return &dto.PageDto{Total: int(total), PageQueryDto: *query, Records: dto.ConvertFromAuthRole(records)} } @@ -24,7 +25,7 @@ func ListAuthRoleQuery() []*dto.AuthRoleRspDto { d := dbquery.AuthRole records, err := d.Debug().Select(d.ID, d.Name).Order(d.CreateTime).Find() if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) + panic(sys_error.New("查询权限数据库出错,请联系维护人员", err)) } return dto.ConvertFromAuthRole(records) } @@ -35,11 +36,11 @@ func CreateAuthRole(a *dto.AuthRoleReqDto) bool { aq := dbquery.AuthRole err := aq.Save(&d) if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) + panic(sys_error.New("保存权限数据库出错,请联系维护人员", err)) } n := len(a.AddPaths) if n == 0 { - return false + return true } // 查询刚插入的角色 newAuthRole, _ := aq.Where(aq.Name.Eq(a.Name)).Order(aq.CreateTime).Last() @@ -56,7 +57,7 @@ func QueryAuthRole(rid int32) *dto.AuthRoleDetailRspDto { // 查询用户角色信息 role, err := dbquery.AuthRole.Where(dbquery.AuthRole.ID.Eq(rid)).First() if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) + panic(sys_error.New("查询角色数据库出错,请联系维护人员", err)) } rsp := &dto.AuthRoleDetailRspDto{ Id: role.ID, @@ -71,7 +72,7 @@ func QueryAuthRoleByUid(uid int32) []*model.AuthRole { aru := dbquery.AuthRoleUser arus, err1 := aru.Distinct(aru.Rid).Select(aru.Rid).Where(aru.UID.Eq(uid)).Find() if err1 != nil { - panic(dto.ErrorDto{Code: dto.DataNotExist, Message: err1.Error()}) + panic(sys_error.New("查询角色数据库出错,请联系维护人员", err1)) } if len(arus) == 0 { return nil @@ -82,7 +83,7 @@ func QueryAuthRoleByUid(uid int32) []*model.AuthRole { } roles, err2 := dbquery.AuthRole.Where(dbquery.AuthRole.ID.In(rids...)).Find() if err2 != nil { - panic(dto.ErrorDto{Code: dto.DataNotExist, Message: err2.Error()}) + panic(sys_error.New("查询角色数据库发生错误,请联系维护人员", err2)) } return roles } @@ -92,7 +93,7 @@ func UpdateAuthRole(rid int32, info *dto.AuthRoleReqDto) bool { // 查询用户角色信息 role, err := dbquery.AuthRole.Where(dbquery.AuthRole.ID.Eq(rid)).First() if err != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err.Error()}) + panic(sys_error.New("更新角色数据库发生错误,不存在此用户", err)) } role.Name = info.Name // 更新名称 dbquery.AuthRole.Updates(role) @@ -119,18 +120,18 @@ func UpdateAuthRole(rid int32, info *dto.AuthRoleReqDto) bool { func DeleteAuthRole(rid int32) bool { oldD, err1 := dbquery.AuthRole.Where(dbquery.AuthRole.ID.Eq(rid)).First() if err1 != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err1.Error()}) + panic(sys_error.New("删除权限角色数据库发生错误", err1)) } if dto.IsSystemRole(oldD.ID) { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: "系统角色不可删除"}) + panic(sys_error.New("系统角色不可删除", err1)) } // 如果有用户关联则不删除 count, err2 := dbquery.AuthRoleUser.Where(dbquery.AuthRoleUser.Rid.Eq(rid)).Count() if err2 != nil { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: err2.Error()}) + panic(sys_error.New("删除失败,还存在用户关联", err2)) } if count > 0 { - panic(dto.ErrorDto{Code: dto.DataOperationError, Message: "有用户关联该角色"}) + panic(sys_error.New("删除失败,有用户关联该角色")) } // 删除用户关联关系 dbquery.AuthRoleUser.Where(dbquery.AuthRoleUser.Rid.Eq(rid)).Delete() From 18b15ad619058ad7fd346de2c9b1145234d67d1c Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Mon, 23 Oct 2023 17:35:58 +0800 Subject: [PATCH 04/16] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B1=8F=E8=94=BD?= =?UTF-8?q?=E9=97=A8=E7=9B=B8=E5=85=B3=E7=BB=84=E4=BB=B6=E3=80=81=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bj-rtss-message | 2 +- rtss_simulation | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bj-rtss-message b/bj-rtss-message index 9b1c6d7..60ed568 160000 --- a/bj-rtss-message +++ b/bj-rtss-message @@ -1 +1 @@ -Subproject commit 9b1c6d78012eff4f9d300412ad41c8175751767d +Subproject commit 60ed5685cf48665f31df84a62a1182bfcb08dbb2 diff --git a/rtss_simulation b/rtss_simulation index 365f5a5..51df0c5 160000 --- a/rtss_simulation +++ b/rtss_simulation @@ -1 +1 @@ -Subproject commit 365f5a50d94b1ad1462d58d1e555d4fb1fd2bc7e +Subproject commit 51df0c521e056d1260aedacf1b85c39162f4c7ac From 17143a20a383f6dfe3072c0f83e918a426acb6a7 Mon Sep 17 00:00:00 2001 From: xzb <223@qq.com> Date: Mon, 23 Oct 2023 18:01:48 +0800 Subject: [PATCH 05/16] =?UTF-8?q?=E8=AE=A1=E8=BD=B4=E5=8C=BA=E6=AE=B5?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wayside/memory/wayside_memory_section.go | 38 +++++++++++++++++++ .../wayside/memory/wayside_simulation.go | 11 +++--- 2 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 ats/verify/simulation/wayside/memory/wayside_memory_section.go diff --git a/ats/verify/simulation/wayside/memory/wayside_memory_section.go b/ats/verify/simulation/wayside/memory/wayside_memory_section.go new file mode 100644 index 0000000..48b60db --- /dev/null +++ b/ats/verify/simulation/wayside/memory/wayside_memory_section.go @@ -0,0 +1,38 @@ +package memory + +import ( + "joylink.club/bj-rtsts-server/ats/verify/protos/graphicData" + "joylink.club/bj-rtsts-server/ats/verify/protos/state" + "joylink.club/ecs" + "joylink.club/rtsssimulation/component" + "joylink.club/rtsssimulation/entity" +) + +func GetMapAllSectionState(sim *VerifySimulation, mapId int32) []*state.SectionState { + uidMap := QueryMapUidMapByType(mapId, &graphicData.Section{}) + var sectionArr []*state.SectionState + for _, u := range uidMap { + s := handlerSectionState(sim.World, u.Uid) + if s == nil { + continue + } + s.Id = u.CommonId + sectionArr = append(sectionArr, s) + } + return sectionArr +} +func handlerSectionState(w ecs.World, uid string) *state.SectionState { + entry, ok := entity.GetEntityByUid(w, uid) + if !ok { + //fmt.Printf("id=%s的信号机不存在", uid) + return nil + } + if entry.HasComponent(component.AxleSectionTag) { //计轴区段 + sectionState := &state.SectionState{} + axleState := component.AxleSectionStateType.Get(entry) + sectionState.Occupied = axleState.Occ + sectionState.Type = state.SectionType_Axle + return sectionState + } + return nil +} diff --git a/ats/verify/simulation/wayside/memory/wayside_simulation.go b/ats/verify/simulation/wayside/memory/wayside_simulation.go index a454111..fc4ed57 100644 --- a/ats/verify/simulation/wayside/memory/wayside_simulation.go +++ b/ats/verify/simulation/wayside/memory/wayside_simulation.go @@ -147,11 +147,12 @@ func (s *VerifySimulation) GetAllState(mapId int32) *state.PushedDevicesStatus { return &state.PushedDevicesStatus{ All: true, AllStatus: &state.AllDevicesStatus{ - SwitchState: GetMapAllTurnoutState(s, mapId), - TrainState: GetAllTrainState(s), - SignalState: GetMapAllSignalState(s, mapId), - ButtonState: GetMapAllStationButtonState(s, mapId), - PsdState: GetMapAllPsdState(s, mapId), + SwitchState: GetMapAllTurnoutState(s, mapId), + TrainState: GetAllTrainState(s), + SignalState: GetMapAllSignalState(s, mapId), + ButtonState: GetMapAllStationButtonState(s, mapId), + PsdState: GetMapAllPsdState(s, mapId), + SectionState: GetMapAllSectionState(s, mapId), }, } case graphicData.PictureType_RelayCabinetLayout: From 5efd93d91b27dcbfb4bcd0dae8439a56a932c3b7 Mon Sep 17 00:00:00 2001 From: weizhihong Date: Tue, 24 Oct 2023 09:03:38 +0800 Subject: [PATCH 06/16] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E8=81=94=E9=94=81=E6=96=B9=E6=B3=95=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../simulation/wayside/memory/wayside_simulation.go | 11 +++++++++++ bj-rtss-message | 2 +- rtss_simulation | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ats/verify/simulation/wayside/memory/wayside_simulation.go b/ats/verify/simulation/wayside/memory/wayside_simulation.go index a454111..f1ff62f 100644 --- a/ats/verify/simulation/wayside/memory/wayside_simulation.go +++ b/ats/verify/simulation/wayside/memory/wayside_simulation.go @@ -390,6 +390,17 @@ func (s *VerifySimulation) HandleSemiPhysicalTrainControlMsg(b []byte) { }) } +// 处理接到的联锁消息 +func (s *VerifySimulation) HandleDriverInfo(b []byte) { + +} + +// 采集联锁中的继电器消息 +func (s *VerifySimulation) CollectRelayInfo() *message.InterlockSendMsgPkg { + + return nil +} + func buildProtoRepository(mapIds []int32) (*proto.Repository, error) { repo := &proto.Repository{} var exceptStationGiMapIds []int32 diff --git a/bj-rtss-message b/bj-rtss-message index 9b1c6d7..60ed568 160000 --- a/bj-rtss-message +++ b/bj-rtss-message @@ -1 +1 @@ -Subproject commit 9b1c6d78012eff4f9d300412ad41c8175751767d +Subproject commit 60ed5685cf48665f31df84a62a1182bfcb08dbb2 diff --git a/rtss_simulation b/rtss_simulation index 365f5a5..f5e9aee 160000 --- a/rtss_simulation +++ b/rtss_simulation @@ -1 +1 @@ -Subproject commit 365f5a50d94b1ad1462d58d1e555d4fb1fd2bc7e +Subproject commit f5e9aeecc88bc2c60aac21b98e6f0b40d297d4ca From e057d8ec3a02b93915e92c4b09132dbc675b30f1 Mon Sep 17 00:00:00 2001 From: weizhihong Date: Tue, 24 Oct 2023 09:14:54 +0800 Subject: [PATCH 07/16] =?UTF-8?q?=E3=80=90=E8=81=94=E9=94=81=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E7=BB=93=E6=9E=84=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rtss_simulation | 2 +- third_party/message/interlock.go | 109 +++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 third_party/message/interlock.go diff --git a/rtss_simulation b/rtss_simulation index f5e9aee..3c65650 160000 --- a/rtss_simulation +++ b/rtss_simulation @@ -1 +1 @@ -Subproject commit f5e9aeecc88bc2c60aac21b98e6f0b40d297d4ca +Subproject commit 3c65650745096e41bb008c74db31aa943e41285a diff --git a/third_party/message/interlock.go b/third_party/message/interlock.go new file mode 100644 index 0000000..f868619 --- /dev/null +++ b/third_party/message/interlock.go @@ -0,0 +1,109 @@ +package message + +import "fmt" + +// 消息包头解析 +type InterlockMsgPkgHeader struct { + Header1 byte //包头1 1个字节 + Header2 byte //包头2 1个字节 + TypeCode uint8 //类型码 1个字节 0x02 + SerialNumber uint8 //序列号 1个字节 序列号0~255 + Reserve1 byte //预留 1个字节 + Reserve2 byte //预留 1个字节 +} + +func (h *InterlockMsgPkgHeader) Encode() []byte { + return []byte{h.Header1, h.Header2, h.TypeCode, h.SerialNumber, h.Reserve1, h.Reserve2} +} + +func (h *InterlockMsgPkgHeader) Decode(buf []byte) error { + if len(buf) < 6 { + return fmt.Errorf("数据少于6个字节") + } + h.Header1 = buf[0] + h.Header2 = buf[1] + h.TypeCode = buf[2] + h.SerialNumber = buf[3] + h.Reserve1 = buf[4] + h.Reserve2 = buf[5] + return nil +} + +// 消息包尾解析 +type InterlockMsgPkgTail struct { + Tail []byte // 包尾2个字节 +} + +func (t *InterlockMsgPkgTail) Encode() []byte { + if len(t.Tail) == 0 { + return make([]byte, 2) + } + return t.Tail +} + +func (t *InterlockMsgPkgTail) Decode(buf []byte) error { + if len(buf) < 2 { + return fmt.Errorf("数据少于2个字节") + } + t.Tail = buf[len(buf)-2:] + return nil +} + +// 发送给联锁的采集数据 +type InterlockSendMsgPkg struct { + Header *InterlockMsgPkgHeader // 包头 + Info []byte // 发给联锁的状态数据 + Tail *InterlockMsgPkgTail // 包尾 +} + +func (m *InterlockSendMsgPkg) Encode() []byte { + var data []byte + data = append(data, m.Header.Encode()...) + data = append(data, m.Info...) + data = append(data, m.Tail.Encode()...) + return data +} + +// 收到联锁发来的驱动数据 +type InterlockReceiveMsgPkg struct { + toagent_len int32 + et_out_num int32 + tcc_output_len int32 + Header *InterlockMsgPkgHeader // 包头 + syncZone []byte // 同步区状态 + driveInfo []byte // 驱动数据 + tccInfo []byte // 应答器报文 + Tail *InterlockMsgPkgTail // 包尾 +} + +// ET_OUT_NUM、TOAGENTLEN、TCC_OUTPUT_LEN(应答器数量*131)的具体数值取决于数据配置。 +func NewInterlockReceiveMsgPkg(tlen, etLen, tccLen int32) *InterlockReceiveMsgPkg { + return &InterlockReceiveMsgPkg{ + toagent_len: tlen, + et_out_num: etLen, + tcc_output_len: tccLen, + Header: &InterlockMsgPkgHeader{}, + Tail: &InterlockMsgPkgTail{}, + } +} + +func (t *InterlockReceiveMsgPkg) Decode(buf []byte) error { + var preIndex, lastIndex int32 = 0, 6 + // 包头 + t.Header.Decode(buf[preIndex:lastIndex]) + // 同步区状态 + preIndex = lastIndex + lastIndex = lastIndex + t.toagent_len + t.syncZone = buf[preIndex:lastIndex] + // 驱动数据 + preIndex = lastIndex + lastIndex = lastIndex + t.et_out_num + t.driveInfo = buf[preIndex:lastIndex] + // 应答器报文 + preIndex = lastIndex + lastIndex = lastIndex + t.tcc_output_len + t.tccInfo = buf[preIndex:lastIndex] + // 包尾 + t.Tail.Decode(buf) + return nil +} From 2d9f79fb8e31edac29f9c3eb631b9bddabc1ee32 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Tue, 24 Oct 2023 09:15:07 +0800 Subject: [PATCH 08/16] =?UTF-8?q?=E6=B6=88=E9=99=A4=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wayside/memory/wayside_simulation.go | 68 +++++++++---------- rtss_simulation | 2 +- 2 files changed, 34 insertions(+), 36 deletions(-) diff --git a/ats/verify/simulation/wayside/memory/wayside_simulation.go b/ats/verify/simulation/wayside/memory/wayside_simulation.go index 0491526..688b605 100644 --- a/ats/verify/simulation/wayside/memory/wayside_simulation.go +++ b/ats/verify/simulation/wayside/memory/wayside_simulation.go @@ -11,9 +11,6 @@ import ( "sync" "time" - "joylink.club/rtsssimulation/component" - "joylink.club/rtsssimulation/entity" - rtss_simulation "joylink.club/rtsssimulation" "joylink.club/bj-rtsts-server/ats/verify/protos/graphicData" @@ -168,33 +165,34 @@ func (s *VerifySimulation) GetAllState(mapId int32) *state.PushedDevicesStatus { // 获取门控箱状态 func (s *VerifySimulation) GetAllPSLState(mapId int32, boxId string) *state.PushedDevicesStatus { - world := s.GetSimulationWorld() - uidStructure := queryUidStructure[*stationUidStructure](mapId) - boxUid := uidStructure.GateBoxIds[boxId].Uid - mkxEntry, ok := entity.GetEntityByUid(world, boxUid) - var buttonStateArr []*state.ButtonState - if ok { - mkxCircuit := component.MkxCircuitType.Get(mkxEntry) - var boxArr []*ecs.Entry - boxArr = append(boxArr, mkxCircuit.PcbList...) - boxArr = append(boxArr, mkxCircuit.PobList...) - boxArr = append(boxArr, mkxCircuit.PabList...) - for _, mkxBoxEntry := range boxArr { - mkxBox := component.MkxBoxType.Get(mkxBoxEntry) - uid := component.UidType.Get(mkxBox.Btn).Id - down := component.BitStateType.Get(mkxBox.Btn).Val - buttonStateArr = append(buttonStateArr, &state.ButtonState{ - Id: uid, - Down: down, - }) - } - } - return &state.PushedDevicesStatus{ - All: true, - AllStatus: &state.AllDevicesStatus{ - ButtonState: buttonStateArr, - }, - } + //world := s.GetSimulationWorld() + //uidStructure := queryUidStructure[*stationUidStructure](mapId) + //boxUid := uidStructure.GateBoxIds[boxId].Uid + //mkxEntry, ok := entity.GetEntityByUid(world, boxUid) + //var buttonStateArr []*state.ButtonState + //if ok { + // mkxCircuit := component.MkxCircuitType.Get(mkxEntry) + // var boxArr []*ecs.Entry + // boxArr = append(boxArr, mkxCircuit.PcbList...) + // boxArr = append(boxArr, mkxCircuit.PobList...) + // boxArr = append(boxArr, mkxCircuit.PabList...) + // for _, mkxBoxEntry := range boxArr { + // mkxBox := component.MkxBoxType.Get(mkxBoxEntry) + // uid := component.UidType.Get(mkxBox.Btn).Id + // down := component.BitStateType.Get(mkxBox.Btn).Val + // buttonStateArr = append(buttonStateArr, &state.ButtonState{ + // Id: uid, + // Down: down, + // }) + // } + //} + //return &state.PushedDevicesStatus{ + // All: true, + // AllStatus: &state.AllDevicesStatus{ + // ButtonState: buttonStateArr, + // }, + //} + return nil } // 获取车站IBP状态 @@ -396,11 +394,11 @@ func (s *VerifySimulation) HandleDriverInfo(b []byte) { } -// 采集联锁中的继电器消息 -func (s *VerifySimulation) CollectRelayInfo() *message.InterlockSendMsgPkg { - - return nil -} +//// 采集联锁中的继电器消息 +//func (s *VerifySimulation) CollectRelayInfo() *message.InterlockSendMsgPkg { +// +// return nil +//} func buildProtoRepository(mapIds []int32) (*proto.Repository, error) { repo := &proto.Repository{} diff --git a/rtss_simulation b/rtss_simulation index f5e9aee..3c65650 160000 --- a/rtss_simulation +++ b/rtss_simulation @@ -1 +1 @@ -Subproject commit f5e9aeecc88bc2c60aac21b98e6f0b40d297d4ca +Subproject commit 3c65650745096e41bb008c74db31aa943e41285a From f521f45cca0501e40d54fd88f0a9a333dbb85b5d Mon Sep 17 00:00:00 2001 From: xzb <223@qq.com> Date: Tue, 24 Oct 2023 09:37:36 +0800 Subject: [PATCH 09/16] =?UTF-8?q?=E8=AE=A1=E8=BD=B4=E5=8C=BA=E6=AE=B5?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=9E=9A=E4=B8=BE=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../protos/graphicData/ibpGraphics.pb.go | 2 +- ats/verify/protos/graphicData/picture.pb.go | 2 +- .../protos/graphicData/pslGraphics.pb.go | 2 +- .../relayCabinetLayoutGraphics.pb.go | 270 +++++--- .../graphicData/stationLayoutGraphics.pb.go | 624 +++++++++--------- ats/verify/protos/state/device_state.pb.go | 2 +- dto/request_proto/request.pb.go | 133 +++- 7 files changed, 620 insertions(+), 415 deletions(-) diff --git a/ats/verify/protos/graphicData/ibpGraphics.pb.go b/ats/verify/protos/graphicData/ibpGraphics.pb.go index 099bc3d..177fcb3 100644 --- a/ats/verify/protos/graphicData/ibpGraphics.pb.go +++ b/ats/verify/protos/graphicData/ibpGraphics.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.31.0 // protoc v4.23.1 // source: ibpGraphics.proto diff --git a/ats/verify/protos/graphicData/picture.pb.go b/ats/verify/protos/graphicData/picture.pb.go index 30b00db..ef7ff2a 100644 --- a/ats/verify/protos/graphicData/picture.pb.go +++ b/ats/verify/protos/graphicData/picture.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.31.0 // protoc v4.23.1 // source: picture.proto diff --git a/ats/verify/protos/graphicData/pslGraphics.pb.go b/ats/verify/protos/graphicData/pslGraphics.pb.go index 3600846..f38f39c 100644 --- a/ats/verify/protos/graphicData/pslGraphics.pb.go +++ b/ats/verify/protos/graphicData/pslGraphics.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.31.0 // protoc v4.23.1 // source: pslGraphics.proto diff --git a/ats/verify/protos/graphicData/relayCabinetLayoutGraphics.pb.go b/ats/verify/protos/graphicData/relayCabinetLayoutGraphics.pb.go index 3e534ca..3a5d827 100644 --- a/ats/verify/protos/graphicData/relayCabinetLayoutGraphics.pb.go +++ b/ats/verify/protos/graphicData/relayCabinetLayoutGraphics.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.31.0 // protoc v4.23.1 // source: relayCabinetLayoutGraphics.proto @@ -100,6 +100,7 @@ type RelayCabinetGraphicStorage struct { UniqueIdPrefix *UniqueIdType `protobuf:"bytes,6,opt,name=UniqueIdPrefix,proto3" json:"UniqueIdPrefix,omitempty"` //设备唯一编码--前缀 PhaseFailureProtectors []*PhaseFailureProtector `protobuf:"bytes,7,rep,name=phaseFailureProtectors,proto3" json:"phaseFailureProtectors,omitempty"` CombinationtypeList []*Combinationtype `protobuf:"bytes,8,rep,name=combinationtypeList,proto3" json:"combinationtypeList,omitempty"` + SignalFaultAlarms []*SignalFaultAlarm `protobuf:"bytes,9,rep,name=signalFaultAlarms,proto3" json:"signalFaultAlarms,omitempty"` } func (x *RelayCabinetGraphicStorage) Reset() { @@ -183,6 +184,13 @@ func (x *RelayCabinetGraphicStorage) GetCombinationtypeList() []*Combinationtype return nil } +func (x *RelayCabinetGraphicStorage) GetSignalFaultAlarms() []*SignalFaultAlarm { + if x != nil { + return x.SignalFaultAlarms + } + return nil +} + type RelayCabinet struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -358,6 +366,62 @@ func (x *PhaseFailureProtector) GetCode() string { return "" } +// 信号机故障报警仪 +type SignalFaultAlarm struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Common *CommonInfo `protobuf:"bytes,1,opt,name=common,proto3" json:"common,omitempty"` + Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"` //编号 +} + +func (x *SignalFaultAlarm) Reset() { + *x = SignalFaultAlarm{} + if protoimpl.UnsafeEnabled { + mi := &file_relayCabinetLayoutGraphics_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignalFaultAlarm) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignalFaultAlarm) ProtoMessage() {} + +func (x *SignalFaultAlarm) ProtoReflect() protoreflect.Message { + mi := &file_relayCabinetLayoutGraphics_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignalFaultAlarm.ProtoReflect.Descriptor instead. +func (*SignalFaultAlarm) Descriptor() ([]byte, []int) { + return file_relayCabinetLayoutGraphics_proto_rawDescGZIP(), []int{4} +} + +func (x *SignalFaultAlarm) GetCommon() *CommonInfo { + if x != nil { + return x.Common + } + return nil +} + +func (x *SignalFaultAlarm) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + // 设备管理的继电器列表 type DeviceRelateRelay struct { state protoimpl.MessageState @@ -375,7 +439,7 @@ type DeviceRelateRelay struct { func (x *DeviceRelateRelay) Reset() { *x = DeviceRelateRelay{} if protoimpl.UnsafeEnabled { - mi := &file_relayCabinetLayoutGraphics_proto_msgTypes[4] + mi := &file_relayCabinetLayoutGraphics_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -388,7 +452,7 @@ func (x *DeviceRelateRelay) String() string { func (*DeviceRelateRelay) ProtoMessage() {} func (x *DeviceRelateRelay) ProtoReflect() protoreflect.Message { - mi := &file_relayCabinetLayoutGraphics_proto_msgTypes[4] + mi := &file_relayCabinetLayoutGraphics_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -401,7 +465,7 @@ func (x *DeviceRelateRelay) ProtoReflect() protoreflect.Message { // Deprecated: Use DeviceRelateRelay.ProtoReflect.Descriptor instead. func (*DeviceRelateRelay) Descriptor() ([]byte, []int) { - return file_relayCabinetLayoutGraphics_proto_rawDescGZIP(), []int{4} + return file_relayCabinetLayoutGraphics_proto_rawDescGZIP(), []int{5} } func (x *DeviceRelateRelay) GetCode() string { @@ -437,7 +501,7 @@ type Combinationtype struct { func (x *Combinationtype) Reset() { *x = Combinationtype{} if protoimpl.UnsafeEnabled { - mi := &file_relayCabinetLayoutGraphics_proto_msgTypes[5] + mi := &file_relayCabinetLayoutGraphics_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -450,7 +514,7 @@ func (x *Combinationtype) String() string { func (*Combinationtype) ProtoMessage() {} func (x *Combinationtype) ProtoReflect() protoreflect.Message { - mi := &file_relayCabinetLayoutGraphics_proto_msgTypes[5] + mi := &file_relayCabinetLayoutGraphics_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -463,7 +527,7 @@ func (x *Combinationtype) ProtoReflect() protoreflect.Message { // Deprecated: Use Combinationtype.ProtoReflect.Descriptor instead. func (*Combinationtype) Descriptor() ([]byte, []int) { - return file_relayCabinetLayoutGraphics_proto_rawDescGZIP(), []int{5} + return file_relayCabinetLayoutGraphics_proto_rawDescGZIP(), []int{6} } func (x *Combinationtype) GetCode() string { @@ -493,7 +557,7 @@ type UniqueIdType struct { func (x *UniqueIdType) Reset() { *x = UniqueIdType{} if protoimpl.UnsafeEnabled { - mi := &file_relayCabinetLayoutGraphics_proto_msgTypes[6] + mi := &file_relayCabinetLayoutGraphics_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -506,7 +570,7 @@ func (x *UniqueIdType) String() string { func (*UniqueIdType) ProtoMessage() {} func (x *UniqueIdType) ProtoReflect() protoreflect.Message { - mi := &file_relayCabinetLayoutGraphics_proto_msgTypes[6] + mi := &file_relayCabinetLayoutGraphics_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -519,7 +583,7 @@ func (x *UniqueIdType) ProtoReflect() protoreflect.Message { // Deprecated: Use UniqueIdType.ProtoReflect.Descriptor instead. func (*UniqueIdType) Descriptor() ([]byte, []int) { - return file_relayCabinetLayoutGraphics_proto_rawDescGZIP(), []int{6} + return file_relayCabinetLayoutGraphics_proto_rawDescGZIP(), []int{7} } func (x *UniqueIdType) GetCity() string { @@ -551,7 +615,7 @@ var file_relayCabinetLayoutGraphics_proto_rawDesc = []byte{ 0x74, 0x6f, 0x12, 0x17, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x43, 0x61, 0x62, 0x69, 0x6e, 0x65, 0x74, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x1b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, - 0x63, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc3, 0x04, 0x0a, 0x1a, 0x52, 0x65, 0x6c, + 0x63, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9c, 0x05, 0x0a, 0x1a, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x43, 0x61, 0x62, 0x69, 0x6e, 0x65, 0x74, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x12, 0x2b, 0x0a, 0x06, 0x63, 0x61, 0x6e, 0x76, 0x61, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, @@ -587,65 +651,76 @@ var file_relayCabinetLayoutGraphics_proto_rawDesc = []byte{ 0x28, 0x2e, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x43, 0x61, 0x62, 0x69, 0x6e, 0x65, 0x74, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x52, 0x13, 0x63, 0x6f, 0x6d, 0x62, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x53, - 0x0a, 0x0c, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x43, 0x61, 0x62, 0x69, 0x6e, 0x65, 0x74, 0x12, 0x2f, - 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, - 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, - 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, - 0x6f, 0x64, 0x65, 0x22, 0xac, 0x02, 0x0a, 0x05, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x12, 0x2f, 0x0a, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x57, + 0x0a, 0x11, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x41, 0x6c, 0x61, + 0x72, 0x6d, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x72, 0x65, 0x6c, 0x61, + 0x79, 0x43, 0x61, 0x62, 0x69, 0x6e, 0x65, 0x74, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, + 0x61, 0x74, 0x61, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x41, + 0x6c, 0x61, 0x72, 0x6d, 0x52, 0x11, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x46, 0x61, 0x75, 0x6c, + 0x74, 0x41, 0x6c, 0x61, 0x72, 0x6d, 0x73, 0x22, 0x53, 0x0a, 0x0c, 0x52, 0x65, 0x6c, 0x61, 0x79, + 0x43, 0x61, 0x62, 0x69, 0x6e, 0x65, 0x74, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, + 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0xac, 0x02, 0x0a, + 0x05, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, + 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x44, 0x0a, 0x08, 0x6e, + 0x65, 0x77, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, + 0x72, 0x65, 0x6c, 0x61, 0x79, 0x43, 0x61, 0x62, 0x69, 0x6e, 0x65, 0x74, 0x47, 0x72, 0x61, 0x70, + 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x2e, 0x4d, 0x6f, + 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x6e, 0x65, 0x77, 0x4d, 0x6f, 0x64, 0x65, + 0x6c, 0x22, 0x97, 0x01, 0x0a, 0x09, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x0b, 0x0a, 0x07, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, + 0x4a, 0x50, 0x58, 0x43, 0x5f, 0x31, 0x30, 0x30, 0x30, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x4a, + 0x50, 0x58, 0x43, 0x5f, 0x31, 0x37, 0x30, 0x30, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x4a, 0x57, + 0x4a, 0x58, 0x43, 0x5f, 0x34, 0x38, 0x30, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x4a, 0x57, 0x4a, + 0x58, 0x43, 0x5f, 0x48, 0x31, 0x32, 0x35, 0x5f, 0x38, 0x30, 0x10, 0x04, 0x12, 0x0d, 0x0a, 0x09, + 0x4a, 0x57, 0x58, 0x43, 0x5f, 0x31, 0x37, 0x30, 0x30, 0x10, 0x05, 0x12, 0x0d, 0x0a, 0x09, 0x4a, + 0x57, 0x58, 0x43, 0x5f, 0x48, 0x33, 0x34, 0x30, 0x10, 0x06, 0x12, 0x11, 0x0a, 0x0d, 0x4a, 0x59, + 0x4a, 0x58, 0x43, 0x5f, 0x31, 0x36, 0x30, 0x5f, 0x32, 0x36, 0x30, 0x10, 0x07, 0x12, 0x0c, 0x0a, + 0x08, 0x4a, 0x5a, 0x58, 0x43, 0x5f, 0x48, 0x31, 0x38, 0x10, 0x08, 0x22, 0x5c, 0x0a, 0x15, 0x50, + 0x68, 0x61, 0x73, 0x65, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x65, + 0x63, 0x74, 0x6f, 0x72, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, + 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x57, 0x0a, 0x10, 0x53, 0x69, 0x67, + 0x6e, 0x61, 0x6c, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x41, 0x6c, 0x61, 0x72, 0x6d, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, - 0x64, 0x65, 0x12, 0x44, 0x0a, 0x08, 0x6e, 0x65, 0x77, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x43, 0x61, 0x62, 0x69, - 0x6e, 0x65, 0x74, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, - 0x65, 0x6c, 0x61, 0x79, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, - 0x6e, 0x65, 0x77, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x22, 0x97, 0x01, 0x0a, 0x09, 0x4d, 0x6f, 0x64, - 0x65, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, - 0x6e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4a, 0x50, 0x58, 0x43, 0x5f, 0x31, 0x30, 0x30, 0x30, - 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x4a, 0x50, 0x58, 0x43, 0x5f, 0x31, 0x37, 0x30, 0x30, 0x10, - 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x4a, 0x57, 0x4a, 0x58, 0x43, 0x5f, 0x34, 0x38, 0x30, 0x10, 0x03, - 0x12, 0x11, 0x0a, 0x0d, 0x4a, 0x57, 0x4a, 0x58, 0x43, 0x5f, 0x48, 0x31, 0x32, 0x35, 0x5f, 0x38, - 0x30, 0x10, 0x04, 0x12, 0x0d, 0x0a, 0x09, 0x4a, 0x57, 0x58, 0x43, 0x5f, 0x31, 0x37, 0x30, 0x30, - 0x10, 0x05, 0x12, 0x0d, 0x0a, 0x09, 0x4a, 0x57, 0x58, 0x43, 0x5f, 0x48, 0x33, 0x34, 0x30, 0x10, - 0x06, 0x12, 0x11, 0x0a, 0x0d, 0x4a, 0x59, 0x4a, 0x58, 0x43, 0x5f, 0x31, 0x36, 0x30, 0x5f, 0x32, - 0x36, 0x30, 0x10, 0x07, 0x12, 0x0c, 0x0a, 0x08, 0x4a, 0x5a, 0x58, 0x43, 0x5f, 0x48, 0x31, 0x38, - 0x10, 0x08, 0x22, 0x5c, 0x0a, 0x15, 0x50, 0x68, 0x61, 0x73, 0x65, 0x46, 0x61, 0x69, 0x6c, 0x75, - 0x72, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x2f, 0x0a, 0x06, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, - 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, - 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, - 0x22, 0xc1, 0x01, 0x0a, 0x11, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x54, 0x0a, 0x10, 0x63, 0x6f, - 0x6d, 0x62, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x05, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x43, 0x61, 0x62, 0x69, - 0x6e, 0x65, 0x74, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, - 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x52, 0x10, + 0x64, 0x65, 0x22, 0xc1, 0x01, 0x0a, 0x11, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x6c, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x54, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x12, 0x42, 0x0a, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, - 0x74, 0x61, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x66, 0x2e, 0x44, 0x65, - 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, - 0x54, 0x79, 0x70, 0x65, 0x22, 0x43, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, - 0x65, 0x66, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, - 0x72, 0x65, 0x66, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x22, 0x7c, 0x0a, 0x0c, 0x55, 0x6e, 0x69, - 0x71, 0x75, 0x65, 0x49, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x69, 0x74, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, - 0x06, 0x6c, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6c, - 0x69, 0x6e, 0x65, 0x49, 0x64, 0x12, 0x40, 0x0a, 0x1b, 0x62, 0x65, 0x6c, 0x6f, 0x6e, 0x67, 0x73, - 0x43, 0x6f, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1b, 0x62, 0x65, 0x6c, 0x6f, - 0x6e, 0x67, 0x73, 0x43, 0x6f, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x53, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x21, 0x5a, 0x1f, 0x2e, 0x2f, 0x61, 0x74, 0x73, - 0x2f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x67, - 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x43, 0x61, + 0x62, 0x69, 0x6e, 0x65, 0x74, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, + 0x2e, 0x43, 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x74, 0x79, 0x70, 0x65, + 0x52, 0x10, 0x63, 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x12, 0x42, 0x0a, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, + 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x66, 0x2e, + 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x43, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x62, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1c, 0x0a, + 0x09, 0x72, 0x65, 0x66, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x09, 0x72, 0x65, 0x66, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x22, 0x7c, 0x0a, 0x0c, 0x55, + 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, + 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x69, 0x74, 0x79, 0x12, + 0x16, 0x0a, 0x06, 0x6c, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x6c, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x12, 0x40, 0x0a, 0x1b, 0x62, 0x65, 0x6c, 0x6f, 0x6e, + 0x67, 0x73, 0x43, 0x6f, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1b, 0x62, 0x65, + 0x6c, 0x6f, 0x6e, 0x67, 0x73, 0x43, 0x6f, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x21, 0x5a, 0x1f, 0x2e, 0x2f, 0x61, + 0x74, 0x73, 0x2f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x2f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -661,39 +736,42 @@ func file_relayCabinetLayoutGraphics_proto_rawDescGZIP() []byte { } var file_relayCabinetLayoutGraphics_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_relayCabinetLayoutGraphics_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_relayCabinetLayoutGraphics_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_relayCabinetLayoutGraphics_proto_goTypes = []interface{}{ (Relay_ModelType)(0), // 0: relayCabinetGraphicData.Relay.ModelType (*RelayCabinetGraphicStorage)(nil), // 1: relayCabinetGraphicData.RelayCabinetGraphicStorage (*RelayCabinet)(nil), // 2: relayCabinetGraphicData.RelayCabinet (*Relay)(nil), // 3: relayCabinetGraphicData.Relay (*PhaseFailureProtector)(nil), // 4: relayCabinetGraphicData.PhaseFailureProtector - (*DeviceRelateRelay)(nil), // 5: relayCabinetGraphicData.DeviceRelateRelay - (*Combinationtype)(nil), // 6: relayCabinetGraphicData.Combinationtype - (*UniqueIdType)(nil), // 7: relayCabinetGraphicData.UniqueIdType - (*Canvas)(nil), // 8: graphicData.Canvas - (*CommonInfo)(nil), // 9: graphicData.CommonInfo - (RelatedRef_DeviceType)(0), // 10: graphicData.RelatedRef.DeviceType + (*SignalFaultAlarm)(nil), // 5: relayCabinetGraphicData.SignalFaultAlarm + (*DeviceRelateRelay)(nil), // 6: relayCabinetGraphicData.DeviceRelateRelay + (*Combinationtype)(nil), // 7: relayCabinetGraphicData.Combinationtype + (*UniqueIdType)(nil), // 8: relayCabinetGraphicData.UniqueIdType + (*Canvas)(nil), // 9: graphicData.Canvas + (*CommonInfo)(nil), // 10: graphicData.CommonInfo + (RelatedRef_DeviceType)(0), // 11: graphicData.RelatedRef.DeviceType } var file_relayCabinetLayoutGraphics_proto_depIdxs = []int32{ - 8, // 0: relayCabinetGraphicData.RelayCabinetGraphicStorage.canvas:type_name -> graphicData.Canvas + 9, // 0: relayCabinetGraphicData.RelayCabinetGraphicStorage.canvas:type_name -> graphicData.Canvas 2, // 1: relayCabinetGraphicData.RelayCabinetGraphicStorage.relayCabinets:type_name -> relayCabinetGraphicData.RelayCabinet 3, // 2: relayCabinetGraphicData.RelayCabinetGraphicStorage.relays:type_name -> relayCabinetGraphicData.Relay - 5, // 3: relayCabinetGraphicData.RelayCabinetGraphicStorage.deviceRelateRelayList:type_name -> relayCabinetGraphicData.DeviceRelateRelay - 7, // 4: relayCabinetGraphicData.RelayCabinetGraphicStorage.UniqueIdPrefix:type_name -> relayCabinetGraphicData.UniqueIdType + 6, // 3: relayCabinetGraphicData.RelayCabinetGraphicStorage.deviceRelateRelayList:type_name -> relayCabinetGraphicData.DeviceRelateRelay + 8, // 4: relayCabinetGraphicData.RelayCabinetGraphicStorage.UniqueIdPrefix:type_name -> relayCabinetGraphicData.UniqueIdType 4, // 5: relayCabinetGraphicData.RelayCabinetGraphicStorage.phaseFailureProtectors:type_name -> relayCabinetGraphicData.PhaseFailureProtector - 6, // 6: relayCabinetGraphicData.RelayCabinetGraphicStorage.combinationtypeList:type_name -> relayCabinetGraphicData.Combinationtype - 9, // 7: relayCabinetGraphicData.RelayCabinet.common:type_name -> graphicData.CommonInfo - 9, // 8: relayCabinetGraphicData.Relay.common:type_name -> graphicData.CommonInfo - 0, // 9: relayCabinetGraphicData.Relay.newModel:type_name -> relayCabinetGraphicData.Relay.ModelType - 9, // 10: relayCabinetGraphicData.PhaseFailureProtector.common:type_name -> graphicData.CommonInfo - 6, // 11: relayCabinetGraphicData.DeviceRelateRelay.combinationtypes:type_name -> relayCabinetGraphicData.Combinationtype - 10, // 12: relayCabinetGraphicData.DeviceRelateRelay.deviceType:type_name -> graphicData.RelatedRef.DeviceType - 13, // [13:13] is the sub-list for method output_type - 13, // [13:13] is the sub-list for method input_type - 13, // [13:13] is the sub-list for extension type_name - 13, // [13:13] is the sub-list for extension extendee - 0, // [0:13] is the sub-list for field type_name + 7, // 6: relayCabinetGraphicData.RelayCabinetGraphicStorage.combinationtypeList:type_name -> relayCabinetGraphicData.Combinationtype + 5, // 7: relayCabinetGraphicData.RelayCabinetGraphicStorage.signalFaultAlarms:type_name -> relayCabinetGraphicData.SignalFaultAlarm + 10, // 8: relayCabinetGraphicData.RelayCabinet.common:type_name -> graphicData.CommonInfo + 10, // 9: relayCabinetGraphicData.Relay.common:type_name -> graphicData.CommonInfo + 0, // 10: relayCabinetGraphicData.Relay.newModel:type_name -> relayCabinetGraphicData.Relay.ModelType + 10, // 11: relayCabinetGraphicData.PhaseFailureProtector.common:type_name -> graphicData.CommonInfo + 10, // 12: relayCabinetGraphicData.SignalFaultAlarm.common:type_name -> graphicData.CommonInfo + 7, // 13: relayCabinetGraphicData.DeviceRelateRelay.combinationtypes:type_name -> relayCabinetGraphicData.Combinationtype + 11, // 14: relayCabinetGraphicData.DeviceRelateRelay.deviceType:type_name -> graphicData.RelatedRef.DeviceType + 15, // [15:15] is the sub-list for method output_type + 15, // [15:15] is the sub-list for method input_type + 15, // [15:15] is the sub-list for extension type_name + 15, // [15:15] is the sub-list for extension extendee + 0, // [0:15] is the sub-list for field type_name } func init() { file_relayCabinetLayoutGraphics_proto_init() } @@ -752,7 +830,7 @@ func file_relayCabinetLayoutGraphics_proto_init() { } } file_relayCabinetLayoutGraphics_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeviceRelateRelay); i { + switch v := v.(*SignalFaultAlarm); i { case 0: return &v.state case 1: @@ -764,7 +842,7 @@ func file_relayCabinetLayoutGraphics_proto_init() { } } file_relayCabinetLayoutGraphics_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Combinationtype); i { + switch v := v.(*DeviceRelateRelay); i { case 0: return &v.state case 1: @@ -776,6 +854,18 @@ func file_relayCabinetLayoutGraphics_proto_init() { } } file_relayCabinetLayoutGraphics_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Combinationtype); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_relayCabinetLayoutGraphics_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UniqueIdType); i { case 0: return &v.state @@ -794,7 +884,7 @@ func file_relayCabinetLayoutGraphics_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_relayCabinetLayoutGraphics_proto_rawDesc, NumEnums: 1, - NumMessages: 7, + NumMessages: 8, NumExtensions: 0, NumServices: 0, }, diff --git a/ats/verify/protos/graphicData/stationLayoutGraphics.pb.go b/ats/verify/protos/graphicData/stationLayoutGraphics.pb.go index 673b869..5e86820 100644 --- a/ats/verify/protos/graphicData/stationLayoutGraphics.pb.go +++ b/ats/verify/protos/graphicData/stationLayoutGraphics.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.31.0 // protoc v4.23.1 // source: stationLayoutGraphics.proto @@ -271,14 +271,15 @@ func (Section_SectionType) EnumDescriptor() ([]byte, []int) { type RelatedRef_DeviceType int32 const ( - RelatedRef_Section RelatedRef_DeviceType = 0 - RelatedRef_Turnout RelatedRef_DeviceType = 1 - RelatedRef_TrainWindow RelatedRef_DeviceType = 2 - RelatedRef_AxleCounting RelatedRef_DeviceType = 3 - RelatedRef_SectionLink RelatedRef_DeviceType = 4 - RelatedRef_signal RelatedRef_DeviceType = 5 - RelatedRef_station RelatedRef_DeviceType = 6 - RelatedRef_ScreenDoor RelatedRef_DeviceType = 7 + RelatedRef_Section RelatedRef_DeviceType = 0 + RelatedRef_Turnout RelatedRef_DeviceType = 1 + RelatedRef_TrainWindow RelatedRef_DeviceType = 2 + RelatedRef_AxleCounting RelatedRef_DeviceType = 3 + RelatedRef_SectionLink RelatedRef_DeviceType = 4 + RelatedRef_signal RelatedRef_DeviceType = 5 + RelatedRef_station RelatedRef_DeviceType = 6 + RelatedRef_ScreenDoor RelatedRef_DeviceType = 7 + RelatedRef_SignalFaultAlarm RelatedRef_DeviceType = 8 ) // Enum value maps for RelatedRef_DeviceType. @@ -292,16 +293,18 @@ var ( 5: "signal", 6: "station", 7: "ScreenDoor", + 8: "SignalFaultAlarm", } RelatedRef_DeviceType_value = map[string]int32{ - "Section": 0, - "Turnout": 1, - "TrainWindow": 2, - "AxleCounting": 3, - "SectionLink": 4, - "signal": 5, - "station": 6, - "ScreenDoor": 7, + "Section": 0, + "Turnout": 1, + "TrainWindow": 2, + "AxleCounting": 3, + "SectionLink": 4, + "signal": 5, + "station": 6, + "ScreenDoor": 7, + "SignalFaultAlarm": 8, } ) @@ -4274,7 +4277,7 @@ var file_stationLayoutGraphics_proto_rawDesc = []byte{ 0x64, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x30, 0x0a, 0x0b, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x50, 0x68, 0x79, 0x73, 0x69, 0x63, 0x61, 0x6c, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x75, 0x72, 0x6e, 0x6f, 0x75, - 0x74, 0x50, 0x68, 0x79, 0x73, 0x69, 0x63, 0x61, 0x6c, 0x10, 0x02, 0x22, 0xcd, 0x02, 0x0a, 0x0a, + 0x74, 0x50, 0x68, 0x79, 0x73, 0x69, 0x63, 0x61, 0x6c, 0x10, 0x02, 0x22, 0xe3, 0x02, 0x0a, 0x0a, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x66, 0x12, 0x42, 0x0a, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x6c, @@ -4285,7 +4288,7 @@ var file_stationLayoutGraphics_proto_rawDesc = []byte{ 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x66, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x6f, - 0x72, 0x74, 0x22, 0x83, 0x01, 0x0a, 0x0a, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, + 0x72, 0x74, 0x22, 0x99, 0x01, 0x0a, 0x0a, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x54, 0x75, 0x72, 0x6e, 0x6f, 0x75, 0x74, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, @@ -4293,312 +4296,313 @@ var file_stationLayoutGraphics_proto_rawDesc = []byte{ 0x0a, 0x0b, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x6b, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x10, 0x05, 0x12, 0x0b, 0x0a, 0x07, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x10, 0x06, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x63, 0x72, 0x65, - 0x65, 0x6e, 0x44, 0x6f, 0x6f, 0x72, 0x10, 0x07, 0x22, 0x21, 0x0a, 0x0a, 0x44, 0x65, 0x76, 0x69, - 0x63, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x05, 0x0a, 0x01, 0x41, 0x10, 0x00, 0x12, 0x05, 0x0a, - 0x01, 0x42, 0x10, 0x01, 0x12, 0x05, 0x0a, 0x01, 0x43, 0x10, 0x02, 0x22, 0x3b, 0x0a, 0x0d, 0x54, - 0x75, 0x72, 0x6e, 0x6f, 0x75, 0x74, 0x50, 0x6f, 0x73, 0x52, 0x65, 0x66, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x76, 0x0a, 0x09, 0x53, 0x65, 0x70, 0x61, - 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, - 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x73, 0x65, - 0x70, 0x61, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, - 0x22, 0xcd, 0x02, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x65, 0x72, - 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, - 0x6e, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x46, 0x0a, 0x0f, 0x6b, 0x69, 0x6c, 0x6f, 0x6d, 0x65, 0x74, - 0x65, 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, - 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4b, 0x69, 0x6c, - 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x0f, 0x6b, 0x69, - 0x6c, 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x12, 0x3f, 0x0a, - 0x0e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65, 0x66, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, - 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x66, 0x52, 0x0e, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x65, 0x72, 0x52, 0x65, 0x66, 0x12, 0x30, - 0x0a, 0x13, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x53, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x63, 0x65, 0x6e, - 0x74, 0x72, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x22, 0x8b, 0x01, 0x0a, 0x09, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x12, 0x41, - 0x0a, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, - 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, - 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, - 0x64, 0x22, 0x2b, 0x0a, 0x0a, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x0b, 0x0a, 0x07, 0x54, 0x75, 0x72, 0x6e, 0x6f, 0x75, 0x74, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, - 0x41, 0x78, 0x6c, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x10, 0x01, 0x22, 0xe2, - 0x02, 0x0a, 0x0b, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x2f, - 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, - 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, - 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, - 0x6f, 0x64, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, - 0x61, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, - 0x0e, 0x0a, 0x02, 0x75, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x75, 0x70, 0x12, - 0x30, 0x0a, 0x07, 0x61, 0x53, 0x69, 0x6d, 0x52, 0x65, 0x66, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x16, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x53, - 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x52, 0x07, 0x61, 0x53, 0x69, 0x6d, 0x52, 0x65, - 0x66, 0x12, 0x30, 0x0a, 0x07, 0x62, 0x53, 0x69, 0x6d, 0x52, 0x65, 0x66, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, - 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x52, 0x07, 0x62, 0x53, 0x69, 0x6d, - 0x52, 0x65, 0x66, 0x12, 0x2b, 0x0a, 0x04, 0x61, 0x52, 0x65, 0x66, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, - 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x66, 0x52, 0x04, 0x61, 0x52, 0x65, 0x66, - 0x12, 0x2b, 0x0a, 0x04, 0x62, 0x52, 0x65, 0x66, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, - 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x6c, - 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x66, 0x52, 0x04, 0x62, 0x52, 0x65, 0x66, 0x12, 0x14, 0x0a, - 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x22, 0xb6, 0x02, 0x0a, 0x13, 0x41, 0x78, 0x6c, 0x65, 0x43, 0x6f, 0x75, 0x6e, - 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x06, 0x63, + 0x65, 0x6e, 0x44, 0x6f, 0x6f, 0x72, 0x10, 0x07, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x69, 0x67, 0x6e, + 0x61, 0x6c, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x41, 0x6c, 0x61, 0x72, 0x6d, 0x10, 0x08, 0x22, 0x21, + 0x0a, 0x0a, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x05, 0x0a, 0x01, + 0x41, 0x10, 0x00, 0x12, 0x05, 0x0a, 0x01, 0x42, 0x10, 0x01, 0x12, 0x05, 0x0a, 0x01, 0x43, 0x10, + 0x02, 0x22, 0x3b, 0x0a, 0x0d, 0x54, 0x75, 0x72, 0x6e, 0x6f, 0x75, 0x74, 0x50, 0x6f, 0x73, 0x52, + 0x65, 0x66, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x76, + 0x0a, 0x09, 0x53, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, - 0x12, 0x2a, 0x0a, 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x12, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x50, - 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x2d, 0x0a, 0x05, - 0x70, 0x61, 0x52, 0x65, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, - 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, - 0x64, 0x52, 0x65, 0x66, 0x52, 0x05, 0x70, 0x61, 0x52, 0x65, 0x66, 0x12, 0x2d, 0x0a, 0x05, 0x70, - 0x62, 0x52, 0x65, 0x66, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, - 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, - 0x52, 0x65, 0x66, 0x52, 0x05, 0x70, 0x62, 0x52, 0x65, 0x66, 0x12, 0x3a, 0x0a, 0x0a, 0x74, 0x75, - 0x72, 0x6e, 0x6f, 0x75, 0x74, 0x50, 0x6f, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x75, 0x72, - 0x6e, 0x6f, 0x75, 0x74, 0x50, 0x6f, 0x73, 0x52, 0x65, 0x66, 0x52, 0x0a, 0x74, 0x75, 0x72, 0x6e, - 0x6f, 0x75, 0x74, 0x50, 0x6f, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0xd9, 0x01, 0x0a, - 0x0c, 0x4c, 0x6f, 0x67, 0x69, 0x63, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, - 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, - 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12, - 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, - 0x64, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, - 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x24, - 0x0a, 0x0d, 0x61, 0x78, 0x6c, 0x65, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x78, 0x6c, 0x65, 0x53, 0x65, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x75, - 0x72, 0x6e, 0x6f, 0x75, 0x74, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, - 0x75, 0x72, 0x6e, 0x6f, 0x75, 0x74, 0x49, 0x64, 0x22, 0x97, 0x03, 0x0a, 0x0c, 0x54, 0x72, 0x61, - 0x63, 0x6b, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, - 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x06, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, 0x61, - 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, - 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x12, 0x3e, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, - 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x72, 0x61, - 0x63, 0x6b, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x12, 0x28, 0x0a, 0x0f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, - 0x6f, 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x65, 0x73, 0x74, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x2c, 0x0a, 0x11, 0x74, 0x72, - 0x61, 0x63, 0x6b, 0x4c, 0x6f, 0x67, 0x69, 0x63, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x11, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x4c, 0x6f, 0x67, 0x69, - 0x63, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x73, 0x43, 0x75, - 0x72, 0x76, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x43, 0x75, 0x72, - 0x76, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x43, 0x6f, - 0x75, 0x6e, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x73, 0x65, 0x67, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x28, 0x0a, 0x10, 0x54, 0x72, 0x61, 0x63, - 0x6b, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, - 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x4f, 0x52, 0x4b, - 0x10, 0x01, 0x22, 0x9c, 0x01, 0x0a, 0x11, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x4c, 0x6f, 0x67, 0x69, - 0x63, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, - 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x06, 0x70, 0x6f, 0x69, - 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, 0x61, 0x70, - 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x70, - 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x6e, - 0x67, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, - 0x68, 0x22, 0xe0, 0x02, 0x0a, 0x0c, 0x53, 0x74, 0x6f, 0x70, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, - 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x69, 0x70, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x66, 0x6c, 0x69, 0x70, 0x12, 0x3e, 0x0a, 0x08, 0x63, - 0x6f, 0x61, 0x63, 0x68, 0x4e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, - 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x53, 0x74, 0x6f, 0x70, - 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x61, 0x63, 0x68, 0x4e, 0x75, - 0x6d, 0x52, 0x08, 0x63, 0x6f, 0x61, 0x63, 0x68, 0x4e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x69, - 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x12, 0x46, 0x0a, 0x0f, 0x6b, 0x69, 0x6c, 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x79, - 0x73, 0x74, 0x65, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x72, 0x61, - 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4b, 0x69, 0x6c, 0x6f, 0x6d, 0x65, 0x74, - 0x65, 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x0f, 0x6b, 0x69, 0x6c, 0x6f, 0x6d, 0x65, - 0x74, 0x65, 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x12, 0x2f, 0x0a, 0x06, 0x72, 0x65, 0x66, - 0x44, 0x65, 0x76, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, - 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x52, - 0x65, 0x66, 0x52, 0x06, 0x72, 0x65, 0x66, 0x44, 0x65, 0x76, 0x22, 0x28, 0x0a, 0x08, 0x43, 0x6f, - 0x61, 0x63, 0x68, 0x4e, 0x75, 0x6d, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x6f, 0x75, 0x72, 0x10, 0x00, - 0x12, 0x07, 0x0a, 0x03, 0x53, 0x69, 0x78, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x69, 0x67, - 0x68, 0x74, 0x10, 0x02, 0x22, 0xb9, 0x01, 0x0a, 0x0a, 0x53, 0x70, 0x6b, 0x73, 0x53, 0x77, 0x69, - 0x74, 0x63, 0x68, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, - 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x69, 0x70, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x66, 0x6c, 0x69, 0x70, 0x12, 0x14, 0x0a, 0x05, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x66, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x66, 0x53, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x66, 0x53, 0x74, 0x61, 0x6e, 0x64, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x66, 0x53, 0x74, 0x61, 0x6e, 0x64, - 0x22, 0x96, 0x01, 0x0a, 0x09, 0x45, 0x73, 0x62, 0x42, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x12, 0x2f, - 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, - 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, - 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, - 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x69, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x04, 0x66, 0x6c, 0x69, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1a, 0x0a, - 0x08, 0x72, 0x65, 0x66, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x72, 0x65, 0x66, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x22, 0xcf, 0x01, 0x0a, 0x08, 0x47, 0x61, - 0x74, 0x65, 0x64, 0x42, 0x6f, 0x78, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x12, 0x24, 0x0a, 0x0d, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x54, 0x79, 0x70, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, + 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x22, 0xcd, 0x02, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x70, 0x6f, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, - 0x6c, 0x69, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x66, 0x6c, 0x69, 0x70, 0x12, - 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x24, 0x0a, 0x0d, 0x72, 0x65, 0x66, 0x53, 0x63, 0x72, 0x65, - 0x65, 0x6e, 0x44, 0x6f, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, - 0x66, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x44, 0x6f, 0x6f, 0x72, 0x12, 0x2e, 0x0a, 0x12, 0x72, - 0x65, 0x66, 0x47, 0x61, 0x74, 0x65, 0x64, 0x42, 0x6f, 0x78, 0x4d, 0x61, 0x70, 0x43, 0x6f, 0x64, - 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x72, 0x65, 0x66, 0x47, 0x61, 0x74, 0x65, - 0x64, 0x42, 0x6f, 0x78, 0x4d, 0x61, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x9e, 0x01, 0x0a, 0x0f, - 0x53, 0x6c, 0x6f, 0x70, 0x65, 0x4b, 0x69, 0x6c, 0x6f, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x72, 0x12, - 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x63, 0x6f, 0x64, 0x65, 0x12, 0x46, 0x0a, 0x0f, 0x6b, 0x69, 0x6c, 0x6f, 0x6d, 0x65, 0x74, 0x65, - 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, - 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4b, 0x69, 0x6c, 0x6f, - 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x0f, 0x6b, 0x69, 0x6c, - 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x22, 0xa2, 0x01, 0x0a, - 0x13, 0x43, 0x75, 0x72, 0x76, 0x61, 0x74, 0x75, 0x72, 0x65, 0x4b, 0x69, 0x6c, 0x6f, 0x4d, 0x61, - 0x72, 0x6b, 0x65, 0x72, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x74, + 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x65, + 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x46, 0x0a, 0x0f, 0x6b, + 0x69, 0x6c, 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, + 0x74, 0x61, 0x2e, 0x4b, 0x69, 0x6c, 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x52, 0x0f, 0x6b, 0x69, 0x6c, 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x79, 0x73, + 0x74, 0x65, 0x6d, 0x12, 0x3f, 0x0a, 0x0e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x6e, 0x64, + 0x65, 0x72, 0x52, 0x65, 0x66, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, + 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, + 0x64, 0x52, 0x65, 0x66, 0x52, 0x0e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x65, + 0x72, 0x52, 0x65, 0x66, 0x12, 0x30, 0x0a, 0x13, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x69, + 0x7a, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x13, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x53, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x8b, 0x01, 0x0a, 0x09, 0x53, 0x69, 0x6d, 0x70, 0x6c, + 0x65, 0x52, 0x65, 0x66, 0x12, 0x41, 0x0a, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, + 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, + 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x66, + 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x76, + 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x2b, 0x0a, 0x0a, 0x44, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x54, 0x75, 0x72, 0x6e, 0x6f, 0x75, 0x74, + 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x41, 0x78, 0x6c, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x69, + 0x6e, 0x67, 0x10, 0x01, 0x22, 0xe2, 0x02, 0x0a, 0x0b, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x46, 0x0a, 0x0f, 0x6b, 0x69, 0x6c, - 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, - 0x2e, 0x4b, 0x69, 0x6c, 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, - 0x52, 0x0f, 0x6b, 0x69, 0x6c, 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, - 0x6d, 0x22, 0xa8, 0x01, 0x0a, 0x05, 0x53, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x2f, 0x0a, 0x06, 0x63, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x70, 0x6f, 0x69, + 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, 0x61, 0x70, + 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x75, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x02, 0x75, 0x70, 0x12, 0x30, 0x0a, 0x07, 0x61, 0x53, 0x69, 0x6d, 0x52, 0x65, 0x66, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, + 0x44, 0x61, 0x74, 0x61, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x52, 0x07, + 0x61, 0x53, 0x69, 0x6d, 0x52, 0x65, 0x66, 0x12, 0x30, 0x0a, 0x07, 0x62, 0x53, 0x69, 0x6d, 0x52, + 0x65, 0x66, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, + 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x66, + 0x52, 0x07, 0x62, 0x53, 0x69, 0x6d, 0x52, 0x65, 0x66, 0x12, 0x2b, 0x0a, 0x04, 0x61, 0x52, 0x65, + 0x66, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, + 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x66, + 0x52, 0x04, 0x61, 0x52, 0x65, 0x66, 0x12, 0x2b, 0x0a, 0x04, 0x62, 0x52, 0x65, 0x66, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, + 0x74, 0x61, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x66, 0x52, 0x04, 0x62, + 0x52, 0x65, 0x66, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0xb6, 0x02, 0x0a, 0x13, 0x41, 0x78, + 0x6c, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, + 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, + 0x44, 0x61, 0x74, 0x61, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x73, 0x12, 0x2d, 0x0a, 0x05, 0x70, 0x61, 0x52, 0x65, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, + 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x66, 0x52, 0x05, 0x70, 0x61, 0x52, 0x65, + 0x66, 0x12, 0x2d, 0x0a, 0x05, 0x70, 0x62, 0x52, 0x65, 0x66, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, + 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x66, 0x52, 0x05, 0x70, 0x62, 0x52, 0x65, 0x66, + 0x12, 0x3a, 0x0a, 0x0a, 0x74, 0x75, 0x72, 0x6e, 0x6f, 0x75, 0x74, 0x50, 0x6f, 0x73, 0x18, 0x06, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, + 0x74, 0x61, 0x2e, 0x54, 0x75, 0x72, 0x6e, 0x6f, 0x75, 0x74, 0x50, 0x6f, 0x73, 0x52, 0x65, 0x66, + 0x52, 0x0a, 0x74, 0x75, 0x72, 0x6e, 0x6f, 0x75, 0x74, 0x50, 0x6f, 0x73, 0x12, 0x14, 0x0a, 0x05, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x22, 0xd9, 0x01, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x69, 0x63, 0x53, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, + 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x70, 0x6f, 0x69, 0x6e, + 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, + 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x70, 0x6f, + 0x69, 0x6e, 0x74, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x61, 0x78, 0x6c, 0x65, 0x53, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x78, 0x6c, + 0x65, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x75, 0x72, 0x6e, 0x6f, 0x75, 0x74, 0x49, 0x64, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x75, 0x72, 0x6e, 0x6f, 0x75, 0x74, 0x49, 0x64, 0x22, 0x97, + 0x03, 0x0a, 0x0c, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x12, 0x2a, 0x0a, 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x12, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x50, + 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, + 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x3e, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, + 0x74, 0x61, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, + 0x12, 0x2c, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x4c, 0x6f, 0x67, 0x69, 0x63, 0x53, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x11, 0x74, 0x72, 0x61, + 0x63, 0x6b, 0x4c, 0x6f, 0x67, 0x69, 0x63, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, + 0x0a, 0x07, 0x69, 0x73, 0x43, 0x75, 0x72, 0x76, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x07, 0x69, 0x73, 0x43, 0x75, 0x72, 0x76, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x73, 0x65, 0x67, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0d, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x28, + 0x0a, 0x10, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x08, + 0x0a, 0x04, 0x46, 0x4f, 0x52, 0x4b, 0x10, 0x01, 0x22, 0x9c, 0x01, 0x0a, 0x11, 0x54, 0x72, 0x61, + 0x63, 0x6b, 0x4c, 0x6f, 0x67, 0x69, 0x63, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2f, + 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, + 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, + 0x2a, 0x0a, 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x12, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x50, 0x6f, + 0x69, 0x6e, 0x74, 0x52, 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, + 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0xe0, 0x02, 0x0a, 0x0c, 0x53, 0x74, 0x6f, 0x70, + 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, + 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x66, 0x6c, 0x69, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x66, 0x6c, 0x69, + 0x70, 0x12, 0x3e, 0x0a, 0x08, 0x63, 0x6f, 0x61, 0x63, 0x68, 0x4e, 0x75, 0x6d, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, + 0x61, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, + 0x6f, 0x61, 0x63, 0x68, 0x4e, 0x75, 0x6d, 0x52, 0x08, 0x63, 0x6f, 0x61, 0x63, 0x68, 0x4e, 0x75, + 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x46, 0x0a, 0x0f, 0x6b, 0x69, 0x6c, 0x6f, 0x6d, + 0x65, 0x74, 0x65, 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4b, + 0x69, 0x6c, 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x0f, + 0x6b, 0x69, 0x6c, 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x12, + 0x2f, 0x0a, 0x06, 0x72, 0x65, 0x66, 0x44, 0x65, 0x76, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, + 0x6c, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x66, 0x52, 0x06, 0x72, 0x65, 0x66, 0x44, 0x65, 0x76, + 0x22, 0x28, 0x0a, 0x08, 0x43, 0x6f, 0x61, 0x63, 0x68, 0x4e, 0x75, 0x6d, 0x12, 0x08, 0x0a, 0x04, + 0x46, 0x6f, 0x75, 0x72, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x69, 0x78, 0x10, 0x01, 0x12, + 0x09, 0x0a, 0x05, 0x45, 0x69, 0x67, 0x68, 0x74, 0x10, 0x02, 0x22, 0xb9, 0x01, 0x0a, 0x0a, 0x53, + 0x70, 0x6b, 0x73, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, + 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x66, 0x6c, 0x69, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x66, 0x6c, + 0x69, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x66, 0x53, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x72, + 0x65, 0x66, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, + 0x66, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, + 0x66, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x22, 0x96, 0x01, 0x0a, 0x09, 0x45, 0x73, 0x62, 0x42, 0x75, + 0x74, 0x74, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, + 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x69, + 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x66, 0x6c, 0x69, 0x70, 0x12, 0x14, 0x0a, + 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x66, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x66, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x22, + 0xcf, 0x01, 0x0a, 0x08, 0x47, 0x61, 0x74, 0x65, 0x64, 0x42, 0x6f, 0x78, 0x12, 0x2f, 0x0a, 0x06, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, + 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x0a, + 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x69, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x04, 0x66, 0x6c, 0x69, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x24, 0x0a, 0x0d, 0x72, + 0x65, 0x66, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x44, 0x6f, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x66, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x44, 0x6f, 0x6f, + 0x72, 0x12, 0x2e, 0x0a, 0x12, 0x72, 0x65, 0x66, 0x47, 0x61, 0x74, 0x65, 0x64, 0x42, 0x6f, 0x78, + 0x4d, 0x61, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x72, + 0x65, 0x66, 0x47, 0x61, 0x74, 0x65, 0x64, 0x42, 0x6f, 0x78, 0x4d, 0x61, 0x70, 0x43, 0x6f, 0x64, + 0x65, 0x22, 0x9e, 0x01, 0x0a, 0x0f, 0x53, 0x6c, 0x6f, 0x70, 0x65, 0x4b, 0x69, 0x6c, 0x6f, 0x4d, + 0x61, 0x72, 0x6b, 0x65, 0x72, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, + 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x46, 0x0a, 0x0f, 0x6b, 0x69, + 0x6c, 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, + 0x61, 0x2e, 0x4b, 0x69, 0x6c, 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x52, 0x0f, 0x6b, 0x69, 0x6c, 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x22, 0xa2, 0x01, 0x0a, 0x13, 0x43, 0x75, 0x72, 0x76, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x4b, 0x69, 0x6c, 0x6f, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x72, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, + 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x63, + 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, + 0x46, 0x0a, 0x0f, 0x6b, 0x69, 0x6c, 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, + 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4b, 0x69, 0x6c, 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, + 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x0f, 0x6b, 0x69, 0x6c, 0x6f, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x22, 0xa8, 0x01, 0x0a, 0x05, 0x53, 0x6c, 0x6f, 0x70, + 0x65, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, + 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, + 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x20, + 0x0a, 0x0b, 0x73, 0x6c, 0x6f, 0x70, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x11, 0x52, 0x0b, 0x73, 0x6c, 0x6f, 0x70, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x66, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, + 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x66, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x49, 0x64, 0x22, 0xb4, 0x01, 0x0a, 0x09, 0x43, 0x75, 0x72, 0x76, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x12, 0x2a, 0x0a, 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, + 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x28, 0x0a, + 0x0f, 0x63, 0x75, 0x72, 0x76, 0x61, 0x74, 0x75, 0x72, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x11, 0x52, 0x0f, 0x63, 0x75, 0x72, 0x76, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x66, 0x44, 0x65, + 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, + 0x66, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x22, 0xcb, 0x03, 0x0a, 0x0d, 0x43, 0x61, + 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, - 0x52, 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x6c, 0x6f, 0x70, - 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x11, 0x52, 0x0b, 0x73, - 0x6c, 0x6f, 0x70, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, - 0x66, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x0b, 0x72, 0x65, 0x66, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x22, 0xb4, 0x01, 0x0a, - 0x09, 0x43, 0x75, 0x72, 0x76, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, - 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x06, 0x70, - 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, - 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, - 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x28, 0x0a, 0x0f, 0x63, 0x75, 0x72, 0x76, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x11, - 0x52, 0x0f, 0x63, 0x75, 0x72, 0x76, 0x61, 0x74, 0x75, 0x72, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x72, 0x65, 0x66, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x66, 0x44, 0x65, 0x76, 0x69, 0x63, - 0x65, 0x49, 0x64, 0x22, 0xcb, 0x03, 0x0a, 0x0d, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, - 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, - 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, - 0x44, 0x61, 0x74, 0x61, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x70, 0x6f, 0x69, 0x6e, - 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x39, 0x0a, 0x0b, 0x61, 0x52, - 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, - 0x6c, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x66, 0x52, 0x0b, 0x61, 0x52, 0x65, 0x6c, 0x61, 0x74, - 0x65, 0x64, 0x52, 0x65, 0x66, 0x12, 0x39, 0x0a, 0x0b, 0x62, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, - 0x64, 0x52, 0x65, 0x66, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, - 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, - 0x52, 0x65, 0x66, 0x52, 0x0b, 0x62, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x66, - 0x12, 0x53, 0x0a, 0x0f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x72, 0x61, 0x70, - 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, - 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x64, 0x0a, 0x0e, 0x44, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, - 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, - 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, - 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, - 0x65, 0x22, 0x79, 0x0a, 0x17, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x64, 0x4f, 0x66, 0x53, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x12, 0x12, 0x0a, 0x04, - 0x63, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x69, 0x74, 0x79, - 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x6c, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x12, 0x32, 0x0a, 0x14, 0x6d, 0x61, 0x69, 0x6e, - 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x6d, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6f, 0x72, - 0x64, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x22, 0x90, 0x01, 0x0a, - 0x10, 0x4b, 0x69, 0x6c, 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, - 0x74, 0x12, 0x2e, 0x0a, 0x03, 0x6b, 0x6d, 0x41, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, - 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4b, 0x69, 0x6c, - 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x03, 0x6b, 0x6d, - 0x41, 0x12, 0x2e, 0x0a, 0x03, 0x6b, 0x6d, 0x42, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, - 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4b, 0x69, 0x6c, - 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x03, 0x6b, 0x6d, - 0x42, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x61, 0x6d, 0x65, 0x54, 0x72, 0x65, 0x6e, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x73, 0x61, 0x6d, 0x65, 0x54, 0x72, 0x65, 0x6e, 0x64, 0x22, - 0xbd, 0x01, 0x0a, 0x13, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x6c, 0x61, 0x74, - 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x4e, 0x0a, 0x10, 0x63, - 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, - 0x61, 0x74, 0x61, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6d, 0x62, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x52, 0x10, 0x63, 0x6f, 0x6d, 0x62, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x0a, 0x64, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x22, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, - 0x6c, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x66, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, - 0x79, 0x70, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, - 0x4b, 0x0a, 0x15, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1e, 0x0a, 0x0a, - 0x72, 0x65, 0x66, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x0a, 0x72, 0x65, 0x66, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2a, 0x20, 0x0a, 0x09, - 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x45, 0x46, - 0x54, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x49, 0x47, 0x48, 0x54, 0x10, 0x01, 0x42, 0x5d, - 0x0a, 0x25, 0x63, 0x6c, 0x75, 0x62, 0x2e, 0x6a, 0x6f, 0x79, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x62, - 0x6a, 0x72, 0x74, 0x73, 0x73, 0x2e, 0x61, 0x74, 0x73, 0x2e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x42, 0x13, 0x4c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x47, - 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x5a, 0x1f, 0x2e, 0x2f, - 0x61, 0x74, 0x73, 0x2f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x73, 0x2f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, + 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, + 0x12, 0x39, 0x0a, 0x0b, 0x61, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x66, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, + 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x66, 0x52, 0x0b, + 0x61, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x66, 0x12, 0x39, 0x0a, 0x0b, 0x62, + 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x66, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, + 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x66, 0x52, 0x0b, 0x62, 0x52, 0x65, 0x6c, 0x61, + 0x74, 0x65, 0x64, 0x52, 0x65, 0x66, 0x12, 0x53, 0x0a, 0x0f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x29, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x61, + 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x2e, 0x44, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x64, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x1a, 0x64, 0x0a, 0x0e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x50, 0x6f, 0x73, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x64, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x76, + 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x79, 0x0a, 0x17, 0x55, 0x6e, 0x69, 0x71, 0x75, + 0x65, 0x49, 0x64, 0x4f, 0x66, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x61, 0x79, 0x6f, + 0x75, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x63, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x69, 0x6e, 0x65, 0x49, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x12, 0x32, + 0x0a, 0x14, 0x6d, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x65, + 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x6d, 0x61, + 0x69, 0x6e, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x53, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x22, 0x90, 0x01, 0x0a, 0x10, 0x4b, 0x69, 0x6c, 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, + 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x12, 0x2e, 0x0a, 0x03, 0x6b, 0x6d, 0x41, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, + 0x74, 0x61, 0x2e, 0x4b, 0x69, 0x6c, 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x52, 0x03, 0x6b, 0x6d, 0x41, 0x12, 0x2e, 0x0a, 0x03, 0x6b, 0x6d, 0x42, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, + 0x74, 0x61, 0x2e, 0x4b, 0x69, 0x6c, 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x52, 0x03, 0x6b, 0x6d, 0x42, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x61, 0x6d, 0x65, 0x54, + 0x72, 0x65, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x73, 0x61, 0x6d, 0x65, + 0x54, 0x72, 0x65, 0x6e, 0x64, 0x22, 0xbd, 0x01, 0x0a, 0x13, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, + 0x65, 0x12, 0x4e, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x72, + 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x43, 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x52, + 0x10, 0x63, 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x12, 0x42, 0x0a, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, + 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x66, 0x2e, 0x44, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x4b, 0x0a, 0x15, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x43, + 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x66, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x66, 0x44, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x73, 0x2a, 0x20, 0x0a, 0x09, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x08, 0x0a, 0x04, 0x4c, 0x45, 0x46, 0x54, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x49, 0x47, + 0x48, 0x54, 0x10, 0x01, 0x42, 0x5d, 0x0a, 0x25, 0x63, 0x6c, 0x75, 0x62, 0x2e, 0x6a, 0x6f, 0x79, + 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x62, 0x6a, 0x72, 0x74, 0x73, 0x73, 0x2e, 0x61, 0x74, 0x73, 0x2e, + 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x42, 0x13, 0x4c, + 0x61, 0x79, 0x6f, 0x75, 0x74, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x5a, 0x1f, 0x2e, 0x2f, 0x61, 0x74, 0x73, 0x2f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, + 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/ats/verify/protos/state/device_state.pb.go b/ats/verify/protos/state/device_state.pb.go index 14da7d0..455c057 100644 --- a/ats/verify/protos/state/device_state.pb.go +++ b/ats/verify/protos/state/device_state.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.31.0 // protoc v4.23.1 // source: device_state.proto diff --git a/dto/request_proto/request.pb.go b/dto/request_proto/request.pb.go index d70da5a..609309a 100644 --- a/dto/request_proto/request.pb.go +++ b/dto/request_proto/request.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.31.0 // protoc v4.23.1 // source: request.proto @@ -165,6 +165,59 @@ func (Signal_Operation) EnumDescriptor() ([]byte, []int) { return file_request_proto_rawDescGZIP(), []int{2, 0} } +// 计轴区段操作 +type Section_AxleOperation int32 + +const ( + Section_Drst Section_AxleOperation = 0 //设置计轴直接复位 + Section_Pdrst Section_AxleOperation = 1 //设置计轴预复位 + Section_TrainIn Section_AxleOperation = 2 //设置计轴区段内有车轴 + Section_TrainOut Section_AxleOperation = 3 //设置计轴区段内没有车轴 +) + +// Enum value maps for Section_AxleOperation. +var ( + Section_AxleOperation_name = map[int32]string{ + 0: "Drst", + 1: "Pdrst", + 2: "TrainIn", + 3: "TrainOut", + } + Section_AxleOperation_value = map[string]int32{ + "Drst": 0, + "Pdrst": 1, + "TrainIn": 2, + "TrainOut": 3, + } +) + +func (x Section_AxleOperation) Enum() *Section_AxleOperation { + p := new(Section_AxleOperation) + *p = x + return p +} + +func (x Section_AxleOperation) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Section_AxleOperation) Descriptor() protoreflect.EnumDescriptor { + return file_request_proto_enumTypes[2].Descriptor() +} + +func (Section_AxleOperation) Type() protoreflect.EnumType { + return &file_request_proto_enumTypes[2] +} + +func (x Section_AxleOperation) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Section_AxleOperation.Descriptor instead. +func (Section_AxleOperation) EnumDescriptor() ([]byte, []int) { + return file_request_proto_rawDescGZIP(), []int{3, 0} +} + // 道岔 type Turnout struct { state protoimpl.MessageState @@ -315,6 +368,45 @@ func (*Signal) Descriptor() ([]byte, []int) { return file_request_proto_rawDescGZIP(), []int{2} } +// 区段 +type Section struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Section) Reset() { + *x = Section{} + if protoimpl.UnsafeEnabled { + mi := &file_request_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Section) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Section) ProtoMessage() {} + +func (x *Section) ProtoReflect() protoreflect.Message { + mi := &file_request_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Section.ProtoReflect.Descriptor instead. +func (*Section) Descriptor() ([]byte, []int) { + return file_request_proto_rawDescGZIP(), []int{3} +} + var File_request_proto protoreflect.FileDescriptor var file_request_proto_rawDesc = []byte{ @@ -353,9 +445,14 @@ var file_request_proto_rawDesc = []byte{ 0x10, 0x08, 0x12, 0x12, 0x0a, 0x0e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x4c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x44, 0x73, 0x10, 0x09, 0x12, 0x12, 0x0a, 0x0e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x41, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x44, 0x73, 0x10, 0x0a, 0x12, 0x12, 0x0a, 0x0e, 0x4c, 0x69, - 0x67, 0x68, 0x74, 0x42, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x44, 0x73, 0x10, 0x0b, 0x42, 0x15, - 0x5a, 0x13, 0x2e, 0x2f, 0x64, 0x74, 0x6f, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x67, 0x68, 0x74, 0x42, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x44, 0x73, 0x10, 0x0b, 0x22, 0x4a, + 0x0a, 0x07, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3f, 0x0a, 0x0d, 0x41, 0x78, 0x6c, + 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x72, + 0x73, 0x74, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x50, 0x64, 0x72, 0x73, 0x74, 0x10, 0x01, 0x12, + 0x0b, 0x0a, 0x07, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, + 0x54, 0x72, 0x61, 0x69, 0x6e, 0x4f, 0x75, 0x74, 0x10, 0x03, 0x42, 0x15, 0x5a, 0x13, 0x2e, 0x2f, + 0x64, 0x74, 0x6f, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -370,14 +467,16 @@ func file_request_proto_rawDescGZIP() []byte { return file_request_proto_rawDescData } -var file_request_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_request_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_request_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_request_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_request_proto_goTypes = []interface{}{ (Turnout_Operation)(0), // 0: request.Turnout.Operation (Signal_Operation)(0), // 1: request.Signal.Operation - (*Turnout)(nil), // 2: request.Turnout - (*TurnoutOperationReq)(nil), // 3: request.TurnoutOperationReq - (*Signal)(nil), // 4: request.Signal + (Section_AxleOperation)(0), // 2: request.Section.AxleOperation + (*Turnout)(nil), // 3: request.Turnout + (*TurnoutOperationReq)(nil), // 4: request.TurnoutOperationReq + (*Signal)(nil), // 5: request.Signal + (*Section)(nil), // 6: request.Section } var file_request_proto_depIdxs = []int32{ 0, // 0: request.TurnoutOperationReq.operation:type_name -> request.Turnout.Operation @@ -430,14 +529,26 @@ func file_request_proto_init() { return nil } } + file_request_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Section); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_request_proto_rawDesc, - NumEnums: 2, - NumMessages: 3, + NumEnums: 3, + NumMessages: 4, NumExtensions: 0, NumServices: 0, }, From 20a0f2f829be111ba513fd3388e2c424e6bf648c Mon Sep 17 00:00:00 2001 From: xzb <223@qq.com> Date: Tue, 24 Oct 2023 09:42:10 +0800 Subject: [PATCH 10/16] =?UTF-8?q?=E8=AE=A1=E8=BD=B4=E5=8C=BA=E6=AE=B5?= =?UTF-8?q?=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dto/simulation.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dto/simulation.go b/dto/simulation.go index 01d63b9..747a3ce 100644 --- a/dto/simulation.go +++ b/dto/simulation.go @@ -80,6 +80,12 @@ type SignalOperationReqDto struct { Operation request_proto.Signal_Operation `form:"operation" json:"operation" binding:"required"` //信号机操作类型 Aspect state.Signal_Aspect `form:"aspect" json:"aspect" binding:"required"` // 当操作为Operation.Display时有效,表示显示的信号 } +type AxleSectionOperationReqDto struct { + SimulationId string `form:"simulationId" json:"simulationId" binding:"required"` + MapId int32 `json:"mapId" from:"mapId" binding:"required"` + DeviceId string `form:"id" json:"id" binding:"required"` + Operation request_proto.Section_AxleOperation `form:"operation" json:"operation"` +} type EsbButtonOperationReqDto struct { SimulationId string `form:"simulationId" json:"simulationId" binding:"required"` From 840a2baa6a642d90406bfdc97cd9346c2ae1653c Mon Sep 17 00:00:00 2001 From: xzb <223@qq.com> Date: Tue, 24 Oct 2023 10:19:51 +0800 Subject: [PATCH 11/16] =?UTF-8?q?=E8=AE=A1=E8=BD=B4=E5=8C=BA=E6=AE=B5?= =?UTF-8?q?=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/simulation.go | 30 ++++++++++++++++++- .../wayside/memory/wayside_memory_section.go | 16 ++++++++++ dto/simulation.go | 1 + 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/api/simulation.go b/api/simulation.go index 7a69938..eaf04ea 100644 --- a/api/simulation.go +++ b/api/simulation.go @@ -35,6 +35,7 @@ func InitSimulationRouter(api *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddle authed.GET("/getDataChannelName", getDataChannelName) authed.POST("/relay/operation", relayOperation) authed.POST("/signal/operation", signalOperation) + authed.POST("/axleSection/operation", axleSectionOperation) authed.POST("/esbBtn/operation", esbBtnOperation) authed.POST("/ibp/btn/operation", ibpBtnOperation) authed.POST("/ibp/key/operation", ibpKeyOperation) @@ -277,7 +278,7 @@ func switchOperation(c *gin.Context) { func signalOperation(c *gin.Context) { req := &dto.SignalOperationReqDto{} if err := c.ShouldBind(&req); err != nil { - panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()}) + panic(sys_error.New("输入参数格式错误", err)) } simulation := checkDeviceDataAndReturn(req.SimulationId) slog.Info("传入状态参数", req) @@ -285,6 +286,33 @@ func signalOperation(c *gin.Context) { c.JSON(http.StatusOK, "ok") } +// ATS测试-计轴区段操作 +// +// @Summary ATS测试-计轴区段操作 +// +// @Security JwtAuth +// +// @Description ATS测试-计轴区段操作 +// @Tags ATS测试仿真Api +// @Accept json +// @Produce json +// @Param Authorization header string true "JWT Token" +// @Param AxleSectionOperationReqDto body dto.AxleSectionOperationReqDto true "ATS测试仿真-操作计轴区段" +// +// @Success 200 {object} string +// @Failure 500 {object} dto.ErrorDto +// @Router /api/v1/simulation/axleSection/operation [post] +func axleSectionOperation(c *gin.Context) { + req := &dto.AxleSectionOperationReqDto{} + if err := c.ShouldBind(&req); err != nil { + panic(sys_error.New("输入参数格式错误", err)) + } + simulation := checkDeviceDataAndReturn(req.SimulationId) + slog.Info("传入状态参数", req) + memory.ChangeAxleSectionState(simulation, req) + c.JSON(http.StatusOK, "ok") +} + // ATS测试-ESB按钮操作 // // @Summary ATS测试-ESB按钮操作 diff --git a/ats/verify/simulation/wayside/memory/wayside_memory_section.go b/ats/verify/simulation/wayside/memory/wayside_memory_section.go index 48b60db..fb40e66 100644 --- a/ats/verify/simulation/wayside/memory/wayside_memory_section.go +++ b/ats/verify/simulation/wayside/memory/wayside_memory_section.go @@ -3,9 +3,12 @@ package memory import ( "joylink.club/bj-rtsts-server/ats/verify/protos/graphicData" "joylink.club/bj-rtsts-server/ats/verify/protos/state" + "joylink.club/bj-rtsts-server/dto" + "joylink.club/bj-rtsts-server/dto/request_proto" "joylink.club/ecs" "joylink.club/rtsssimulation/component" "joylink.club/rtsssimulation/entity" + "joylink.club/rtsssimulation/fi" ) func GetMapAllSectionState(sim *VerifySimulation, mapId int32) []*state.SectionState { @@ -36,3 +39,16 @@ func handlerSectionState(w ecs.World, uid string) *state.SectionState { } return nil } +func ChangeAxleSectionState(simulation *VerifySimulation, req *dto.AxleSectionOperationReqDto) { + sectionUid := QueryUidByMidAndComId(req.MapId, req.DeviceId, &graphicData.Section{}) + switch req.Operation { + case request_proto.Section_Drst: + fi.DriveAxleSectionDrst(simulation.World, sectionUid, req.Reset) + case request_proto.Section_Pdrst: + fi.DriveAxleSectionPdrst(simulation.World, sectionUid, req.Reset) + case request_proto.Section_TrainIn: + fi.DriveAxleSectionTrainIn(simulation.World, sectionUid) + case request_proto.Section_TrainOut: + fi.DriveAxleSectionTrainOut(simulation.World, sectionUid) + } +} diff --git a/dto/simulation.go b/dto/simulation.go index 747a3ce..153a86c 100644 --- a/dto/simulation.go +++ b/dto/simulation.go @@ -85,6 +85,7 @@ type AxleSectionOperationReqDto struct { MapId int32 `json:"mapId" from:"mapId" binding:"required"` DeviceId string `form:"id" json:"id" binding:"required"` Operation request_proto.Section_AxleOperation `form:"operation" json:"operation"` + Reset bool `form:"reset" json:"reset"` //当操作为直接复位或预复位时有效,true-复位,false-取消或结束复位 } type EsbButtonOperationReqDto struct { From 4aecaf4512a1b6fa6465c03abf4c57c9a610e2d8 Mon Sep 17 00:00:00 2001 From: xzb <223@qq.com> Date: Tue, 24 Oct 2023 10:22:28 +0800 Subject: [PATCH 12/16] =?UTF-8?q?=E8=AE=A1=E8=BD=B4=E5=8C=BA=E6=AE=B5?= =?UTF-8?q?=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/swagger.json | 99 +++++++++++++++++++++++++++++++++++++++++++++++ docs/swagger.yaml | 68 ++++++++++++++++++++++++++++++++ 2 files changed, 167 insertions(+) diff --git a/docs/swagger.json b/docs/swagger.json index 8c270b3..efd4f17 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -2772,6 +2772,58 @@ } } }, + "/api/v1/simulation/axleSection/operation": { + "post": { + "security": [ + { + "JwtAuth": [] + } + ], + "description": "ATS测试-计轴区段操作", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ATS测试仿真Api" + ], + "summary": "ATS测试-计轴区段操作", + "parameters": [ + { + "type": "string", + "description": "JWT Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "ATS测试仿真-操作计轴区段", + "name": "AxleSectionOperationReqDto", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AxleSectionOperationReqDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + } + } + } + }, "/api/v1/simulation/check/data": { "post": { "security": [ @@ -4871,6 +4923,32 @@ } } }, + "dto.AxleSectionOperationReqDto": { + "type": "object", + "required": [ + "id", + "mapId", + "simulationId" + ], + "properties": { + "id": { + "type": "string" + }, + "mapId": { + "type": "integer" + }, + "operation": { + "$ref": "#/definitions/request_proto.Section_AxleOperation" + }, + "reset": { + "description": "当操作为直接复位或预复位时有效,true-复位,false-取消或结束复位", + "type": "boolean" + }, + "simulationId": { + "type": "string" + } + } + }, "dto.CheckMapDataReqDto": { "type": "object", "required": [ @@ -5590,6 +5668,27 @@ } } }, + "request_proto.Section_AxleOperation": { + "type": "integer", + "enum": [ + 0, + 1, + 2, + 3 + ], + "x-enum-comments": { + "Section_Drst": "设置计轴直接复位", + "Section_Pdrst": "设置计轴预复位", + "Section_TrainIn": "设置计轴区段内有车轴", + "Section_TrainOut": "设置计轴区段内没有车轴" + }, + "x-enum-varnames": [ + "Section_Drst", + "Section_Pdrst", + "Section_TrainIn", + "Section_TrainOut" + ] + }, "request_proto.Signal_Operation": { "type": "integer", "enum": [ diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 96a3ce2..0663145 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -60,6 +60,24 @@ definitions: name: type: string type: object + dto.AxleSectionOperationReqDto: + properties: + id: + type: string + mapId: + type: integer + operation: + $ref: '#/definitions/request_proto.Section_AxleOperation' + reset: + description: 当操作为直接复位或预复位时有效,true-复位,false-取消或结束复位 + type: boolean + simulationId: + type: string + required: + - id + - mapId + - simulationId + type: object dto.CheckMapDataReqDto: properties: data: @@ -559,6 +577,23 @@ definitions: description: 名称 type: string type: object + request_proto.Section_AxleOperation: + enum: + - 0 + - 1 + - 2 + - 3 + type: integer + x-enum-comments: + Section_Drst: 设置计轴直接复位 + Section_Pdrst: 设置计轴预复位 + Section_TrainIn: 设置计轴区段内有车轴 + Section_TrainOut: 设置计轴区段内没有车轴 + x-enum-varnames: + - Section_Drst + - Section_Pdrst + - Section_TrainIn + - Section_TrainOut request_proto.Signal_Operation: enum: - 0 @@ -2433,6 +2468,39 @@ paths: summary: 获取仿真地图的公里标范围 tags: - ATS测试仿真Api + /api/v1/simulation/axleSection/operation: + post: + consumes: + - application/json + description: ATS测试-计轴区段操作 + parameters: + - description: JWT Token + in: header + name: Authorization + required: true + type: string + - description: ATS测试仿真-操作计轴区段 + in: body + name: AxleSectionOperationReqDto + required: true + schema: + $ref: '#/definitions/dto.AxleSectionOperationReqDto' + produces: + - application/json + responses: + "200": + description: OK + schema: + type: string + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/dto.ErrorDto' + security: + - JwtAuth: [] + summary: ATS测试-计轴区段操作 + tags: + - ATS测试仿真Api /api/v1/simulation/check/data: post: consumes: From 40a8616d9587156717156ee82c936882d7afcb2c Mon Sep 17 00:00:00 2001 From: xzb <223@qq.com> Date: Tue, 24 Oct 2023 10:22:52 +0800 Subject: [PATCH 13/16] =?UTF-8?q?=E8=AE=A1=E8=BD=B4=E5=8C=BA=E6=AE=B5?= =?UTF-8?q?=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/docs.go | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 100 insertions(+), 2 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index e83bb02..751dfa1 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1,5 +1,4 @@ -// Code generated by swaggo/swag. DO NOT EDIT. - +// Package docs Code generated by swaggo/swag. DO NOT EDIT package docs import "github.com/swaggo/swag" @@ -2779,6 +2778,58 @@ const docTemplate = `{ } } }, + "/api/v1/simulation/axleSection/operation": { + "post": { + "security": [ + { + "JwtAuth": [] + } + ], + "description": "ATS测试-计轴区段操作", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ATS测试仿真Api" + ], + "summary": "ATS测试-计轴区段操作", + "parameters": [ + { + "type": "string", + "description": "JWT Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "ATS测试仿真-操作计轴区段", + "name": "AxleSectionOperationReqDto", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AxleSectionOperationReqDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + } + } + } + }, "/api/v1/simulation/check/data": { "post": { "security": [ @@ -4878,6 +4929,32 @@ const docTemplate = `{ } } }, + "dto.AxleSectionOperationReqDto": { + "type": "object", + "required": [ + "id", + "mapId", + "simulationId" + ], + "properties": { + "id": { + "type": "string" + }, + "mapId": { + "type": "integer" + }, + "operation": { + "$ref": "#/definitions/request_proto.Section_AxleOperation" + }, + "reset": { + "description": "当操作为直接复位或预复位时有效,true-复位,false-取消或结束复位", + "type": "boolean" + }, + "simulationId": { + "type": "string" + } + } + }, "dto.CheckMapDataReqDto": { "type": "object", "required": [ @@ -5597,6 +5674,27 @@ const docTemplate = `{ } } }, + "request_proto.Section_AxleOperation": { + "type": "integer", + "enum": [ + 0, + 1, + 2, + 3 + ], + "x-enum-comments": { + "Section_Drst": "设置计轴直接复位", + "Section_Pdrst": "设置计轴预复位", + "Section_TrainIn": "设置计轴区段内有车轴", + "Section_TrainOut": "设置计轴区段内没有车轴" + }, + "x-enum-varnames": [ + "Section_Drst", + "Section_Pdrst", + "Section_TrainIn", + "Section_TrainOut" + ] + }, "request_proto.Signal_Operation": { "type": "integer", "enum": [ From 735e46893b5a384137b09bc6145b07b16b59e04e Mon Sep 17 00:00:00 2001 From: weizhihong Date: Tue, 24 Oct 2023 10:57:04 +0800 Subject: [PATCH 14/16] =?UTF-8?q?=E3=80=90=E8=81=94=E9=94=81=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E5=A4=84=E7=90=86=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wayside/memory/wayside_simulation.go | 29 ++++- config/bj_local.yml | 6 + config/config.go | 8 ++ config/dev.yml | 7 + config/test_local.yml | 8 +- rtss_simulation | 2 +- third_party/interlock/interlock.go | 120 ++++++++++++++++++ third_party/message/interlock.go | 47 +++++-- 8 files changed, 211 insertions(+), 16 deletions(-) create mode 100644 third_party/interlock/interlock.go diff --git a/ats/verify/simulation/wayside/memory/wayside_simulation.go b/ats/verify/simulation/wayside/memory/wayside_simulation.go index 688b605..bca18b9 100644 --- a/ats/verify/simulation/wayside/memory/wayside_simulation.go +++ b/ats/verify/simulation/wayside/memory/wayside_simulation.go @@ -21,6 +21,7 @@ import ( "joylink.club/bj-rtsts-server/third_party/message" "joylink.club/bj-rtsts-server/third_party/semi_physical_train" "joylink.club/ecs" + "joylink.club/rtsssimulation/fi" "joylink.club/rtsssimulation/repository" "joylink.club/rtsssimulation/repository/model/proto" ) @@ -391,14 +392,30 @@ func (s *VerifySimulation) HandleSemiPhysicalTrainControlMsg(b []byte) { // 处理接到的联锁消息 func (s *VerifySimulation) HandleDriverInfo(b []byte) { - + driverMsg := message.NewInterlockReceiveMsgPkg(0, 128, 8*131) + driverMsg.Decode(b) + driveState := driverMsg.DriveInfo + for x, lenght := 0, len(driveState); x < lenght/32; x++ { + for y := 0; y < 32; y++ { + fi.DriveCircuitStateChange(s.World, x, y, driveState[x*32+y]) + } + } } -//// 采集联锁中的继电器消息 -//func (s *VerifySimulation) CollectRelayInfo() *message.InterlockSendMsgPkg { -// -// return nil -//} +// 采集联锁中的继电器消息 +func (s *VerifySimulation) CollectRelayInfo() *message.InterlockSendMsgPkg { + msg := &message.InterlockSendMsgPkg{} + relayArr := make([]string, 256) + for index, id := range relayArr { + if index%2 == 0 { + msg.Info = append(msg.Info, fi.CollectXQCircuitState(s.World, id)) + } else { + msg.Info = append(msg.Info, fi.CollectLXCircuitState(s.World, id)) + + } + } + return msg +} func buildProtoRepository(mapIds []int32) (*proto.Repository, error) { repo := &proto.Repository{} diff --git a/config/bj_local.yml b/config/bj_local.yml index 6bc9d74..fed7d57 100644 --- a/config/bj_local.yml +++ b/config/bj_local.yml @@ -18,6 +18,12 @@ vobc: localPort: 10000 remotePort: 4000 open: true +# interlock +interlock: + ip: 10.60.1.59 + localPort: 10000 + remotePort: 4000 + open: true # 数据源 datasource: diff --git a/config/config.go b/config/config.go index 1facce2..4767b1a 100644 --- a/config/config.go +++ b/config/config.go @@ -20,6 +20,7 @@ type AppConfig struct { Messaging messaging Dynamics dynamics Vobc vobc + Interlock interlock } type server struct { Port int @@ -63,6 +64,13 @@ type vobc struct { Open bool } +type interlock struct { + Ip string + LocalPort int + RemotePort int + Open bool +} + var Config AppConfig var SimulationId_prefix = (func() string { diff --git a/config/dev.yml b/config/dev.yml index 719b521..7d0fd6d 100644 --- a/config/dev.yml +++ b/config/dev.yml @@ -18,6 +18,13 @@ vobc: localPort: 10000 remotePort: 4000 open: false +# interlock +interlock: + ip: 10.60.1.59 + localPort: 10000 + remotePort: 4000 + open: false + # 数据源 datasource: diff --git a/config/test_local.yml b/config/test_local.yml index 18c017d..346044b 100644 --- a/config/test_local.yml +++ b/config/test_local.yml @@ -18,7 +18,13 @@ vobc: localPort: 10000 remotePort: 4000 open: true - +# interlock +interlock: + ip: 10.60.1.59 + localPort: 10000 + remotePort: 4000 + open: true + # 数据源 datasource: # 数据库访问url diff --git a/rtss_simulation b/rtss_simulation index 3c65650..af7cb83 160000 --- a/rtss_simulation +++ b/rtss_simulation @@ -1 +1 @@ -Subproject commit 3c65650745096e41bb008c74db31aa943e41285a +Subproject commit af7cb83fa8e983fb1dabf4179fd0a7692e20bb16 diff --git a/third_party/interlock/interlock.go b/third_party/interlock/interlock.go new file mode 100644 index 0000000..234a001 --- /dev/null +++ b/third_party/interlock/interlock.go @@ -0,0 +1,120 @@ +package interlock + +import ( + "context" + "fmt" + "log/slog" + "runtime/debug" + "time" + + "joylink.club/bj-rtsts-server/config" + "joylink.club/bj-rtsts-server/third_party/message" + "joylink.club/bj-rtsts-server/third_party/udp" +) + +// 联锁代理通信接口 +type InterlockMessageManager interface { + CollectRelayInfo() *message.InterlockSendMsgPkg + HandleDriverInfo(b []byte) +} + +// 联锁接口 +type InterlockProxy interface { + // 启动联锁消息功能 + Start(manager InterlockMessageManager) + // 停止联锁消息功能 + Stop() + // 发送联锁采集消息 + SendCollectMessage(b []byte) +} + +var _default InterlockProxy + +func Default() InterlockProxy { + if !config.Config.Interlock.Open { // TODO + panic("联锁接口模块未开启") + } + return _default +} + +type interlockProxy struct { + driveInfoUdpServer udp.UdpServer + sendCollectUdpClient udp.UdpClient + + manager InterlockMessageManager + collectInfoTaskCancel context.CancelFunc +} + +// 驱动信息进行转发 +func (d *interlockProxy) handleDriverInfo(b []byte) { + handler := d.manager + if handler != nil { + handler.HandleDriverInfo(b) + } +} + +func (d *interlockProxy) Start(manager InterlockMessageManager) { + if manager == nil { + panic("启动联锁消息服务错误: InterlockMessageManager不能为nil") + } + if d.manager != nil { + panic("启动联锁消息服务错误: 存在正在运行的任务") + } + d.manager = manager + ctx, cancle := context.WithCancel(context.Background()) + go d.collectInfoStateTask(ctx) + d.collectInfoTaskCancel = cancle +} + +const ( + // 采集电路状态发送间隔,单位ms + InterlockMessageSendInterval = 50 +) + +// 定时发送采集电路状态任务 +func (d *interlockProxy) collectInfoStateTask(ctx context.Context) { + defer func() { + if err := recover(); err != nil { + slog.Error("定时发送道岔状态任务异常", "error", err, "stack", string(debug.Stack())) + debug.PrintStack() + } + }() + for { + select { + case <-ctx.Done(): + return + default: + } + collectInfoStates := d.manager.CollectRelayInfo() + d.sendCollectUdpClient.SendMsg(collectInfoStates) + time.Sleep(time.Millisecond * InterlockMessageSendInterval) + } +} + +func (d *interlockProxy) Stop() { + if d.collectInfoTaskCancel != nil { + d.collectInfoTaskCancel() + d.manager = nil + } +} + +func (d *interlockProxy) SendCollectMessage(b []byte) { + d.sendCollectUdpClient.Send(b) +} + +func newInterlockProxy() *interlockProxy { + d := &interlockProxy{ + sendCollectUdpClient: udp.NewClient(fmt.Sprintf("%v:%v", config.Config.Interlock.Ip, config.Config.Interlock.RemotePort)), + } + d.driveInfoUdpServer = udp.NewServer(fmt.Sprintf(":%d", config.Config.Interlock.LocalPort), d.handleDriverInfo) + d.driveInfoUdpServer.Listen() + return d +} + +func Init() { + if !config.Config.Interlock.Open { // TODO + return + } + slog.Info("初始化联锁接口模块") + _default = newInterlockProxy() +} diff --git a/third_party/message/interlock.go b/third_party/message/interlock.go index f868619..6fbdb76 100644 --- a/third_party/message/interlock.go +++ b/third_party/message/interlock.go @@ -52,27 +52,49 @@ func (t *InterlockMsgPkgTail) Decode(buf []byte) error { // 发送给联锁的采集数据 type InterlockSendMsgPkg struct { Header *InterlockMsgPkgHeader // 包头 - Info []byte // 发给联锁的状态数据 + Info []bool // 发给联锁的状态数据 Tail *InterlockMsgPkgTail // 包尾 } +var boolsToByteArrLen int = 8 + func (m *InterlockSendMsgPkg) Encode() []byte { var data []byte data = append(data, m.Header.Encode()...) - data = append(data, m.Info...) + for index, length, cycles := 0, len(m.Info), len(m.Info)/boolsToByteArrLen; index < cycles; index++ { + startIndex := index * boolsToByteArrLen + toByteArr := [8]bool{} + for i := 0; i < boolsToByteArrLen && startIndex < length; i++ { + startIndex = startIndex + i + toByteArr[i] = m.Info[startIndex+i] + } + data = append(data, boolsToByte(toByteArr)) + } data = append(data, m.Tail.Encode()...) return data } +// bool数组转byte +func boolsToByte(flags [8]bool) byte { + var result uint8 + for _, b := range flags { + result <<= 1 + if b { + result |= 1 + } + } + return result +} + // 收到联锁发来的驱动数据 type InterlockReceiveMsgPkg struct { toagent_len int32 et_out_num int32 tcc_output_len int32 Header *InterlockMsgPkgHeader // 包头 - syncZone []byte // 同步区状态 - driveInfo []byte // 驱动数据 - tccInfo []byte // 应答器报文 + SyncZone []bool // 同步区状态 + DriveInfo []bool // 驱动数据 + TccInfo []bool // 应答器报文 Tail *InterlockMsgPkgTail // 包尾 } @@ -94,16 +116,25 @@ func (t *InterlockReceiveMsgPkg) Decode(buf []byte) error { // 同步区状态 preIndex = lastIndex lastIndex = lastIndex + t.toagent_len - t.syncZone = buf[preIndex:lastIndex] + t.parseByte(t.SyncZone, buf, preIndex, lastIndex) // 驱动数据 preIndex = lastIndex lastIndex = lastIndex + t.et_out_num - t.driveInfo = buf[preIndex:lastIndex] + t.parseByte(t.DriveInfo, buf, preIndex, lastIndex) // 应答器报文 preIndex = lastIndex lastIndex = lastIndex + t.tcc_output_len - t.tccInfo = buf[preIndex:lastIndex] + t.parseByte(t.TccInfo, buf, preIndex, lastIndex) // 包尾 t.Tail.Decode(buf) return nil } + +func (t *InterlockReceiveMsgPkg) parseByte(r []bool, buf []byte, start, end int32) { + for i := start; i < end; i++ { + b := buf[i] + for bit := 7; bit >= 0; bit-- { + r = append(r, (b&(1< Date: Tue, 24 Oct 2023 13:20:36 +0800 Subject: [PATCH 15/16] =?UTF-8?q?=E8=AE=A1=E8=BD=B4=E5=8C=BA=E6=AE=B5?= =?UTF-8?q?=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ats/verify/simulation/wayside/memory/wayside_memory_section.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ats/verify/simulation/wayside/memory/wayside_memory_section.go b/ats/verify/simulation/wayside/memory/wayside_memory_section.go index fb40e66..5a545f7 100644 --- a/ats/verify/simulation/wayside/memory/wayside_memory_section.go +++ b/ats/verify/simulation/wayside/memory/wayside_memory_section.go @@ -9,6 +9,7 @@ import ( "joylink.club/rtsssimulation/component" "joylink.club/rtsssimulation/entity" "joylink.club/rtsssimulation/fi" + "log/slog" ) func GetMapAllSectionState(sim *VerifySimulation, mapId int32) []*state.SectionState { @@ -41,6 +42,7 @@ func handlerSectionState(w ecs.World, uid string) *state.SectionState { } func ChangeAxleSectionState(simulation *VerifySimulation, req *dto.AxleSectionOperationReqDto) { sectionUid := QueryUidByMidAndComId(req.MapId, req.DeviceId, &graphicData.Section{}) + slog.Debug("操作计轴区段", "axleSectionUid", sectionUid) switch req.Operation { case request_proto.Section_Drst: fi.DriveAxleSectionDrst(simulation.World, sectionUid, req.Reset) From ce657e262a0c361198d7fbe8e93b34da0e733595 Mon Sep 17 00:00:00 2001 From: weizhihong Date: Tue, 24 Oct 2023 16:37:27 +0800 Subject: [PATCH 16/16] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E8=BF=90=E8=A1=8C=E7=8E=AF=E5=A2=83=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/projectRunConfig.go | 171 +++++++++ ats/verify/simulation/simulation_manage.go | 3 - bj-rtss-message | 2 +- db/dbquery/gen.go | 8 + db/dbquery/project_run_config.gen.go | 400 +++++++++++++++++++++ db/model/project_run_config.gen.go | 26 ++ docs/docs.go | 376 ++++++++++++++++++- docs/swagger.json | 373 +++++++++++++++++++ docs/swagger.yaml | 237 ++++++++++++ dto/projectRunConfig.go | 43 +++ dto/simulation.go | 2 + main.go | 1 + rtss_simulation | 2 +- service/projectRunConfig.go | 82 +++++ 14 files changed, 1720 insertions(+), 6 deletions(-) create mode 100644 api/projectRunConfig.go create mode 100644 db/dbquery/project_run_config.gen.go create mode 100644 db/model/project_run_config.gen.go create mode 100644 dto/projectRunConfig.go create mode 100644 service/projectRunConfig.go diff --git a/api/projectRunConfig.go b/api/projectRunConfig.go new file mode 100644 index 0000000..dfb0f79 --- /dev/null +++ b/api/projectRunConfig.go @@ -0,0 +1,171 @@ +package api + +import ( + "net/http" + "strconv" + + jwt "github.com/appleboy/gin-jwt/v2" + "github.com/gin-gonic/gin" + "joylink.club/bj-rtsts-server/dto" + "joylink.club/bj-rtsts-server/middleware" + "joylink.club/bj-rtsts-server/service" + "joylink.club/bj-rtsts-server/sys_error" +) + +func InitProjectRunConfigRouter(api *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) { + authed := api.Group("/v1/runconfig").Use(authMiddleware.MiddlewareFunc(), middleware.PermissMiddleware) + authed.GET("/paging", pageQueryProjectRunConfig) + authed.GET("/list", listQueryProjectRunConfig) + authed.POST("", createProjectRunConfig) + authed.GET("/:id", queryProjectRunConfig) + authed.PUT("/:id", updateProjectRunConfig) + authed.DELETE("/:id", deleteProjectRunConfig) +} + +// 分页查询项目运行环境配置信息 +// +// @Summary 分页查询项目运行环境配置信息 +// +// @Security JwtAuth +// +// @Description 可以通过项目名称过滤,分页查询项目运行环境配置信息 +// @Tags 项目运行环境配置Api +// @Accept json +// @Produce json +// @Param PageProjectRunConfigReqDto query dto.PageProjectRunConfigReqDto true "运行环境配置查询条件带分页信息" +// @Success 200 {object} dto.PageDto +// @Failure 401 {object} dto.ErrorDto +// @Failure 404 {object} dto.ErrorDto +// @Failure 500 {object} dto.ErrorDto +// @Router /api/v1/runconfig/paging [get] +func pageQueryProjectRunConfig(c *gin.Context) { + req := dto.PageProjectRunConfigReqDto{} + if err := c.ShouldBind(&req); err != nil { + panic(sys_error.New("查询失败,参数格式错误", err)) + } + c.JSON(http.StatusOK, service.PageProjectRunConfigQuery(&req)) +} + +// 查询项目运行环境配置信息列表 +// +// @Summary 查询项目运行环境配置信息列表 +// +// @Security JwtAuth +// +// @Description 无参数,查询项目运行环境配置列表 +// @Tags 项目运行环境配置Api +// @Accept json +// @Produce json +// @Success 200 {object} dto.ProjectRunConfigDto +// @Failure 401 {object} dto.ErrorDto +// @Failure 404 {object} dto.ErrorDto +// @Failure 500 {object} dto.ErrorDto +// @Router /api/v1/runconfig/list [get] +func listQueryProjectRunConfig(c *gin.Context) { + c.JSON(http.StatusOK, service.ListProjectRunConfigQuery()) +} + +// 创建项目运行环境配置信息 +// +// @Summary 创建项目运行环境配置信息 +// +// @Security JwtAuth +// +// @Description 创建项目运行环境配置数据 +// @Tags 项目运行环境配置Api +// @Accept json +// @Produce json +// @Param ProjectRunConfigReqDto query dto.ProjectRunConfigReqDto true "创建的项目运行环境配置信息" +// @Success 200 {object} nil +// @Failure 401 {object} dto.ErrorDto +// @Failure 404 {object} dto.ErrorDto +// @Failure 500 {object} dto.ErrorDto +// @Router /api/v1/runconfig [post] +func createProjectRunConfig(c *gin.Context) { + req := dto.ProjectRunConfigReqDto{} + if err := c.ShouldBind(&req); err != nil { + panic(sys_error.New("创建失败,参数格式错误", err)) + } + c.JSON(http.StatusOK, service.CreateProjectRunConfig(&req)) +} + +// 查询项目运行环境信息 +// +// @Summary 查询项目运行环境信息 +// +// @Security JwtAuth +// +// @Description 查询项目运行环境信息 +// @Tags 项目运行环境配置Api +// @Accept json +// @Produce json +// @Param id path int true "项目运行环境ID" +// @Success 200 {object} dto.ProjectRunConfigDto +// @Failure 401 {object} dto.ErrorDto +// @Failure 404 {object} dto.ErrorDto +// @Failure 500 {object} dto.ErrorDto +// @Router /api/v1/runconfig/{id} [get] +func queryProjectRunConfig(c *gin.Context) { + id, exist := c.Params.Get("id") + if !exist { + panic(sys_error.New("查询失败,缺少主键")) + } + intId, _ := strconv.Atoi(id) + c.JSON(http.StatusOK, service.QueryProjectRunConfig(int32(intId))) +} + +// 修改项目运行环境信息 +// +// @Summary 修改项目运行环境信息 +// +// @Security JwtAuth +// +// @Description 修改项目运行环境信息 +// @Tags 项目运行环境配置Api +// @Accept json +// @Produce json +// @Param id path int true "项目运行环境信息ID" +// @Param ProjectDto query dto.ProjectDto true "修改的项目信息" +// @Success 200 {object} nil +// @Failure 401 {object} dto.ErrorDto +// @Failure 404 {object} dto.ErrorDto +// @Failure 500 {object} dto.ErrorDto +// @Router /api/v1/runconfig/{id} [put] +func updateProjectRunConfig(c *gin.Context) { + id, exist := c.Params.Get("id") + if !exist { + panic(sys_error.New("更新失败,缺少主键")) + } + req := dto.ProjectRunConfigReqDto{} + if err := c.ShouldBind(&req); err != nil { + panic(sys_error.New("更新失败,参数格式错误", err)) + } + intId, _ := strconv.Atoi(id) + c.JSON(http.StatusOK, service.UpdateProjectRunConfig(int32(intId), &req)) +} + +// 删除项目运行环境信息 +// +// @Summary 删除项目运行环境信息 +// +// @Security JwtAuth +// +// @Description 删除项目运行环境信息 +// @Tags 项目运行环境配置Api +// @Accept json +// @Produce json +// @Param id path int true "项目运行环境信息ID" +// @Success 200 {object} nil +// @Failure 401 {object} dto.ErrorDto +// @Failure 404 {object} dto.ErrorDto +// @Failure 500 {object} dto.ErrorDto +// @Router /api/v1/runconfig/{id} [delete] +func deleteProjectRunConfig(c *gin.Context) { + idStr := c.Param("id") + id, err := strconv.Atoi(idStr) + if err != nil { + panic(sys_error.New("删除失败,缺少主键")) + } + service.DeleteProjectRunConfigById(int32(id)) + c.JSON(http.StatusOK, true) +} diff --git a/ats/verify/simulation/simulation_manage.go b/ats/verify/simulation/simulation_manage.go index c1153fd..d61de20 100644 --- a/ats/verify/simulation/simulation_manage.go +++ b/ats/verify/simulation/simulation_manage.go @@ -31,14 +31,12 @@ func CreateSimulation(projectId int32, mapIds []int32) (string, error) { simulationId := createSimulationId(projectId) _, e := simulationMap.Load(simulationId) if !e && IsExistSimulation() { - // panic(dto.ErrorDto{Code: dto.DataAlreadyExist, Message: "已有仿真在运行"}) return "", sys_error.New("一套环境同时只能运行一个仿真") } if !e { verifySimulation, err := memory.CreateSimulation(projectId, mapIds) if err != nil { return "", err - // panic(fmt.Sprintf("创建仿真失败:%s", err.Error())) } verifySimulation.SimulationId = simulationId if config.Config.Dynamics.Open { @@ -47,7 +45,6 @@ func CreateSimulation(projectId int32, mapIds []int32) (string, error) { err := dynamics.Default().RequestStartSimulation(lineBaseInfo) if err != nil { return "", err - // panic(dto.ErrorDto{Code: dto.DynamicsError, Message: err.Error()}) } dynamics.Default().Start(verifySimulation) } diff --git a/bj-rtss-message b/bj-rtss-message index 60ed568..6827f96 160000 --- a/bj-rtss-message +++ b/bj-rtss-message @@ -1 +1 @@ -Subproject commit 60ed5685cf48665f31df84a62a1182bfcb08dbb2 +Subproject commit 6827f9671a619b95d80dac699463bbcd9ed0cb15 diff --git a/db/dbquery/gen.go b/db/dbquery/gen.go index 033ef0e..7bc16d3 100644 --- a/db/dbquery/gen.go +++ b/db/dbquery/gen.go @@ -25,6 +25,7 @@ var ( Drafting *drafting Project *project ProjectPublishLink *projectPublishLink + ProjectRunConfig *projectRunConfig ProjectTrainSizeLink *projectTrainSizeLink PublishedGi *publishedGi TrainModel *trainModel @@ -43,6 +44,7 @@ func SetDefault(db *gorm.DB, opts ...gen.DOOption) { Drafting = &Q.Drafting Project = &Q.Project ProjectPublishLink = &Q.ProjectPublishLink + ProjectRunConfig = &Q.ProjectRunConfig ProjectTrainSizeLink = &Q.ProjectTrainSizeLink PublishedGi = &Q.PublishedGi TrainModel = &Q.TrainModel @@ -62,6 +64,7 @@ func Use(db *gorm.DB, opts ...gen.DOOption) *Query { Drafting: newDrafting(db, opts...), Project: newProject(db, opts...), ProjectPublishLink: newProjectPublishLink(db, opts...), + ProjectRunConfig: newProjectRunConfig(db, opts...), ProjectTrainSizeLink: newProjectTrainSizeLink(db, opts...), PublishedGi: newPublishedGi(db, opts...), TrainModel: newTrainModel(db, opts...), @@ -82,6 +85,7 @@ type Query struct { Drafting drafting Project project ProjectPublishLink projectPublishLink + ProjectRunConfig projectRunConfig ProjectTrainSizeLink projectTrainSizeLink PublishedGi publishedGi TrainModel trainModel @@ -103,6 +107,7 @@ func (q *Query) clone(db *gorm.DB) *Query { Drafting: q.Drafting.clone(db), Project: q.Project.clone(db), ProjectPublishLink: q.ProjectPublishLink.clone(db), + ProjectRunConfig: q.ProjectRunConfig.clone(db), ProjectTrainSizeLink: q.ProjectTrainSizeLink.clone(db), PublishedGi: q.PublishedGi.clone(db), TrainModel: q.TrainModel.clone(db), @@ -131,6 +136,7 @@ func (q *Query) ReplaceDB(db *gorm.DB) *Query { Drafting: q.Drafting.replaceDB(db), Project: q.Project.replaceDB(db), ProjectPublishLink: q.ProjectPublishLink.replaceDB(db), + ProjectRunConfig: q.ProjectRunConfig.replaceDB(db), ProjectTrainSizeLink: q.ProjectTrainSizeLink.replaceDB(db), PublishedGi: q.PublishedGi.replaceDB(db), TrainModel: q.TrainModel.replaceDB(db), @@ -149,6 +155,7 @@ type queryCtx struct { Drafting IDraftingDo Project IProjectDo ProjectPublishLink IProjectPublishLinkDo + ProjectRunConfig IProjectRunConfigDo ProjectTrainSizeLink IProjectTrainSizeLinkDo PublishedGi IPublishedGiDo TrainModel ITrainModelDo @@ -167,6 +174,7 @@ func (q *Query) WithContext(ctx context.Context) *queryCtx { Drafting: q.Drafting.WithContext(ctx), Project: q.Project.WithContext(ctx), ProjectPublishLink: q.ProjectPublishLink.WithContext(ctx), + ProjectRunConfig: q.ProjectRunConfig.WithContext(ctx), ProjectTrainSizeLink: q.ProjectTrainSizeLink.WithContext(ctx), PublishedGi: q.PublishedGi.WithContext(ctx), TrainModel: q.TrainModel.WithContext(ctx), diff --git a/db/dbquery/project_run_config.gen.go b/db/dbquery/project_run_config.gen.go new file mode 100644 index 0000000..96a67a7 --- /dev/null +++ b/db/dbquery/project_run_config.gen.go @@ -0,0 +1,400 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package dbquery + +import ( + "context" + + "gorm.io/gorm" + "gorm.io/gorm/clause" + "gorm.io/gorm/schema" + + "gorm.io/gen" + "gorm.io/gen/field" + + "gorm.io/plugin/dbresolver" + + "joylink.club/bj-rtsts-server/db/model" +) + +func newProjectRunConfig(db *gorm.DB, opts ...gen.DOOption) projectRunConfig { + _projectRunConfig := projectRunConfig{} + + _projectRunConfig.projectRunConfigDo.UseDB(db, opts...) + _projectRunConfig.projectRunConfigDo.UseModel(&model.ProjectRunConfig{}) + + tableName := _projectRunConfig.projectRunConfigDo.TableName() + _projectRunConfig.ALL = field.NewAsterisk(tableName) + _projectRunConfig.ID = field.NewInt32(tableName, "id") + _projectRunConfig.Name = field.NewString(tableName, "name") + _projectRunConfig.Description = field.NewString(tableName, "description") + _projectRunConfig.ConfigContent = field.NewString(tableName, "config_content") + _projectRunConfig.CreateTime = field.NewTime(tableName, "create_time") + _projectRunConfig.UpdateTime = field.NewTime(tableName, "update_time") + + _projectRunConfig.fillFieldMap() + + return _projectRunConfig +} + +type projectRunConfig struct { + projectRunConfigDo + + ALL field.Asterisk + ID field.Int32 + Name field.String // 测试环境名称 + Description field.String // 环境描述 + ConfigContent field.String // 环境配置信息 + CreateTime field.Time // 创建时间 + UpdateTime field.Time // 更新时间 + + fieldMap map[string]field.Expr +} + +func (p projectRunConfig) Table(newTableName string) *projectRunConfig { + p.projectRunConfigDo.UseTable(newTableName) + return p.updateTableName(newTableName) +} + +func (p projectRunConfig) As(alias string) *projectRunConfig { + p.projectRunConfigDo.DO = *(p.projectRunConfigDo.As(alias).(*gen.DO)) + return p.updateTableName(alias) +} + +func (p *projectRunConfig) updateTableName(table string) *projectRunConfig { + p.ALL = field.NewAsterisk(table) + p.ID = field.NewInt32(table, "id") + p.Name = field.NewString(table, "name") + p.Description = field.NewString(table, "description") + p.ConfigContent = field.NewString(table, "config_content") + p.CreateTime = field.NewTime(table, "create_time") + p.UpdateTime = field.NewTime(table, "update_time") + + p.fillFieldMap() + + return p +} + +func (p *projectRunConfig) GetFieldByName(fieldName string) (field.OrderExpr, bool) { + _f, ok := p.fieldMap[fieldName] + if !ok || _f == nil { + return nil, false + } + _oe, ok := _f.(field.OrderExpr) + return _oe, ok +} + +func (p *projectRunConfig) fillFieldMap() { + p.fieldMap = make(map[string]field.Expr, 6) + p.fieldMap["id"] = p.ID + p.fieldMap["name"] = p.Name + p.fieldMap["description"] = p.Description + p.fieldMap["config_content"] = p.ConfigContent + p.fieldMap["create_time"] = p.CreateTime + p.fieldMap["update_time"] = p.UpdateTime +} + +func (p projectRunConfig) clone(db *gorm.DB) projectRunConfig { + p.projectRunConfigDo.ReplaceConnPool(db.Statement.ConnPool) + return p +} + +func (p projectRunConfig) replaceDB(db *gorm.DB) projectRunConfig { + p.projectRunConfigDo.ReplaceDB(db) + return p +} + +type projectRunConfigDo struct{ gen.DO } + +type IProjectRunConfigDo interface { + gen.SubQuery + Debug() IProjectRunConfigDo + WithContext(ctx context.Context) IProjectRunConfigDo + WithResult(fc func(tx gen.Dao)) gen.ResultInfo + ReplaceDB(db *gorm.DB) + ReadDB() IProjectRunConfigDo + WriteDB() IProjectRunConfigDo + As(alias string) gen.Dao + Session(config *gorm.Session) IProjectRunConfigDo + Columns(cols ...field.Expr) gen.Columns + Clauses(conds ...clause.Expression) IProjectRunConfigDo + Not(conds ...gen.Condition) IProjectRunConfigDo + Or(conds ...gen.Condition) IProjectRunConfigDo + Select(conds ...field.Expr) IProjectRunConfigDo + Where(conds ...gen.Condition) IProjectRunConfigDo + Order(conds ...field.Expr) IProjectRunConfigDo + Distinct(cols ...field.Expr) IProjectRunConfigDo + Omit(cols ...field.Expr) IProjectRunConfigDo + Join(table schema.Tabler, on ...field.Expr) IProjectRunConfigDo + LeftJoin(table schema.Tabler, on ...field.Expr) IProjectRunConfigDo + RightJoin(table schema.Tabler, on ...field.Expr) IProjectRunConfigDo + Group(cols ...field.Expr) IProjectRunConfigDo + Having(conds ...gen.Condition) IProjectRunConfigDo + Limit(limit int) IProjectRunConfigDo + Offset(offset int) IProjectRunConfigDo + Count() (count int64, err error) + Scopes(funcs ...func(gen.Dao) gen.Dao) IProjectRunConfigDo + Unscoped() IProjectRunConfigDo + Create(values ...*model.ProjectRunConfig) error + CreateInBatches(values []*model.ProjectRunConfig, batchSize int) error + Save(values ...*model.ProjectRunConfig) error + First() (*model.ProjectRunConfig, error) + Take() (*model.ProjectRunConfig, error) + Last() (*model.ProjectRunConfig, error) + Find() ([]*model.ProjectRunConfig, error) + FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.ProjectRunConfig, err error) + FindInBatches(result *[]*model.ProjectRunConfig, batchSize int, fc func(tx gen.Dao, batch int) error) error + Pluck(column field.Expr, dest interface{}) error + Delete(...*model.ProjectRunConfig) (info gen.ResultInfo, err error) + Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error) + UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) + Updates(value interface{}) (info gen.ResultInfo, err error) + UpdateColumn(column field.Expr, value interface{}) (info gen.ResultInfo, err error) + UpdateColumnSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error) + UpdateColumns(value interface{}) (info gen.ResultInfo, err error) + UpdateFrom(q gen.SubQuery) gen.Dao + Attrs(attrs ...field.AssignExpr) IProjectRunConfigDo + Assign(attrs ...field.AssignExpr) IProjectRunConfigDo + Joins(fields ...field.RelationField) IProjectRunConfigDo + Preload(fields ...field.RelationField) IProjectRunConfigDo + FirstOrInit() (*model.ProjectRunConfig, error) + FirstOrCreate() (*model.ProjectRunConfig, error) + FindByPage(offset int, limit int) (result []*model.ProjectRunConfig, count int64, err error) + ScanByPage(result interface{}, offset int, limit int) (count int64, err error) + Scan(result interface{}) (err error) + Returning(value interface{}, columns ...string) IProjectRunConfigDo + UnderlyingDB() *gorm.DB + schema.Tabler +} + +func (p projectRunConfigDo) Debug() IProjectRunConfigDo { + return p.withDO(p.DO.Debug()) +} + +func (p projectRunConfigDo) WithContext(ctx context.Context) IProjectRunConfigDo { + return p.withDO(p.DO.WithContext(ctx)) +} + +func (p projectRunConfigDo) ReadDB() IProjectRunConfigDo { + return p.Clauses(dbresolver.Read) +} + +func (p projectRunConfigDo) WriteDB() IProjectRunConfigDo { + return p.Clauses(dbresolver.Write) +} + +func (p projectRunConfigDo) Session(config *gorm.Session) IProjectRunConfigDo { + return p.withDO(p.DO.Session(config)) +} + +func (p projectRunConfigDo) Clauses(conds ...clause.Expression) IProjectRunConfigDo { + return p.withDO(p.DO.Clauses(conds...)) +} + +func (p projectRunConfigDo) Returning(value interface{}, columns ...string) IProjectRunConfigDo { + return p.withDO(p.DO.Returning(value, columns...)) +} + +func (p projectRunConfigDo) Not(conds ...gen.Condition) IProjectRunConfigDo { + return p.withDO(p.DO.Not(conds...)) +} + +func (p projectRunConfigDo) Or(conds ...gen.Condition) IProjectRunConfigDo { + return p.withDO(p.DO.Or(conds...)) +} + +func (p projectRunConfigDo) Select(conds ...field.Expr) IProjectRunConfigDo { + return p.withDO(p.DO.Select(conds...)) +} + +func (p projectRunConfigDo) Where(conds ...gen.Condition) IProjectRunConfigDo { + return p.withDO(p.DO.Where(conds...)) +} + +func (p projectRunConfigDo) Order(conds ...field.Expr) IProjectRunConfigDo { + return p.withDO(p.DO.Order(conds...)) +} + +func (p projectRunConfigDo) Distinct(cols ...field.Expr) IProjectRunConfigDo { + return p.withDO(p.DO.Distinct(cols...)) +} + +func (p projectRunConfigDo) Omit(cols ...field.Expr) IProjectRunConfigDo { + return p.withDO(p.DO.Omit(cols...)) +} + +func (p projectRunConfigDo) Join(table schema.Tabler, on ...field.Expr) IProjectRunConfigDo { + return p.withDO(p.DO.Join(table, on...)) +} + +func (p projectRunConfigDo) LeftJoin(table schema.Tabler, on ...field.Expr) IProjectRunConfigDo { + return p.withDO(p.DO.LeftJoin(table, on...)) +} + +func (p projectRunConfigDo) RightJoin(table schema.Tabler, on ...field.Expr) IProjectRunConfigDo { + return p.withDO(p.DO.RightJoin(table, on...)) +} + +func (p projectRunConfigDo) Group(cols ...field.Expr) IProjectRunConfigDo { + return p.withDO(p.DO.Group(cols...)) +} + +func (p projectRunConfigDo) Having(conds ...gen.Condition) IProjectRunConfigDo { + return p.withDO(p.DO.Having(conds...)) +} + +func (p projectRunConfigDo) Limit(limit int) IProjectRunConfigDo { + return p.withDO(p.DO.Limit(limit)) +} + +func (p projectRunConfigDo) Offset(offset int) IProjectRunConfigDo { + return p.withDO(p.DO.Offset(offset)) +} + +func (p projectRunConfigDo) Scopes(funcs ...func(gen.Dao) gen.Dao) IProjectRunConfigDo { + return p.withDO(p.DO.Scopes(funcs...)) +} + +func (p projectRunConfigDo) Unscoped() IProjectRunConfigDo { + return p.withDO(p.DO.Unscoped()) +} + +func (p projectRunConfigDo) Create(values ...*model.ProjectRunConfig) error { + if len(values) == 0 { + return nil + } + return p.DO.Create(values) +} + +func (p projectRunConfigDo) CreateInBatches(values []*model.ProjectRunConfig, batchSize int) error { + return p.DO.CreateInBatches(values, batchSize) +} + +// Save : !!! underlying implementation is different with GORM +// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values) +func (p projectRunConfigDo) Save(values ...*model.ProjectRunConfig) error { + if len(values) == 0 { + return nil + } + return p.DO.Save(values) +} + +func (p projectRunConfigDo) First() (*model.ProjectRunConfig, error) { + if result, err := p.DO.First(); err != nil { + return nil, err + } else { + return result.(*model.ProjectRunConfig), nil + } +} + +func (p projectRunConfigDo) Take() (*model.ProjectRunConfig, error) { + if result, err := p.DO.Take(); err != nil { + return nil, err + } else { + return result.(*model.ProjectRunConfig), nil + } +} + +func (p projectRunConfigDo) Last() (*model.ProjectRunConfig, error) { + if result, err := p.DO.Last(); err != nil { + return nil, err + } else { + return result.(*model.ProjectRunConfig), nil + } +} + +func (p projectRunConfigDo) Find() ([]*model.ProjectRunConfig, error) { + result, err := p.DO.Find() + return result.([]*model.ProjectRunConfig), err +} + +func (p projectRunConfigDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.ProjectRunConfig, err error) { + buf := make([]*model.ProjectRunConfig, 0, batchSize) + err = p.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error { + defer func() { results = append(results, buf...) }() + return fc(tx, batch) + }) + return results, err +} + +func (p projectRunConfigDo) FindInBatches(result *[]*model.ProjectRunConfig, batchSize int, fc func(tx gen.Dao, batch int) error) error { + return p.DO.FindInBatches(result, batchSize, fc) +} + +func (p projectRunConfigDo) Attrs(attrs ...field.AssignExpr) IProjectRunConfigDo { + return p.withDO(p.DO.Attrs(attrs...)) +} + +func (p projectRunConfigDo) Assign(attrs ...field.AssignExpr) IProjectRunConfigDo { + return p.withDO(p.DO.Assign(attrs...)) +} + +func (p projectRunConfigDo) Joins(fields ...field.RelationField) IProjectRunConfigDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Joins(_f)) + } + return &p +} + +func (p projectRunConfigDo) Preload(fields ...field.RelationField) IProjectRunConfigDo { + for _, _f := range fields { + p = *p.withDO(p.DO.Preload(_f)) + } + return &p +} + +func (p projectRunConfigDo) FirstOrInit() (*model.ProjectRunConfig, error) { + if result, err := p.DO.FirstOrInit(); err != nil { + return nil, err + } else { + return result.(*model.ProjectRunConfig), nil + } +} + +func (p projectRunConfigDo) FirstOrCreate() (*model.ProjectRunConfig, error) { + if result, err := p.DO.FirstOrCreate(); err != nil { + return nil, err + } else { + return result.(*model.ProjectRunConfig), nil + } +} + +func (p projectRunConfigDo) FindByPage(offset int, limit int) (result []*model.ProjectRunConfig, count int64, err error) { + result, err = p.Offset(offset).Limit(limit).Find() + if err != nil { + return + } + + if size := len(result); 0 < limit && 0 < size && size < limit { + count = int64(size + offset) + return + } + + count, err = p.Offset(-1).Limit(-1).Count() + return +} + +func (p projectRunConfigDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) { + count, err = p.Count() + if err != nil { + return + } + + err = p.Offset(offset).Limit(limit).Scan(result) + return +} + +func (p projectRunConfigDo) Scan(result interface{}) (err error) { + return p.DO.Scan(result) +} + +func (p projectRunConfigDo) Delete(models ...*model.ProjectRunConfig) (result gen.ResultInfo, err error) { + return p.DO.Delete(models) +} + +func (p *projectRunConfigDo) withDO(do gen.Dao) *projectRunConfigDo { + p.DO = *do.(*gen.DO) + return p +} diff --git a/db/model/project_run_config.gen.go b/db/model/project_run_config.gen.go new file mode 100644 index 0000000..660c6fc --- /dev/null +++ b/db/model/project_run_config.gen.go @@ -0,0 +1,26 @@ +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. +// Code generated by gorm.io/gen. DO NOT EDIT. + +package model + +import ( + "time" +) + +const TableNameProjectRunConfig = "project_run_config" + +// ProjectRunConfig mapped from table +type ProjectRunConfig struct { + ID int32 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"` + Name string `gorm:"column:name;comment:测试环境名称" json:"name"` // 测试环境名称 + Description string `gorm:"column:description;comment:环境描述" json:"description"` // 环境描述 + ConfigContent string `gorm:"column:config_content;comment:环境配置信息" json:"config_content"` // 环境配置信息 + CreateTime time.Time `gorm:"column:create_time;comment:创建时间" json:"create_time"` // 创建时间 + UpdateTime time.Time `gorm:"column:update_time;comment:更新时间" json:"update_time"` // 更新时间 +} + +// TableName ProjectRunConfig's table name +func (*ProjectRunConfig) TableName() string { + return TableNameProjectRunConfig +} diff --git a/docs/docs.go b/docs/docs.go index 751dfa1..676d9bc 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1,4 +1,5 @@ -// Package docs Code generated by swaggo/swag. DO NOT EDIT +// Code generated by swaggo/swag. DO NOT EDIT. + package docs import "github.com/swaggo/swag" @@ -2735,6 +2736,356 @@ const docTemplate = `{ } } }, + "/api/v1/runconfig": { + "post": { + "security": [ + { + "JwtAuth": [] + } + ], + "description": "创建项目运行环境配置数据", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "项目运行环境配置Api" + ], + "summary": "创建项目运行环境配置信息", + "parameters": [ + { + "type": "string", + "name": "config", + "in": "query" + }, + { + "type": "string", + "name": "description", + "in": "query" + }, + { + "type": "integer", + "name": "id", + "in": "query" + }, + { + "type": "string", + "name": "name", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + } + } + } + }, + "/api/v1/runconfig/list": { + "get": { + "security": [ + { + "JwtAuth": [] + } + ], + "description": "无参数,查询项目运行环境配置列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "项目运行环境配置Api" + ], + "summary": "查询项目运行环境配置信息列表", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.ProjectRunConfigDto" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + } + } + } + }, + "/api/v1/runconfig/paging": { + "get": { + "security": [ + { + "JwtAuth": [] + } + ], + "description": "可以通过项目名称过滤,分页查询项目运行环境配置信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "项目运行环境配置Api" + ], + "summary": "分页查询项目运行环境配置信息", + "parameters": [ + { + "type": "string", + "name": "name", + "in": "query" + }, + { + "type": "integer", + "example": 1, + "description": "页码", + "name": "current", + "in": "query", + "required": true + }, + { + "type": "integer", + "example": 10, + "description": "页面行数", + "name": "size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageDto" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + } + } + } + }, + "/api/v1/runconfig/{id}": { + "get": { + "security": [ + { + "JwtAuth": [] + } + ], + "description": "查询项目运行环境信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "项目运行环境配置Api" + ], + "summary": "查询项目运行环境信息", + "parameters": [ + { + "type": "integer", + "description": "项目运行环境ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.ProjectRunConfigDto" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + } + } + }, + "put": { + "security": [ + { + "JwtAuth": [] + } + ], + "description": "修改项目运行环境信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "项目运行环境配置Api" + ], + "summary": "修改项目运行环境信息", + "parameters": [ + { + "type": "integer", + "description": "项目运行环境信息ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "code", + "in": "query" + }, + { + "type": "integer", + "name": "id", + "in": "query" + }, + { + "type": "string", + "name": "name", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + } + } + }, + "delete": { + "security": [ + { + "JwtAuth": [] + } + ], + "description": "删除项目运行环境信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "项目运行环境配置Api" + ], + "summary": "删除项目运行环境信息", + "parameters": [ + { + "type": "integer", + "description": "项目运行环境信息ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK" + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + } + } + } + }, "/api/v1/simulation/:id/getMapKilometerRange": { "get": { "security": [ @@ -5156,6 +5507,29 @@ const docTemplate = `{ } } }, + "dto.ProjectRunConfigDto": { + "type": "object", + "properties": { + "config": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "description": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "updateAt": { + "type": "string" + } + } + }, "dto.PslOperationReqDto": { "type": "object", "required": [ diff --git a/docs/swagger.json b/docs/swagger.json index efd4f17..b73dd4a 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -2729,6 +2729,356 @@ } } }, + "/api/v1/runconfig": { + "post": { + "security": [ + { + "JwtAuth": [] + } + ], + "description": "创建项目运行环境配置数据", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "项目运行环境配置Api" + ], + "summary": "创建项目运行环境配置信息", + "parameters": [ + { + "type": "string", + "name": "config", + "in": "query" + }, + { + "type": "string", + "name": "description", + "in": "query" + }, + { + "type": "integer", + "name": "id", + "in": "query" + }, + { + "type": "string", + "name": "name", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + } + } + } + }, + "/api/v1/runconfig/list": { + "get": { + "security": [ + { + "JwtAuth": [] + } + ], + "description": "无参数,查询项目运行环境配置列表", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "项目运行环境配置Api" + ], + "summary": "查询项目运行环境配置信息列表", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.ProjectRunConfigDto" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + } + } + } + }, + "/api/v1/runconfig/paging": { + "get": { + "security": [ + { + "JwtAuth": [] + } + ], + "description": "可以通过项目名称过滤,分页查询项目运行环境配置信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "项目运行环境配置Api" + ], + "summary": "分页查询项目运行环境配置信息", + "parameters": [ + { + "type": "string", + "name": "name", + "in": "query" + }, + { + "type": "integer", + "example": 1, + "description": "页码", + "name": "current", + "in": "query", + "required": true + }, + { + "type": "integer", + "example": 10, + "description": "页面行数", + "name": "size", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.PageDto" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + } + } + } + }, + "/api/v1/runconfig/{id}": { + "get": { + "security": [ + { + "JwtAuth": [] + } + ], + "description": "查询项目运行环境信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "项目运行环境配置Api" + ], + "summary": "查询项目运行环境信息", + "parameters": [ + { + "type": "integer", + "description": "项目运行环境ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.ProjectRunConfigDto" + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + } + } + }, + "put": { + "security": [ + { + "JwtAuth": [] + } + ], + "description": "修改项目运行环境信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "项目运行环境配置Api" + ], + "summary": "修改项目运行环境信息", + "parameters": [ + { + "type": "integer", + "description": "项目运行环境信息ID", + "name": "id", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "code", + "in": "query" + }, + { + "type": "integer", + "name": "id", + "in": "query" + }, + { + "type": "string", + "name": "name", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + } + } + }, + "delete": { + "security": [ + { + "JwtAuth": [] + } + ], + "description": "删除项目运行环境信息", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "项目运行环境配置Api" + ], + "summary": "删除项目运行环境信息", + "parameters": [ + { + "type": "integer", + "description": "项目运行环境信息ID", + "name": "id", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK" + }, + "401": { + "description": "Unauthorized", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + }, + "404": { + "description": "Not Found", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + } + } + } + }, "/api/v1/simulation/:id/getMapKilometerRange": { "get": { "security": [ @@ -5150,6 +5500,29 @@ } } }, + "dto.ProjectRunConfigDto": { + "type": "object", + "properties": { + "config": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "description": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "updateAt": { + "type": "string" + } + } + }, "dto.PslOperationReqDto": { "type": "object", "required": [ diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 0663145..cd563df 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -215,6 +215,21 @@ definitions: $ref: '#/definitions/dto.TrainSizeDto' type: array type: object + dto.ProjectRunConfigDto: + properties: + config: + type: string + createdAt: + type: string + description: + type: string + id: + type: integer + name: + type: string + updateAt: + type: string + type: object dto.PslOperationReqDto: properties: buttonCode: @@ -2441,6 +2456,228 @@ paths: summary: 从发布数据拉取信息到草稿 tags: - 发布的图形数据Api + /api/v1/runconfig: + post: + consumes: + - application/json + description: 创建项目运行环境配置数据 + parameters: + - in: query + name: config + type: string + - in: query + name: description + type: string + - in: query + name: id + type: integer + - in: query + name: name + type: string + produces: + - application/json + responses: + "200": + description: OK + "401": + description: Unauthorized + schema: + $ref: '#/definitions/dto.ErrorDto' + "404": + description: Not Found + schema: + $ref: '#/definitions/dto.ErrorDto' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/dto.ErrorDto' + security: + - JwtAuth: [] + summary: 创建项目运行环境配置信息 + tags: + - 项目运行环境配置Api + /api/v1/runconfig/{id}: + delete: + consumes: + - application/json + description: 删除项目运行环境信息 + parameters: + - description: 项目运行环境信息ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + "401": + description: Unauthorized + schema: + $ref: '#/definitions/dto.ErrorDto' + "404": + description: Not Found + schema: + $ref: '#/definitions/dto.ErrorDto' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/dto.ErrorDto' + security: + - JwtAuth: [] + summary: 删除项目运行环境信息 + tags: + - 项目运行环境配置Api + get: + consumes: + - application/json + description: 查询项目运行环境信息 + parameters: + - description: 项目运行环境ID + in: path + name: id + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.ProjectRunConfigDto' + "401": + description: Unauthorized + schema: + $ref: '#/definitions/dto.ErrorDto' + "404": + description: Not Found + schema: + $ref: '#/definitions/dto.ErrorDto' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/dto.ErrorDto' + security: + - JwtAuth: [] + summary: 查询项目运行环境信息 + tags: + - 项目运行环境配置Api + put: + consumes: + - application/json + description: 修改项目运行环境信息 + parameters: + - description: 项目运行环境信息ID + in: path + name: id + required: true + type: integer + - in: query + name: code + type: string + - in: query + name: id + type: integer + - in: query + name: name + type: string + produces: + - application/json + responses: + "200": + description: OK + "401": + description: Unauthorized + schema: + $ref: '#/definitions/dto.ErrorDto' + "404": + description: Not Found + schema: + $ref: '#/definitions/dto.ErrorDto' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/dto.ErrorDto' + security: + - JwtAuth: [] + summary: 修改项目运行环境信息 + tags: + - 项目运行环境配置Api + /api/v1/runconfig/list: + get: + consumes: + - application/json + description: 无参数,查询项目运行环境配置列表 + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.ProjectRunConfigDto' + "401": + description: Unauthorized + schema: + $ref: '#/definitions/dto.ErrorDto' + "404": + description: Not Found + schema: + $ref: '#/definitions/dto.ErrorDto' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/dto.ErrorDto' + security: + - JwtAuth: [] + summary: 查询项目运行环境配置信息列表 + tags: + - 项目运行环境配置Api + /api/v1/runconfig/paging: + get: + consumes: + - application/json + description: 可以通过项目名称过滤,分页查询项目运行环境配置信息 + parameters: + - in: query + name: name + type: string + - description: 页码 + example: 1 + in: query + name: current + required: true + type: integer + - description: 页面行数 + example: 10 + in: query + name: size + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.PageDto' + "401": + description: Unauthorized + schema: + $ref: '#/definitions/dto.ErrorDto' + "404": + description: Not Found + schema: + $ref: '#/definitions/dto.ErrorDto' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/dto.ErrorDto' + security: + - JwtAuth: [] + summary: 分页查询项目运行环境配置信息 + tags: + - 项目运行环境配置Api /api/v1/simulation/:id/getMapKilometerRange: get: consumes: diff --git a/dto/projectRunConfig.go b/dto/projectRunConfig.go new file mode 100644 index 0000000..af9741d --- /dev/null +++ b/dto/projectRunConfig.go @@ -0,0 +1,43 @@ +package dto + +import "joylink.club/bj-rtsts-server/db/model" + +type PageProjectRunConfigReqDto struct { + PageQueryDto + Name string `json:"name" form:"name"` +} + +type ProjectRunConfigReqDto struct { + Id int32 `json:"id" form:"id"` + Name string `json:"name" form:"name"` + Description string `json:"description" form:"description"` + ConfigContent string `json:"config" form:"config"` +} + +type ProjectRunConfigDto struct { + Id int32 `json:"id" form:"id"` + Name string `json:"name" form:"name"` + Description string `json:"description" form:"description"` + ConfigContent string `json:"config" form:"config"` + CreatedAt JsonTime `json:"createdAt" time_format:"2006-01-02 15:04:05"` + UpdateAt JsonTime `json:"updateAt" time_format:"2006-01-02 15:04:05"` +} + +func ConvertToRunConfigDto(gi *model.ProjectRunConfig) *ProjectRunConfigDto { + return &ProjectRunConfigDto{ + Id: gi.ID, + Name: gi.Name, + Description: gi.Description, + ConfigContent: gi.ConfigContent, + CreatedAt: JsonTime(gi.CreateTime), + UpdateAt: JsonTime(gi.UpdateTime), + } +} + +func ConvertToRunConfigFromSlice(giSlice []*model.ProjectRunConfig) []*ProjectRunConfigDto { + var result []*ProjectRunConfigDto + for _, gi := range giSlice { + result = append(result, ConvertToRunConfigDto(gi)) + } + return result +} diff --git a/dto/simulation.go b/dto/simulation.go index 153a86c..aa36087 100644 --- a/dto/simulation.go +++ b/dto/simulation.go @@ -11,6 +11,8 @@ type SimulationCreateReqDto struct { MapId int32 `json:"mapId" form:"mapId"` // 项目id ProjectId int32 `json:"projectId" form:"projectId"` + // 运行环境ID + ProjectRunConfigId int32 `json:"runConfigId" form:"runConfigId"` } // 创建仿真响应 diff --git a/main.go b/main.go index c52ec08..4a1a67a 100644 --- a/main.go +++ b/main.go @@ -38,6 +38,7 @@ func main() { api.InitTrainManageRouter(router, authMiddleware) api.InitProjectLinkRouter(router, authMiddleware) api.InitAuthRouter(router, authMiddleware) + api.InitProjectRunConfigRouter(router, authMiddleware) docs.SwaggerInfo.Title = "CBTC测试系统API" engine.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler)) diff --git a/rtss_simulation b/rtss_simulation index af7cb83..4fc223c 160000 --- a/rtss_simulation +++ b/rtss_simulation @@ -1 +1 @@ -Subproject commit af7cb83fa8e983fb1dabf4179fd0a7692e20bb16 +Subproject commit 4fc223c9f7154d6a01e75db0c5745ad6c177c57e diff --git a/service/projectRunConfig.go b/service/projectRunConfig.go new file mode 100644 index 0000000..0b4a490 --- /dev/null +++ b/service/projectRunConfig.go @@ -0,0 +1,82 @@ +package service + +import ( + "fmt" + "time" + + "joylink.club/bj-rtsts-server/db/dbquery" + "joylink.club/bj-rtsts-server/db/model" + "joylink.club/bj-rtsts-server/dto" + "joylink.club/bj-rtsts-server/sys_error" +) + +// 查询项目运行环境列表带分页 +func PageProjectRunConfigQuery(query *dto.PageProjectRunConfigReqDto) *dto.PageDto { + d := dbquery.ProjectRunConfig + dq := d.Where() + if query.Name != "" { + dq = dq.Where(d.Name.Like(fmt.Sprintf("%%%s%%", query.Name))) + } + records, total, err := dq.Debug().Omit(d.ConfigContent).FindByPage(query.Offset(), query.Size) + if err != nil { + panic(sys_error.New("查询失败,数据库错误请联系运维人员", err)) + } + return &dto.PageDto{Total: int(total), PageQueryDto: query.PageQueryDto, Records: records} +} + +// 查询项目运行环境列表 +func ListProjectRunConfigQuery() []*dto.ProjectRunConfigDto { + records, err := dbquery.ProjectRunConfig.Debug().Omit(dbquery.ProjectRunConfig.ConfigContent).Find() + if err != nil { + panic(sys_error.New("查询失败,数据库错误请联系运维人员", err)) + } + return dto.ConvertToRunConfigFromSlice(records) +} + +// 创建项目运行环境 +func CreateProjectRunConfig(dd *dto.ProjectRunConfigReqDto) bool { + d := model.ProjectRunConfig{ + Name: dd.Name, + Description: dd.Description, + ConfigContent: dd.ConfigContent, + CreateTime: time.Now(), + UpdateTime: time.Now(), + } + err := dbquery.ProjectRunConfig.Save(&d) + if err != nil { + panic(sys_error.New("保存失败,数据库错误请联系运维人员", err)) + } + return true +} + +// 查询项目运行环境 +func QueryProjectRunConfig(id int32) *dto.ProjectRunConfigDto { + query, err := dbquery.ProjectRunConfig.Where(dbquery.ProjectRunConfig.ID.Eq(id)).Debug().First() + if err != nil { + panic(sys_error.New("查询失败,不存在此信息", err)) + } + return dto.ConvertToRunConfigDto(query) +} + +// 更新项目运行环境 +func UpdateProjectRunConfig(id int32, dd *dto.ProjectRunConfigReqDto) bool { + findOldQuery := dbquery.ProjectRunConfig + oldD, err := findOldQuery.Where(findOldQuery.ID.Eq(id)).Debug().First() + if oldD == nil || err != nil { + panic(sys_error.New("保存失败,不存在此信息", err)) + } + oldD.Name = dd.Name + oldD.Description = dd.Description + oldD.ConfigContent = dd.ConfigContent + oldD.UpdateTime = time.Now() + _, err2 := findOldQuery.Updates(oldD) + if err2 != nil { + panic(sys_error.New("保存失败,请联系维护人员", err2)) + } + return true +} + +// 删除项目运行环境 +func DeleteProjectRunConfigById(id int32) { + dbquery.ProjectRunConfig.Debug().Where(dbquery.ProjectRunConfig.ID.Eq(id)).Delete() +}